[Fluent Inc. Logo] return to home search
next up previous contents index



You can use DEFINE_DPM_TIMESTEP to change the time step for DPM particle tracking based on user-specified inputs. The time step can be prescribed for special applications where a certain time step is needed. It can also be limited to values that are required to validate physical models.



Argument Type Description
symbol name UDF name.
Tracked_Particle *p Pointer to the Tracked_Particle data structure which
  contains data related to the particle being tracked.
real ts Time step.
Function returns  

There are three arguments to DEFINE_DPM_TIMESTEP: name, p, and ts. You supply the name of your user-defined function. p and ts are variables that are passed by the FLUENT solver to your UDF. Your function will return the real value of the DPM particle timestep to the solver.

Example 1

The following compiled UDF named limit_to_e_minus_four sets the time step to a maximum value of $1e^-4$. If the time step computed by FLUENT (and passed as an argument) is smaller than $1e^-4$, then FLUENT's time step is returned.

/* Time step control UDF for DPM  */

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

DEFINE_DPM_TIMESTEP(limit_to_e_minus_four,p dt)
   if (dt > 1.e-4)
/*       p->next_time_step = 1.e-4; */
       return 1.e-4;

   return dt;

Example 2

The following compiled UDF named limit_to_fifty_of_prt computes the particle relaxation time based on the formula:

 \tau_p = frac{\rho_p d_p^2}{18 \mu} \frac{24}{C_D Re_p} (2.5-2)


 Re_p = \frac{\rho d_p \Vert u - u_p\Vert}{\mu} (2.5-3)

The particle time step is limited to a fifth of the particle relaxation time. If the particle time step computed by FLUENT (and passed as an argument) is smaller than this value, then FLUENT's time step is returned.

/* Particle time step control UDF for DPM  */

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

   real drag_factor = 0.;
   real p_relax_time;
   cphase_state_t *c = &(p->cphase);

   /* compute particle relaxation time */
   if (P_DIAM(p) != 0.0)
     drag_factor = DragCoeff(p) * c->mu / ( P_RHO(p) * P_DIAM(p) * P_DIAM(p));
     drag_factor = 1.;

   p_relax_time = 1./drag_factor;

   /* check the condition and return the time step */
   if (dt > p_relax_time/5.)
       return p_relax_time/5.;

   return dt;

Hooking a DPM Timestep UDF to FLUENT

After the UDF that you have defined using DEFINE_DPM_TIMESTEP is interpreted (Chapter  4) or compiled (Chapter  5), the name of the argument that you supplied as the first DEFINE macro argument will become visible and selectable for DPM Timestep in the Discrete Phase Model panel in FLUENT. See Section  6.4.14 for details on how to hook your DEFINE_DPM_TIMESTEP UDF to FLUENT.

next up previous contents index Previous: 2.5.13 DEFINE_DPM_SWITCH
Up: 2.5 Discrete Phase Model
© Fluent Inc. 2006-09-13