3.2.4. Face Macros

The macros listed in Table 3.21: Macro for Face Centroids Defined in metric.h – Table 3.24: Macros for Interior and Boundary Face Flow Variables Defined in mem.h can be used to return real face variables in SI units. They are identified by the F_ prefix. Note that these variables are available only in the pressure-based solver. In addition, 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 files (for example, mem.h).

3.2.4.1. Face Centroid (F_CENTROID)

The macro listed in Table 3.21: Macro for Face Centroids Defined in metric.h can be used to obtain the real centroid of a face. F_CENTROID finds the coordinate position of the centroid of the face f 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.21:  Macro for Face Centroids Defined in metric.h

Macro

Argument Types

Outputs

F_CENTROID(x,f,t)

real x[ND_ND], face_t f, Thread *t

x (face centroid)


The ND_ND macro returns 2 or 3 in 2D and 3D cases, respectively, as defined in The ND Macros. DEFINE_PROFILE contains an example of F_CENTROID usage.

3.2.4.2. Face Area Vector (F_AREA)

F_AREA can be used to return the real face area vector (or ‘face area normal’) of a given face f in a face thread t. See DEFINE_UDS_FLUX for an example UDF that utilizes F_AREA.

Table 3.22:  Macro for Face Area Vector Defined in metric.h

Macro

Argument Types

Outputs

F_AREA(A,f,t)

A[ND_ND], face_t f, Thread *t

A (area vector)


By convention in ANSYS Fluent, boundary face area normals always point out of the domain. ANSYS Fluent determines the direction of the face area normals for interior faces by applying the right hand rule to the nodes on a face, in order of increasing node number. This is shown in Figure 3.1: ANSYS Fluent Determination of Face Area Normal Direction: 2D Face.

Figure 3.1:  ANSYS Fluent Determination of Face Area Normal Direction: 2D Face

ANSYS Fluent Determination of Face Area Normal Direction: 2D Face

ANSYS Fluent assigns adjacent cells to an interior face (c0 and c1) according to the following convention: the cell out of which a face area normal is pointing is designated as cell C0, while the cell in to which a face area normal is pointing is cell c1 (Figure 3.1: ANSYS Fluent Determination of Face Area Normal Direction: 2D Face). In other words, face area normals always point from cell c0 to cell c1.

3.2.4.3. Flow Variable Macros for Boundary Faces

The macros listed in Table 3.23: Macros for Boundary Face Flow Variables Defined in mem.h access flow variables at a boundary face.

Table 3.23:  Macros for Boundary Face Flow Variables Defined in mem.h

Macro

Argument Types

Returns

F_U(f,t)

face_t f, Thread *t,

u velocity

F_V(f,t)

face_t f, Thread *t,

v velocity

F_W(f,t)

face_t f, Thread *t,

w velocity

F_T(f,t)

face_t f, Thread *t,

temperature

F_H(f,t)

face_t f, Thread *t,

enthalpy

F_K(f t)

face_t f, Thread *t,

turbulent kinetic energy

F_D(f,t)

face_t f, Thread *t,

turbulent kinetic energy dissipation rate

F_YI(f,t,i)

face_t f, Thread *t, int i

species mass fraction


See DEFINE_UDS_FLUX for an example UDF that utilizes some of these macros.

3.2.4.4. Flow Variable Macros at Interior and Boundary Faces

The macros listed in Table 3.24: Macros for Interior and Boundary Face Flow Variables Defined in mem.h access flow variables at interior faces and boundary faces.

Table 3.24:  Macros for Interior and Boundary Face Flow Variables Defined in mem.h

Macro

Argument Types

Returns

F_P(f,t)

face_t f, Thread *t,

pressure

F_FLUX(f,t)

face_t f, Thread *t

mass flow rate through a face


F_FLUX can be used to return the real scalar mass flow rate through a given face f in a face thread t. The sign of F_FLUX that is computed by the ANSYS Fluent solver is positive if the flow direction is the same as the face area normal direction (as determined by F_AREA - see Face Area Vector (F_AREA)), and is negative if the flow direction and the face area normal directions are opposite. In other words, the flux is positive if the flow is out of the domain, and is negative if the flow is in to the domain.

Note that the sign of the flux that is computed by the solver is opposite to that which is reported in the ANSYS Fluent GUI (for example, the Flux Reports dialog box).


Important:   F_P(f,t) is not available in the density-based solver.

In the density-based solver, F_FLUX(f,t) will only return a value if one or more scalar equations (for example, turbulence quantities) are being solved that require the mass flux of a face to be stored by the solver.



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