CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF Problem (

Zhang April 24, 2005 18:21

UDF Problem
Take an example to explain mu question:

There is a DPM concerned macro DEFINE_DPM_DRAG ( name, Re, p) which is used to specify the drag coefficient between particle and fluid. Now my question is, what to do if I just want to make use of this macro to do something else instead of specifying the drag? Or, how to obtain the drag calculated by Fluent and return it at the end of this macro (since it requires a return).

Here is another example:

Macro DEFINE_DPM_BC ( name, p, t, f, f_normal, dim) is called everytime a particle touches a boundary and usually we use this macro to define our own boundary conditions for particles. But what if I just want to count the number of impingement and use the default BCs?

Maybe this is not a question for you. Please help me out and thanks in advance!


rom April 25, 2005 08:20

Re: UDF Problem
Fluent standard functions for DPM can be found in dpm.h .Declarations start with FLUENT_EXPORT. The Standard function for drag coeffient is "real DragCoeff(Tracked_Particle *p)".

good luck


Zhang April 25, 2005 11:25

Re: UDF Problem
Thanks rom. It helps a lot but I am still confused. I do not find the function for drag "real DragCoeff(Tracked_Particle *p)" in dpm.h. Neither do I know which function is for DPM BCs. Do you know where to get description of so many things defined in head files?

rom April 26, 2005 01:52

Re: UDF Problem
Most of the standard fluent function are undocumented so the best option ist to search the headers hoping to find something :(. For the fluent 6.2.16 dpm.h :

line 1135 of the header file

FLUENT_EXPORT real DragCoeff(Tracked_Particle *p);

in line 1051 you can find the standrad function for particle reflection:

FLUENT_EXPORT void Reflect_Particle (Tracked_Particle *, real[], int, face_t, Thread *);

The function returns no value so you will have to do this on your own in your DPM_BC function. So the body of your DEFINE_DPM_BC should look like this:






good luck rom

Zhang April 26, 2005 11:02

Thanks a lot
Thanks rom.

I just realized that my Fluent version is 6.1.22 in which there is no DragCoeff(...).

Thanks again!


All times are GMT -4. The time now is 17:39.