Boundary Conditions / CFX Expression Language

Slides:



Advertisements
Similar presentations
Fluent Overview Ahmadi/Nazridoust ME 437/537/637.
Advertisements

Workshop 7 Tank Flushing
Lecture 14 User-defined functions Function: concept, syntax, and examples © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
Outline Overview of Pipe Flow CFD Process ANSYS Workbench
Workshop 10 Turbo Pre and Post
Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
© Fluent Inc. 4/16/ Introductory GAMBIT Notes GAMBIT v2.0 Jan 2002 Fluent User Services Center Edge and Face Meshing.
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
Chapter 2 Introduction to Heat Transfer
Pacemaker Electrode Bidirectional Interface to Autodesk Inventor.
Output - Derived Variables Derived Variables are quantities evaluated from the primitive (or solved) variables by PHOENICS. It means, PHOENICS first solve.
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
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
Post-processing J.Cugnoni, LMAF/EPFL, Finite element « outputs » Essential variables:  Displacement u, temperature T find u such that : K u = f.
Workshop 3 Room Temperature Study
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
In the analysis of a tilting pad thrust bearing, the following dimensions were measured: h1 = 10 mm, h2 = 5mm, L = 10 cm, B = 24 cm The shaft rotates.
Linear Momentum and Collisions
Chapter 10 Heat Transfer Introduction to CFX.
Chapter 11 CFX Expression Language (CEL)
Fortran 1- Basics Chapters 1-2 in your Fortran book.
Introduction and Vectors
Workshop 2 Transonic Flow Over a NACA 0012 Airfoil.
© Fluent Inc. 9/20/ Introductory FLUENT Notes FLUENT v6.0 Jan 2002 Fluent User Services Center Solver Basics.
Workshop 4 Flow Through Porous Media
Non stationary heat transfer at ceramic pots firing Janna Mateeva, MP 0053 Department Of Material Science And Engineering Finite Element Method.
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
Catalytic Converter Simulation
One of the most important fields in engineering Mechanics.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
Workshop 3 Room Temperature Study (Part 1)
Appendix B Turbo Pre and Post
Introduction to Programming with RAPTOR
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.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
CFX-10 Introduction Lecture 1.
Heating Coil Simulation
WS7-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Introductory FLUENT Training Workshop 7 Tank Flushing.
9.0 New Features Metal Shaft with Rubber Boot Workshop 7 Load Steps in Workbench.
FREE CONVECTION 7.1 Introduction Solar collectors Pipes Ducts Electronic packages Walls and windows 7.2 Features and Parameters of Free Convection (1)
Convection in Flat Plate Boundary Layers P M V Subbarao Associate Professor Mechanical Engineering Department IIT Delhi A Universal Similarity Law ……
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.
Conifer Cast 2.5 New Features: Numerical Options GMRES Iteration Option for Pressure- Velocity Coupling Tilt Pour Casting Custom Flow-3D Parameters Three.
13-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Chapter 13 Solver.out File and CCL Introduction to.
Momentum Equation and its Applications
THERMO-STRUCTURAL ANALYSIS
Workshop 6 Electronics Cooling with Natural Convection and Radiation
Workshop 7 Tank Flushing
Workshop 7 Tank Flushing
Chapter 13 Solver .out File and CCL
Maxwell 3D Transient.
Workshop 6 Modeling of Catalytic Convertor
Workshop 5 Cavitating Centrifugal Pump
Workshop 5 Centrifugal Pump
Conifer Cast 2.5 New Features: Numerical Options
Workshop 2 Transonic Flow Over a NACA 0012 Airfoil.
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Fluent Overview Ahmadi/Nazridoust ME 437/537/637.
Workshop 9 Scripting and Batch Processing
Workshop 4 Flow Through Porous Media
Introduction to Matlab
Presentation transcript:

Boundary Conditions / CFX Expression Language Lecture 3

Boundary Conditions Required on all regions at the outer extremities of the Domain to be simulated (bound the problem) Create sensible names for Boundary Conditions (you don’t have to accept the default names) Select the Domain for the Boundary Condition (applicable to multi-domain cases).

