CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF for particle velocity doesn't work !!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2021, 14:10
Default
  #21
New Member
 
Join Date: May 2016
Posts: 2
Rep Power: 0
wasim.raza is on a distinguished road
Hi,

I am using steady particle tracking in Fluent. I am trying to set the initial velocity of the particle same as the flow velocity in respective cells of the inlet surface,
I am using UDF, DEFINE_DPM_INJECTION_INIT(velocity_magnitude, I).
But, I am unable to check, whether the initial velocity has been applied to the particle or not. How can I check it?
Also, there is no effect on the result after using the UDF.

Thanks.

Quote:
Originally Posted by pakk View Post
I would be interested in what happens with the following code:
Code:
#include "udf.h"
#include "dpm.h"

DEFINE_DPM_INJECTION_INIT(velocity_magnitude, I)
{

Particle *p;
cell_t c;
Thread *t;

loop(p,I->p_init)           /*Standard Fluent looping Macro to get particle streams in an inejction using unsteady particle tracking*/
{
c = P_CELL(p);              /*Get the cell that the particle is currently in*/
t = P_CELL_THREAD(p);       /*Get the thread that the particle is currently in*/
P_VEL(p)[0] =7;    /*Longitudinal velocity*/
P_VEL(p)[1] = 8;    /*Spanwise velocity*/
P_VEL(p)[2] = 9;    /*vertical velocity*/
}
}
Do you see velocities (0,0,0) or (7,8,9)?
wasim.raza is offline   Reply With Quote

Old   November 18, 2021, 09:21
Default
  #22
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Do you use the code that you quoted which still has problems, or do you include the solution that was given further below?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   November 18, 2021, 20:36
Default
  #23
New Member
 
Join Date: May 2016
Posts: 2
Rep Power: 0
wasim.raza is on a distinguished road
Quote:
Originally Posted by pakk View Post
Do you use the code that you quoted which still has problems, or do you include the solution that was given further below?
I have used the code after including the solution as mentioned, by replacing loop(p,I->p_init) with loop(p,I->p). It compiled and it is available in the UDF Tab of particle injection.
I tried with high velocity in the UDF also , but the particle velocity is not changing in the output file sampled at the outlet.
Therefore, I want to check, whether the initial velocity has been applied to the particle or not. How can I do it?
Thanks
wasim.raza is offline   Reply With Quote

Old   November 19, 2021, 06:24
Default
  #24
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Plot one trajectory, showing the particle velocity.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF Unsteady velocity parabolic profile Rashad FLUENT 3 October 1, 2018 16:27
Simulation with UDF for species mass fraction and velocity profile virgy Fluent UDF and Scheme Programming 8 February 7, 2012 05:30
the udf has been hooked to the fluent successfully,but it does not work! hugeforest Fluent UDF and Scheme Programming 1 July 8, 2011 05:31
UDF for wall slipping HFLUENT Fluent UDF and Scheme Programming 0 April 27, 2011 13:03
UDF velocity profile problem Steve FLUENT 0 January 18, 2005 13:11


All times are GMT -4. The time now is 21:16.