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

3.2.7 Model-Specific Macros



DPM Macros


The macros listed in Tables  3.2.26- 3.2.31 can be used to return real variables associated with the Discrete Phase Model (DPM), in SI units. They are typically used in DPM UDFs that are described in Section  2.5. The variables are available in both the pressure-based and the density-based solver. The macros are defined in the dpm.h header file, which is included in udf.h.

The variable p indicates a pointer to the Tracked_Particle structure ( Tracked_Particle *p) which gives you the value for the particle at the current position.

Refer to the following sections for examples of UDFs that utilize some of these macros: Section  2.5.7, Section  2.5.1, Section  2.5.6, Section  2.5.13, and Section  2.5.9.


Table 3.2.26: Macros for Particles at Current Position Defined in dpm.h
Macro Argument Types Returns
P_POS(p)[i] Tracked_Particle *p int i position i= 0, 1, 2
P_VEL(p)[i] Tracked_Particle *p int i velocity i= 0, 1, 2
P_DIAM(p) Tracked_Particle *p diameter
P_T(p) Tracked_Particle *p temperature
P_RHO(p) Tracked_Particle *p density
P_MASS(p) Tracked_Particle *p mass
P_TIME(p) Tracked_Particle *p current particle time
P_DT(p) Tracked_Particle *p time step
P_FLOW_RATE(p) Tracked_Particle *p flow rate of particles in a stream
in kg/s (see below for details)
P_LF(p) Tracked_Particle *p liquid fraction (wet
combusting particles only)
P_VFF(p) Tracked_Particle *p volatile fraction
(combusting particles only)


P_FLOW_RATE(p)

Each particle in a steady flow calculation represents a "stream'' of many particles that follow the same path. The number of particles in this stream that passes a particular point in a second is the "strength'' of the stream. P_FLOW_RATE returns the strength multiplied by P_MASS(p) at the current particle position.


Table 3.2.27: Macros for Particles at Entry to Current Cell Defined in dpm.h
Macro Argument Types Returns
P_POS0(p)[i] Tracked_Particle *p int i position i= 0, 1, 2
P_VEL0(p)[i] Tracked_Particle *p int i velocity i= 0, 1, 2
P_DIAM0(p) Tracked_Particle *p diameter
P_T0(p) Tracked_Particle *p temperature
P_RHO0(p) Tracked_Particle *p density
P_MASS0(p) Tracked_Particle *p mass
P_TIME0(p) Tracked_Particle *p particle time at entry
P_LF0(p) Tracked_Particle *p liquid fraction (wet
combusting particles only)


figure   

Note that when you are the using the macros listed in Table  3.2.27 to track transient particles, the particle state is the beginning of the fluid flow time step only if the particle does not cross a cell boundary.


Table 3.2.28: Macros for Particle Cell Index and Thread Pointer Defined in dpm.h
Name(Arguments) Argument Types Returns
P_CELL(p) Tracked_Particle *p cell index of the cell
that the particle is currently in
P_CELL_THREAD(p) Tracked_Particle *p pointer to the thread of the cell
that the particle is currently in



Table 3.2.29: Macros for Particles at Injection into Domain Defined in dpm.h
Macro Argument Types Returns
P_INIT_POS(p)[i] Tracked_Particle *p int i position i= 0, 1, 2
P_INIT_VEL(p)[i] Tracked_Particle *p int i velocity i= 0, 1, 2
P_INIT_DIAM(p) Tracked_Particle *p diameter
P_INIT_TEMP(p) Tracked_Particle *p temperature
P_INIT_RHO(p) Tracked_Particle *p density
P_INIT_MASS(p) Tracked_Particle *p mass
P_INIT_LF(p) Tracked_Particle *p liquid fraction
(wet combusting particles only)



