The macros listed in Table 3.27: Macros for Particles at Current Position Defined in dpm_types.h – Table 3.32: Macros for Particle Material Properties Defined in dpm_laws.h can be used to return real variables associated with the Discrete Phase Model (DPM), in SI
units (where relevant). They are typically used in DPM UDFs that are
described in Discrete Phase Model (DPM) DEFINE Macros. The variables are
available in both the pressure-based and the density-based solver.
The macros are defined in the dpm_types.h and dpm_laws.h header files, which are included in udf.h.
The variable tp indicates
a pointer to the Tracked_Particle structure
(Tracked_Particle *tp) which gives you the
value for the particle at the current position, the variable m indicates a pointer to the relevant Material structure
(Material *m), and the real variable t is
the temperature.
Refer to the following sections for examples of UDFs that use
some of these macros:
DEFINE_DPM_LAW
,
DEFINE_DPM_BC
,
DEFINE_DPM_INJECTION_INIT
,
DEFINE_DPM_SWITCH
, and
DEFINE_DPM_PROPERTY
.
The TP_... macros listed in Table 3.27: Macros for Particles at Current Position Defined in dpm_types.h through Table 3.31: Macros for Particle Species, Laws, Materials, and User Scalars
Defined in dpm_types.h are to be used to access elements of variables of the type Tracked_Particles or elements within instances of the data structure pointed to by pointer variables of the type Tracked_Particle *.
In addition, the dpm_types.h header file also contains definitions for the PP_... macros that are analogous to the corresponding TP_... macros. The PP_... macros are similar in function, but they are to be used for accessing elements of variables of the Particle or elements within the data structure that are pointed to by pointer variables of the type Particle *.
Important: The TP_.... and analogous PP_... macros should not be used interchangeably. Their definitions may be modified without notice in future releases.
Table 3.27: Macros for Particles at Current Position Defined in dpm_types.h
| Macro | Argument Types | Returns |
|---|---|---|
| | | position
|
| | | velocity |
| | | diameter |
| | | temperature |
| | | density |
| | | mass |
| | | current particle time |
| | | time step |
| | | flow rate of particles in a stream in kg/s (see below for details) |
| | | liquid mass fraction (wet combusting particles only) |
| | | liquid volume fraction (wet combusting particles only) |
| | | volatile fraction (combusting particles only) |
| | | char mass fraction (combusting particles only) |
| | | volatile fraction remaining (two competing rates devolatilization model only) |
TP_FLOW_RATE(tp)
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. TP_FLOW_RATE(tp) returns the strength multiplied by TP_MASS_INIT(tp) at the current particle position.
Table 3.28: Macros for Particles at Entry to Current Cell Defined in dpm_types.h
| Macro | Argument Types | Returns |
|---|---|---|
| | | position
|
| | | velocity |
| | | diameter |
| | | temperature |
| | | density |
| | | mass |
| | | particle time at entry |
| | | liquid mass fraction (wet combusting particles only) |
Important: Note that when you are using the macros listed in Table 3.28: Macros for Particles at Entry to Current Cell Defined in dpm_types.h 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.29: Macros for Particle Cell Index and Thread Pointer Defined in dpm_types.h
| Name (Arguments) | Argument Types | Returns |
|---|---|---|
| | | cell_t c, cell index of the cell in which the particle is currently located |
| | | Thread *tc, pointer to the thread of the cell in which the particle is currently located |
| | | face_t f, face index of the face to which the film particle is currently attached |
| | | Thread *tf, pointer to the thread of the face to which the film particle is currently attached |
Table 3.30: Macros for Particles at Injection into Domain Defined in dpm_types.h
| Macro | Argument Types | Returns |
|---|---|---|
| | | position
|
| | | velocity |
| | | diameter |
| | | temperature |
| | | density |
| | | mass |
| | | liquid mass fraction (wet combusting particles only) |
Table 3.31: Macros for Particle Species, Laws, Materials, and User Scalars Defined in dpm_types.h
| Macro | Argument Types | Returns |
|---|---|---|
| | | evaporating species index in mixture |
| | | devolatilizing species index in mixture |
| | | oxidizing species index in mixture |
| | | combustion products species index in mixture |
| | | int law, current particle law index |
| | | int next_law, next particle law index |
| | | Material *m, material pointer |
| | | storage array for
user-defined values (indexed by |
Table 3.32: Macros for Particle Material Properties Defined in dpm_laws.h
| Macro | Argument Types | Returns |
|---|---|---|
| | | boiling temperature |
| | | Binary diffusion coefficient to be used in the gaseous boundary layer around the particle |
| | | emissivity and scattering factor for the radiation model |
| | | thermal conductivity |
| | | heat of pyrolysis |
| | | heat of reaction |
| | | latent heat |
| | | specific heat of material used for liquid associated with particle |
| | | dynamic viscosity of liquid part of particle |
| | | particle density |
| | | specific heat |
| | | swelling coefficient for devolatilization |
| | | surface tension of liquid part of particles |
| | | vapor pressure of liquid part of particle |
| | | vaporization temperature used to switch to vaporization law |
| | | particle material volatile fraction |
| | | particle material char fraction |
Table 3.33: Macros to access source terms on CFD cells for the DPM model
| Macro | Argument Types | Returns |
|---|---|---|
| | | momentum source (SI units: kg m/s2), explicit |
| | | momentum source (SI units: kg/s), implicit |
| | | momentum source swirl component (SI units: kg m/s2), explicit |
| | | momentum source swirl component (SI units: kg/s), implicit |
| | | energy source (SI units: J/s), explicit |
| | | energy source (SI units: J/K/s), implicit |
| | | species mass source (SI units: kg/s), explicit |
| | | species mass source (SI units: kg/s), implicit |
| | | reaction rates of particle REACTIONS (SI units: kg/s/m3) |
| | | vaporization mass source of material |
| | | devolatilization mass source of material |
| | | burnout mass source of material |
| | | mass source of pdf stream 1 (SI units: kg/s) |
| | | mass source of pdf stream 2 (SI units: kg/s) |
| | | particles emissivity (SI units: m2K4) |
| | | particles absorption coefficient (SI units: m3/m) |
| | | particles scattering coefficient (SI units: m3/m) |
| | | burnout mass source (SI units: kg/s) |
| | | concentration of particles (SI units: kg/s/m3) |
| | | concentration of particle surface species (SI units: kg/s/m3) |
The macros listed in Table 3.33: Macros to access source terms on CFD cells for the DPM model in general are not intended to
be used to assign values inside DEFINE_DPM_SOURCE.
By design, you cannot assign values to some macros,
such as C_DPMS_YI and C_DPMS_YI_AP. These macros are used only for reporting purposes in DEFINE_ADJUST and DEFINE_ON_DEMAND.
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
DEFINE_NOX_RATE
for examples of DEFINE_NOX_RATE UDFs that
use these macros.
Table 3.34: Macros for NOx UDFs Defined in sg_nox.h
| Macro | Returns |
|---|---|
| | index of pollutant equation being solved (see below) |
| | molar
concentration of species specified by |
| | TRUE if the species specified by |
| | Arrhenius
rate calculated from the constants specified by |
| | production rate of the pollutant species being solved |
| | reduction rate of the pollutant species being solved |
| | quasi-steady rate of N2O formation (if the quasi-steady model is used) |
| | fluctuating density value (or, if no PDF model is used, mean density at a given cell |
| | fluctuating temperature value (or, if no PDF model is used, mean temperature at a given cell) |
| | fluctuating mass fraction value (or,
if no PDF model is used, mean mass fraction at a given cell) of the
species given by index |
| | upper limit for the temperature PDF integration (see below) |
Important: 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.
POLLUT_EQN(Pollut_Par) returns
the index of the pollutant equation currently being solved. The indices
are EQ_NO for NO, EQ_HCN for HCN, EQ_N2O for O, and
EQ_NH3 for .
MOLECON(Pollut,SPE) returns
the molar concentration of a species specified by SPE, which is either the name of the species or IDX(i) when the species is a pollutant (like NO). SPE must be replaced by one of the following identifiers: FUEL, O2, O, OH, H2O, N2, N, CH, CH2, CH3, IDX(NO), IDX(N2O), IDX(HCN),
IDX(NH3). For example, for molar concentration you should call
MOLECON(Pollut, O2), whereas for NO molar concentration
the call should be MOLECON(Pollut, IDX(NO)). The identifier FUEL represents the fuel
species as specified in the Fuel Species drop-down
list under Prompt NO Parameters in the NOx Model dialog box.
ARRH(Pollut,K) returns the
Arrhenius rate calculated from the constants specified by K. K is defined using the Rate_Const data type and has three elements - A, B, and C.
The Arrhenius rate is given in the form of
where T is the temperature.
Note that the units of K must be in m-mol-J-s.
POLLUT_CTMAX(Pollut_Par) can be used to modify the value used as the upper limit for the integration
of the temperature PDF (when temperature is accounted for in the turbulence
interaction modeling). You must make sure not to put this macro under
any conditions within the UDF (for example,
IN_PDF or OUT_PDF).
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
DEFINE_SOX_RATE
for examples
of DEFINE_SOX_RATE UDFs that use these macros.
Table 3.35: Macros for SOx UDFs Defined in sg_nox.h
| Macro | Returns |
|---|---|
| | index of pollutant equation being solved (see below) |
| | molar
concentration of species specified by |
| | TRUE if the species specified by |
| | Arrhenius
rate calculated from the constants specified by |
| | production rate of the pollutant species being solved |
| | reduction rate of the pollutant species being solved |
| | fluctuating density value (or, if no PDF model is used, mean density at a given cell) |
| | fluctuating temperature value (or, if no PDF model is used, mean temperature at a given cell) |
| | fluctuating mass fraction value (or,
if no PDF model is used, mean mass fraction at a given cell) of the
species given by index |
| | upper limit for the temperature PDF integration (see below) |
Important: 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.
POLLUT_EQN(Pollut_Par) returns
the index of the pollutant equation currently being solved. The indices
are EQ_SO2 for and
EQ_SO3 for , and so on.
MOLECON(Pollut, SPE) returns
the molar concentration of a species specified by SPE. SPE is either the name of the species
or IDX(i) when the species is a pollutant
(like ). For example, for
molar concentration you should call
MOLECON(Pollut, O2), whereas for molar concentration the call should be
MOLECON(Pollut, IDX(SO2)).
ARRH(Pollut,K) returns the
Arrhenius rate calculated from the constants specified by K. K is defined using the Rate_Const data type and has three elements - A, B, and C.
The Arrhenius rate is given in the form of
where T is the temperature.
Note that the units of must be in m-mol-J-s.
POLLUT_CTMAX(Pollut_Par) can be used to modify the value used as the upper limit for the integration
of the temperature PDF (when temperature is accounted for in the turbulence
interaction modeling). You must make sure not to put this macro under
any conditions within the UDF (for example,
IN_PDF or OUT_PDF).
The macros listed in Table 3.36: Macros for Dynamic Mesh Variables Defined in dynamesh_tools.h 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.36: Macros for Dynamic Mesh Variables Defined in dynamesh_tools.h
| Name (Arguments) | Argument Types | Returns |
|---|---|---|
| | | pointer to a thread |
| | | center of gravity vector |
| | | cg velocity vector |
| | | angular velocity vector |
| | | orientation of body-fixed axis vector |
| | N/A | current dynamic mesh time |
| | | absolute value of the crank angle |
See
DEFINE_GRID_MOTION
for an
example UDF that utilizes DT_THREAD.