CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   DPM UDFs Group Injection (https://www.cfd-online.com/Forums/fluent/42698-dpm-udfs-group-injection.html)

Abigail October 30, 2006 09:12

DPM UDFs Group Injection
 
Is it possible to write a UDF for a group injection. I want to use a UDF as my injection position changes with time, but I wish to have a range of particle sizes at the injection point.

I have successful written a udf using DEFINE_DPM_INJECTION_INIT for a single injection but would like to expand it to group. Tne only way I can think to do it is to make several injections one for each size. Is there a better way?

Adriano October 31, 2006 12:44

Re: DPM UDFs Group Injection
 
Hi, I think u can try to use a particle injection file definition. In this .txt file, You should write as follow:

((x-position y-posizion z-posizion x-velocity y-velocity z-velocity DIAMETER Temperature mass-flow Time) ParticleName)

all of them must be number such (0.000e+000); 'name' could be whatever u want. ofcourse u must write one row per particle. if u have a lot of particles u can implement it in MATLAB or samething like that.

I hope it'll be helpfull

regards Adriano. ps. sorry for my english.


Julien76 November 6, 2006 19:33

Re: DPM UDFs Group Injection
 
When you use DEFINE_DPM_INJECTION_INIT, the loop(p,I->I) macro can be used as many times as you want, that is to say if you want 40 particles injected, just precise in the particles panel how many particles you want to inject in your group, and fluent will automatically run 40 times the loop macro.

for instance, faceid[i] is an array of face ID (let's say 100 faces IDs), if you precise 40 particles to inject in the panel, the following code will be run 40 times by fluent, and you will inject in the middle (CENTROID Macro) of face i, i+1, i+2, etc...

P_POS defines the position of the particle (P_POS(p)[1]=x, P_POS(p)=y, etc...)

P_DIAM is for the diameter

Here is the code:

loop(p,I->p_init)

{

f=faceid[i];

Message("injection number %d \n",i);

for(j=0;j<3;j++)

{

F_CENTROID(coor,f,thread);

P_POS(p)[j]=coor[j];

}

P_DIAM(p)=pdiam;

i++

}


All times are GMT -4. The time now is 03:33.