
Description
You can use DEFINE_DPM_TIMESTEP to change the time step for DPM particle tracking based on userspecified 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.
Usage
DEFINE_DPM_TIMESTEP( name, p, ts) 
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  
real  
There are three arguments to DEFINE_DPM_TIMESTEP: name, p, and ts. You supply the name of your userdefined 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 . If the time step computed by FLUENT (and passed as an argument) is smaller than , 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.e4) { /* p>next_time_step = 1.e4; */ return 1.e4; } return dt; } 
Example 2
The following compiled UDF named limit_to_fifty_of_prt computes the particle relaxation time based on the formula:
(2.52) 
where
(2.53) 
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" DEFINE_DPM_TIMESTEP(limit_to_fifth_of_prt,p,dt) { 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)); else 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.