Table 3.2.30: Macros for Particle Species, Laws, and User Scalars Defined in dpm.h
Macro Argument Types Returns
P_EVAP_SPECIES_INDEX(p) Tracked_Particle *p evaporating species index
in mixture
P_DEVOL_SPECIES_INDEX(p) Tracked_Particle *p devolatilizing species index
in mixture.
P_OXID_SPECIES_INDEX(p) Tracked_Particle *p oxidizing species index
in mixture
P_PROD_SPECIES_INDEX(p) Tracked_Particle *p combustion products species index in mixture
P_CURRENT_LAW(p) Tracked_Particle *p current particle law index
P_NEXT_LAW(p) Tracked_Particle *p next particle law index
P_USER_REAL(p,i) Tracked_Particle *p storage array for user-defined
values (indexed by i)



Table 3.2.31: Macros for Particle Material Properties Defined in dpm.h
Macro Argument Types Returns
P_MATERIAL(p) Tracked_Particle *p material pointer
DPM_BOILING_TEMPERATURE
(p,m)
Tracked_Particle *p,
Material *m
boiling temperature
DPM_CHAR_FRACTION(p) Tracked_Particle *p char fraction
DPM_DIFFUSION_COEFF(p,t) Tracked_Particle *p,
particle temperature t
diffusion coefficient to
be used the gaseous boundary layer around
particle
DPM_EMISSIVITY(p,m) Tracked_Particle *p,
Material *m
emissivity for the
radiation model
DPM_EVAPORATION_ Tracked_Particle *p,
TEMPERATURE(p,m)
evaporation
temperature
DPM_HEAT_OF_PYROLYSIS(p) Tracked_Particle *p heat of pyrolysis
DPM_HEAT_OF_REACTION(p) Tracked_Particle *p heat of reaction
DPM_LATENT_HEAT(p) Tracked_Particle *p latent heat
DPM_LIQUID_SPECIFIC_HEAT
(p,t)
Tracked_Particle *p,
particle temperature t
Note: particle temp.
typically determined by P_T(p)
specific heat of material
used for liquid
associated with particle
DPM_MU(p) Tracked_Particle *p dynamic viscosity of
droplets
DPM_SCATT_FACTOR(p,m) Tracked_Particle *p,
Material *m
scattering factor
for radiation model
DPM_SPECIFIC_HEAT(p,t) Tracked_Particle *p,
particle temperature t
Note: particle tem-
perature is typically
determined by P_T(p)
specific heat at
temperature t
DPM_SWELLING_COEFF(p) Tracked_Particle *p swelling coefficient
for devolatilization
DPM_SURFTEN(p) Tracked_Particle *p surface tension of
droplets
DPM_VAPOR_PRESSURE(p,m) Tracked_Particle *p,
Material *m
vapor pressure of
liquid part of particle
DPM_VAPOR_TEMP(p,m) Tracked_Particle *p,
Material *m
vaporization
temperature used to switch to vaporization
law
DPM_VOLATILE_FRACTION(p) Tracked_Particle *p volatile fraction




NOx Macros


The following macros can be used in NOx model UDFs in the calculation of pollutant rates. These macros are defined in the header file sg_nox.h, which is included in udf.h. They can be used to return real NOx variables in SI units, and are available in both the pressure-based and the density-based solver. See Section  2.3.12 for examples of DEFINE_NOX_RATE UDFs that utilize these macros.


