3.2.3. Cell Macros

The macros listed in Table 3.3: Macro for Cell Centroids Defined in metric.h – Table 3.20: Macros for Multiphase Variables Defined in sg_mphase.h can be used to return real cell variables in SI units. They are identified by the C_ prefix. These variables are available in the pressure-based and the density-based solver. The quantities that are returned are available only if the corresponding physical model is active. For example, species mass fraction is available only if species transport has been enabled in the Species Model dialog box in ANSYS Fluent. Definitions for these macros can be found in the referenced header file (for example, mem.h).

3.2.3.1. Cell Centroid (C_CENTROID)

The macro listed in Table 3.3: Macro for Cell Centroids Defined in metric.h can be used to obtain the real centroid of a cell. C_CENTROID finds the coordinate position of the centroid of the cell c and stores the coordinates in the x array. Note that the x array is always one-dimensional, but it can be x[2] or x[3] depending on whether you are using the 2D or 3D solver.

Table 3.3:  Macro for Cell Centroids Defined in metric.h

Macro

Argument Types

Outputs

C_CENTROID(x,c,t)

real x[ND_ND], cell_t c, Thread * t

x (cell centroid)


See DEFINE_INIT for an example UDF that utilizes C_CENTROID.

3.2.3.2. Cell Volume (C_VOLUME)

The macro listed in Table 3.4: Macro for Cell Volume Defined in mem.h can be used to obtain the real cell volume for 2D, 3D, and axisymmetric simulations.

Table 3.4:  Macro for Cell Volume Defined in mem.h

Macro

Argument Types

Returns

C_VOLUME(c,t)

cell_t c, Thread *t

real cell volume for 2D or 3D, real cell volume/2π for axisymmetric


See DEFINE_UDS_UNSTEADY C_VOLUME.

3.2.3.3. Number of Faces (C_NFACES) and Nodes (C_NNODES) in a Cell

The macro C_NFACES shown in Table 3.5: Macros for Number of Node and Faces Defined in mem.h returns the integer number of faces for a given cell. C_NNODES, also shown in Table 3.2: Macro for Number of Nodes Defined in mem.h , returns the integer number of nodes for a given cell.

Table 3.5:  Macros for Number of Node and Faces Defined in mem.h

Macro

Argument Types

Returns

C_NNODES(c,t)

cell_t c, Thread *t

int number of nodes in a cell

C_NFACES(c,t)

cell_t c, Thread *t

int number of faces in a cell


3.2.3.4. Cell Face Index (C_FACE)

C_FACE expands to return the global face index face_t f for the given cell_t c, Thread *t, and local face index number i. Specific faces can be accessed via the integer index i and all faces can be looped over with c_face_loop. The macro is defined in mem.h.

Table 3.6:  Macro for Cell Face Index Defined in mem.h

Macro

Argument Types

Returns

C_FACE(c,t,i)

cell_t c, Thread *t, int i

global face index face_t f


3.2.3.5. Cell Face Index (C_FACE_THREAD)

C_FACE_THREAD expands to return the Thread *t of the face_t f that is returned by C_FACE (see above). Specific faces can be accessed via the integer index i and all faces can be looped over with c_face_loop. The macro is defined in mem.h.

Table 3.7:  Macro for Cell Face Index Defined in mem.h

Macro

Argument Types

Returns

C_FACE_THREAD

cell_t c, Thread *t, int i

Thread *t of face_t f returned by C_FACE.


3.2.3.6. Flow Variable Macros for Cells

You can access flow variables using macros listed in Table 3.8: Macros for Cell Flow Variables Defined in mem.h or sg_mem.h.

Table 3.8:  Macros for Cell Flow Variables Defined in mem.h or sg_mem.h

Macro

Argument Types

Returns

C_R(c,t)

cell_t c, Thread *t

density

C_P(c,t)

cell_t c, Thread *t

pressure

C_U(c,t)

cell_t c, Thread *t

u velocity

C_V(c,t)

