This is a tutorial to work on CFX CEL language. This helps to all CFX users.

© All Rights Reserved

19 views

This is a tutorial to work on CFX CEL language. This helps to all CFX users.

© All Rights Reserved

- SA_16_17_XII_XII_Physics_Unit-1_Section-A.pdf
- Problems and Questions in Physics
- estimating_excavation_revised_book_preview.pdf
- Physics Lab VIVA VOICE
- Smart Structures L06
- KVPY 2012 Stream SB SX Solved Paper
- ME268 Experiment No4
- PREDICTING PRESSURE FILTER NET SOLIDS YIELD USING BUCKINGHAM-Π METHOD OF LMT DIMENSIONAL ANALYSIS.
- haake.pdf
- 920FM_3e_Chap02_lecture.ppt
- ME2202_1.1_RM.pdf
- Complete Mcq f.sc. 1st Year
- 001 Units & Dimensions.doc
- 001 Units & Dimensions.doc
- White_6ed_P5.21
- Units and Measurements_ Lecture 2_ Dimensions
- Viscosity Reference
- Week 1---Introduction+Vectors
- Physics II Unit
- Ch2 Fluid Properties

You are on page 1of 19

(CEL)

Introduction to CFX

11-1

CFX Expression Language

CEL

Allows the user to create equations (can be functions of

solution/system variables) that can be used in CFX-Pre and CFD-Post

Example:

11-2

CFX Expression Language

CEL Rules

The syntax rules are the same as those for conventional arithmetic.

Operators are written as:

+ (addition) - (subtraction) * (multiplication)

/ (division) ^ (exponentiation)

operations (example: 1.0 [mm] + 0.45 [yds] is OK)

You cannot add values with inconsistent dimensions

Units of expressions are not declared they are the result of units in the