Table 3.2.32: Macros for NOx UDFs Defined in sg_nox.h
Macro Returns
POLLUT_EQN(Pollut_Par) index of pollutant equation being
solved (see below)
MOLECON(Pollut,SPE) molar concentration of species specified
by SPE (see below)
NULLIDX(Pollut_Par,SPE) TRUE if the species specified by
SPE doesn't exist in ANSYS FLUENT case
(i.e., in the Species dialog box)
ARRH(Pollut,K) Arrhenius rate calculated from the constants
specified by K (see below)
POLLUT_FRATE(Pollut) production rate of the pollutant
species being solved
POLLUT_RRATE(Pollut) reduction rate of the pollutant
species being solved
POLLUT_QRATE(Pollut) quasi-steady rate of N $_2$O formation (if the
quasi-steady model is used)
POLLUT_FLUCTDEN(Pollut) fluctuating density value (or, if no PDF model
is used, mean density at a given cell
POLLUT_FLUCTTEM(Pollut) fluctuating temperature value (or, if no
PDF model is used, mean temperature at a
given cell)
POLLUT_FLUCTYI(Pollut,SPE) fluctuating mass fraction value (or, if no
PDF model is used, mean mass fraction at a
given cell) of the species given by index SPE
POLLUT_CTMAX(Pollut_Par) upper limit for the temperature PDF
integration (see below)

figure   

Pollut_Par is a pointer to the Pollut_Parameter data structure that contains auxiliary data common to all pollutant species and NOx is a pointer to the NOx_Parameter data structure that contains data specific to the NOx model.



SOx Macros


The following macros can be used in SOx model UDFs in the calculation of pollutant rates. These macros are defined in the header file sg_nox.h, which is included in udf.h. They can be used to return real SOx variables in SI units and are available in both the pressure-based and the density-based solver. See Section  2.3.20 for examples of DEFINE_SOX_RATE UDFs that utilize these macros.


Table 3.2.33: Macros for SOx UDFs Defined in sg_nox.h
Macro Returns
POLLUT_EQN(Pollut_Par) index of pollutant equation being
solved (see below)
MOLECON(Pollut,SPE) molar concentration of species specified
by SPE (see below)
NULLIDX(Pollut_Par,SPE) TRUE if the species specified by
SPE doesn't exist in ANSYS FLUENT case
(i.e., in the Species dialog box)
ARRH(Pollut,K) Arrhenius rate calculated from the constants
specified by K (see below)
POLLUT_FRATE(Pollut) production rate of the pollutant
species being solved
POLLUT_RRATE(Pollut) reduction rate of the pollutant
species being solved
POLLUT_FLUCTDEN(Pollut) fluctuating density value (or, if no PDF model
is used, mean density at a given cell)
POLLUT_FLUCTTEM(Pollut) fluctuating temperature value (or, if no
PDF model is used, mean temperature at a
given cell)
POLLUT_FLUCTYI(Pollut,SPE) fluctuating mass fraction value (or, if no
PDF model is used, mean mass fraction at a
given cell) of the species given by index SPE
POLLUT_CTMAX(Pollut_Par) upper limit for the temperature PDF
integration (see below)

figure   

Pollut_Par is a pointer to the Pollut_Parameter data structure that contains auxiliary data common to all pollutant species and SOx is a pointer to the SOx_Parameter data structure that contains data specific to the SOx model.



Dynamic Mesh Macros


The macros listed in Table  3.2.34 are useful in dynamic mesh UDFs. The argument dt is a pointer to the dynamic thread structure, and time is a real value. These macros are defined in the dynamesh_tools.h.


Table 3.2.34: Macros for Dynamic Mesh Variables Defined in dynamesh_tools.h
Name(Arguments) Argument Types Returns
DT_THREAD(dt) Dynamic_Thread *dt pointer to a thread
DT_CG(dt) Dynamic_Thread *dt center of gravity vector
DT_VEL_CG(dt) Dynamic_Thread *dt cg velocity vector
DT_OMEGA_CG(t) Dynamic_Thread *dt angular velocity vector
DT_THETA(dt) Dynamic_Thread *dt orientation of body-fixed axis vector
DYNAMESH_CURRENT_TIME N/A current dynamic mesh time
TIME_TO_ABSOLUTE_CRANK_ANGLE( time) real time absolute value of the crank angle

See Section  2.6.4 for an example UDF that utilizes DT_THREAD.


next up previous contents index Previous: 3.2.6 Special Macros
Up: 3.2 Data Access Macros
Next: 3.2.8 User-Defined Scalar (UDS)
Release 12.0 © ANSYS, Inc. 2009-01-14