Professional Documents
Culture Documents
CFX Command Language
CFX Command Language
Master Contents
CFX-Post
Master Index
Help On Help
Retrace
Page 163
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
Page 164
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
CCL Syntax
Basic Terminology The following is an example of a CCL object to define 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 ISOSURFACE 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 165
CCL Syntax
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
CCL Syntax
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
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. The indentation will be used, however, when displaying contents of the file 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. 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 : followed by 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.
Page 167
CCL Syntax
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
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. 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.
Page 168
CCL Syntax
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
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. 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: 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.
names
Page 169
CCL Syntax
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
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 a a A real a a = 12.24 = 1.224E01 = 12.24 [m s^-1] may also be specified as an expression such as = myvel^2 + b = max(b,2.0)
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 used in CFX-Build to represent 5 entries of the value 2.0 is not supported within CCL and hence within CFX-Post. In CFX-Build the data is expanded prior to being written to the CCL file. Logical Several forms are acceptable: YES or TRUE or 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. The preferred form, recommended for GUI output files and for user documentation is, Yes/No. Logical strings are also case insensitive (YeS, nO) Logical List List of Logicals, comma separated.
Page 170
CCL Syntax
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
Escape character The \ character to be used as an escape character, for example to allow $ or # to be used in strings.
Page 171
CCL Syntax
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
Page 172
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
Page 173
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
where terms in [ ] 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_CoordFrame1. ([<Expression>]) is a required argument for some functions and should be left blank as in the above area example (i.e. ())for other function (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.
Page 174
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
Consistent units must be maintained when adding, subtracting or comparing values. The following table contains the quantitative function available for use with CEL. 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. 128) for this information.
Function Name area (p. 176) 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 Required Arguments @<Location> Optional Arguments _<Axis>
areaAve (p. 176) areaInt (p. 177) ave (p. 177) count (p. 177) force (p. 177) forceNorm (p. 178)
<Expression> @<Location> <Expression> <Location> <Expression> @<Location> @<Location> _<Axis> @<Location> _<Axis> @<Location> @<Location> <Expression> @<Location> <Expression> @<Location> @<Location> <Expression> @<Location> <Expression> @<Location> <Expression> @<Location>
_<Axis> _<Axis>
<Fluid>. <Fluid>.
length (p. 178) lengthAve (p. 178) lengthInt (p. 179) massFlow (p. 179) massFlowAve (p. 179) massFlowInt (p. 179) maxVal (p. 179)
Page 175
CFX-5.5.1
CFX-Post Advanced
Master Index
Function Name minVal (p. 179) probe (p. 180) sum (p. 180) torque (p. 180) volume (p. 180) volumeAve (p. 180) volumeInt (p. 180)
<Expression> @<Location> <Expression> @<Location> <Expression> @<Location> _<Axis> @<Location> @<Location> <Expression> @<Location> <Expression> @<Location> <Fluid>.
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>]()@<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. 129) 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>](<Expression>)@<Location>
An error is raised if the location specified is not a 2-D Object. See areaAve (p. 130) 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.
Page 176
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
areaInt
areaInt[_<Axis>](<Expression>)@<Location>
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. 130) 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. 131) 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. 132) for a function description. Example: count()@Polyline1 returns the number of points on the specified Polyline locator. force
[<Fluid>.]force_<Axis>()@<Location>
Page 177
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
Force calculations on boundaries require additional momentum flow data. This can be include in the Results file by adding the Expert Control Parameter output eq flows and setting its value to T. See force (p. 132) 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>()@<Location>
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. 133) for a function description. Example: forceNorm_y()@Polyline1 calculates the per unit width force in the y-direction 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). Note that when using this function in Power Syntax the leading character should be capitalised to avoid confusion with the Perl internal command length. See length (p. 133 in CFXPost) for a function description. Example: length()@Polyline1 returns the length of the Polyline. lengthAve
lengthAve(<Expression>)@<Location>
A 1-D or 2-D location must be specified. See lengthAve (p. 134) 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).
Page 178
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
lengthInt
lengthInt(<Expression>)@<Location>
A 1-D location must be specified. See lengthInt (p. 134) for a function description. massFlow
[<Fluid>.]massFlow()@<Location>
Computes the mass flow through the specified 2-D location. See massFlow (p. 134) 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>
An error is raised if the location specified is not 2-D. See massFlowAve (p. 134) 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. 135) for a function description. maxVal
maxVal(<Expression>)@<Location>
Point, and one, two and three-dimensional locators can be specified. See maxVal (p. 135) for a function description. minVal
minVal(<Expression>)@<Location>
Point, and one, two and three-dimensional locators can be specified. See minVal (p. 135) for a function description.
Page 179
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
probe
probe(<Expression>)@<Location>
Valid only for Point locators, this will return the value of a variable at a given location. See probe (p. 135) for a function description. sum
sum(<Expression>)@<Location>
One, two and three-dimensional locators can be specified. See sum (p. 136) for a function description. torque
[<Fluid>.]torque_<Axis>()@<Location>
An error is raised if the location specified is not 2-D.See torque (p. 136) for a function description. volume
volume()@<Location>
An error is raised if the location specified is not a 3-D Object. See volume (p. 136) for a function description. volumeAve
volumeAve(<Expression>)@<Location>
An error is raised if the location specified is not a 3-D Object. Any variable or valid expression (see CEL Functions, Constants and System Variables (p. 173 in CFX-Post)) can be used as the <Expression> argument. See volumeAve (p. 137) for a function description. volumeInt
volumeInt(<Expression>)@<Location>
A 3-D Object must be selected as the location. See volumeInt (p. 137) for a function description. Example: volumeInt(Density)@StaticMixer calculates the total fluid mass in the domain StaticMixer.
Page 180
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
CEL Standard Functions The following is a list of standard functions that are available in CFX-Post. In the table below:
Note: [ ] denotes a dimensionless quantity. [a] denotes any dimensions of first operand. Result [] [] [] [radian] [radian] [radian] [radian] [] [] [] [a] [a^0.5] [] [a] [a] Function sin cos tan asin acos atan atan2 exp loge log10 abs sqrt step min max Operands ([radian]) ([radian]) ([radian]) ([ ]) ([ ]) ([ ]) ([ ],[ ])) ([ ]) ([ ]) ([ ]) ([a]) ([a]) ([ ]) ([a],[a]) ([a],[a])
CEL Constants The following predefined constants can be used within CEL expressions.
Constant e g pi
Page 181
CFX-Post Advanced
Help On Help
Retrace
CEL System Variables The following System Variables are available for use with CEL when defining expressions:
Name x y z r theta t u v w p vf ke ed eddy viscosity T sstrnr density viscosity Cp cond enthalpy
Page 182
Meaning Direction 1 in Reference Coordinate Frame Direction 2 in Reference Coordinate Frame Direction 3 in Reference Coordinate Frame Radial spatial location, r = Angle, arctan(y/x) Time Velocity in the x coordinate direction Velocity in the y coordinate direction Velocity in the z coordinate direction (absolute) Pressure Volume Fraction Turbulent kinetic energy Turbulent eddy dissipation Eddy Viscosity Temperature Shear strain rate Density Dynamic Viscosity Specic Heat Capacity at Constant Pressure Thermal Conductivity Specic Enthalpy
CFX-5.5.1
x +y
CFX-Post Advanced
Master Index
Retrace
Thermal Expansivity Local speed of sound in uid Subdomain variable (1.0 in Subdomain, 0.0 elsewhere) Mean Diameter Effective Density Additional Variable name
AV name
The r, theta t and subdomain values in the above table can only be used if the variables associated with them are output from the solver. r and theta are not calculated by CFX-Post from x, y, z but expressions to do so can be defined. subdomain is not usually defined in CFX-Post. Where appropriate, fluid or component names may be prefixed to these variables i.e. Water at STP.v.
Page 183
CFX-5.5.1
CFX-Post Advanced
Master Contents
Master Index
Help On Help
Retrace
Page 184
CFX-5.5.1