Basic Settings Boundary Type Location Coord Frame Frame Type Inlet, Outlet, Opening, Wall, Symmetry Location select from all 2D primitive and composite regions Coord Frame if more than one exists, select the appropriate frame Frame Type available only in a rotating domain. Allows you to specify quantities based on a rotating or stationary (absolute) frame of reference.

Boundary Details Options depend on Boundary Type and Domain settings i.e. Supersonic availability depends on Heat Transfer option chosen on Domain panel in this case, only turbulence is modeled (i.e. no heat transfer or multicomponent/multiphase modeling)

Boundary Condition Types Inlet Where fluid enters the domain: displayed with white arrows Outlet Where fluid leaves the domain: displayed with yellow arrows Opening Fluid can leave or enter the domain based on local conditions: displayed with bi-directional blue arrows. Similar setup to Inlet boundary conditions. Flow direction and pressure are also set Wall Displayed with green octahedra. No Slip/Free Slip, heat transfer properties and roughness characteristics can be set. Symmetry Used when flow on one side of a plane is a mirror image of flow on the other side. Can be utilised to reduce the number of nodes in cases where symmetric flow exists.

Profile Boundary Conditions It is possible to specify a boundary conditions based on the interpolation of values from a data file. It is often useful to use the results of a previous simulation or experimental results as a boundary condition for the current simulation CFX-Pre will generate CEL expressions that refer to the imported data, using interpolation functions. This data is automatically generated when creating a boundary condition using the ‘Profile’ method.

Steps to implement a Profile Boundary Condition Create a BC Profile file. You can facilitate this by using the Export feature of CFX-Post. Example of the BC file from CFX-Post. The information on the colour boxes is needed and will be read automatically by CFX-Pre.

Steps to implement a Profile Boundary Condition Initialize (read in) the profile in CFX-Pre. Do this by selecting Tools>Initialize Profile Data and selecting the profile file. You can load multiple profile files and each file can be applied in more than one locator.

Steps to implement a Profile Boundary Condition Assign the profile data to a boundary condition. Select the appropriate profile from the drop-down list, then click Generate Values.

Steps to implement a Profile Boundary Condition The Boundary Details panel will be modified to use the profile data. These changes to the Boundary Details panel will not be applied unless you click Apply.

Steps to implement a Profile Boundary Condition The profile boundary condition (as well as other boundary conditions) can be visualised in CFX-Pre by using the Plot Options panel on the boundary condition editor. You can create a Boundary Contour or a Boundary Vector plot of the profile data. The profile data is read into the CFX-Solver each time the solver is started/restarted (I.e. the profile file can be edited between solver runs without returning to CFX-Pre.

Using a profile in more than one location It is possible to apply a profile from one location to another: For locations that both have a surface normal vector of X, Y or Z, export the data as a 2D profile (for two boundaries with a normal in the Z direction, export X and Y profile data). The data from the first boundary can then be used at the second with no need for modifications to the data. If the two boundaries don’t have same normal direction, then edit the data in your profile file directly to map the locations from the first boundary to the second

Standard Variable Names Some variables require a prefix to include the material name (for example air.vf corresponds to the volume fraction of air) Non-standard Variable Names and Custom Variables

Data Interpolation method For 1D discrete profiles, the topology of the data can be determined by ordering the raw data based on the given single spatial coordinate. Linear interpolation is performed between the ordered raw data points. The data is sorted so that the order of specification is not important. For 2D and 3D discrete profiles, a “cloud of points” algorithm is used to perform the interpolation. The process involves a fast lookup of the three nearest raw data points to the evaluation point, and then application of an inverse distance weighted averaging procedure. If raw data point lies precisely at the evaluation point location, the raw data value at that point will be used. During the solution process, the solver requires values at various locations, for example at integrations points, nodes and face center locations, as required by the specifications of the discretisation and numerical integration process. In all instances, the required location is determined and the raw data is interpolated to that location.

Extracting Profile Data from Results Files When profiles have been read into the CFX-Solver, they will be written to the .out file under the section Profile Data if the data size is less than 16K (by default, although this value can be changed). All profile data is written to the results file and can be extracted using the command line utility cfx5dfile, described next.

Extracting Profile Data from Results Files To find out which profile file(s) is/are referenced by the current results file, enter: cfx5dfile file_001.res –list-profile-files (This outputs a list of all profile files stored in the results file, one per line) For any file referenced in the results file, enter: cfx5dfile file_001.res –read-profile-file <profile_name>.csv (To print the profile data from the file <profile_name> to your terminal window) Alternatively, enter: cfx5dfile file_001.res –extract-profile-file <profile_name>.csv (to write it to the current directory under the name <profile_name>.csv. If this file already exists in the current directory, it will not be overwritten)

CFX Expression Language CEL - CFX Expression Language CEL is an interpreted, declarative language which enables users to enhance simulations without recourse to external Fortran routines - can access CFX internal solution variables - are evaluated by the CFX Solver and CFX-Post

CEL Statements The CFX Expression Language is declarative declare the name and definition of the expression (and optional comment or description) statements must conform to a predefined syntax which is similar to many programming language mathematical statements The statement must consist of the following: a number, optionally with associated units. One or more references to constants, system variables, existing user variables, functions or other CEL expressions, separated by + (addition), - (subtraction), * (multiplication), / (division) and ^ (exponentiation), with optional grouping of these by parentheses The syntax rules for these expressions are the same as those for conventional arithmetic

Rules For Expressions Variables and expressions are case sensitive Always use brackets to specify the order of operations 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)

