CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Using UDF to alter particle size (

Tumppi May 18, 2005 04:05

Using UDF to alter particle size
Hello everybody

Kind of newbie quetion here. I'm trying to alter the particle size (diameter) with UDF in fluent. I made a little code for testing purposes and interpreted it and then defined an injection which uses this UDF. But when I dislay particle track, the diameter doesn't change. I used DEFINE_DPM_LAW as define function. If someone could help me it would be great.

Allan Walsh May 18, 2005 13:45

Re: Using UDF to alter particle size
I assume you are manipulating P_DIAM(p). Print out P_DIAM(p) in your UDF, before and after manipulating it. Depending on particle type (i.e. inert, combusting, etc.) FLUENT could reset it somewhere else.

Good luck.

Tumppi May 23, 2005 07:50

Re: Using UDF to alter particle size
Well seems thet I'm dooing something really wrong. When I put printf lines to see what happens I only get 0 values for P_DIAM(p) and its only reported once at the start.

If someone can guide me to right direction that would be nice.

Allan Walsh May 23, 2005 11:13

Re: Using UDF to alter particle size
Do the values for P_DIAM(P) match up with what FLUENT shows if you do a step-by-step particle tracking? They should.

If it is only getting to your print statement once, it could be that FLUENT is only using your UDF once and then setting the particle to use the next law. Can you check that.

Tumppi May 25, 2005 03:21

Re: Using UDF to alter particle size
I think I found the answer why I cant get the UDF to work. If you read part 19.9.3 Particle Types at the manual you can see that only law 1 is active when one uses inert particle (which I did). So I gues that I have to use a droplet particle type to get my UDF to work, am I right?

Thank you for your help so far Allan.

Tumppi May 27, 2005 03:23

Re: Using UDF to alter particle s. Problem Solved
Well I solved the problem and got it to work with inert particle, I had selected wrong law from the custom laws panel at injection properties. When I put my custom law as Law 1 I got it to work.

Thanks for help.

tagada April 7, 2011 10:17

Hello Tumppi,

I'm very interested to have a look on your UDF, I'm also trying to alter the particle size with UDF an,d it doesn't work.
This is my code:

#include "udf.h"
#include "dpm.h"

DEFINE_DPM_LAW (diam_particle, p, ci)
/* compute new particle diameter */
P_DIAM(p) = 6*pow((0.015/2*0.7*1000.0*9.81)* 0.000300*P_POS(p)[0],1/3);
Thank you

All times are GMT -4. The time now is 23:31.