5.2. Expression Sources

Expression sources are the variables that can be used in expressions.

5.2.1. Field Variables

A subset of the Fluent postprocessing field variables are available for use in expressions. See Appendix: Supported Field Variables for a listing of all the available field variables.


Note:  Some variables require additional context, which is specified in the following format: Variable(<context>="<context value>"). For example, to get the species mass fraction of carbon dioxide: MassFraction(species="co2").

In multiphase simulations, the phase context must be specified. For example: MassFraction(species="co2", phase="air").

The context for variables requiring it is provided in the Variables (type/context) column of Appendix: Supported Field Variables.


5.2.2. Solution Variables

The following solution variables are available:

Table 5.2: Solution Variables

Variable

Description

Time

Current time*

*In steady state, time evaluates as 0, unless the case was run in transient, then switched to steady state, in which case it will evaluate as the latest time from the transient run.

Timestep

Current time step number*

*In steady state, timestep evaluates as 0, unless the case was run in transient, then switched to steady state, in which case it will evaluate as the latest timestep from the transient run.

DeltaTime

Current time step size*

*In steady state, delta time evaluates as 0, unless the case was run in transient, then switched to steady state, in which case it will evaluate as the latest delta time from the transient run.

Iteration

Global iteration count


5.2.3. Scientific Constants

Table 5.3: Scientific Constants

Variable

Description

Value

PI

Pi

3.14159265358979323846

e

e (base of the natural logarithm)

2.71828182845904523536

R

Gas constant

8.314472 [J K^-1 mol^-1]

avogadro

Avogadro's number

6.02214199e23 [mol^-1]

boltzmann

Boltzmann constant

1.3806503 [J K^-1]

clight

Light velocity

2.99792458e8 [m s^-1]

echarge

Electron charge

1.60217653e-19 [A s]

g

Acceleration due to gravity

9.8066502 [m s^-2]

planck

Planck's constant

6.62606876e-34 [J s]

stephan

Stephan-Boltzmann constant

5.670400e-08 [W m^-2 K^-2]

mupermo

Magnetic permeability

4.0*PI*1.0e-7 [N A^-2]

epspermo

Electric constant

1./(clight*clight*mupermo)

5.2.4. Aliases

Aliases provide simplified syntax to access frequently used variables.

Table 5.4: Variable Aliases

Alias

Variable

x

Position.x

y

Position.y

z

Position.z

u

Velocity.x

v

Velocity.y

w

Velocity.z

t

Time*

*In steady state, time evaluates as 0, unless the case was run in transient, then switched to steady state, in which case it will evaluate as the latest time from the transient run.

dt

DeltaTime*

*In steady state, delta time evaluates as 0, unless the case was run in transient, then switched to steady state, in which case it will evaluate as the latest delta time from the transient run.

iter

Global iteration count

T

StaticTemperature

P

StaticPressure

mf

MassFraction

Amag

FaceAreaMagnitude

vol

CellVolume

mass

CellVolume*Density


5.2.5. Profiles

You can use profiles in expressions to specify boundary and cell zone conditions, for postprocessing, and in reduction operations. Profiles are tabular data that can be imported into Fluent, which typically contain X, Y, and Z columns (for spatial profiles) or Time (for transient profiles), in addition to one or more dependent variable columns.


Note:  Radial profiles are not supported in expressions.


Prior to using profiles in an expression you must load one or more profiles. Refer to Reading and Writing Profile Files for additional information.

The profile expression requires the following inputs: profile('<profile-name>', '<field-name>', frame='<reference-frame-name>') (the reference frame argument is only for spatial profiles). Note that if specified, profile coordinates are assumed to be of the specified frame and are therefore transformed to global coordinates prior to interpolation (profile coordinates are not transformed if you specify the reference frame as frame='global').

Once the profile expression is defined, you can select it for the desired boundary condition or cell zone condition field. Refer to Expressions for Cell Zones and Boundary Conditions

Figure 5.1: Example Profile Expression

Example Profile Expression