cell_t c, Thread *t

v velocity

C_W(c,t)

cell_t c, Thread *t

w velocity

C_T(c,t)

cell_t c, Thread *t

temperature

C_H(c,t)

cell_t c, Thread *t

enthalpy

C_K(c,t)

cell_t c, Thread *t

turb. kinetic energy

C_NUT(c,t)

cell_t c, Thread *t

turbulent viscosity for Spalart-Allmaras

C_D(c,t)

cell_t c, Thread *t

turb. kinetic energy dissipation rate

C_O(c,t)

cell_t c, Thread *t

specific dissipation rate

C_YI(c,t,i)

cell_t c, Thread *t, int i

Note: int i is species index

species mass fraction

C_IGNITE (c,t)

cell_t c, Thread *t

ignition mass fraction

C_PREMIXC_T(c,t)

cell_t c, Thread *t

premixed combustion temperature

C_STORAGE_R(c,t,nv)

cell_t c, Thread *t, real nv

value of variable nv, where nv is a generic flow variable. For instance, for temperature, nv = SV_T, for pressure, nv = SV_P, for density, nv = SV_DENSITY, and so on.



Note:  The C_YI(c,t,i) macro is not available with the non/partially premixed models. See Species Fractions Calculations with the Non- and Partially- Premixed Models for Information on calculating the species fractions with the non-premixed and partially premixed models.


Table 3.9:  Macro for Cell Porosity in mem.h

Macro

Argument Types

Returns

C_POR(c,t)

cell_t c, Thread *t

porosity of fluid cell

C_DUAL_ZN_POROSITY(c,t)

cell_t c, Thread *t

porosity of fluid at the dual cell zone region in the non-equilibrium thermal model[a]


3.2.3.6.1. Species Fractions Calculations with the Non- and Partially- Premixed Models

When the non-premixed or partially premixed model is enabled, ANSYS Fluent uses lookup tables to calculate temperature, density, and species fractions. If you need to access these variables in your UDF, then note that while density and temperature can be obtained through the macros C_R(c,t) and C_T(c,t), if you need to access the species fractions, you will need to first retrieve them by calling the species lookup functions Pdf_Yi(c, t, n) or Pdf_XY(c,t,x,y). The functions are defined in the header file pdf_props.h, which you will need to include in your UDF:

Pdf_XY returns the species mole and mass fraction arrays x and y.

Function: Pdf_XY(cell_t c, Thread *t, real *x, real *y)

Argument Type

Description

cell_t c

Cell index.

Thread *t

Pointer to thread.

real *x

Array of species mole fractions.

real *y

Array of species mass fractions.

Function returns

void

Pdf_Yi returns the mass fraction of species n.

Function: Pdf_XY(cell_t c, Thread *t, int n)

Argument Type

Description

cell_t c

Cell index.

Thread *t

Pointer to thread.

int n

Species index.

Function returns

real

The species number in the lookup tables is stored in the integer variable n_spe_pdf, which is also included in the header file pdf_props.h.

3.2.3.7. Gradient (G) and Reconstruction Gradient (RG) Vector Macros

You can access gradient and reconstruction gradient vectors (and components) for many of the cell variables listed in Table 3.8: Macros for Cell Flow Variables Defined in mem.h or sg_mem.h. ANSYS Fluent calculates the gradient of flow in a cell (based on the divergence theory) and stores this value in the variable identified by the suffix _G. For example, cell temperature is stored in the variable C_T, and the temperature gradient of the cell is stored in C_T_G. The gradients stored in variables with the _G suffix are non-limited values and if used to reconstruct values within the cell (at faces, for example), may potentially result in values that are higher (or lower) than values in the surrounding cells. Therefore, if your UDF needs to compute face values from cell gradients, you should use the reconstruction gradient (RG) values instead of non-limited gradient (G) values. Reconstruction gradient variables are identified by the suffix _RG, and use the limiting method that you have activated in your ANSYS Fluent model to limit the cell gradient values.