expression (example: a [kg m^-3] * b [m s^-1] has units of [kg m^-2 s^-1]

e Constant: 2.7182818

g Acceleration due to gravity: 9.806 [m s^-2]

pi Constant: 3.1415927

R Universal Gas Constant: 8314.5 [m^2 s^-2 K^-1]

11-3

CFX Expression Language

Built In Functions

Numerical functions and operators are also available in CEL

Right-click when creating expressions for a complete list

Custom functions with User Fortran can also be created

Function Operands Dimensions [x] Operands Values Results Dimensions

sin(x) Angle Any Dimensionless

cos(x) Angle Any Dimensionless

tan(x) *** Angle Any Dimensionless

asin(x) Dimensionless -1 x 1 Angle

acos(x) Dimensionless -1 x 1 Angle

atan(x) Dimensionless Any Angle

exp(x) Dimensionless Any Dimensionless

loge(x) Dimensionless 0<x Dimensionless

log10(x) Dimensionless 0<x Dimensionless

abs(x) Any Any [x]

sqrt(x) Any 0 x [x]^0.5

if(test, res1, res2)* Any Any Any (res1 and res2 must have the same dimensions)

min(x,y) **** Any Any [x]

max(x,y) **** Any Any [x]

step(x) * Dimensionless Any Dimensionless

*if functions contain a test, and two result outcomes. The first outcome, res1 will be returned if test evaluates to true. If test evaluates to false, res2 is

returned. Consider the following example, where we wish to set volume fraction to 1 when X is greater than 1 [m], and 0 if X is less than 1 [m]:

if (x>1[m], 1, 0)

In this case, if the result is precisely equal to 1[m], the result is (res1+res2)/2

**step(x) is 0 for negative x, 1 for positive x and 0.5 for x=0.

*** note that tan(x) is undefined for np/2 where n=1, 3, 5 .. .

**** both x and y must have the same dimensions.

11-4

CFX Expression Language

Solver Variables

Solver variables are available for use in any expression

Below is a partial list of the available system variables:

When creating expressions, right-click to access a full list

y Direction 2 in Reference Coordinate Frame

z Direction 3 in Reference Coordinate Frame

r Radial spatial location, r = (x^2+y^2)^0.5

theta Angle, arctan(y/x)

t Time

u Velocity in the x coordinate direction

v Velocity in the y coordinate direction

w Velocity in the z coordinate direction

p (absolute) Pressure

ke Turbulent kinetic energy

ed Turbulent eddy dissipation Depending on your

T Temperature

sstrnr Shear strain rate physics, some

density Density variables will not be

rNoDim Non-dimensional radius (rotating frame only)

viscosity Dynamic Viscosity valid e.g. you need

Cp Specific Heat Capacity at Constant Pressure to solver heat transfer

cond Thermal Conductivity

AV name Additional Variable name to use T

mf Mass Fraction

11-5

CFX Expression Language

How To Create Expressions

11-6

CFX Expression Language

How To Create Expressions

To add more

expressions

(similar method in

CFD-Post)

Right-click in the

Definition window

to access

Variables,

Constants,

Functions,

Locators and

existing

Expressions

11-7

CFX Expression Language

CEL in CFX-Pre: Example 1

Creating a variable viscosity

Viscosity of a shear thickening fluid:

K n1

where is the shear strain rate

accessed via the right mouse button

11-8

CFX Expression Language

CEL in CFX-Pre: Example 1

11-9

CFX Expression Language

CEL in CFX-Pre: Example 2

Using an if Function

Set inlet temperature to 300 K for the first 19 iterations then raise it to

320 K after 20 iterations

Solver variable

accessed with the right Note: On the 21st iteration

mouse button inlet temp = 310 K

11-10

CFX Expression Language

User Functions

You can also define your own 1-D linear, or 3-D cloud of points

interpolation functions

Import

data

points or

add

manually

11-11

CFX Expression Language

User Functions: Example

Example: Having the timestep change

with iteration number as shown here

Iteration Number is

dimensionless

Continued on next

slide...

11-12

CFX Expression Language

User Functions: Example

with iteration number as shown here

11-13

CFX Expression Language

Integrated Quantities

Integrated quantities can be used in expressions to evaluate variables over

some location

Examples:

Calculate the area average of Cp on an isosurface: areaAve(Cp)@iso1

Mass flow of particular fluid through a locator: oil.massFlow()@slice1

Usage is more strict in CFX-Pre

E.g. the argument supplied to the function must be a variable, not an expression

physics definition

A boundary condition name, a domain name, a monitor point name, etc.

[<phase name>.][<component name>.]<function>@<locator>

E.g. Air.Nitrogen.massFlow()@outlet

11-14

CFX Expression Language

Integrated Quantities

Some functions allow an x, y or z operator:

area_x()@boundary gives the area projected in the x-direction

force_z()@wall gives the z component of the force on the wall

See documentation for a full list

force_z_MyCoord()@wall gives the z component of the force on the wall using the

coordinate frame MyCoord

areaAve requires 1 argument: areaAve(Temperature)@Wall

massFlow requires 0 arguments: massFlow()@Inlet

areaAve(Temperature)@Wall will return a value with units of Temperature

11-15

CFX Expression Language

Integrated Quantities

Below is a partial list of functions

See documentation for a complete list

Right-clicking when creating an expression will show most functions

Function Name and Syntax

Operation Valid <Location>

<required> [<optional>]

Area of a boundary or Any 2D region (e.g., boundary

area( )@<Location> interface. or interface)

The (signed) component of the

area_x( )@<Location> normal area vector in the local

area_y( )@<Location> x, y or z direction. Any 2D region (e.g., a

area_z( )@<Location> boundary or interface)

Area-weighted average of <var> Any 2D region (e.g., a

areaAve(<var>)@<Location> on a boundary. boundary or interface)

Area-weighted integral of <var> Any 2D region (e.g., a

areaInt(<var>)@<Location> on a boundary. boundary or interface)

ave(<var>)@<Location> within a domain or subdomain. subdomain)

The magnitude of the force

[<Fluid>.]force( )@<Location> vector on a boundary. Any 2D region (e.g., a wall)

11-16

CFX Expression Language

Integrated Quantities

Function Name and Syntax

Operation Valid <Location>

<required> [<optional>]

[<Fluid>.]force_y( )@<Location> force vector in the local x, y

[<Fluid>.]force_z( )@<Location> or z direction. Any 2D region (e.g., a wall)

Any 2D or 3D named sub-

Similar to the subdomain region of the physical location

variable, but allows a specific on which the expression is

inside()@<Location> 2D or 3D location to be given. evaluated.

The total mass within a domain

or subdomain. This is fluid Any 3D region (e.g., domain or

mass()@<Location> dependent. subdomain)

Mass-weighted average of

<var> on a domain or Any 3D region (e.g., domain or

massAve(<var>)@<Location> subdomain. subdomain)

The mass-weighted integration

of <var> within a domain or Any 3D region (e.g., domain or

massInt(<var>)@<Location> subdomain subdomain)

