Chapter 11 CFX Expression Language (CEL)

Slides:



Advertisements
Similar presentations
Workshop 7 Tank Flushing
Advertisements

Workshop 10 Turbo Pre and Post
Boundary Conditions / CFX Expression Language
Workshop 5 Cavitating Centrifugal Pump
UNICAMP GENERAL PARTICLE TRACKING ALGORITHM Sources of Information : Phoenics Lecture: GENTRAGENTRA Workshop: GENTRAGENTRA GENTRA user guide: (html) or.
Workshop 8 Transient Brake Rotor
Lecture 15: Capillary motion
Chapter 2 Introduction to Heat Transfer
1 Chapter 2 Basic Elements of Fortran Programming.
WS9-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Workshop 9 Scripting and Batch Processing Introduction.
Pacemaker Electrode Bidirectional Interface to Autodesk Inventor.
D-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Appendix D Profile Boundary Conditions Introduction.
© Fluent Inc. 5/10/2015N1 Fluids Review TRN Postprocessing and Visualization.
Workshop 6 Modeling of Catalytic Convertor
Workshop 5 Centrifugal Pump
Lecture 2 Introduction to C Programming
II. Properties of Fluids. Contents 1. Definition of Fluids 2. Continuum Hypothesis 3. Density and Compressibility 4. Viscosity 5. Surface Tension 6. Vaporization.
Workshop 1 Mixing T-Junction
Introduction to Computers and Programming Lecture 4: Mathematical Operators New York University.
Workshop 3 Room Temperature Study
Instructor: André Bakker
Chapter 7 Interfaces, Sources and Additional Variables
Physical Properties: Melting Temperature Boiling Temperature Color
1 TENSORS/ 3-D STRESS STATE. 2 Tensors Tensors are specified in the following manner: –A zero-rank tensor is specified by a sole component, independent.
Chapter 10 Heat Transfer Introduction to CFX.
19/5/2015CS150 Introduction to Computer Science 1 Announcements  1st Assignment due next Monday, Sep 15, 2003  1st Exam next Friday, Sep 19, 2003  1st.
CHAPTER 6 MOMENTUM PRINCIPLE Dr. Ercan Kahya Engineering Fluid Mechanics 8/E by Crowe, Elger, and Roberson Copyright © 2005 by John Wiley & Sons, Inc.
1 CHAPTER 5 POROUS MEDIA Examples of Conduction in Porous Media component electronic micro channels coolant (d) coolant porous material (e) Fig.
JavaScript – Part II Data Types and Operations George Mason University June 3, 2010.
Workshop 2 Transonic Flow Over a NACA 0012 Airfoil.
Chapter 9 CAD & Parameters
Workshop 4 Flow Through Porous Media
PTT 204/3 APPLIED FLUID MECHANICS SEM 2 (2012/2013)
Kinetic Energy and Work Chapter 7 Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
2440: 211 Interactive Web Programming Expressions & Operators.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB is a powerful program for numerical computations, plotting and programming.
Catalytic Converter Simulation
Operations Making Things Happen. Our Scuba Program #include // cin, cout, > using namespace std; int main() { const double FEET_PER_ATM = 33.0, LBS_PER_SQ_IN_PER_ATM.
15-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Chapter 15 Review and Tips Introduction to CFX.
CHAPTER (III) KINEMATICS OF FLUID FLOW 3.1: Types of Fluid Flow : Real - or - Ideal fluid : Laminar - or - Turbulent Flows : Steady -
Workshop 3 Room Temperature Study (Part 1)

Chapter 4 Heat and the first law of thermodynamics
Appendix B Turbo Pre and Post
6-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Chapter 6 Day 1 Review and Tips Introduction to CFX.
Foundations of chemistry Chapter 1. Key concepts in this unit The scientific method The definition of chemistry Matter and energy –States of matter –Chemical.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
CFX-10 Introduction Lecture 1.
MM150 Unit 3 Seminar Agenda Seminar Topics Order of Operations Linear Equations in One Variable Formulas Applications of Linear Equations.
C++ Programming Lecture 9 Functions – Part I By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
4-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Chapter 4 Solver Settings Introduction to CFX.
Distributed Resistances and Fan Models Chapter 4.
Multiple Species Chapter 7. Training Manual May 15, 2001 Inventory # Objectives The FLOTRAN multiple species capabilities. Dilute mixture option.
 Most C programs perform calculations using the C arithmetic operators (Fig. 2.9).  Note the use of various special symbols not used in algebra.  The.
