How to loop over all the DPM injections (and particles) using UDF?

To loop over all the injections, you first need to get a list of all the injections you have defined. This can be done using the following command

Injection *Ilist = Get_dpm_injections();

You will also have to define a generic injection pointer

Injection *I;

Now, looping over all the injections can be done using the following command

loop(I, Ilist)
You can loop over all the particles from a given injection. To do that, you first need to define a particle pointer

Particle *p;

Looping over all the particles can be done using

loop(p, I->p)
In unsteady DPM calculations, if you want to initialize the transient particles, you will require the following loop
loop(p, I->p_init)

You can use these loops to fetch particle data using particle specific macros like

P_DIAM(p) for particle diameter
P_T(p) for particle temperature etc.

Show Form
No comments yet. Be the first to add a comment!