Professional Documents
Culture Documents
ANSYS Conference
Training Manual
Customizing CFX
CFX Command Language (CCL) and
CFX Expression Language (CEL)
2-1
Methods of customization
Training Manual
1-2
Training Manual
Material properties
Physical models
Boundary conditions
Initialisation
Solver control
1-3
Training Manual
1-4
Editing CCL
Training Manual
Solution Data
(res file or def file
after solution
interpolation)
1-5
Training Manual
cfx5cmds -read
file1.def (original)
Editor
file1.ccl (original)
cfx5cmds -write
file1.ccl (modified)
file1.def (modified)
1-6
Training Manual
1-7
Training Manual
The resulting CCL used by the solver is given at the top of the
solver output file
ANSYS, Inc. Proprietary
2008 ANSYS, Inc. All rights reserved.
1-8
Training Manual
1-9
Training Manual
1-10
Training Manual
1-11
Training Manual
1-12
Training Manual
1-13
Training Manual
(valid)
(valid)
(invalid)
1-14
System Variables
Training Manual
Units
Description
x,y,z
m s-1
kg m-1 s-2
Pressure
ptot
kg m-1 s-2
Total Pressure
mf
dimensionless
Mass Fraction
density
kg m-3
Density
Temperature
viscosity
kg m-1 s-1
Dynamic Viscosity
Cp
m2 s-2 K-1
cond
kg m s-3 K-1
Thermal Conductivity
ctstep
dimensionless
atstep
dimensionless
citern
dimensionless
aitern
dimensionless
1-15
Training Manual
Meaning
pressure
Air.density
Density of Air.
Air.viscosity
Viscosity of Air.
Air.carbondioxide.mf
1-16
Training Manual
Components
Velocity
Reynolds stress
Normal Vector
Note that short name forms use lower case X,Y,Z post fixes.
E.g. Magnetic Induction X or bmag x are identical.
ANSYS, Inc. Proprietary
2008 ANSYS, Inc. All rights reserved.
1-17
Training Manual
1-18
Training Manual
1-19
Variable Operators
Training Manual
1-20
Training Manual
Constant
Value
Units
Description
2.7182818
dimensionless
Usual meaning
9.806
m/s2
pi
3.1415927
dimensionless
Usual meaning
8314.5
m2/(s2 K)
stefan
5.670400E-08
W m-2 K-4
Stefan-Boltzmann constant
boltzmann
1.3806503E-23
J K-1
Boltzmanns constant
planck
6.62606876E-34
Js
Planck Constant
clight
2.99792458E+08
m/s
Speed of light
avogadro
6.02214199E+23
mol-1
Avogadro constant
1-21
CEL operators
Training Manual
Operator
Description
1st operand
dimensions
2nd operand
dimensions
Operand
values
Result
dimensions
-x
Negation (unary)
any
any
[x]
x+y
Addition
any
[x]
any
[x]
x-y
Subtraction
any
[x]
any
[x]
xy
Product
any
any
any
[x]*[y]
x/y
Quotient
any
any
y0
[x]/[y]
X^y
Power
any
[]
Any
[x] [y]
X^y
Power
any
[]
Y>0
[x] [y]
[]
[]
Y>0
[]
x^y
Power
(where y is not
simple and constant)
1-22
Training Manual
Function
Description
Argument units
Result units
sin(x)
sine
angle
dimensionless
cos(x)
cosine
angle
dimensionless
tan(x)
tangent
angle
dimensionless
asin(x)
sin-1
dimensionless
angle
acos(x)
cos-1
dimensionless
angle
atan(x)
tan-1
dimensionless
angle
atan2(x,y)
tan-1
dimensionless
angle
sinh(x)
hyperbolic sine
angle
dimensionless
cosh(x)
hyperbolic cosine
angle
dimensionless
tanh(x)
hyperbolic tangent
angle
dimensionless
exp(x)
ex
dimensionless
dimensionless
1-23
Training Manual
Function
Description
loge(x)
natural log
dimensionless
dimensionless
ln(x)
log10(x)
log base 10
dimensionless
dimensionless
log(x)
abs(x)
|x|
any
units of x
sqrt(x)
square root
any
units of x
step(x)
step function
dimensionless
dimensionless
min(x,y)
minimum
units of x
max(x,y)
maximum
units of x
int(x)
integer part of x
any
units of x
nint(x)
nearest integer
any
units of x
besselJ(n,x)
dimensionless
dimensionless
besselY(n,x)
dimensionless
dimensionless
1-24
Expression Editor
Training Manual
1-25
Training Manual
1-26
Training Manual
1-27
Return units
Valid regions
D
Training Manual
Description
area()
area
area_x(), area_y(),
area_z()
area
massFlowAve(
)
units of
massFlowAveAbs(
)
units of
massFlow()
mass flow
massFlowInt(
)
units of . area
massAve(
)
units of
areaAve(
)
units of
rmsAve(
)
units of
volumeAve(
)
units of
areaInt(
)
units of . area
Y
Y
1-28
Function
Return units
Valid regions
D
Training Manual
Description
ave(
)
units of
Arithmetic average of
sum (
)
units of
minVal (
)
units of
Minimum value of
When is a vector or tensor the minimum magnitude is returned
maxVal (
)
units of
Maximum value of
When is a vector or tensor the maximum magnitude is returned
probe (
)
units of
force()
force
force_x()
force
force_y()
force
force_z()
force
Cartesian
coordinate
1-29
Function
Return units
Valid regions
D
Training Manual
Description
torque()
torque
torque_x()
torque
torque_y()
torque
torque_z()
torque
volume()
volume
mass()
mass
volumeInt (
)
units of . vol
massInt (
)
units of . mass
inside()
dimensionless
1-30
Training Manual
Physics boundary
massFlow()@Inlet
REGION syntax does not yet work in CFX Post, which has its own approach for
addressing non-unique names
ANSYS, Inc. Proprietary
2008 ANSYS, Inc. All rights reserved.
1-31
Training Manual
1-32
Training Manual
1-33
Training Manual
1-34
Training Manual
LIBRARY:
.. ..
CEL:
EXPRESSIONS:
velmax = 1.0E-03 [m/s]
ymax = 0.05 [m]
ynorm = y/ymax
END
END
END
BOUNDARY: inlet
Boundary Type = INLET
Coord Frame = Coord 0
Location = inlet
BOUNDARY CONDITIONS:
FLOW REGIME:
Option = Subsonic
END
MASS AND MOMENTUM:
Normal Speed = velmax * (1.0 - ynorm^2)
Option = Normal Speed
END
END
END
1-35
Training Manual
1-36
Training Manual
1-37