14.1.1. Values and Expressions

CEL can be used to generate both values and expressions. Values are dimensional (that is, with units) or dimensionless constants. The simplest type of definition is the dimensionless value, for example:

b = 3.743

You can also specify a value with units, for example:

g = 9.81 [m s^-2]

The dimensions of the quantities of interest for CFD calculations can be written in terms of mass, length, time, temperature and angle. The concept of units is fundamental to the behavior of values and expressions.

Values can be used directly, or they can be used as part of an expression. For example, you can use an expression to add two values together:

<Expr_1> = <Value_1> + <Value_2>

In this example, you may want to predefine <Value_1> and <Value_2>, but this is not required. However, in order to add two quantities together, they must have the same dimension; that is, it is meaningful to add a quantity in inches to one expressed in meters, but it is not meaningful to add one expressed in kilograms to one in square feet.

Expressions can also be functions of other (predefined) expressions:

<Expr_2> = <Expr_1> + <Value_3>

Units follow the conventions in the rest of CFX, in that a calculation has a set of solution units (by default, SI units), and that any quantity can be defined either in terms of the solution units, or any other set of units with the correct form.

An expression does not have its own units string, but if it references quantities that have dimensions, these will determine the resulting units for the expression. For example, if an expression depends inversely on the square of the x coordinate, then it has implied dimensions of length to the power -2.

14.1.1.1. Using Locators in Expressions

A CFX simulation has physics locators and mesh locators; physics locators are boundaries while mesh locators are regions. These two types of locator can occupy completely different spaces in a simulation; however, there is no requirement that locator names be unique between physics and mesh. This can lead to ambiguities when you use these names in expressions.

To avoid these ambiguities, Ansys CFX first checks to see if "@<locator>" is a physics name; if this is not found, the name is checked in the list of mesh names. Thus if "in1" is both the name of a physics locator and the name of a mesh locator, "@in1" is taken to indicate the physics locator.

Ansys CFX also has @REGION CEL syntax so that you can identify a named locator as being a mesh locator. Thus to identify the mesh locator in1, you would use the syntax:

@REGION:in1

Note that if <locator> does not appear as a physics name or a mesh name, the expression fails.


Note:  For any CEL expression that is defined for a locator (such as a domain, boundary, subdomain, injection region), the input coordinates (x, y, z, r, theta) are interpreted in the local frame but variables are normally interpreted in the global frame.