Gradient (G) Vector Macros

Table 3.10: Macros for Cell Gradients Defined in mem.h shows a list of cell gradient vector macros. Note that gradient variables are available only when the equation for that variable is being solved. For example, if you are defining a source term for energy, your UDF can access the cell temperature gradient (using C_T_G), but it cannot get access to the x-velocity gradient (using C_U_G). The reason for this is that the solver continually removes data from memory that it does not need. In order to retain the gradient data (when you want to set up user-defined scalar transport equations, for example), you can prevent the solver from freeing up memory by issuing the text command solve/set/expert and then answering yes to the question, “Keep temporary solver memory from being freed?” Note that when you do this, all of the gradient data is retained, but the calculation requires more memory to run.

You can access a component of a gradient vector by specifying it as an argument in the gradient vector call (0 for the x component; 1 for y; and 2 for z). For example,

C_T_G(c,t)[0]; /* returns the x-component of the cell temperature gradient vector */ 

Table 3.10:  Macros for Cell Gradients Defined in mem.h

Macro

Argument Types

Returns

C_P_G(c,t)

cell_t c, Thread *t

pressure gradient vector

C_U_G(c,t)

cell_t c, Thread *t

velocity gradient vector

C_V_G(c,t)

cell_t c, Thread *t

velocity gradient vector

C_W_G(c,t)

cell_t c, Thread *t

velocity gradient vector

C_T_G(c,t)

cell_t c, Thread *t

temperature gradient vector

C_H_G(c,t)

cell_t c, Thread *t

enthalpy gradient vector

C_NUT_G(c,t)

cell_t c, Thread *t

turbulent viscosity for Spalart- Allmaras gradient vector

C_K_G(c,t)

cell_t c, Thread *t

turbulent kinetic energy gradient vector

C_D_G(c,t)

cell_t c, Thread *t

turbulent kinetic energy dissipation rate gradient vector

C_O_G(c,t)

cell_t c, Thread *t

specific dissipation rate gradient vector

C_YI_G(c,t,i)

cell_t c, Thread *t, int i

Note: int i is species index

species mass fraction gradient vector



Important:  Note that you can access vector components of each of the variables listed in Table 3.10: Macros for Cell Gradients Defined in mem.h by using the integer index [i] for each macro listed in Table 3.10: Macros for Cell Gradients Defined in mem.h . For example, C_T_G(c,t)[i] will access a component of the temperature gradient vector.



Important:   C_P_G can be used only in the pressure-based solver.



Important:   C_YI_G can be used only in the density-based solver. To use this in the pressure-based solver, you will need to set the rpvar ’species/save-gradients? to #t.


As stated previously, the availability of gradient variables is affected by your solver selection, which models are turned on, the setting for the spatial discretization, and whether the temporary solver memory is retained. To make it easy for you to verify what gradient variables are available for your particular case and data files, the following UDF (named showgrad.c) is provided. Simply compile this UDF, run your solution, and then hook the UDF using the Execute on Demand dialog box (as described in Hooking DEFINE_ON_DEMAND UDFs). The available gradient variables will be displayed in the console.