Rules for Expressions Fractional and decimal powers are allowed a^(1/2) (valid) 1.0^0.5 (valid) 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]

System Variables A number of system variables have been predefined for easy access These variables can be used in any expression Units have been included The list of variables can be: - displayed in Pre by hitting the System Variables and Functions button in the Expression Editor - displayed in CFX-Post by viewing the full list of available scalars

System Variables 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 Denstiy rNoDim Non-dimensional radius (rotating frame only) viscosity Dynamic Viscosity Cp Specific Heat Capacity at Constant Pressure cond Thermal Conductivity enthalpy Specific Enthalpy beta Thermal Expansivity speedofsound Local speed of sound in fluid subdomain Sub-domain variable (1.0 in Sub-domain, 0.0 elsewhere) mean diameter Mean Diameter deneff Effective Density AV name Additional Variable name mf Mass Fraction

System Variables CFX-5 System Variables and user-defined expressions will be available or unavailable depending on the simulation you are performing and the expressions you wish to create In some circumstances, System Variables are logically unavailable time (t) is not available for steady-state simulations Temperature (T) is not available when heat transfer is turned off In others, the availability of a System Variable is not allowed for physical model reasons

Built in functions / constants Some numerical functions and operators are also available in CEL 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 min(x,y) *** Any Any [x] max(x,y) *** Any Any [x] step(x) * Dimensionless Any Dimensionless *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.

Built in operators/functions and constants Some constants are also available in CEL for developing your expressions, these are: 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] You can also define your own 1-D linear, or 3-D cloud interpolation functions apply a linear interpolation between input data points and output a single value input units and output units are defined by the user If you require a function which is not available through CEL, or requires access to certain variables, such as gradient terms, a user defined function may be created by linking to a Fortran library

Defining Expressions CFX-Pre Modifying the solver CCL Read in from a file Created in the Expression Editor Entered directly where needed Modifying the solver CCL Editing the .DEF or .RES file Passed to the solver at the commandline Post expressions may be used for the solver in this manner

CEL Example: Variable Viscosity Mathematical Expression Viscosity of a shear thickening fluid: where  is the shear strain rate CEL Equivalent Viscosity as a function of temperature K = 10.0 [kg m^-1 s^-0.5] n = 1.5 ViscT = K * sstrnr ^ (n-1) or ViscT = K*(min(UpperS,(sstrnr+LowerS))^(n-1)) where sstrnr is the shear strain rate provided as a system variable The second form of the CEL equation above includes an upper and lower bound for strain rate to ensure it remains physically reasonable

