15.2. Quantitative CEL Functions in Ansys CFX

CEL expressions can incorporate specialized functions that are useful in CFD calculations. All CEL functions are described in Quantitative Function List. For a description of the full CFX Expression Language, see CFX Expression Language (CEL).


Important:  You must use consistent units when adding, subtracting, or comparing values.

There are some differences between CEL functions in CFX-Pre and CFX-Solver and those in CFD-Post. For details, see below.


The syntax used for calling these functions when used within CEL expressions is:

[<Phase_Name>.][<Component_Name>.]<Function>([<Operand>])@<Location>

where:

  • Terms enclosed in square brackets [ ] are optional and terms in angle brackets < > should be replaced with the required entry.

  • <Phase_Name>: specifies a valid name of a phase. The phase can be fluid, particle, solid, fluid pair, or polydispersed fluid. For multi-phase cases in CFX-Pre, if the phase name is not specified in the <Operand>, then the phase name associated with the domain, subdomain, domain boundary, initialization or function in which the operand is being evaluated will be used. For multi-phase cases in CFX-Pre, a discussion of the handling of the phase name when it is not used to qualify (prepended to) <Function> and/or <Operand> can be found in CEL Functions with Multiphase Flow. For multi-phase cases in CFD-Post, if the phase name is not specified then the bulk quantity (if available for the CFX-Solver Results file) is used.

  • <Component_Name>: specifies a valid name of a component material, size group, or reaction. For multi-component cases in CFX-Pre, if the component name is not specified in the <Operand>, then the component name associated with the domain, subdomain, domain boundary, initialization or function in which the operand is being evaluated is used.

  • <Function>: specifies the CEL function to evaluate. See Quantitative Function List. The function can be further qualified by appending _Coordinate_Direction. In CFX-Pre, if the coordinate frame is not specified (in _Coordinate_Direction ) then the function will use the coordinate frame associated with the object (such as for a material, domain, subdomain, domain boundary, source point, monitor point, initialization, reference location or spark ignition object) in which it is being invoked.

  • <Coordinate_Direction>: specifies a particular coordinate direction. The syntax of the coordinate direction is [x|y|z][_<Coordinate_Frame>] where the coordinate frame can be the global coordinate frame or any user defined coordinate frame. In CFD-Post, if the coordinate frame is not specified then the global frame is used. See Coordinate Frame Command in the CFD-Post User's Guide, for discussion of creating a coordinate frame in CFD-Post.


    Note:  For a vector CEL function, you can only specify a stationary local coordinate frame in <Coordinate_Direction>.


  • <Operand>: specifies the argument of the function (if required). The operand can be either a valid mathematical CEL expression (only in CFD-Post) or specified using the following general variable syntax:

    [<Phase_Name>.][<Component_Name>.]<Variable_Name>[.<Variable_Operator>][.Difference]

    In CFX-Pre the operand cannot be a CEL expression or any operand qualified by <Variable_Operator>. However, you can create an Additional Variable based on any expression and then use the Additional Variable as the operand. In this case, it is important to qualify component variables with their respective component names; any unqualified variables are assumed to be in the context of the mixture rather than any particular mixture component.

    The operand always uses the conservative values unless the Boundcon variable operator is specified (for details, see Data Acquisition Routines in the CFX-Solver Modeling Guide). For primitive or composite mesh regions, conservative values will be used even if the Boundcon variable operator is specified.

    The operand must be valid for the physical models being used over the entire location. For example, if the location spans fluid and solid domains, then the operand cannot be Pressure.

    For some functions, the operand must be left blank as in area()@Inlet.

    In CFD-Post, difference variables created during case comparison are appended by .Difference.

  • <Variable_Name>: specifies the base name of the variable. You can use the short or long form for variable names. The variable name can be further qualified by appending _<Coordinate_Direction>. This is useful for specifying a particular component of a vector or tensor, for example Velocity_y_myLocalFrame. If the variable name corresponds to that of a component of a vector or a tensor, and a coordinate frame is not prescribed (as part of the coordinate direction), then the global coordinate frame is used. An exception applies for the position vector x, y, z (or r, theta, z) components, which are always local, see Functions Involving Coordinates.


    Note:
    • For a vector variable, you can only specify a stationary local coordinate frame in <Coordinate_Direction>.

      For a tensor variable, the only coordinate frame supported is the global coordinate frame.

    • A local coordinate frame cannot be appended to a variable that is used as an argument to a quantitative CEL function, unless that function is RBState for rigid bodies. A workaround that involves the use of an Additional Variable is given in [Monitor Name]: Coordinate Frame.


  • <Variable_Operator> specifies the name of the variable operator. The variable operators are:

    Long Name

    Short Name

    Magnitude

    magnitude

    Gradient

    grad

    Curl

    curl

    Laplacian

    laplacian

    Time Derivative

    dt

    Transient Minimum

    Trnmin

    Transient Maximum

    Trnmax

    Transient Std Deviation

    Trnsdv

    Transient RMS

    Trnrms

    Transient Average

    Trnavg

    Boundcon

    hybrid


    Note:  

    • Some variable operators might not be available in CFD-Post. Other variable operators might require the existence of certain derived variables in the solution results before they can be used in CFD-Post.

    • The Magnitude and Curl operators may only be applied to vector variables. All other operators may be applied to scalar variables and vector components.


  • <Location>: specifies the location over which the function is to be applied. The syntax of location is:

    [Case:<Case_Name>.][REGION:]<Location_Name>

    The case syntax [Case:<Case_Name>.] is only available in CFD-Post. When multiple cases are loaded, this syntax is used to narrow down the locator to the desired case.

    In CFX-Pre [<Location_Name>] must be a domain boundary, domain, subdomain, injection region, or primitive or composite mesh region. If the location name of a mesh region is the same as the name of a named boundary, domain, subdomain, or injection region, then the mesh location name must be prepended by REGION:. For primitive or composite mesh regions, conservative values will be used even if the name of the mesh region is the same as that of a named boundary.

    In CFD-Post [<Location_Name>] can be any loaded or user-defined location (for example, a point, domain boundary, plane, mesh region, or injection region). The syntax REGION:<Region Name> can also be used in CFD-Post to refer to any mesh region. If a mesh region is present with the same name as, for example, a domain boundary, then the mesh region is imported into CFD-Post with a Region suffix. For example, if there is both a domain boundary and a mesh region called in1 in the CFX-Solver Results file, then in CFD-Post the mesh region will appear in CFD-Post as in1 Region. The syntax in1 will refer to the domain boundary, and either of in1 Region or REGION:in1 can be used to refer to the mesh region as desired.


    Note:  You cannot use a composite region that consists of a mixture of regions from more than one of the following categories: 2D regions, 3D regions, injection regions.


Table 15.2: Examples of the Calling Syntax for an Expression

areaAve(p)@Inlet

This results in the area-weighted average of pressure on the boundary named Inlet.

area()@REGION:myCompositeMeshRegion

This results in the area of a 2D mesh region named myCompositeMeshRegion.

areaAve(Pressure - 10000 [Pa])@outlet

This syntax is appropriate only for CFD-Post.

area_x()@inlet

 

Water at RTP.force_z()@Default

 

area()@CASE:newcase.myplane

This syntax is appropriate only for CFD-Post and is used when multiple files are loaded. It follows the general form function()@CASE:case name.location. This example results in the area of the part of myplane that is located within the case newcase.

probe(Pressure)@CASE:1.Point 1

probe(Pressure)@CASE:2.Point 1

This syntax is used only for CFD-Post, when two cases are loaded in the comparison mode. This example results in the difference in pressure between cases 1 and 2, where the pressure for Case 1 and the pressure for Case 2 are evaluated at the same point. The general syntax, function()@CASE:[1|2].location, is used when performing file comparisons.