CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Loop over particles (

Umesh Shah June 24, 2003 10:50

Loop over particles
Does anybody know how to get loop over all the particles entering a cell. The particles are tracked using Discrete phase model in Fluent6.0.

Thank you all for your time.


Alex Munoz June 24, 2003 17:56

Re: Loop over particles

I gave you this macro before for your concentration problem. I coopy this UDf from fluent

/************************************************** *********

Example UDF that demonstrates DEFINE_DPM_SPRAY_COLLIDE ************************************************** **********/ #include "udf.h" #include "dpm.h" #include "surf.h"

DEFINE_DPM_SPRAY_COLLIDE(udf_man_spray_collide, tp, p) { /* non-physical collision UDF that relaxes the particle */ /* velocity and diameter in a cell to the mean over the */ /* specified time scale t_relax */

const real t_relax = 0.001; /* seconds */

/* get the cell and Thread that the particle is currently in */ cell_t c = RP_CELL(&(tp->cCell)); Thread *t = RP_THREAD(&(tp->cCell));

/* Particle index for looping over all particles in the cell */ Particle *pi;

/* loop over all particles in the cell to find their mass */ /* weighted mean velocity and diameter */ int i; real u_mean[3]={0.}, mass_mean=0.; real d_orig = tp->state.diam; real decay = 1. - exp(-t_relax);

begin_particle_cell_loop(pi,c,t) {

mass_mean += pi->state.mass;


u_mean[i] += pi->state.V[i]*pi->state.mass;

} end_particle_cell_loop(pi,c,t)

Best regards

Alex Munoz

Umesh Shah June 24, 2003 18:17

Re: Loop over particles
Hello Alex,

Thanx for your time. But I guess this looping macro is available in Fluent 6.1 since this is an example in it's manual.

I am using Fluent6.0. Do u know if i can use

begin_particle_cell_loop(pi,c,t) for my case?

Because there is nothing about this macro anywhere in fluent6.0 UDF manual.

Thanks again for your help.


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