Evaluating Expressions In CFX-Pre The expression editor has a calculate feature to test expressions, or plot 1-D results some values may have to be input manually, since solver variables will not have values In the Solver Expressions are evaluated when the value is needed Initial guess: at the start of a run Time dependant boundary condition: at the start of each timestep Fluid property: inner solver loops between timesteps Integrated quantities: at the start of each timestep

Expression Editor Expression Editor Interactive tool for developing and managing expressions within CFX Available from many panels and from the Create pull down menu

CEL Example The following example shows how to set the viscosity to be a function of temperature. The viscosity-temperature relation is taken as follows:

CEL Example Alternatively, a file can be constructed with any text editor and read into the Expression Editor Example: C1 = 10. [ K^-1 ] # constant C2 = 1. [ kg/ms ] # constant vis = C2*exp(-C1*T) # viscosity

CEL Example (B.C.) The following example shows how to set angular velocity for a rotating wall using the u and v components :

Integrated Quantities It is also possible for advanced users to access integration functions within the solver. These quantities can entered into an expression and be monitored (see Output Control section of documentation) Allow calculation of non-local integrated quantities at named locations. Examples: Calculate the area average of Cp on an isosurface: areaAve(Cp)@iso1 Mass flow of particular fluid through a locator: oil.massFlow()@slice1 Note: “@<locator>” syntax - must always supply a location. Phase/component can be selected using [<phase>.][<component>.]<function>

Integrated Quantities Predefined functions available 0 or 1 arguments depending on function - see documentation If 1 argument: may be an expression in Post; only variables allowed in solver return value units depends on argument units (e.g. consider massAve)

Integrated Quantities EXPRESSIONS: ReqT = 350 [K] TempOut = areaAve(T)@outlet TCFilter = step(TempOut/1[K]-ReqT/1[K]) TCTemp = 400[K]*TCFilter+285[K]*(1-TCFilter) TCFlow = 10[m/s]*TCFilter+2[m/s]*(1-TCFilter) END […] BOUNDARY : TempControl Boundary Type = INLET Location = TempControl Coord Frame = Coord BOUNDARY CONDITIONS : MASS AND MOMENTUM : Option = Normal Speed Normal Speed = TCFlow HEAT TRANSFER : Option = Static Temperature Static Temperature = TCTemp

Defining Expressions in Post In CFX-Post Expressions may be defined by: using the CFX-Post Expression Editor entered directly in an object form entered at the commandline (using Line input mode), or the Command Editor read in from a CCL file read in from a session file read in from a state file

CFX-Post Functions CFX-Post provides an additional set of functions: [<Fluid>.]<function>[_<Axis>[_<Coord Frame>]]([<Expression>])@<Location> area Area (projected to axis optional) areaAve Area-weighted average areaInt Area-weighted integral ave Arithmetic average count Number of calculation points force Force on a surface in the specified direction forceNorm Magnitude of normalized force on a curve in the specified direction length Length of a curve lengthAve Length-weighted average lengthInt Length-weighted integration massFlow Total mass flow massFlowAve Mass-weighted average massFlowInt Mass-weighted integral maxVal Maximum Value minVal Minimum Value

CFX-Post Functions CFX-Post provides an additional set of functions: [<Fluid>.]<function>[_<Axis>[_<Coord Frame>]]([<Expression>])@<Location> probe Value at a point sum Sum over the calculation points torque Torque on a surface about the specified axis volume Volume of a 3-D location volumeAve Volume-weighted average volumeInt Volume-weighted integral

CEL Example: Pressure Coefficient Mathematical Expression Pressure Coefficient: CEL Equivalent Pressure Coefficient Pref = massFlowAve(P)@inflow DynH = massFlowAve(.5*Density*V^2)@inflow Cpress = (P - Pref)/DynH or Cpress = (P - massFlowAve(P)@inflow) / massFlowAve(.5*Density*V^2)@inflow

Practical Session Practical 5: Mixing Tube Demonstrates how to set up a Profile Boundary Condition and the use of CEL to define a variable viscosity.