Any fluid surfaces (e.g., Inlets,

Outlets, Openings and fluid-

[<Fluid>.]massFlow()@<Location> Mass flow through a boundary. fluid interfaces)

Any fluid surfaces (e.g., Inlets,

[<Fluid>.]massFlowAve(<var>) Mass flow weighted average of Outlets, Openings and fluid-

@<Location> <var> on a boundary. fluid interfaces)

11-17

CFX Expression Language

Integrated Quantities

Function Name and Syntax

Operation Valid <Location>

<required> [<optional>]

Absolute mass flow weighted Any fluid surfaces (e.g., Inlets,

[<Fluid>.]massFlowAveAbs(<var>) average of <var> on a Outlets, Openings and fluid-

@<Location> boundary. fluid interfaces)

Any fluid surfaces (e.g., Inlets,

[<Fluid>.]massFlowInt(<var>) Mass flow weighted integration Outlets, Openings and fluid-

@<Location> of <var> on a boundary. fluid interfaces)

maxVal(<var>)@<Location> within a domain or subdomain. subdomain)

minVal(<var>)@<Location> a domain or subdomain. subdomain)

Returns the value of the Any point object (e.g., a

specified variable on the Source Point or Cartesian

probe(<var>)@<Location> specified Point locator. Monitor Point)

RMS average of <var> within a Any 3D region (e.g., domain or

rmsAve(<var>)@<Location> domain. subdomain)

Sum of <var> over all domain Any 3D region (e.g., domain or

sum(<var>)@<Location> or subdomain vertices. subdomain)

11-18

CFX Expression Language

Useful Functions

The inside() function returns 1 when inside the specified location and

0 when outside

Useful to limit the scope of a function to a subdomain or boundary

when the argument is negative

Useful as an on-off switch

if() function can also be used as a switch

quantity on a location

areaAve() is an area-weighted average. It is usually used on wall

boundaries and when the quantity is not carried with the flow, e.g.

Pressure at an outlet, Temperature on a wall

massFlowAve() is an average weighted by the local mass flow. It is

usually used to evaluate quantities that are carried with the flow, e.g.

Temperature at an outlet

11-19

- SA_16_17_XII_XII_Physics_Unit-1_Section-A.pdfUploaded byKirtiMishra
- Problems and Questions in PhysicsUploaded bytomasisla
- estimating_excavation_revised_book_preview.pdfUploaded byjose jimenez
- Physics Lab VIVA VOICEUploaded byNoble Sharma
- Smart Structures L06Uploaded bydefulane
- ME268 Experiment No4Uploaded byNavid Anjum Aadit
- PREDICTING PRESSURE FILTER NET SOLIDS YIELD USING BUCKINGHAM-Π METHOD OF LMT DIMENSIONAL ANALYSIS.Uploaded byIJAR Journal
- haake.pdfUploaded bySimão Pinto
- KVPY 2012 Stream SB SX Solved PaperUploaded byAnkitKamboj
- 920FM_3e_Chap02_lecture.pptUploaded byizzet9696
- ME2202_1.1_RM.pdfUploaded bySai Kumar
- Complete Mcq f.sc. 1st YearUploaded byWajid Hussain
- 001 Units & Dimensions.docUploaded byVaibhav Tripathi
- 001 Units & Dimensions.docUploaded byVaibhav Tripathi
- White_6ed_P5.21Uploaded bySahata Manurung
- Units and Measurements_ Lecture 2_ DimensionsUploaded byGarena Williams
- Viscosity ReferenceUploaded byNgũ Viên Gia Các
- Week 1---Introduction+VectorsUploaded byiwhy_
- Physics II UnitUploaded bysoundarinbox
- Ch2 Fluid PropertiesUploaded byFardous Rababah
- Chapter_1Uploaded byAbdul Aziz
- A New Methodology to Analyze Fluid Pound in Sucker-Rod Pump Systems: Phenomenological ApproachUploaded byIJAERS JOURNAL
- HydraulicsUploaded bymayil
- FactsUploaded byRalph Edrean Omadto
- Equation of Forces and StressesUploaded bySam
- ART SeveroUploaded byKrishna Kanth
- ET6018 Lecture 1 Fluid IntroUploaded bylishad
- Vector Addition Activity.pdfUploaded byjose_dino10005190
- ACES_2013011108480688.pdfUploaded byChichBong
- Full Text 01Uploaded bySana