Important:  Note that the showgrad.c UDF is useful only for single-phase models.


 /*
 * ON Demand User-Defined Functions to check                              *
 * on the availability of Reconstruction Gradient and Gradients           *
 * for a given Solver and Solver settings:                                *
 *                                                                        *
 * Availability of Gradients & Reconstruction Gradients depends on:       *
 * 1) the selected Solver (density based or pressure based)               *
 * 2) the selected Model                                                  *
 * 3) the order of discretizations                                        *
 * 4) whether the temporary solver memory is being retained (to keep      *
 *    temporary memory go to solve - set -expert and type YES             *
 *    for "Keep temporary solver memory from being freed?")               *
 *                                                                        *
 *                                                                        *
 * How to use showgrad:                                                   *
 *                                                                        *
 * - Read in your case & data file.                                       *
 * - Compile showgrad.c UDF.                                              *
 * - Load library libudf.                                                 *
 * - Attach the showgrad UDF in the Execute on Demand dialog box.         *
 * - Run your solution.                                                   *
 * - Click the Execute button in the Execute on Demand dialog box.        *
 *                                                                        *
 * A list of available Grads and Recon Grads will be displayed in the     *
 * console.                                                               *
 *                                                                        *
 * 2004 Laith Zori                                                        *
 */ #include "udf.h"
 
 DEFINE_ON_DEMAND(showgrad)
 {
    Domain *domain;
    Thread *t;  domain=Get_Domain(1);
    if (! Data_Valid_P()) return;
    Message0(" >>> entering show-grad: \n ");
    thread_loop_c(t, domain)
      {
       Material *m = THREAD_MATERIAL(t);
       int nspe = MIXTURE_NSPECIES(m);
       int nspm = nspe-1;
       Message0("::::\n ");
       Message0("::::  Reconstruction Gradients :::: \n ");
       Message0("::::\n ");
       if (NNULLP(THREAD_STORAGE(t, SV_P_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of P is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_U_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of U is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_V_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of V is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_W_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of W is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_T_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of T is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_H_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of H is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_K_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of K is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_D_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of D is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_O_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of O is available \n ");
         }
       if (NNULLP(THREAD_STORAGE(t, SV_NUT_RG)))
         {
          Message0("....show-grad:Reconstruction Gradient of NUT is available \n ");
         }
 
       if (nspe && NNULLP(THREAD_STORAGE(t, SV_Y_RG)))
         {
           Message0("....show-grad:Reconstruction Gradient of Species is available \n ");
         }
 
     /********************************************************************/
     /********************************************************************/
     /********************************************************************/
     /********************************************************************/
     Message0("::::\n ");
     Message0("::::   Gradients :::: \n ");
     Message0("::::\n ");
     if (NNULLP(THREAD_STORAGE(t, SV_P_G)))
        {
         Message0("....show-grad:Gradient of P is available \n ");
        }
     if (NNULLP(THREAD_STORAGE(t, SV_U_G)))
        {
         Message0("....show-grad:Gradient of U is available \n ");
        }
     if (NNULLP(THREAD_STORAGE(t, SV_V_G)))
       {
        Message0("....show-grad:Gradient of V is available \n ");
       }
    if (NNULLP(THREAD_STORAGE(t, SV_W_G)))
       {
        Message0("....show-grad:Gradient of W is available \n ");
       }
     if (NNULLP(THREAD_STORAGE(t, SV_T_G)))
       {
        Message0("....show-grad:Gradient of T is available \n ");
       }
     if (NNULLP(THREAD_STORAGE(t, SV_H_G)))
       {
        Message0("....show-grad:Gradient of H is available \n ");
       }
     if (NNULLP(THREAD_STORAGE(t, SV_K_G)))
       {
        Message0("....show-grad:Gradient of K is available \n ");
       }
     if (NNULLP(THREAD_STORAGE(t, SV_D_G)))
       {
        Message0("....show-grad:Gradient of D is available \n ");
       }
     if (NNULLP(THREAD_STORAGE(t, SV_O_G)))
       {
        Message0("....show-grad:Gradient of O is available \n ");
       }
     if (NNULLP(THREAD_STORAGE(t, SV_NUT_G)))
       {
        Message0("....show-grad:Gradient of NUT is available \n ");
       }
 
     if (nspe && NNULLP(THREAD_STORAGE(t, SV_Y_G)))
         {
           Message0("....show-grad:Gradient of Species is available \n ");
         }
    }
 } 

Reconstruction Gradient (RG) Vector Macros

Table 3.11: Macros for Cell Reconstruction Gradients (RG) Defined in mem.h shows a list of cell reconstruction gradient vector macros. Like gradient variables, RG variables are available only when the equation for that variable is being solved. As in the case of gradient variables, you can retain all of the reconstruction gradient data by issuing the text command solve/set/expert and then answering yes to the question Keep temporary solver memory from being freed?. Note that when you do this, the reconstruction gradient data is retained, but the calculation requires more memory to run.

You can access a component of a reconstruction gradient vector by specifying it as an argument in the reconstruction gradient vector call (0 for the x component; 1 for y; and 2 for z). For example,

 C_T_RG(c,t)[0]; /* returns the x-component of the cell temperature
                    reconstruction gradient vector */ 

Table 3.11:  Macros for Cell Reconstruction Gradients (RG) Defined in mem.h

Macro

Argument Types

Returns

C_R_RG(c,t)

cell_t c, Thread *t

density RG vector

C_P_RG(c,t)

cell_t c, Thread *t

pressure RG vector

C_U_RG(c,t)

cell_t c, Thread *t

velocity RG vector

C_V_RG(c,t)

cell_t c, Thread *t

velocity RG vector

C_W_RG(c,t)

cell_t c, Thread *t

velocity RG vector

C_T_RG(c,t)

cell_t c, Thread *t

temperature RG vector

C_H_RG(c,t)

cell_t c, Thread *t

enthalpy RG vector

C_NUT_RG(c,t)

cell_t c, Thread *t

turbulent viscosity for Spalart-Allmaras RG vector

C_K_RG(c,t)

cell_t c, Thread *t

turbulent kinetic energy RG vector

C_D_RG(c,t)

cell_t c, Thread *t

turbulent kinetic energy dissipation rate RG vector

C_YI_RG(c,t,i)

cell_t c, Thread *t, int i

Note: int i is species index

species mass fraction RG vector



Important:  Note that you can access vector components by using the integer index [i] for each macro listed in Table 3.11: Macros for Cell Reconstruction Gradients (RG) Defined in mem.h . For example, C_T_RG(c,t)[i] will access a component of the temperature reconstruction gradient vector.



Important:   C_P_RG can be used in the pressure-based solver only when the second order discretization scheme for pressure is specified.



Important:   C_YI_RG can be used only in the density-based solver.


As stated previously, the availability of reconstruction gradient variables is affected by your solver selection, which models are turned on, the setting for the spatial discretization, and whether the temporary solver memory is freed. To make it easy for you to verify which reconstruction gradient variables are available for your particular case and data files, a UDF (named showgrad.c) has been provided that will display the available gradients in the console. See the previous section for details.

3.2.3.8. Previous Time Step Macros

The _M1 suffix can be applied to some of the cell variable macros in Table 3.8: Macros for Cell Flow Variables Defined in mem.h or sg_mem.h to allow access to the value of the variable at the previous time step (that is, ). These data may be useful in unsteady simulations. For example,

 C_T_M1(c,t); 

returns the value of the cell temperature at the previous time step. Previous time step macros are shown in Table 3.12: Macros for Cell Time Level 1 Defined in mem.h .


Important:  Note that data from C_T_M1 is available only if user-defined scalars are defined. It can also be used with adaptive time stepping.


Table 3.12:  Macros for Cell Time Level 1 Defined in mem.h

Macro

Argument Types

Returns

C_R_M1(c,t)

cell_t c, Thread *t

density, previous time step

C_U_M1(c,t)

cell_t c, Thread *t

velocity, previous time step

C_V_M1(c,t)

cell_t c, Thread *t

velocity, previous time step

C_W_M1(c,t)

cell_t c, Thread *t

velocity, previous time step

C_T_M1(c,t)

cell_t c, Thread *t

temperature, previous time step

C_YI_M1(c,t,i)

cell_t c, Thread *t, int i

Note: int i is species index

species mass fraction, previous time step


See DEFINE_UDS_UNSTEADY for an example UDF that utilizes C_R_M1.

The M2 suffix can be applied to some of the cell variable macros in Table 3.12: Macros for Cell Time Level 1 Defined in mem.h to allow access to the value of the variable at the time step before the previous one (that is, ). These data may be useful in unsteady simulations. For example,

 C_T_M2(c,t); 

returns the value of the cell temperature at the time step before the previous one (referred to as second previous time step). Two previous time step macros are shown in Table 3.13: Macros for Cell Time Level 2 Defined in mem.h .


Important:  Note that data from C_T_M2 is available only if user-defined scalars are defined. It can also be used with adaptive time stepping.


Table 3.13:  Macros for Cell Time Level 2 Defined in mem.h

Macro

Argument Types

Returns

C_R_M2(c,t)

cell_t c, Thread *t

density, second previous time step

C_U_M2(c,t)

cell_t c, Thread *t

velocity, second previous time step

C_V_M2(c,t)

cell_t c, Thread *t

velocity, second previous time step

C_W_M2(c,t)

cell_t c, Thread *t

velocity, second previous time step

C_T_M2(c,t)

cell_t c, Thread *t

temperature, second previous time step

C_YI_M2(c,t,i)

cell_t c, Thread *t, int i

species mass fraction, second previous time step


3.2.3.9. Derivative Macros

The macros listed in Table 3.14: Macros for Cell Velocity Derivatives Defined in mem.h can be used to return real velocity derivative variables in SI units. The variables are available in both the pressure-based and the density-based solver. Definitions for these macros can be found in the mem.h header file.

Table 3.14:  Macros for Cell Velocity Derivatives Defined in mem.h

Macro

Argument Types

Returns

C_STRAIN_RATE_MAG(c,t)

cell_t c, Thread *t

strain rate magnitude

C_DUDX(c,t)

cell_t c, Thread *t

velocity derivative

C_DUDY(c,t)

cell_t c, Thread *t

velocity derivative

C_DUDZ(c,t)

cell_t c, Thread *t

velocity derivative

C_DVDX(c,t)

cell_t c, Thread *t

velocity derivative

C_DVDY(c,t)

cell_t c, Thread *t

velocity derivative

C_DVDZ(c,t)

cell_t c, Thread *t

velocity derivative

C_DWDX(c,t)

cell_t c, Thread *t

velocity derivative

C_DWDY(c,t)

cell_t c, Thread *t

velocity derivative

C_DWDZ(c,t)

cell_t c, Thread *t

velocity derivative


3.2.3.10. Material Property Macros

The macros listed in Table 3.15: Macros for Diffusion Coefficients Defined in mem.h – Table 3.17: Additional Material Property Macros Defined in sg_mem.h can be used to return real material property variables in SI units. The variables are available in both the pressure-based and the density-based solver. Argument real prt is the turbulent Prandtl number. Definitions for material property macros can be found in the referenced header file (for example, mem.h).

Table 3.15:  Macros for Diffusion Coefficients Defined in mem.h

Macro

Argument Types

Returns

C_MU_L(c,t)

cell_t c, Thread *t

laminar viscosity

C_MU_T(c,t)

cell_t c, Thread *t

turbulent viscosity[a]

C_MU_EFF(c,t)

cell_t c, Thread *t

effective viscosity

C_K_L(c,t)

cell_t c, Thread *t

thermal conductivity

C_K_T(c,t,prt)

cell_t c, Thread *t, real prt

turbulent thermal conductivity

C_K_EFF(c,t,prt)

cell_t c, Thread *t, real prt

effective thermal conductivity

C_DIFF_L(c,t,i,j)

cell_t c, Thread *t, int i, int j

laminar species diffusivity

C_DIFF_EFF(c,t,i)

cell_t c, Thread *t, int i

effective species diffusivity

[a] In an Embedded LES case with SAS or DES for the global turbulence model, the global turbulence model is solved even inside the LES zone, although it does not affect the velocity equations or any other model there. (This allows the global turbulence model in a downstream RANS zone to have proper inflow turbulence conditions.) Inside the LES zone, the turbulent eddy viscosity of the “muted” global SAS or DES model can be accessed through the C_MU_T_LES_ZONE(c,t) macro. (All other global turbulence models are completely frozen in all LES zones; in such cases, only the LES sub-grid scale model's eddy viscosity is available through C_MU_T(c,t) in the LES zones, as is always true for all LES zones and all pure LES cases.)


Table 3.16:  Macros for Thermodynamic Properties Defined in mem.h

Name (Arguments)

Argument Types

Returns

C_CP(c,t)

cell_t c, Thread *t

specific heat

C_RGAS(c,t)

cell_t c, Thread *t

universal gas constant/molecular weight

C_NUT(c,t)

cell_t c, Thread *t

turbulent viscosity for Spalart-Allmaras


Table 3.17:  Additional Material Property Macros Defined in sg_mem.h

Macro

Argument Types

Returns

C_FMEAN(c,t)

cell_t c, Thread *t

primary mean mixture fraction

C_FMEAN2(c,t)

cell_t c, Thread *t

secondary mean mixture fraction

C_FVAR(c,t)

cell_t c, Thread *t

primary mixture fraction variance

C_FVAR2(c,t)

cell_t c, Thread *t

secondary mixture fraction variance

C_PREMIXC(c,t)

cell_t c, Thread *t

reaction progress variable

C_LAM_FLAME_SPEED(c,t)

cell_t c, Thread *t

laminar flame speed

C_SCAT_COEFF(c,t)

cell_t c, Thread *t

scattering coefficient

C_ABS_COEFF(c,t)

cell_t c, Thread *t

absorption coefficient

C_CRITICAL_STRAIN_ RATE(c,t)

cell_t c, Thread *t

critical strain rate

C_LIQF(c,t)

cell_t c, Thread *t

liquid fraction in a cell

C_POLLUT(c,t,i)

cell_t c, Thread *t, int i

th pollutant species mass fraction (see table below)



Important:   C_LIQF is available only in fluid cells and only if solidification is turned ON.


Table 3.18:  Table of Definitions for Argument i of the Pollutant Species Mass Fraction Function C_POLLUT

i

Definitions

0

Mass Fraction of NO

1

Mass Fraction of HCN

2

Mass Fraction of NH3

3

Mass Fraction of N2O

4

Soot Mass Fraction

5

Normalized Radical Nuclei



Note:  Concentration in particles /kg. For mass fraction concentrations in the table above, see Equation 14–132 in the Fluent Theory Guide for the defining equation.


3.2.3.11. Reynolds Stress Model Macros

The macros listed in Table 3.19: Macros for Reynolds Stress Model Variables Defined in sg_mem.h can be used to return real variables for the Reynolds stress turbulence model in SI units. The variables are available in both the pressure-based and the density-based solver. Definitions for these macros can be found in the metric.h header file.

Table 3.19:  Macros for Reynolds Stress Model Variables Defined in sg_mem.h

Macro

Argument Types

Returns

C_RUU(c,t)

cell_t c, Thread *t

uu Reynolds stress

C_RVV(c,t)

cell_t c, Thread *t

vv Reynolds stress

C_RWW(c,t)

cell_t c, Thread *t

ww Reynolds stress

C_RUV(c,t)

cell_t c, Thread *t

uv Reynolds stress

C_RVW(c,t)

cell_t c, Thread *t

vw Reynolds stress

C_RUW(c,t)

cell_t c, Thread *t

uw Reynolds stress


3.2.3.12. VOF Multiphase Model Macro

The macro C_VOF can be used to return real variables associated with the VOF multiphase model in SI units. The variables are available in both the pressure-based and the density-based solver, with the exception of the VOF variable, which is available only for the pressure-based solver. Definitions for these macros can be found in sg_mphase.h, which is included in udf.h.

Table 3.20:  Macros for Multiphase Variables Defined in sg_mphase.h

Macro

Argument Types

Returns

C_VOF(c,t)

cell_t c, Thread *t

(has to be a phase thread)

volume fraction for the phase corresponding to phase thread t.



Release 18.2 - © ANSYS, Inc. All rights reserved.