CFX! CFX Expression Language(CEL) 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-1 CFX Expression Language (CEL)
CFX! Introduction CEL-CFX Expression language CEL is an interpreted declarative language which enables users to enhance simulations without recourse to external fortran routines It uses mathematical expressions for physical quantities as opposed to using fixed values Access to CFX-5 internal variables(including solution variables) Can use built-in mathematical functions Can be used on any form which has an Expression Editor button Examples to use CeL Complex boundary conditions Variable material properties Variable initial conditions Extra terms to the governing equations 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-2 Introduction CEL - CFX Expression Language. - CEL is an interpreted, declarative language which enables users to enhance simulations without recourse to external fortran routines. - It uses mathematical expressions for physical quantities as opposed to using fixed values. - Access to CFX-5 internal variables (including solution variables). - Can use built-in mathematical functions. - Can be used on any form which has an Expression Editor button. - Examples to use CEL: > Complex boundary conditions. > Variable material properties. > Variable initial conditions. > Extra terms to the governing equations
CFX! Values and expressions CEL can be used to generate both values and expressions Values Values are constants Different units for dimensional values are available from the Select units list Expressions Expressions are mathematical combinations of predefined values, system variables(.g u, v, w.),numerical constants and other predefined expressions Can use in-line units when creating expression e.g,X+5m Expressions and values may be entered directly into physical quantity forms or they may be developed in the expression editor and referred to by name 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-3 Values and Expressions CEL can be used to generate both values and expressions. - Values. > Values are constants. > Different units for dimensional values are available from the Select Unitslist. - Expressions. > Expressions are mathematical combinations of predefined values, system variables (e.g. u, v, w ...), numerical constants, and other predefined expressions. > Can use in-line units when creating expression. * e.g., x + 5 [m]. Expressions and values may be entered directly into physical quantity forms, or they may be developed in the expression editor and referred to by name
CFX! Rules for Expressions Rules for expressions Variables and expressions are case sensitive Always use brackets to specify the order of operations For multiple line expression, use operators to separate each line e. g, A+ B/C A+ B /C Expressions must be dimensionally consistent for addition and subtraction operations 1.0/mm7+0.45/yvds7 (valid) >2,5/3m~-1-(3.0ms^-1^~1 (valid) 0/mm7+0.3/kg invalid) 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-4 Rules for Expressions Rules for Expressions - Variables and expressions are case sensitive - Always use brackets to specify the order of operations - For multiple line expression, use operators to separate each line > e.g., A+ B/C A+ B /C - Expressions must be dimensionally consistent for addition and subtraction operations > 1.0[mm] + 0.45[yds] (valid) > 2.5[s m^-1] - (3.0[m s^-1])^-1 (valid) > 1.0[mm] + 0.3[kg] (invalid)
CFX! Rules for expressions Rules for expressions Fractional and decimal powers are allowed (valid) 1.0^0.5 (valid) The units of expressions are not declared They are the result of units in the expression (alkg m-3/*6/ms-l/ has units of/ kg m-2s-1/ 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-5 Rules for Expressions Rules for Expressions - Fractional and decimal powers are allowed > a^1/2 (valid) > 1.0^0.5 (valid) - The units of expressions are not declared. They are the result of units in the expression > (a[kg m^-3] * b[m s^-1]) has units of [kg m^-2 s^-1]
CFX! System Variables Direction 2 in Reference Coordinate Frame Direction 3 in Reference Coordinate Frame Radial spatial location, r= x2+y theta Angle, arctan(y/x) velocity in the x coordinate direction Velocity in the y coordinate direction Turbulent kinetic energy Turbulent kinetic energy dissipation star Shear strain rate rOdIn Non-dimensional radius (rotating frame only viscosity Thermal Conductivity Specific Enthalpy subdomain (1. 0 in Sub-domain; 0. 0 elsewhere) Avram Additional variable: name Mass Fraction 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-6 System Variables
CFX! System Variable Prefixes System variable prefixes In order to distinguish system variables of different components and fluids, prefixes are used Example air density air viscoSity air carbondioxide mf- the mass fraction of carbon dioxide in air 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-7 System Variable Prefixes System variable prefixes - In order to distinguish system variables of different components and fluids, prefixes are used - Example: > air.density > air.viscosity > air.carbondioxide.mf - the mass fraction of carbon dioxide in air
CFX! Available and unavailable system variables ymxy2"““P百2圣量要 圖圖■圖圖■■■■圖圖■■■ Dynamic Viscosity I· specific Heat Cap Thermal Conduct Thermal Expans Speed of Sound Kinematic ●●·。。·。●●。● Diffusive Solid heat capacit onductivity Fluid Sub-domain... Source Solid Sub-domain···· Sources Bound Conditions Initial Guess d·s · Variables are considered‘ available”'or“ unavailable depending on the current state of the model 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-8 Available and Unavailable System Variables • Variables are considered “available” or “unavailable” depending on the current state of the model
CFX! CEL Operators, Built-in Functions and Constants Operator Function Function sin(x)loge(x) x+y x-y CoS(X log10(x) tan(g) abs(x x y (if y is a simple constant, integer asin(*) sqrt(x) expression acosta〕 step(x) cy(if y is any simple, constant expression) atan() mn〔xy) xy(if y is not exp[X〕 mR区y) simple constant Constant: 2.7 1828 18 ms- Acceleration due to gravity: 9.806 Constant: 3: 14 15927 m^2s^-2K^-1 Universal gas C constant: 8314. 5 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-9 CEL Operators, Built-in Functions and Constants
CEX! Expression Editor Expression Editor 日 Expression Editor Interactive tool for developing and Modify managing expressions within CFX-Build Calculate Create/ Delete/ Modify /read/Write/Calculate values and expressions Can list available System variables and Functions for use in expressions C Ad Before Add After System variables and Fns Available from many values forms and from the Tools pull do own menu Apply 10 5.5 2001AEA Technology
CFX 5.5 © 2001AEA Technology 4-10 Expression Editor Expression Editor - Interactive tool for developing and managing expressions within CFX-Build - Create/Delete/Modify/Read/Write/Calculate values and expressions - Can list available System Variables and Functionsfor use in expressions - Available from many values forms and from the Tools pull down menu