- Effective Thermal Coefficient of Expansion in Ansys_by_BillBulatUploaded byaruatscribd
- CFD ProblemUploaded byaruatscribd
- Thermal Engg II Sem(3)Uploaded byGaddam Ravikumar
- Ch07 Buckling finite element methodUploaded byAkash Agarwal
- Design, Analysis and Manufacturing of Spiral Bevel Gear_by_JadejaUploaded byaruatscribd
- Influence of the Butt Joint Design of TIG Welding on the Thermal Stresses- Hani Aziz AmeenUploaded byHani Aziz Ameen
- Material EquivalentUploaded byangga
- HM Advanced TrainingUploaded byganeshaero
- FEA of Ellipsoidal Head Pressure Vessel_by_VikramUploaded byaruatscribd
- Transmission Loss in Piping From FisherUploaded byaruatscribd
- Austenitic Standard GradesUploaded byfierro44
- Spin Softening n Stress StiffeningUploaded byaruatscribd
- WRC 107 Stress Analysis of a Nozzle in a CylinderUploaded byaruatscribd
- Equation editor in Word2010Uploaded byaruatscribd
- Review of Hooke and Jeeves methodUploaded byaruatscribd
- Plane Stress StrainUploaded byhasib_me_lamar
- Surface Effect Elements Thermal SheldonUploaded byaruatscribd
- Effect of Discrete Heat Sources on Natural Conv in a Square Cavity By_jaikrishnaUploaded byaruatscribd
- eat216_cw3_2013-2014Uploaded byaruatscribd
- Tutorial for engineering studentsUploaded byaruatscribd
- Natural Convection During Ice FormationUploaded byaruatscribd
- Parametric Optimization of Butt Weld for Minimum Residual StressUploaded byaruatscribd
- ScienceUploaded byHansel Francis
- ABMA HRSG Fatigue Assessment Paper 12.03Uploaded bymlsimhan
- Interview Questions ThermalUploaded byaruatscribd
- Creep Fatigue Damage DevelopmentUploaded byMustafa Tarek Ismail
- San Geeta 1Uploaded byShathish Gunasekaran
- Finite Element Analysis for Pressure Vessel Design_by_MichelUploaded byaruatscribd

- rotordynamics_3Uploaded byFarouk Hamdoon
- HW3_W2013-3Uploaded byJessica_Chiang_433
- C5303 - Theory of Structure 2 (Kertas soalan politeknik-politeknik malaysia kejuruteraan awam)Uploaded byAzil14
- Empirical and Mechanistic Flexible Design of PavementsUploaded byMaharajan Mcs
- Seismic LoadUploaded byMarc Alamo
- Free Will in the Theory of Everything, Gerard ’t HooftUploaded byVasillis Mamos
- new EM1Uploaded bycooldude99344
- CBSE Class 11 Physics - Mechanical Properties of Solids NotesUploaded byabhithaa
- UBC_1966_A7 B9Uploaded byjames_frank
- EPRI-R-3002010332-MRP-418 Use of Master Curve for Pressure-Retaining MaterialsUploaded byOtso Cronvall
- 4.4.1 Electric Fields.pdfUploaded byMozammel Anowar
- verify_88Uploaded byDipak Borsaikia
- Lecture 26Uploaded bypeach5
- Aptitude Test 1Uploaded byduraibecse
- Review LightUploaded byJihee Yoon
- Fin Plate Beam-To-column-flange Connection (GB)Uploaded byVlad Mos
- CBSE Sample Papers for Class 11 Physics SET AUploaded byChikku
- Euler buckling theoryUploaded byNazmul
- Waves PrimerUploaded byFrancis Huang
- Lec 8 - Compressible Duct Flow With FrictionUploaded byRicky Luzny
- Pipe ThicknessUploaded byvijayunity
- ST7201-Finite Element Analysis.pdfUploaded byMadhan Kumar
- Made Easy Online Test Series HmtUploaded bywqewree
- Practice ProblemsUploaded byDallin
- ME-305-B1-Zink-F11Uploaded byykhamidi3889
- ├▀├╡╣«┴ª 2 - Copy.docxUploaded bynomio12
- Work, Energy, PowerUploaded byMiralv
- C50X100Uploaded byGabriel Rojas
- Sim Presentation Lauri LeighUploaded byL.a.Zumárraga
- Term Paper on CPTUploaded byAntoine Letendre