CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   udf of DPM questions! (

winnie April 22, 2003 23:58

udf of DPM questions!
Hi, thanks for reading my question.

I want to define my own particle body forces via the DPM udf. The body forces include the velocity and the velocity gradient of the continuous phase at the particle position, but the fluent DEFINE macro of the body force does't include the arguments that pass these variables to my udf.

How can I get these variables in my udf?

Any help will be appreciated!



majestywzh April 25, 2003 06:45

Re: udf of DPM questions!
hey,Fluent allow users to access the velocity derivative by using the Marco C_DUDX(c,t) C_DUDY(c,t),C_DUDZ(c,t)....

winnie April 26, 2003 04:37

Re: udf of DPM questions!
Hi, thank you for your help.

I know that I can access the velocity and velocity gradient by using Macro C_U(c,t)¡¢ C_DUDX(c,t)and so on. But the arguments of DEFINE_DPM_BODY_FORCE are name¡¢p and i which represent the function name, pointer to tracked particle and the Cartesian component of the body force that is to be returned by the function respectively. The thread pointer and cell index of the continuous phase (c,t) can't be passed by the UDF arguments. My question is how can I get these variables in my UDF?

Hope you can help me!



Marc April 28, 2003 07:25

Re: udf of DPM questions!

I am working on something similiar since I want to create body forces using my own scalars, which are defined for the cells of the continuous phase.

The solution supposed by the support was to use the macros RP_CELL and RP_THREAD to get the cell and thread number of the hosting cell. Since now this doesnt work for me, but maybe it helps you. If I get any more news I´ll let you know.

Greetings Marc

winnie April 28, 2003 21:00

Re: udf of DPM questions!
It is a great help!!!

Thank you. Marc

Regards winnie

winnie April 29, 2003 03:41

Re: udf of DPM questions!
Hi, Marc

I have tried and they work in my case.

I don't know if your have included "surf.h" in your UDF.The RP_THREAD and RP_CELL is defined in this .h file.



Marc April 30, 2003 02:52

Re: udf of DPM questions!
Hi Winnie,

works for me now as well. Thing is it works without including surf.h with linux, but with X86 system you need it. This kind of confused the guy on the support an me, but it is fine now.


All times are GMT -4. The time now is 08:45.