CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   In steady DPM model, how to get a particle residence time in a specific cell? (

DanK June 1, 2012 10:34

In steady DPM model, how to get a particle residence time in a specific cell?
Hi All,

In steady DPM model, how can I get a particle residence time in a specific cell?

I am trying to calculate the particle concentration by PSI-C (particle source in cell) method. To calculate the concentration, I really need to get the particle residence time in specific position.

Please help me to solve this problem.


jorkolino August 25, 2012 00:33

Dong Hwa, is that you? If yes, I hope we solved your problem, if not, here is algorithm that you and others can follow.

in FLUENT 6.3 UDF Manual in chapter 3.2.7 you will find a lot of macros for DPM. I am mentiioning a few releveant here:
P_TIME(p): current particle time.
P_DT(p): current particle time step.
P_TIME0(p): particle time at entry to current cell.

TO get residence in current cell, I guess that the expression P_TIME(p)-P_TIME0(p) is needed.

The trick is, to be able to log this result over the particle track, i.e. to know at each point of the track what is the cell residence time. This is done with a macro called DEFINE_DPM_SCALAR_UPDATE. It is run each time the particle changes position.


DEFINE_DPM_SCALAR_UPDATE(dose, c, t, initialize, p)
        if (initialize)
                P_USER_REAL(p,0) = 0; /* this variable will hold the cell residence time, we initialize it here */
                P_USER_REAL(p,0) = P_TIME(p)-P_TIME0(p) ; /* store the cell residence time into the variable */

Every particle has an array of variables, which variables hold data for the particle during its track (i.e. the variable value changes along the particle track). What you essentially do above is declare particle array variable [0] and use it to store the cell residence time in it. Now, after hooking that in FLuent, you will have extra property for the particle, cell residence time. To hook it, (1) declare one variable in the array by going to UDF tab in the DPM model and chose number of scalars = 1 (2) in UDF function field, the same tab, drop down the scalar update and hook the function.

If successful, you can color the tracks by their cell residence time, you can also manipulate this property. You can also store the cell index into a particle array variable, P_USER_REAL(p,1) = P_CELL(p);

By the way, after knowing the cell residence time how do you intend to calculate the concentration of particles in a cell? I am not very clear on that, but I'll need to do something similar and it will be nice to know.

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