Transport process In molecular transport processes in general we are concerned with the transfer or movement of a given property or entire by molecular.
13-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Chapter 13 Solver.out File and CCL Introduction to.
1-2 What is the Matlab environment? How can you create vectors ? What does the colon : operator do? How does the use of the built-in linspace function.
8-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Chapter 8 Surface Meshing ANSYS Meshing Application.
1 Variational and Weighted Residual Methods. 2 Introduction The Finite Element method can be used to solve various problems, including: Steady-state field.
Vectors Chapter 3 Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
Chapter 3: Conservation of Energy. Important Notation 2.
Workshop 6 Electronics Cooling with Natural Convection and Radiation
Workshop 7 Tank Flushing
Chapter 13 Solver .out File and CCL
BIL 104E Introduction to Scientific and Engineering Computing
Workshop 5 Cavitating Centrifugal Pump
Workshop 5 Centrifugal Pump
DATA TYPES There are four basic data types associated with variables:
Kinetic Energy and Work
Presentation transcript:

Chapter 11 CFX Expression Language (CEL) Introduction to CFX

CEL CEL - CFX Expression Language Allows the user to create equations (can be functions of solution/system variables) that can be used in CFX-Pre and CFD-Post Example:

CEL Rules The syntax rules are the same as those for conventional arithmetic. Operators are written as: + (addition) - (subtraction) * (multiplication) / (division) ^ (exponentiation) Variables and expressions are case sensitive (example: t vs. T) Expressions must be dimensionally consistent for addition and subtraction operations (example: 1.0 [mm] + 0.45 [yds] is OK) You cannot add values with inconsistent dimensions Fractional and decimal powers are allowed (example: a^(1/2) + 1.0^0.5) 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] Some constants are also available in CEL for use in expressions: 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]

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 Operand’s Dimensions [x] Operand’s Values Result’s 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.

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 x Direction 1 in Reference Coordinate Frame 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 T Temperature sstrnr Shear strain rate density Density rNoDim Non-dimensional radius (rotating frame only) viscosity Dynamic Viscosity Cp Specific Heat Capacity at Constant Pressure cond Thermal Conductivity AV name Additional Variable name mf Mass Fraction Depending on your physics, some variables will not be valid – e.g. you need to solver heat transfer to use T

How To Create Expressions

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

CEL in CFX-Pre: Example 1 Creating a variable viscosity Viscosity of a shear thickening fluid: where  is the shear strain rate Solver Variable and Expression Name are both accessed via the right mouse button

CEL in CFX-Pre: Example 1 Alternatively, an expression can be entered directly into a field

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 mouse button Note: On the 21st iteration inlet temp = 310 K

Import data points or add manually 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

User Functions: Example Example: Having the timestep change with iteration number as shown here Iteration Number is dimensionless Timestep size is in seconds Continued on next slide...

User Functions: Example Example: Having the timestep change with iteration number as shown here

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 Available in CFX-Pre and CFD-Post Usage is more strict in CFX-Pre E.g. the argument supplied to the function must be a variable, not an expression “@<locator>” syntax must always supply a named location used in the physics definition A boundary condition name, a domain name, a monitor point name, etc. To reference general mesh regions use the syntax “@REGION:<name>” Phases/components can be referenced using: [<phase name>.][<component name>.]<function>@<locator> E.g. Air.Nitrogen.massFlow()@outlet

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 These functions also allow an optional coordinate frame: force_z_MyCoord()@wall gives the z component of the force on the wall using the coordinate frame “MyCoord” Each function requires either 0 or 1 arguments areaAve requires 1 argument: areaAve(Temperature)@Wall massFlow requires 0 arguments: massFlow()@Inlet Return value units depend on the argument units areaAve(Temperature)@Wall will return a value with units of Temperature

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

Integrated Quantities

Integrated Quantities

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 The step() function return 1 when the argument is positive and 0 when the argument is negative Useful as an on-off switch if() function can also be used as a switch areaAve() and massFlowAve() are used to evaluate the average of a 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