Post Command Language
Post Command Language
Master Contents
CFX-Post
Master Index
Help On Help
Page 199
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Page 200
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
CCL Syntax
Basic Terminology The following is an example of a CCL object that defines an isosurface.
ISOSURFACE: Iso1 Variable = Pressure Value = 15000 [Pa] Colour = 1,0,0 Transparency = 0.5 END
ISOSURFACE is an object type Iso1 is an object name Variable = Pressure is a parameter Variable is a parameter name Pressure is a parameter value If the object type does not need a name it is called a singleton object. Only one object of a given singleton type can exist. The Data Hierarchy Data is entered via parameters, these are grouped into objects which are stored in a tree structure.
OBJECT1: object name name1 = value name2 = value END
Objects and parameters may be placed in any order, provided that the information is set prior to being used further down the file. If data is set in one place and modified in another, the latter definition overrides the first. In CFX-Post, all object definitions are only one object level deep (i.e. Objects contain parameters, but not other objects).
Page 201
CCL Syntax
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Case Sensitivity Everything in the file is sensitive to case. Case sensitivity is not ideal for typing in many long parameter names, but it is essential for bringing the CFX Expression Language (CEL) into CCL. This is because some names used to define CCL objects (such as Fluids, Materials and Additional Variables) are used to construct corresponding CEL names. Case sensitive CEL names have been in use since CFX-5.2 (e.g. t = time and T = temperature). For simplicity and consistency, the following is implemented: singletons and object types use upper case only parameter names, and pre-defined object names, are mixed case. We try to follow the following conventions: (1) Major words start with an upper case letter, while minor words such as prepositions and conjunctions are left in lower case, e.g Mass Flow in (2) case is preserved for familiar names, e.g. for variables k or r, or for abbreviation RNG. user object names conventions can be chosen arbitrarily by you. CCL Names Definition Names of singletons, types of object, names of objects, and names of parameters all follow the same rules: In simple syntax, a CCL name must be at least one character. This first character must be alphabetic; there may be any number of subsequent characters and these can be alphabetic, numeric, space or tab. The effect of spaces in CCL names is: Spaces appearing before or after a name are not considered to be part of the name. Single spaces appearing inside a name are significant. Multiple spaces and tabs appearing inside a name are treated as a single space. Indentation Nothing in the file is sensitive to indentation, but indentation can be used for easier reading. End of line comment character The # character is used for this. Any text to the right of this character will be treated as comments. Any characters may be used within comments.
Page 202
CCL Syntax
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Continuation character If a line ends with the character \ the following line will be linked to the existing line. There is no restriction on the number of continuation lines. Named Objects A named object consists of an object type at the start of a line, followed by a : and an object name. Subsequent lines may define parameters and child objects associated with this object. The object definition is terminated by the string "END" on a line by itself. Object names must be unique within the given scope, and the name must not contain an underscore. Singleton Objects A singleton object consists of an object type at the start of a line, followed by a ":. Subsequent lines may define parameters and child objects associated with this object. The object definition is terminated by the string END on a line by itself. The difference between a singleton object and a named object is that (after the data has been processed), a singleton can appear just once as the child of a parent object, whereas there may be several instances of a named object of the same type defined with different names. Parameters A parameter consists of a parameter name at the start of a line followed by an = character followed by a parameter value. A Parameter may belong to many different object types. For example U Velocity = 1.0 [m/s] may belong to an initial value object and U Velocity = 2.0 [m/s] may belong to a boundary condition object. Both refer to the same definition of U velocity in the rules file. Lists Lists are used within the context of parameter values and are comma separated. Parameter values All parameter values are initially handled as data of type String, and should first of all conform to the following definition of allowed String values: String Any characters can be used in a parameter value.
Page 203
CCL Syntax
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
String values or other parameter type values are normally unquoted. If any quotes are present, they are considered part of the value. Leading and trailing spaces are ignored. Internal spaces in parameter values are preserved as given, although a given application is free to subsequently assume a space condensation rule when using the data. The characters '$' and '#' have a special meaning. A string beginning with '$' is evaluated as a Power Syntax variable, even if it occurs within a simple syntax statement. This is useful for performing more complex Power Syntax variable manipulation, and then using the result as part of a parameter or object definition. The appearance of '#' anywhere in the CCL file denotes the start of a comment. The characters such as [ ] { } are special only if used in conjunction with $. Following a $, such characters will terminate the preceding Perl variable name. Other characters that might be special elsewhere in power syntax are escaped automatically when they appear in parameter values. For example, @ % and & are escaped automatically (i.e. you do not need to precede these characters with the escape character \ when using them in parameter values). Parameter values can contain commas, but if the string is processed as a List or part of a List then the commas may be interpreted as separators (see below under List data types). Some examples of valid parameter values using special characters in power syntax are:
Estimated cost = \$500 Title = Run\#1 Sys Command = "echo Starting up Stress solver ; fred.exe &" Pressure = $myArray[4] Option = $myHash{"foo"} Fuel = C${numberCatoms}H${numberHatoms}
Parameter values for data types other than String, will additionally conform to one of the following definitions. String List A list of string items separated by commas. Items in a String List should NOT contain a comma unless contained between parentheses. One exception can be made if the String List to be is interpreted as a Real List (see below). Otherwise each item in the String List follows the same rules as String data. Example: names = one, two, three, four Example: this is a single cell example format table, column resized to 6 inches
Page 204
CCL Syntax
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Integer Sequence of digits containing no spaces or commas. If a real is specified when an integer is needed the real is rounded to the nearest integer. Integer List List of integers, comma separated. Real A single precision real number which may be specified in integer, floating point or scientific format, followed optionally by a dimension. Units use the same syntax as CEL. Expressions are allowed to include commas inside function call argument lists. Example usage:
a = 12.24 a = 1.224E01 a = 12.24 [m s^-1]
Real List List of reals, comma separated. Note that all items in the list must have the same dimensions. Those items which are expressions, are allowed to include commas inside function call argument lists, and the enclosed commas will be ignored when the list is parsed into individual items. Example usage:
a = 1.0 [m/s], 2.0 [m/s], 3.0 [m/s], 2.0*myvel, 4.0 [cm/s]
The list syntax 5*2.0 to represent 5 entries of the value 2.0 is not supported within CCL and hence within CFX-Post. Logical Several forms are acceptable: YES, TRUE, 1 or ON are all equivalent; NO or FALSE or 0 or OFF are all equivalent; initial letter variants Y, T, N, F are accepted (O is not accepted for On/Off); all case variants are accepted. Logical strings are also case insensitive (YeS, nO) Logical List List of Logicals, comma separated.
Page 205
CCL Syntax
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Escape character The \ character to be used as an escape character, for example to allow $ or # to be used in strings.
Page 206
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Page 207
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Important: Since Power Syntax uses Perl mathematical operators, you should exercise caution when combining CEL with Power Syntax expressions. For example, in CEL, 22 is represented as 2^2, but in Perl, would be written 2**2. If you are unsure about the validity of an operator in Perl, please consult a Perl reference guide. Variables Created by CFX-Post CFX-Post creates some additional variables that you can use in expressions or as plot variables. These are listed in Table 8.
Table 8 Variables created by CFX-Post Name Area Description This is only meaningful for surface locators (user surface, plane, isosurface, boundary). The value at each node is equal to the sum of sector areas associated with the node (a sector area is the portion of area of a face touching a node that can be associated with that node). Its sum over the locator is equal to the total locator area, this is the same as the return value of the area (p. 137) function. The value of this variable is calculated in the same way as the force (p. 139) function operates. This variable is only meaningful for polyline and line objects. The value on each line node is equal to the sum of halfs of the two line segments joined at the node. The sum of this variable over a line locator equals to the total line length, this is the same as the return value of length (p. 140) function. The value of this variable is calculated in the same way as the massFlow (p. 141) function operates. This is only meaningful for surface locators (user surface, plane, isosurface, boundary). It is a vector variable dening the surface unit normal at each node in the locator. This variable is only dened on volume locators (volume, domain, subdomain). The value at each node is equal to the sum of the sector volumes associated with the node (a sector volume is the portion of volume of an element touching a node that can be associated with that node). Its sum over the locator is equal to the total locator volume, this is the same as the return value of volume (p. 145) function.
Force Length
Volume
Page 208
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Quantitative CEL Functions in CFX-Post The quantitative functions available from the Function Calculator in the CFX-Post GUI are integrated into CEL in CFX-Post and can be used in any expression. The general syntax used for these functions in CEL is:
[<Fluid>.]<function>[_<Axis>[_<Coord Frame>]]([<Expression>])@<Location>
where terms enclosed in square braces [ ] can be optional depending on the function used and terms in < > should be replaced with the required entry. Some examples are given below.
area()@inlet area_x()@inlet areaAve(Pressure - 10000 [Pa])@outlet Water at RTP.force_z()@Default
[<Fluid>.] is always an optional argument which will default to all fluids in the domain if not specified. For multiphase results it can be set to any single fluid in the domain by entering the fluid name followed by a period before the function definition. See the table below for a list of functions that accept this option. <function> specifies the quantitative function to evaluate. See the table below for a list of functions. [_<Axis>_[<Coord Frame>]] can be an optional or a required argument depending on the function evaluated. [_<Axis>_[<Coord Frame>]] can be replaced with _x, _y or _z (lower case only) to specify the default X, Y and Z axis and should follow the function name. You can use an axis from a different coordinate frame by following the axis specification with the name of the Coordinate Frame, e.g. _x_MyCoordFrame1. ([<Expression>]) is a required argument for some functions and should be left blank as in the above area example (i.e. ()) for other functions (see the table below for a list). Any valid expression or variable can be used. You can also use a variable as part of an expression as shown in the above areaAve example. @<Location> is required for all quantitative functions. Consistent units must be maintained when adding, subtracting or comparing values. The following table contains the quantitative function available for use with CEL in CFX-Post. The operation performed by the function and the arguments accepted are also shown. A detailed description of the calculation performed by each function is not provided here, see Function Selection (p. 136) for this information.
Page 209
CFX-5.7.1
CFX-Post Advanced
Master Master Help On Contents Index Help Table 9 Additional CEL functions in CFX-Post Operation Area projected to axis (no axis specication returns total area) Area-weighted average Area-weighted integral Arithmetic average Number of calculation points Force on a surface in the specied direction Length normalised force on a curve in the specied direction Length of a curve Length-weighted average Length-weighted integration Total mass ow Mass-weighted average Mass-weighted integral Maximum Value Minimum Value Value at a point Required Arguments @<Location> Optional Arguments _<Axis>[_<Coor d Frame>] _<Axis>[_<Coor d Frame>] _<Axis>[_<Coor d Frame>]
areaAve (p. 211) areaInt (p. 211) ave (p. 212) count (p. 212) force (p. 212)
<Expression> @<Location> <Expression> <Location> <Expression> @<Location> @<Location> _<Axis>[_<Coor d Frame>] @<Location> _<Axis>[_<Coor d Frame>] @<Location> @<Location> <Expression> @<Location> <Expression> @<Location> @<Location> <Expression> @<Location> <Expression> @<Location> <Expression> @<Location> <Expression> @<Location> <Expression> @<Location>
<Fluid>.
<Fluid>.
length (p. 213) lengthAve (p. 213) lengthInt (p. 213) massFlow (p. 213) massFlowAve (p. 213) massFlowInt (p. 214) maxVal (p. 214) minVal (p. 214) probe (p. 214)
Page 210
CFX-5.7.1
CFX-Post Advanced
Master Index
Help On Help Required Arguments <Expression> @<Location> _<Axis>[_<Coor d Frame>] @<Location> @<Location> <Expression> @<Location> <Expression> @<Location> <Fluid>. Optional Arguments
Sum over the calculation points Torque on a surface about the specied axis Volume of a 3-D location Volume-weighted average Volume-weighted integral
area
area[_<Axis>[_<Coord Frame>] ]()@<Location>
An error is raised if the location specified is not a 2-D Object. If an axis is not specified the total area of the location is calculated. See area (p. 137) for a function description.
Example: area()@Isosurface1 calculates the total area of the location Isosurface1. Example: area_y()@Isosurface1 calculates the projected area of Isosurface1 onto a plane normal to the Y-axis. areaAve
areaAve[_<Axis>[_<Coord Frame>] ](<Expression>)@<Location>
An error is raised if the location specified is not a 2-D Object. See areaAve (p. 138) for a function description.
Example: Pressure - 1[bar])/ (0.5*Density*(areaAve(Velocity)@inlet)^2) calculates the Pressure coefficient Cp. You can create an expression using this, and then create a User Variable using the expression. The User Variable can then be plotted on objects like any other variable. areaInt
areaInt[_<Axis>[_<Coord Frame>] ](<Expression>)@<Location>
Page 211
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
An error is raised if the location specified is not a 2-D Object. Axis is optional and if not specified the integration is performed over the total face area. If axis is specified, then the integration is performed over the projected face area. See areaInt (p. 138) for a function description.
Example: areaInt_y_Frame2(Pressure)@boundary1 calculates the pressure force acting in the y-direction of the coordinate frame Frame2 on the locator boundary1. This differs from a calculation using the force function which calculates the total force on a wall boundary (i.e. viscous forces on the boundary are included). ave
ave(<Expression>)@<Location>
The ave function can be used on Point, 1-D, 2-D and 3-D locations. See ave (p. 139) for a function description. Example: ave(Yplus)@Default calculates the mean Yplus values from each node on the default walls. count
count()@<Location>
The count function is valid for point, 1-D, 2-D and 3-D locations. See count (p. 139) for a function description. Example: count()@Polyline1 returns the number of points on the specified Polyline locator. force
[<Fluid>.]force[_<Axis>[_<Coord Frame>] ]()@<Location>
Force calculations on boundaries require additional momentum flow data. This can be included in the Results file by adding the Expert Control Parameter output eq flows and setting its value to T. See force (p. 139) for a function description. Example: Water at RTP.force_x()@wall1 returns the total force in the x-direction acting on wall1 due to the fluid Water at RTP. forceNorm
[<Fluid>.]forceNorm[_<Axis>[_<Coord Frame>] ]()@<Location>
Page 212
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Returns the per unit width force on the specified line in the direction of the specified axis. An error will be raised if the location specified is not one-dimensional. See forceNorm (p. 140) for a function description. Example: forceNorm_y()@Polyline1 calculates the per unit width force in the ydirection on the selected Polyline. length
length()@<Location>
A 1-D location should be specified (specifying a 2-D location will not produce an error, the sum of the edge lengths from the elements in the locator will be returned). See length (p. 140 in CFX-Post) for a function description. Example: length()@Polyline1 returns the length of the Polyline. Note: While using this function in Power Syntax the leading character is capitalised to avoid confusion with the Perl internal command length. lengthAve
lengthAve(<Expression>)@<Location>
A 1-D or 2-D location must be specified. See lengthAve (p. 141) for a function description. Example: lengthAve(T)@Polyline1 calculates the average Temperature on Polyline1 weighted by the distance between each point (T is the System Variable for Temperature). lengthInt
lengthInt(<Expression>)@<Location>
A 1-D location must be specified. See lengthInt (p. 141) for a function description. massFlow
[<Fluid>.]massFlow()@<Location>
Computes the mass flow through the specified 2-D location. See massFlow (p. 141) for a function description. Example: Air at STP.massFlow()@DegassingOutlet calculates the mass flow of Air at STP through the selected location. massFlowAve
[<Fluid>.]massFlowAve(<Expression>)@<Location>
Page 213
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
An error is raised if the location specified is not 2-D. See massFlowAve (p. 141) for a function description. Example: massFlowAve(Density)@Plane1 calculates the average Density on Plane1 weighted by the mass flow at each point on the location. massFlowInt
[<Fluid>.]massFlowInt(<Expression>)@<Location>
An error is raised if the location specified is not 2-D. See massFlowInt (p. 144) for a function description. maxVal
maxVal(<Expression>)@<Location>
Point, and one, two and three-dimensional locators can be specified. See maxVal (p. 144) for a function description. minVal
minVal(<Expression>)@<Location>
Point, and one, two and three-dimensional locators can be specified. See minVal (p. 144) for a function description. probe
probe(<Expression>)@<Location>
Valid only for Point locators, this will return the value of a variable at a given location. See probe (p. 144) for a function description. sum
sum(<Expression>)@<Location>
One, two and three-dimensional locators can be specified. See sum (p. 144) for a function description. torque
[<Fluid>.]torque_[<Axis>[_<Coord Frame>] ]()@<Location>
An error is raised if the location specified is not 2-D.See torque (p. 145) for a function description. volume
volume()@<Location>
Page 214
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
An error is raised if the location specified is not a 3-D Object. See volume (p. 145) for a function description. volumeAve
volumeAve(<Expression>)@<Location>
An error is raised if the location specified is not a 3-D Object. See volumeAve (p. 145) for a function description. volumeInt
volumeInt(<Expression>)@<Location>
A 3-D Object must be selected as the location. See volumeInt (p. 145) for a function description. Example: volumeInt(Density)@StaticMixer calculates the total fluid mass in the domain StaticMixer.
Page 215
CFX-5.7.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Page 216
CFX-5.7.1