ANSYS CFX Reference Guide
ANSYS CFX Reference Guide
ANSYS, ANSYS Workbench, AUTODYN, CFX, FLUENT and any and all ANSYS, Inc. brand, product, service and feature
names, logos and slogans are registered trademarks or trademarks of ANSYS, Inc. or its subsidiaries located in the
United States or other countries. ICEM CFD is a trademark used by ANSYS, Inc. under license. CFX is a trademark
of Sony Corporation in Japan. All other brand, product, service and feature names or trademarks are the property
of their respective owners. FLEXlm and FLEXnet are trademarks of Flexera Software LLC.
Disclaimer Notice
THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFID-
ENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, OR LICENSORS. The software products
and documentation are furnished by ANSYS, Inc., its subsidiaries, or affiliates under a software license agreement
that contains provisions concerning non-disclosure, copying, length and nature of use, compliance with exporting
laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions. The software products
and documentation may be used, disclosed, transferred, or copied only in accordance with the terms and conditions
of that software license agreement.
ANSYS, Inc. and ANSYS Europe, Ltd. are UL registered ISO 9001: 2015 companies.
For U.S. Government users, except as specifically granted by the ANSYS, Inc. software license agreement, the use,
duplication, or disclosure by the United States Government is subject to restrictions stated in the ANSYS, Inc.
software license agreement and FAR 12.212 (for non-DOD licenses).
Third-Party Software
See the legal information in the product help files for the complete Legal Notice for ANSYS proprietary software
and third-party software. If you are unable to access the Legal Notice, contact ANSYS, Inc.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. iii
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
iv of ANSYS, Inc. and its subsidiaries and affiliates.
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. v
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
vi of ANSYS, Inc. and its subsidiaries and affiliates.
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. vii
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
viii of ANSYS, Inc. and its subsidiaries and affiliates.
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. ix
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
x of ANSYS, Inc. and its subsidiaries and affiliates.
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xi
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
xii of ANSYS, Inc. and its subsidiaries and affiliates.
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xiii
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
xiv of ANSYS, Inc. and its subsidiaries and affiliates.
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xv
Reference Guide
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
xvi of ANSYS, Inc. and its subsidiaries and affiliates.
List of Figures
1.1. ANSYS CFX Launcher .............................................................................................................................. 1
4.1. Integration of a Remeshing Loop into the General Simulation Workflow ................................................. 69
4.2. Schematic for User Defined remeshing .................................................................................................. 70
4.3. Schematic for ICEM CFD Replay remeshing ............................................................................................ 73
5.1. Original Undeformed Mesh ................................................................................................................... 81
5.2. Deformed Mesh with the Default Diffusion Scheme ............................................................................... 82
5.3. Deformed Mesh with "meshdisp diffusion scheme = 3" .......................................................................... 83
7.1. Flow Rate vs Pressure Rise for a Liquid Pump ....................................................................................... 114
7.2. Cavitation Performance at Constant RPM and Flow Rate ...................................................................... 115
10.1. An exaggerated view of three inflation layers on each side of the uppermost subdomain boundary
surface. ..................................................................................................................................................... 130
11.1. Flow Rate vs Pressure Rise for a Gas Compressor ................................................................................ 134
11.2. Element Aspect Ratio at Domain Interface ......................................................................................... 138
11.3. Impeller/Volute ................................................................................................................................. 138
11.4. Possible Domain Interface Positions with Step Change in Passage Height ........................................... 139
11.5. Radial Compressor ............................................................................................................................ 140
11.6. Flow Leakage Through Gap Near Impeller Inlet .................................................................................. 141
11.7. Domain Interface Between Blade Rows in an Axial Machine ............................................................... 142
12.1. URANS computations of a flow past a circular cylinder (SST model) .................................................... 150
12.2. SAS simulation of flow past a circular cylinder (SAS-SST model) .......................................................... 150
12.3. The domain and grid for the separated flow in CS0 diffuser ................................................................ 154
12.4. Contours of blending functions overset by vorticity iso-lines for CS=0 diffuser for SBES and DDES
models ..................................................................................................................................................... 155
12.5. Contours of eddy viscosity ratio for CS0 diffuser for SBES and DDES models ........................................ 156
12.6.Turbulence spectrum for DIT test case after t=2. Comparison of results without Sub-Grid Scale model
(no LES) with WALE and Smagorinsky LES model simulations ..................................................................... 159
12.7. Sketch of turbulence structures for wall-bounded channel flow with viscous sublayer (a) Low Re number
(b) High Re number (Grey area: viscous sublayer) ....................................................................................... 161
12.8. Turbulence structures in a channel flow ............................................................................................. 161
12.9. Details of grid around a NACA 4412 airfoil (a) Grid topology (b) Leading edge area (c) Trailing edge
area .......................................................................................................................................................... 164
12.10.Turbulence structures of WALE LES computation around a NACA 4412 airfoil (a) Leading edge (b)
Trailing edge (Q-criterion, color- spanwise velocity component) ................................................................. 165
12.11. Wall pressure coefficient Cp on the suction side of a NACA 4412 airfoil: comparison of RANS-SST and
LES-WALE results ...................................................................................................................................... 165
12.12. Wall shear stress coefficient Cf on the suction side of a NACA 4412 airfoil: comparison of RANS-SST
and LES-WALE results ................................................................................................................................ 166
12.13. Concept of WMLES for high Re number flows (a) Wall-resolved LES. (b) WMLES ................................. 167
12.14. Sketch of boundary layer profile with thickness , x-streamwise direction, y-normal direction, and z-
spanwise direction .................................................................................................................................... 168
12.15.Turbulence structures for flow around a generic fighter aircraft (Q-criterion) as computed by SAS-SST
model ...................................................................................................................................................... 174
12.16. Grid around cylinder in crossflow ..................................................................................................... 175
12.17. Turbulence structures for flow around a cylinder in crossflow ........................................................... 175
12.18.Velocity profiles and turbulence RMS profiles for three different stations downstream of the triangular
cylinder (x/a=0.375, x/a=1.53, x/a=3.75). Comparison of SAS-SST, DES-SST models, and experiment. (a) U-
velocity, (b) urms, (c) vrms, (d) u’v’ ................................................................................................................. 176
12.19. SAS-SST simulation for flow around a triangular cylinder using the BCD and the CD scheme for the
convective fluxes ...................................................................................................................................... 176
12.20. Computational domain for the ITS swirl burner ................................................................................ 177
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xvii
Reference Guide
12.21. Unstructured grid on the symmetry plane and boundary locations for the ITS swirl burner and relevant
length scale, L ........................................................................................................................................... 178
12.22. SAS solution for ITS combustion chamber (a) Non-reacting, (b) Reacting flow ................................... 179
12.23. Reacting flow velocity profiles at the axial distance from the inlet x=103 mm (a) Axial velocity, (b)
Tangential velocity .................................................................................................................................... 180
12.24. Schematic of locally unstable flow: Mixing layer originating from a flat plate with two boundary layers
of different freestream velocity. Full yellow circles are boundary layer turbulence. Dashed yellow circles are
remains of the boundary layer turbulence. Red arrows are new mixing layer turbulence ............................. 182
12.25. The domain and grid for the single stream mixing layer flow ............................................................ 186
12.26. Isosurfaces of the Q-criterion colored with the velocity magnitude ................................................... 187
12.27. Profiles of the mean velocity at different sections (x/θ=19.3, 29.6, 40.6, and 54.2) for mixing layer test
case .......................................................................................................................................................... 188
12.28. The domain and grid for the backstep test case ................................................................................ 189
12.29. Isosurfaces of the Q-criterion colored with the velocity magnitude for backstep test case ................. 190
12.30. Contours of the blending function with the vorticity iso-lines for backstep test case ......................... 191
12.31. Contours of the eddy viscosity ratio for backstep test case ............................................................... 192
12.32. Distribution of the skin friction coefficient for backstep test case ...................................................... 193
12.33. Profiles of the mean and RMS velocity at different sections (x/H=3.2, 4.55, 5.87, and 7.2) for backstep
test case ................................................................................................................................................... 194
12.34. Sketch of embedded LES (ELES) domain .......................................................................................... 196
12.35. Computational domain and grid for WMLES of channel flow ............................................................ 198
12.36. Turbulence structures for WMLES of channel flow at lowest Reynolds number (Q=350 [s-2]) .............. 199
12.37. Flow visualization for WMLES of channel flow (a) Vorticity rate Omega, (b) Absolute value of velocity
U, (c) Ratio of eddy-viscosity to molecular viscosity .................................................................................... 199
12.38. Resolved normal stresses, turbulent kinetic energy, and mean velocity profiles for WMLES at different
Reynolds numbers .................................................................................................................................... 200
12.39. Isosurfaces of the Q-criterion colored with the velocity magnitude ................................................... 201
12.40. Profiles of the eddy viscosity ratio for different models ..................................................................... 202
12.41. Profiles of the mean velocity for different models ............................................................................. 202
12.42. Profiles of the total turbulence kinetic energy for different models ................................................... 202
12.43. Computational domain for a Wall Boundary Layer test case .............................................................. 203
12.44. Computational grid (a), (c) and applied boundary conditions (b) ....................................................... 204
12.45. Isosurfaces of Q-criterion (Q=200 [s–2]) colored with velocity for a flat plate at two different Reynolds
numbers ................................................................................................................................................... 205
12.46. Skin friction distributions along a flat plate predicted by WMLES at two Reynolds numbers (a) Re
theta=1000 with different numerical settings (b) Re theta =10 000 ............................................................. 206
12.47. Profiles of resolved normal and shear Reynolds stresses and mean velocity in the flat plate boundary
layer predicted by WMLES at two Reynolds numbers (a) Re theta=1000 with different numerical settings (b)
Re theta=10 000 with the second order pressure interpolation .................................................................. 206
12.48. Experimental set-up for NASA hump flow experiment ...................................................................... 207
12.49. (a) Grid used for the NASA hump simulation (b) Turbulent structures in the LES domain (Q-criterion
colored with spanwise velocity component) .............................................................................................. 208
12.50. (a) Skin-friction, cf, and (b) Wall pressure coefficients, cp, from NASA hump flow simulations. Compar-
ison of WMLES and WALE LES methods in the LES domain ......................................................................... 209
12.51. Geometry and grid of T-Junction test case with measurement planes ............................................... 211
12.52.Turbulence structures for SAS-SST model (a) Central Difference (CD) scheme, (b) Bounded Central
Difference (BCD) scheme .......................................................................................................................... 212
12.53. Vorticity contours for ELES/WMLES simulation (a) CD scheme, (b) BCD scheme ................................. 213
12.54. Comparison of the experimental and computational velocity profiles for T-Junction flow for different
turbulence models (a) CD scheme (b) BCD scheme (note that scales of coordinate axes change by large
factors between curves) ............................................................................................................................ 214
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
xviii of ANSYS, Inc. and its subsidiaries and affiliates.
Reference Guide
12.55. Comparison of the experimental and computational wall temperature distributions for T-Junction
flow at the Top wall (0 degrees, see Figure 12.51) of the main pipe ............................................................. 215
12.56. Comparison of the experimental and computational wall temperature distributions for T-Junction
flow at the Front wall (90 degrees, see Figure 12.51) of the main pipe ......................................................... 215
12.57. Comparison of the experimental and computational wall temperature distributions for T-Junction
flow at the Bottom wall (180 degrees, see Figure 12.51) of the main pipe .................................................... 216
12.58. Comparison of the experimental and computational wall temperature distributions for T-Junction
flow at the Rear wall (270 degrees, see Figure 12.51) of the main pipe ........................................................ 216
12.59. Comparison of turbulence structures on the Top wall downstream of the pipe intersection (a) DDES
model (b) ELES model ............................................................................................................................... 217
12.60. Example of scheme oscillations in T-Junction flow shown by vorticity: (a) CD, (b) BCD ....................... 218
14.1. Temperature Feedback Loop ............................................................................................................. 251
16.1. r and theta with Respect to the Reference Coordinate Frame .............................................................. 317
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xix
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
xx of ANSYS, Inc. and its subsidiaries and affiliates.
List of Tables
12.1. Number of cells, , vs Reynolds number for channel flow .................................................................. 162
12.2. Computing power estimate for a single turbomachinery blade with end-walls ................................... 163
12.3. Grid resolution for WMLES channel flow simulations .......................................................................... 198
12.4. Properties for flat plate boundary layer simulations ............................................................................ 203
12.5. Information on grids for flat plate test case ........................................................................................ 204
12.6. Flow conditions for T-Junction test case ............................................................................................. 209
12.7. Globally Unstable Flows .................................................................................................................... 230
12.8. Locally Unstable Flows ...................................................................................................................... 231
12.9. Stable Flows ...................................................................................................................................... 232
14.1. CEL Operators ................................................................................................................................... 247
14.2. CEL Constants ................................................................................................................................... 248
15.1. Standard Mathematical CEL Functions ............................................................................................... 255
15.2. Examples of the Calling Syntax for an Expression ............................................................................... 259
15.3. CEL Multiphase Examples .................................................................................................................. 260
15.4. CEL Functions in CFX-Pre/CFX-Solver and in CFD-Post ........................................................................ 261
15.5. Source of mass flow data ................................................................................................................... 281
16.1. Common CEL Single-Value Variables and Predefined Expressions ....................................................... 306
16.2. Common CEL Field Variables and Predefined Expressions ................................................................... 307
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xxi
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
xxii of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: ANSYS CFX Launcher
This chapter describes the ANSYS CFX Launcher in detail:
1.1.The ANSYS CFX Launcher Interface
1.2. Customizing the ANSYS CFX Launcher
The launcher consists of a menu bar, a toolbar for launching applications, a working directory selector,
and an output window where messages are displayed. On Windows platforms, an icon to start Windows
Explorer in the working directory appears next to the directory selector.
1.1.1.1.1. Save As
Saves the contents of the output window to a file.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 1
ANSYS CFX Launcher
1.1.1.1.2. Quit
Shuts down the ANSYS CFX Launcher. Any programs already launched will continue to run.
1.1.1.2.1. Clear
Clears the output window.
1.1.1.2.2. Find
Displays a dialog box where you can search the text in the output window.
1.1.1.2.3. Options
Presents the Options dialog box, which enables you to change the appearance of the ANSYS
CFX Launcher. Once you have configured the settings, click Apply to apply the settings tentatively.
Click OK to accept the settings. Click Restore to revert the settings to the previously accepted
configuration.
You can choose any one of the listed interface styles to change the look and feel of the user
interface.
The button to the right of Font sets the font used anywhere outside the text output window.
The button to the right of Formatted Font applies only to the text output window. Clicking
either of these buttons opens the Select Font dialog box.
1.1.1.3.1. CFX-Pre
Runs CFX-Pre, with the working directory as specified in Working Directory Selector (p. 5).
1.1.1.3.3. CFD-Post
Runs CFD-Post, in the current working directory as specified in Working Directory Selector (p. 5).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
2 of ANSYS, Inc. and its subsidiaries and affiliates.
The ANSYS CFX Launcher Interface
If you do not use the Tools > Command Line command to open a command window, then you
will have to either type the full path of the executable in each command, or explicitly set your
operating system path to include the <CFXROOT>/bin directory.
You may want to start components of CFX from the command line rather than by clicking the
appropriate button on the ANSYS CFX Launcher for the following reasons:
• CFX contains some utilities (for example, a parameter editor) that can be run only from the command
line.
• You may want to specify certain command line arguments when starting up a component so that it
starts up in a particular configuration.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 3
ANSYS CFX Launcher
• If you are having problems with a component, you may be able to get a more detailed error message
by starting the component from the command line than you would get if you started the component
from the launcher. If you start a component from the command line, any error messages produced
are written to the command line window.
CFX Launcher
Opens Using the ANSYS CFX Launcher in the CFX Introduction.
Contents
Opens a page that lists various help resources associated with this product.
Help on Help
Opens documentation about the help system: Help On Help in the CFX Introduction.
1.1.2. Toolbar
The toolbar contains shortcuts to the main components of CFX, for example CFX-Pre, CFX-Solver
Manager and CFD-Post. Pressing any of the buttons will start up the component in the specified
working directory. The equivalent menu entries for launching the components also show a keyboard
shortcut that can be used to launch the component.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
4 of ANSYS, Inc. and its subsidiaries and affiliates.
Customizing the ANSYS CFX Launcher
• Type the directory name into the box and press Enter.
• Click the down-arrow icon ( ) next to the directory name. This displays a list of recently used directories.
• Find: Displays a dialog box where you can enter text to search for in the output.
An example of how to add a menu item for the Windows calculator to the launcher is given in Example:
Adding the Windows Calculator (p. 8).
1.2.1.1. GROUP
GROUP objects represent menus and toolbar groups in the ANSYS CFX Launcher. Each new GROUP
creates a new menu and toolbar. Nothing will appear in the menu or toolbar until you add APPLIC
ATION or DIVIDER objects to the group. An example of a GROUP object is given below:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 5
ANSYS CFX Launcher
GROUP: CFX
Position = 200
Menu Name = &CFX
Show In Toolbar = Yes
Show In Menu = Yes
Enabled = Yes
END
• The group name is set after the colon. In this case, it is "CFX". This is the name that APPLICATION and
DIVIDER objects will refer to when you want to add them to this group. This name should be different
to all other GROUP objects.
• Position refers to the position of the menu relative to others. The value should be an integer between
1 and 1000. Groups with a higher Position value, relative to other groups, will have their menu appear
further to the right in the menu bar. Referring to Figure 1.1: ANSYS CFX Launcher (p. 1), CFX has a
lower position value than the ANSYS group. The File and Edit menus are always the first two menus
and the Help menu is always the last menu.
• The title of the menu is set under Menu Name (this menu has the title CFX). The optional ampersand
is placed before the letter that you want to have act as a menu accelerator (for example, Alt+C displays
the CFX menu). You must be careful not to use an existing menu accelerator.
• The creation of the menu or toolbar can be toggled by setting the Show in Menu and Show in
Toolbar options to Yes or No respectively. For example, you may want to create a menu item but
not an associated toolbar icon.
• Enabled sets whether the menu/toolbar is available for selection or is disabled. Set the option to No
to disable it.
1.2.1.2. APPLICATION
APPLICATION objects create entries in the menus and toolbars that will launch an application or
run a process. Two examples are given below with an explanation for each parameter. The first
example creates a menu entry in the Tools menu that opens a command line window. The second
example creates a menu entry and toolbar button to start CFX-Solver Manager.
APPLICATION: Command Line 1
Position = 300
Group = Tools
Tool Tip = Start a window in which CFX commands can be run
Menu Item Name = Command Line
Command = <windir>\system32\cmd.exe
Arguments = /c start
Show In Toolbar = No
Show In Menu = Yes
Enabled = Yes
OS List = winnt
END
APPLICATION: CFXSM
Position = 300
Group = CFX
Tool Tip = Launches ANSYS CFX-Solver Manager
Menu Item Name = CFX-Solver Manager
Command = cfx5solve
Show In Toolbar = Yes
Show In Menu = Yes
Enabled = Yes
Toolbar Name = ANSYS CFX-Solver Manager
Icon = LaunchSolveIcon.xpm
Shortcut = CTRL+S
END
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
6 of ANSYS, Inc. and its subsidiaries and affiliates.
Customizing the ANSYS CFX Launcher
• The application name is set after the colon, in the first example it is "Command Line 1". This name
should be different from all other APPLICATION objects.
• Position: sets the relative position of the menu entry. The value should be an integer between 1 and
1000. The higher the value, relative to other applications that have the same group, the further down
the menu or the further to the right in a toolbar the entry will appear. If you do not specify a position,
the object assumes a high position value (so it will appear at the bottom of a menu or at the right of a
group of buttons).
• Group: sets the GROUP object to which this application belongs. The value must correspond to the
name that appears after "GROUP:" in an existing GROUP object. The menu and/or toolbar entry will not
be created if you do not specify a valid group name. The GROUP object does not have to be in the same
configuration file.
• Tool Tip: displays a message when the mouse pointer is held over a toolbar button. In the "Command
Line 1" example above, the Tool Tip entry is not used because a toolbar button is not created. This
parameter is optional.
• Menu Item Name: sets the name of the entry that will appear in the menu. If you do not specify a
name, the name is set to the name of the APPLICATION: object. The optional ampersand is placed
before the letter that you want to have act as a menu accelerator (for example, Alt+C then S will start
CFX-Solver Manager. Alt+C selects the CFX menu and S selects the entry from the menu). You must be
careful not to use an existing menu accelerator.
• Command: contains the command to run the application. The path can be absolute (that is, use a forward
slash to begin the path on Linux, or a drive letter on Windows). If an absolute path is not specified, a
relative path from <CFXROOT>/bin/ is assumed. If no command is specified, the menu item/toolbar
button will not appear in the ANSYS CFX Launcher. The path and command are checked when the
launcher is started. If the path or command does not exist, the menu item/toolbar button will not appear
in the launcher. You may find it useful to include environment variables in a command path; for details,
see Including Environment Variables (p. 8).
• Arguments: specifies any arguments that need to be passed to the application. The arguments are
appended to the value you entered for Command. You do not need to include this parameter as there
are no arguments to pass. You may find it useful to include environment variables in the arguments;
for details, see Including Environment Variables (p. 8).
Distinct arguments are space-separated. If you need to pass an argument that contains spaces
(such as a Windows filepath) you should include that argument in double quotes, for example:
• Show In Toolbar: determines if a toolbar button is created for the application. This optional para-
meter has a default value of Yes.
• Show In Menu: determines if a menu entry is created for the application. This optional parameter
has a default value of Yes.
• Enabled: controls the menu entry and toolbar button. Set this parameter to No to disable the applic-
ation. This optional parameter has a default value of Yes.
• OS List is an optional parameter that enables you to set which operating system the application is
suitable for. If OS List is not supplied, the launcher will attempt to create the menu item and toolbar
button on all platforms.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 7
ANSYS CFX Launcher
For example, the command to open a command line window varies depending on the operating
system. In the ‘Command Line 1’ example above, the application only applies to Windows plat-
forms. To complete the OS coverage, the launcher configuration files contain more ‘Command
Line’ applications that apply to different operating systems.
• Toolbar Name: sets the name that appears on the toolbar button. This parameter is optional (because
you may want to show only an icon).
• Icon: specifies the icon to use on the toolbar button and in the menu item. The path can be absolute
(that is, use a forward slash to begin the path on Linux, or a drive letter on Windows). If an absolute
path is not specified, a relative path from <CFXROOT>/etc/icons is assumed. The following file
formats are supported for icon image files: Portable Network Graphics (png), Pixel Maps (ppm, xpm)
and Bitmaps (bmp). Other icons used in the launcher are 32 pixels wide and 30 pixels high. This parameter
is optional. If it is not included, an icon will not appear.
• Shortcut: specifies the keyboard shortcut that can be pressed to launch the application. You must
be careful not to use a keyboard shortcut that is used by any other APPLICATION object.
1.2.1.3. DIVIDER
DIVIDER objects create a divider in a menu and/or toolbar (see the Tools menu for an example).
An example of the CCL for DIVIDER objects is shown below.
DIVIDER: Tools Divider 1
Position = 250
Group = Tools
OS List = winnt
END
The Position, Group and OS List parameters are the same as those used in APPLICATION
objects. For details, see APPLICATION (p. 6).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
8 of ANSYS, Inc. and its subsidiaries and affiliates.
Customizing the ANSYS CFX Launcher
Although the parameter Toolbar Name is not strictly required, you would end up with a blank toolbar
button if it were not set.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 9
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
10 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Volume Mesh Import API
The Mesh Import Application Programming Interface (API) enables you to build a customized executable
that reads a 3-dimensional mesh from a 3rd-party mesh file into CFX-Pre and to extend the number of
file formats that CFX-Pre can understand and read beyond those supplied as part of the standard install-
ation.
The communication between the executable and CFX-Pre is via a communications channel that is con-
trolled by use of routines in the API provided.
For details on using the Volume Mesh Import API, see User Import.
The CFX-Solver can solve flows in a mesh that involves any one or more of, and only, the following
element types:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 11
Volume Mesh Import API
You must write the program using the API to translate the mesh read from the 3rd-party file into a
format that can be processed by CFX-Pre.
The installation contains a C source code example file that can be used as the basis of your custom
executable. This file, ImportTemplate.c, is provided in <CFXROOT>/examples/, and is listed in:
An Example of a Customized C Program for Importing Meshes into CFX-Pre (p. 29).
The basic structure of a program written to import a 3rd-party mesh into CFX-Pre is as follows:
1. Inclusion of the cfxImport.h header file (for C programs and not Fortran programs).
5. Optionally, definitions of 2D and 3D regions with either cfxImportRegion or the following three
functions: cfxImportBegReg, cfxImportAddReg, cfxImportEndReg
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
12 of ANSYS, Inc. and its subsidiaries and affiliates.
Creating a Custom Mesh Import Executable for CFX-Pre
The header files associated with the API are located in <CFXROOT>/include/. If you do not use the
header file cfxImport.h, the functionality of the routines contained within the API may not follow
defined behavior.
After writing the program, you will need to compile the source code. For details, see Compiling Code
with the Mesh Import API (p. 13).
You will also need to link your routine with the API routine libraries. For details, see Linking Code with
the Mesh Import API (p. 13).
After a customized executable has been produced, it can be run in CFX-Pre. For details, see User Import.
Note:
Windows users should note that custom mesh import programs must be compiled as multi-
threaded applications.
The customized executable must be linked with the provided Mesh Import API library and the provided
I/O library as detailed in Linking Code with the Mesh Import API (p. 13).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 13
Volume Mesh Import API
You can also write the import program in Fortran and then compile it. An example command line
follows:
The supported compilers are listed in Compiler Requirements for All Windows Versions in the ANSYS,
Inc. Installation Guides.
where <CFXROOT> is the directory in which CFX is installed and <OSDIR> is a directory name
corresponding to the architecture of the machine.
In this example, your own import program is named myimport.c and the executable file will
be called myimport. You should ensure that the libraries to which you are linking (which are in
the path given after -L) appear on the command line after the source file (or object file if you
are just linking to an existing object).
The compiler flags and required libraries may vary, depending on the compiler and the custom
program.
The supported compilers are listed in Compiler Requirements for All Linux Versions in the ANSYS,
Inc. Installation Guides.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
14 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Import API
The supported compilers are listed in Compiler Requirements for All Linux Versions in the ANSYS,
Inc. Installation Guides.
Before trying to use any of the routines listed in this section, it is highly recommended that you read
Creating a Custom Mesh Import Executable for CFX-Pre (p. 12).
Note:
In past releases of ANSYS CFX the API has defined IDs of nodes and elements as integers
(int). This release now uses a datatype ID_t to represent these quantities. This type is currently
defined as an unsigned integer (unsigned int). This allows a greater number of nodes and
elements to be imported than in the past.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 15
Volume Mesh Import API
#define cfxELEM_TET 4
#define cfxELEM_PYR 5
#define cfxELEM_WDG 6
#define cfxELEM_HEX 8
The element node ordering and local face numbering follow Patran Neutral file conventions for
element descriptions.
Node and Face regions define 2D regions of the imported mesh. Element regions define 3D regions
of the imported mesh.
It is best to use face regions to define 2D regions of the mesh and element regions to define 3D
regions of the mesh.
Node regions will be automatically transformed into a face region by the import process. This
transformation requires the node IDs specified to define vertices of valid element faces. If no element
faces can be constructed from the defined node region the node region will be deleted.
Note:
Due to the limited topological information recoverable from a set of nodes it is not ad-
visable to define 2D regions internal to a 3D region using nodes. In this case it is advisable
to use Face regions.
Face regions are defined by a list of face IDs. These face IDs are a combination of an element ID
and a local face number in the element.
2.3.2.1. cfxImportStatus
int cfxImportStatus ()
Returns 0 if descriptor is not opened and -1 if not opened for writing. In the normal case, 1 is re-
turned if opened for writing to CFX, and 2 if opened for writing to a file.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
16 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Import API
2.3.2.2. cfxImportInit
void cfxImportInit ()
Performs initialization to begin communicating with CFX. This routine should be called early on in
the import program to let CFX know that data is to be sent. If not called within 60 seconds, CFX
will terminate the import process. If called and there is no connection with CFX, then the routine
cfxImportTest("/dev/null") (UNIX) or cfxImportTest("null") (Windows) will be
called. This routine will be automatically called by most of the API routines if not already called.
There is no return value for this routine. In the case of an error, cfxImportFatal will be called.
2.3.2.3. cfxImportTest
int cfxImportTest (filename)
char *filename;
This routine allows testing of import program in isolation from CFX by writing data to a file <file
name> instead of attempting to write it to the CFX communication channel.
The routine will return the file descriptor of the output file or will terminate with a call to cfxIm
portFatal on error.
2.3.3.1. cfxImportDone
long cfxImportDone ()
Indicate to the import API that all mesh data has been given and the API should now send the data
to CFX. Except for cfxImportTotals, this should be last call made to the API. Returns the total
number of bytes transferred to CFX by the import program.
2.3.3.2. cfxImportTotals
long cfxImportTotals (counts)
size_t counts[cfxImpCNT_SIZE];
Get the total number of nodes, elements, regions and other useful information given to the mesh
import API by the program. This information is returned in the array counts, which should be of
size at least cfxImpCNT_SIZE (currently defined as 9). The values returned in counts may be
indexed by the enum list in cfxImport.h, which is:
counts[cfxImpCNT_NODE] = number of nodes
counts[cfxImpCNT_ELEMENT] = number of elements
counts[cfxImpCNT_REGION] = number of regions
counts[cfxImpCNT_UNUSED] = number of unused nodes
counts[cfxImpCNT_DUP] = number of duplicate nodes
counts[cfxImpCNT_TET] = number of tetrahedral elements
counts[cfxImpCNT_PYR] = number of pyramid elements
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 17
Volume Mesh Import API
The return value for the function is the total number of bytes of data sent to CFX or written to the
test file given when cfxImportTest was called.
The second routine performs a method for clean termination of the program, shutting down the
program and communication with ANSYS CFX.
2.3.4.1. cfxImportError
void cfxImportError (callback)
void (*callback)(char *errmsg);
Define a user routine to be called before terminating due to a fatal error. callback is the applic-
ation-supplied function to be called in the case of an error. The callback routine takes a single ar-
gument, errmsg, which will be passed by cfxImportFatal and should be processed by the
callback function as a brief message describing the error that has occurred. If this function is not
called or callback is not specified, then the normal termination behavior of the mesh import API
will be that the any fatal errors will write the error message to stderr as well as being sent to
CFX.
2.3.4.2. cfxImportFatal
void cfxImportFatal (errmsg)
char *errmsg;
Terminate with an error message, errmsg. This routine will send the message to CFX, shut down
the communication channel or test file and call the user callback function (if specified by a call to
cfxImportError).
There is no return from this call. The import program will terminate immediately after clean up
tasks have been performed.
2.3.5.1. cfxImportNode
ID_t cfxImportNode (nodeid, x, y, z)
ID_t nodeid;
double x, y, z;
Define a node in the import API to be subsequently imported into CFX. The unique identifier of
the node is given by nodeid, and the coordinates of the node by x, y, and z.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
18 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Import API
Returns 0 if nodeid is invalid (less than 1), or nodeid is successfully defined. If a node with the
same identity has already been defined, the coordinate values will alter to the supplied values.
2.3.5.2. cfxImportGetNode
ID_t cfxImportGetNode (nodeid, x, y, z)
ID_t nodeid;
double *x, *y, *z;
Get the coordinates for the node identified by nodeid and return the values in x, y, and z. Returns
0 if the node has not been defined or the node ID for the node.
2.3.5.3. cfxImportNodeList
ID_t * cfxImportNodeList ()
Returns an array of all node identifiers currently defined or NULL if no nodes have been defined.
The first entry in the array is the number of nodes currently defined.
The memory for the array returned is allocated using malloc by the routine, consequently it should
be destroyed when no longer required by calling free.
2.3.6.1. cfxImportElement
ID_t cfxImportElement (elemid, elemtype, nodelist)
ID_t elemid, *nodelist; int elemtype;
Define a new element to be imported to CFX. The unique identifier of the element is given by
elemid, the element type by elemtype and the list of vertices by nodelist. If an element with
the same ID has already been defined, it will be replaced by the new element being defined.
Only volume elements are currently supported by CFX; these may be tetrahedrons (4 vertices),
pyramids (5 vertices), prisms (6 vertices) or hexahedrons (8 vertices). elemtype is the number of
vertices for the element.
The following defines are included in the header file, cfxImport.h for convenience:
#define cfxELEM_TET 4 /* tet element (4 nodes) */
#define cfxELEM_PYR 5 /* pyramid element (5 nodes) */
#define cfxELEM_WDG 6 /* wedge element (6 nodes) */
#define cfxELEM_HEX 8 /* hex element (8 nodes) */
The list of vertices in nodelist refers to IDs of nodes that on termination of the import program
by a call to cfxImportDone must have been defined by calls to cfxImportNode. If this is not
the case a fatal error will be reported and the API will terminate.
The vertex ordering for the elements follows Patran Neutral File element conventions, and is shown
in the following figure.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 19
Volume Mesh Import API
Note:
The vertex ordering for the export API is different. For details, see cfxExportElementL-
ist (p. 57).
Returns 0 in the case of an elemid is invalid (less than 1) or an unsupported value is given by
elemtype, or elemid if the element is successfully defined. If the element already exists the
vertices of the element will be redefined.
2.3.6.2. cfxImportGetElement
ID_t cfxImportGetElement (elemid, nodelist)
ID_t elemid, nodelist[];
Get the node IDs for corresponding to the vertices of element identified by elemid and store in
the array nodelist. This array must be at least as large the number of vertices for the element (a
size of 8 will handle all possible element types).
Returns 0 if the element is not defined, or the element type (number of vertices). The node IDs will
be ordered in the order expected by cfxImportElement if the program was to redefine the
element.
2.3.6.3. cfxImportElementList
ID_t * cfxImportElementList ()
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
20 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Import API
Returns an array of all the currently defined element IDs or NULL if no elements have been defined.
The first entry in the array is the number of elements.
The memory for the array returned is allocated using malloc by the routine, consequently it should
be destroyed when no longer required by calling free.
2.3.6.4. cfxImportGetFace
ID_t cfxImportGetFace (elemid, facenum, nodelist)
ID_t elemid, nodelist[]; int facenum;
Gets the node IDs for the local facenum’th face of the element identified by elemid.
The node IDs are returned in nodelist, which should be of at least of size 4. The nodes correspond
to the vertices of the face and are ordered counter-clockwise such that the normal for the face
points away from the element. The face numbers and associated node indices are modeled after
Patran Neutral File elements, and are tabulated here:
Note:
The face numbers and associated node indices are different when exporting elements.
For details, see cfxExportFaceNodes (p. 60).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 21
Volume Mesh Import API
Returns -1 if the element has not been defined, 0 if the face number is out of range, or the number
of nodes for the face (3 or 4):
2.3.6.5. cfxImportFindFace
ID_t cfxImportFindFace (elemid, nnodes, nodeid)
ID_t elemid, nodeid[]; int nnodes;
Gets the local face number in element identified by elemid that contains all the nodes supplied
by the calling routine in nodeid. nnodes is the number of nodes for the face (3 or 4).
Returns -1 if the element is not found or nodeid is not supplied or nnodes is greater than 4 or
less than 3. Returns 0 if there is no match, or the local face number (1 to 6) of the element.
2.3.7.1. cfxImportBegReg
int cfxImportBegReg (regname, regtype)
char *regname;
int regtype;
Initialize for the specification of a region. If a region is currently being defined, cfxImportEndReg
will be called.
The name of the region is given by regname. If the region name is NULL, the name Unnamed
Region 2D or Unnamed Region 3D, with a sequential integer appended, will be used. If a region
named regname has already been defined, then additional objects will be added to the previous
region.
The type of region is given by regtype, which should be one of cfxImpREG_NODES, cfxIm
pREG_FACES or cfxImpREG_ELEMS depending on whether the region is to be defined by nodes,
faces or elements, respectively. It is not currently possible to mix types in a region; doing so will
cause the import API to terminate with an error message.
Returns the number of objects (node, faces or elements) currently in the region.
2.3.7.2. cfxImportAddReg
int cfxImportAddReg (numobjs, objlist)
int numobjs, *objlist;
The number of objects to add is given by numobjs and the IDs of the objects are supplied in ob
jlist.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
22 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Import API
The objects are interpreted as node IDs, face IDs, or element IDs, depending on the type of the
region indicated when cfxImportBegReg was called.
On calling cfxImportDone, any node IDs , face IDs or element IDs specified in the object list
must have been defined by the appropriate routine or they will be removed from the region.
Returns the total number of objects in the current region after the object IDs have been added.
2.3.7.3. cfxImportEndReg
int cfxImportEndReg ()
2.3.7.4. cfxImportRegion
int cfxImportRegion (regname, regtype, numobjs, objlist)
char *regname;
int regtype, numobjs, *objlist;
Import a region named regname of type regtype. The number of objects to add to the region
is given by numobjs, and the list of object IDs by objlist. This routine combines calls to cfx
ImportBegReg, cfxImportAddReg and cfxImportEndReg.
Returns the total number of objects in the region on termination of the routine.
2.3.7.5. cfxImportRegionList
char ** cfxImportRegionList ()
The memory for the array and each character string in the array returned is allocated using malloc
by the routine, consequently each array member and the array itself should be destroyed when no
longer required by calling free.
2.3.7.6. cfxImportGetRegion
int * cfxImportGetRegion (regname)
char *regname;
Returns a list of objects in the region named regname, or NULL if the region does not exist. The
first entry in the returned list is the region type and the second entry is the number of object IDs.
The memory for the array is allocated using malloc by the routine, consequently the array itself
should be destroyed when no longer required by calling free.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 23
Volume Mesh Import API
2.3.8.1. cfxImportBegCompRegion
cfxImportBegCompReg()
char *regionName;
2.3.8.2. cfxImportAddCompRegComponents
int cfxImportAddCompRegComponents(componentCount,components)
int componentCount;
char **components;
Add a set of component region names specified in components to the composite region currently
being defined. componentCount specified how many components are specified in the compon
ents array,
Returns -1 if a composite region is not being defined or insufficient memory is available to add the
components of the composite region, or 0 if the components were successfully added.
2.3.8.3. cfxImportEndCompReg
int cfxImportEndCompReg()
2.3.8.4. cfxImportCompositeRegion
int cfxImportCompositeRegion(regionName, componentCount, components)
char *regionName, **components;
int componentCount;
Returns 0 if successful or -1 if an error occurred preventing the composite region being defined.
2.3.9.1. cfxImportMap
ID_t cfxImportMap (nodeid, mapid)
ID_t nodeid, mapid;
Explicitly map the node identified by nodeid to the node identified by mapid.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
24 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Import API
On calling cfxImportDone the Mesh Import API will update regions and elements referencing
the mapped node to the node it is mapped to. This therefore reduces the total node count imported
to CFX and eliminates the duplicate nodes.
Duplicate nodes may also be removed by CFX if the appropriate options are selected in the CFX
interface and an appropriate tolerance set. For details, see Importing Meshes in the CFX-Pre User's
Guide.
2.3.10.1. cfxinit
call cfxinit
2.3.10.2. cfxtest
CHARACTER*n filename
call cfxtest(filename)
Interface to cfxImportTest. <filename> is a CHARACTER*n value that gives the name of the
file to dump the output to.
2.3.10.3. cfxunit
CHARACTER*n units
call cfxunit(units)
2.3.10.4. cfxwarn
CHARACTER*n mesg
call cfxwarn(mesg)
2.3.10.5. cfxfatl
CHARACTER*n mesg
call cfxfatl(mesg)
Interface to cfxImportFatal. Emit a warning message mesg and terminate the program cleanly.
2.3.10.6. cfxdone
call cfxdone
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 25
Volume Mesh Import API
Interface to cfxImportDone. Terminates the program and transfers the data to CFX-Pre.
2.3.10.7. cfxnode
INTEGER idnode
DOUBLE PRECISION x,y,z
call cfxnode(idnode,x,y,z)
Interface to cfxImportNode. Imports a node with the specified coordinates. idnode is an INTEGER
value for the node ID, and x, y, and z are the DOUBLE PRECISION coordinates of the node.
2.3.10.8. cfxnodg
INTEGER idnode
DOUBLE PRECISION x,y,z
call cfxnodg(idnode,x,y,z)
2.3.10.9. cfxnods
INTEGER ids(*)
call cfxnods(ids)
Interface to cfxImportNodeList. Retrieves the list of all valid node IDs having been imported
into the API. ids is an INTEGER array that must be at least as large as the number of nodes currently
imported.
2.3.10.10. cfxelem
INTEGER idelem,itelem,nodes(*)
call cfxelem(idelem,itelem,nodes)
Interface to cfxImportElement. idelem is element ID, and itelem is the element type
(number of nodes - 4,5,6, or 8). Both are of type INTEGER. nodes is an array of INTEGER node IDs
dimensioned of size at least itelem.
2.3.10.11. cfxeleg
INTEGER idelem,itelem,nodes(*)
call cfxeleg(idelem,itelem,nodes)
Interface to cfxImportGetElement. Queries the current node ids that define the vertices of the
element referenced by the id idelem. idelem is element ID, and itelem is the element type
(number of nodes - 4, 5, 6, or 8). Both are of type INTEGER. nodes is an array of INTEGER values
that will contain the node IDs on successful return. It should be dimensioned of size at least itelem.
2.3.10.12. cfxeles
INTEGER ids(*)
call cfxeles(ids)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
26 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Import API
Interface to cfxImportElemList. Retrieves the list of all valid element IDs having been imported
into the API. ids is an INTEGER array that must be at least as large as the number of elements
currently imported.
2.3.10.13. cfxfacd
INTEGER eleid, elefc, id
call cfxfacd(eleid, elefc, id)
2.3.10.14. cfxface
INTEGER eleid, elefc, vtx(*)
INTEGER cfxface(eleid, elefc, vtx)
Interface to cfxImportGetFace. Returns the node IDs of the vertices defining a face located by
the element ID (eleid) and local face (elefc) of that element.
2.3.10.15. cfxffac
INTEGER eleid, nvtx, vtx(*), elefc
call cfxffac(eleid, nvtx, vtx, elefc)
Interface to cfxImportFindFace. Returns the local face (elefc) of an element (eleid) that is
defined by the vertices (vtx).
2.3.10.16. cfxregn
CHARACTER*n regname
INTEGER type,nobjs,objs(*)
call cfxregn(regname,type,nobjs,objs)
2.3.10.17. cfxregb
CHARACTER*n regname
INTEGER type
call cfxregb(regname,type)
Interface to cfxImportBegReg. Start defining a new region or make an existing region of the
same name the current one if it already exists and is of the same type. regname is a CHARACTER*n
string defining the region name, type is an INTEGER value specifying the type of region, either 1
for nodes, 2 for faces, or 3 for elements.
2.3.10.18. cfxrega
INTEGER nobjs,objs(*)
call cfxrega(nobjs,objs)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 27
Volume Mesh Import API
Interface to cfxImportAddReg. Add the objects (objs) to the current region. nobjs is an INTEGER
value that gives the number of objects to add to the region, and objs is an INTEGER array of object
IDs dimensioned at least size nobjs.
2.3.10.19. cfxrege
call cfxrege()
Interface to cfxImportEndReg. Finish defining the current region (after the call there will be no
current region).
2.3.10.20. cfxregs
CHARACTER*n regname
INTEGER numobj
call cfxregs(regname,numobj)
Query how many objects (returned in numobj) are referenced by the region regname. regname
is a CHARACTER*n string specifying the region name.
2.3.10.21. cfxregg
CHARACTER*n regname
INTEGER type, obj(*)
call cfxregg(regname, type, objs)
Get the type (type) and object IDs (objs) referenced by the region regname. regname is a
CHARACTER*n string specifying the region name. type is INTEGER and objs is an INTEGER array
at least of the size returned by cfxregs.
2.3.10.22. cfxcmpb
CHARACTER*n regname
call cfxcmpb(regname)
2.3.10.23. cfxcmpa
INTEGER nregs
CHARACTER*(n) regs
call cfxcmpa(nregs,regs)
Interface to cfxImportAddCompReg. Add the region names (regs) to the current composite
region being defined. nregs is an INTEGER value that gives the number of regions to add to the
region, and regs is a CHARACTER*(*) array of region names dimensioned at least size nregs.
2.3.10.24. cfxcmpe
call cfxcmpe()
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
28 of ANSYS, Inc. and its subsidiaries and affiliates.
Import Programs
Interface to cfxImportEndCompReg. Finish defining the current composite region (after the call
there will be no current composite region).
The following is a list of routines removed from the mesh import API:
cfxImportFixElements
cfxImportTolerance
cfxImportGetTol
cfxImportSetCheck
cfxImportRange
cfxImportCheck
cfxtol
cfxset
cfxchk
Information about importing meshes from the CFX-Pre interface is given in Importing Meshes in the
CFX-Pre User's Guide.
If you want to use command line options that cannot be specified through the CFX-Pre User Interface,
then you may want to run these programs as user-defined mesh import programs. User Import details
how to run a mesh import program.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 29
Volume Mesh Import API
2.5.1. ANSYS
Imports an ANSYS file. The external import routine is ImportANSYS. Available options are:
2.5.3. CFX-4
Imports a CFX-4 grid file. The external import routine is ImportCFX4.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
30 of ANSYS, Inc. and its subsidiaries and affiliates.
Import Programs
-a <nk> Override the number of planes created in the k direction by nk (for example, split theta
with nk planes) for axisymmetric import.
-S Rename multiple symmetry planes with the same name to conform to CFX-Solver requirements
(that is, must lie in a plane).
2.5.4. CFX-5.1
Imports a CFX-5.1 results file. The external import routine is ImportCFX5.
-M <machine type> Set the machine type in the case of a binary or unformatted file so that data
conversion may be done if needed. The default file format is 32-bit IEEE (Iris, Sun, HP, IBM). The currently
recognized machine types are:
• HP - HP 32-bit IEEE.
The argument machine type is case insensitive, and only the first 2 characters are needed (any others
are ignored).
-M <machine type> Set the machine type in the case of a binary or unformatted file so that data
conversion may be done if needed. The default file format is 32-bit IEEE (Iris, Sun, HP, IBM). The currently
recognized machine types are:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 31
Volume Mesh Import API
• HP - HP 32-bit IEEE.
The argument machine type is case-insensitive, and only the first two characters are needed (any
others are ignored).
2.5.5. CFX-TfC
Imports a CFX-TfC 1.3 mesh file. The external import routine is ImportGEM.
-M <machine type> Set the machine type in the case of a binary or unformatted file so that data
conversion may be done if needed. The default file format is 32-bit IEEE (Iris, Sun, HP, IBM). The currently
recognized machine types are:
• HP - HP 32-bit IEEE.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
32 of ANSYS, Inc. and its subsidiaries and affiliates.
Import Programs
The argument machine type is case insensitive, and only the first 2 characters are needed (any others
are ignored).
2.5.6. CGNS
Imports a CGNS file. The external import routine is ImportCGNS. Available options are:
-P Do not add the Zone name as a prefix to any region being defined.
2.5.6.1. SplitCGNS.exe
The SplitCGNS.exe program will take a single CGNS file and split it into multiple files on a "file
per problem basis". The method for running this is:
SplitCGNS.exe [ -l ] <filename> <basename>
If the file contains two problems called "Pipe" and "Elbow", the import filter will only currently read
"Pipe", but using SplitCGNS will produce two files called basename_Pipe.cgns and basename_El-
bow.cgns each containing a single problem that can then be selected for import via the normal
method.
Specifying the "-l" option "links" the part of the data in the original file to the created file using
a relative pathname. The created file does not therefore need to duplicate data.
The "-l" option should only be used if the original file and resulting files are going to be kept rel-
ative to each other (that is, if when SplitCGNS was run the original file was in ../../ex-
ample.cgns, it must always remain in this position relative to the created files).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 33
Volume Mesh Import API
2.5.7. Fluent
Imports Fluent msh and cas files. The external import routine is ImportFluent. The import routine
will read the mesh information from the .cas or .msh file.
2.5.8. GridPro/az3000
Imports a GridPro/az3000 grid and connectivity file from Program Development Corporation (PDC).
The external import routine is ImportPDC. The import routine will attempt to determine the con-
nectivity file associated with the grid file by appending the extension conn to the grid filename. If
the file is not found, then the grid filename extension will be replaced by conn and the new file
checked for. If neither of these are found, the import routine will look for a file named conn.tmp,
and if found will use it. A command line option (-c) is also available to explicitly name the connectivity
file.
If a connectivity file is found, the interface information in the file will be used to eliminate the duplicate
nodes at block interfaces, and boundaries conditions will be imported as regions into CFX. If the
boundary condition is named in the connectivity file, then that name will be used for the region
name, else the default name UnnamedRegionX with the X replaced by a number will be used. If a
connectivity file is not found, or the command line option to ignore the connectivity file is given (-i),
then only the grid file will be imported, resulting in duplicate nodes at the block interfaces. You may
then want to eliminate these duplicate nodes with the command line option (-d or -D).
-i Ignore the connectivity file. Duplicate nodes will result and no regions will be imported.
-c <connfile> Set the name of the connectivity file associated with the grid file to <connfile>.
-p Include periodic boundary conditions as regions. These are not normally included in the import.
Setting this flag will result in these being imported as regions.
-P <propfile> Set the name of the property file associated with the grid file to <propfile>.
2.5.9. I-DEAS
Imports an I-DEAS Universal file from SDRC. The external import routine is ImportIDEAS. Reads datasets
781 and 2411 (nodes) as nodes, 780 and 2412 (elements) as elements, and nodes (type 7) from
datasets 752 and 2417 (permanent groups) as regions. All other datasets are read, but not processed.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
34 of ANSYS, Inc. and its subsidiaries and affiliates.
Import Programs
2.5.11. PATRAN
Imports a PATRAN Neutral file. The external import routine is ImportPatran. Reads packet 01
(nodes) as nodes, packet 02 (elements) as elements, and nodes (type 5) from packet 21 (named groups)
as regions. A command line option is available to read packet 06 (loads) as regions also. All other
packets are read, but not processed.
-l Import packet 06 (distributed loads) as regions. The regions will be assigned the name Patran-
Load<X> where the <X> is replaced by the load ID number.
2.5.12. NASTRAN
Imports a NASTRAN file. The external import routine is ImportMSC. Currently reads only nodes (GRID),
tet (CTETRA) and hex (CHEXA) elements.
2.5.13. CFX-TASCflow
Imports TASCflow Version 2 files. The external import routine is ImportGRD. The import routine will
read the mesh information from the GRD file and automatically remove duplicate nodes where inter-
faces are defined and are 1:1.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 35
Volume Mesh Import API
-b <file> Specifies a bcf file that contains blocked-off regions (boundary condition information
is ignored). For details, see CFX-TASCflow Files in the CFX-Pre User's Guide.
-g <file> Specifies the gci file to import. For details, see CFX-TASCflow Files in the CFX-Pre User's
Guide.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
36 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Mesh and Results Export API
This chapter describes how to create a custom program for exporting mesh and results data. Information
on using such a program is given in Using a Customized Export Program.
Once an export program has been created, it can be used by any number of users; so if other ANSYS
CFX users at a site regularly use a different postprocessor, it may be worth contacting a system admin-
istrator to find out if such a format has already been defined.
Note:
There is no support for the export of cases that use Transient Blade Row modeling.
To define a new format, use the export API. The general steps to follow are:
This is most easily done by editing the template file provided (which is written in C). For details,
see An Example of an Export Program (p. 38).
For details, see Compiling Code with the Mesh and Results Export API (p. 50).
For details, see Linking Code with the Mesh and Results Export API (p. 50).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 37
Mesh and Results Export API
Numerous keywords are required for development and use of custom export files. For details, see
cfx5export Arguments.
An example source routine can be used as the basis of a customized program; one is given in the next
section.
The example program is a reasonably simple example of an export program, which opens a CFX results
file, writes a geometry file (ignoring pyramid elements) and several files containing results. After the
program listing, a sample of the output produced is shown.
Obtaining CFX-Mesh and Results Export API header files is described in more detail. For details, see
Linking Code with the Mesh and Results Export API (p. 50).
The following piece of code simply defines the message that is printed if you enter incorrect options
to the program.
static char *usgmsg[] = {
"usage: ExportTemplate [options] res_file [basename]",
" options are:",
" -u<level> = user level of interest",
" -d<domain> = domain of interest (default is 0 - all the domains",
" are combined into a single domain)",
" -t<timestep> = timestep of interest (if set to -1, all timesteps",
" are exported)"
" -c = use corrected boundary node data",
" -i = include boundary node only data",
" -f = get info on the res_file (No output is created)",
" <basename> is the base filename for Template file output.",
"If not specified, it defaults to ‘res_file’. The Template",
"geometry file will be written to <basename>.geom, the",
"results file to <basename>.res, and the variables to",
"<basename>.s## or <basename>.v## where ## is the variable",
"number and s indicates a scalar and v a vector.",
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
38 of ANSYS, Inc. and its subsidiaries and affiliates.
Creating a Customized Export Program
NULL
};
The variable cfxCNT_SIZE and the types cfxNode and cfxElement are defined in the header
file cfxExport.h as are all variables and functions starting with the letters cfx. For details, see
Mesh and Results Export API (p. 37). The variables level, zone, alias, bndfix and bnddat
are used for setting the default values for the various parameters that can be set on the command
line of the program.
The following line prints an error message if there are not enough arguments to proceed.
if (argc < 2)
cfxUsage (usgmsg, NULL);
The following piece of code reads the specified options and assigns values to certain variables ac-
cordingly. If an invalid or incomplete option is specified, then getargs prints an error message
and the export program stops.
while ((n = getargs (argc, argv, options)) > 0) {
switch (n) {
case ‘u’:
level = atoi (argarg);
break;
case ‘d’:
zone = atoi (argarg);
break;
case ‘t’:
timestep = atoi (argarg);
isTimestep = 1;
break;
case ‘c’:
bndfix = 1;
break;
case ‘i’:
bnddat = 1;
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 39
Mesh and Results Export API
break;
case ‘f’:
infoOnly = 1;
break;
}
}
After this, the level variable contains the user level specified. All results are output if they are of
this user level or below it. The zone variable contains the domain number that you specified. The
variable alias determines whether the variables are referred to by their long names or short
names. The default here is for short names to be used because some post-processors need variable
names to contain no spaces, but you are encouraged to use long variable names wherever possible.
The variable bndfix determines whether the variables are exported with corrected boundary node
values - if bndfix is set to 1, then corrected values are used. Finally, bnddat determines whether
variables that contain meaningful values only on the boundary (such as Yplus) are exported or not;
if bnddat is set to 1, then these variables are exported.
The following code writes the basename specified to the character array baseFileName. If one
was not specified, then it defaults to the name of the results file specified. A basename name may
be specified in another directory (for example, “../template/output”). However, later in the code this
basename without the preceding directory information is required (in this example “output”); and
so the pointer pptr is assigned to point to the first character of this name.
/* base file name */
if (argind + 1 < argc)
strcpy (baseFileName, argv[argind+1]);
else
strcpy (baseFileName, argv[argind]);
if (NULL != (pptr = strrchr (baseFileName, ‘/’)))
pptr++;
else if (NULL != (pptr = strrchr (baseFileName, ‘\\’)))
pptr++;
else
pptr = baseFileName;
The following code checks that the results file that will be produced by the export program will
not overwrite an existing results file.
/* don’t overwrite results file */
sprintf (fileName, "%s.res", baseFileName);
if (0 == strcmp (argv[argind], fileName)) {
fprintf (stderr, "Template res file would overwrite CFX results file\n");
fprintf (stderr, "Need to select new Template output base file name\n");
exit (1);
}
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
40 of ANSYS, Inc. and its subsidiaries and affiliates.
Creating a Customized Export Program
The following code is ignoring any pyramid elements (elements with 5 nodes) and decreases
nelems by the number of pyramid elements. It then checks to make sure that neither the number
of nodes nor the number of elements is zero; if so, the program exits with return code -1.
The first two lines focus on the number of nodes in the zone and the number of elements in the
zone.
nnodes = cfxExportNodeCount();
nelems = cfxExportElementCount();
if (counts[cfxCNT_PYR]) {
printf ("%d pyramid elements found - they are being ignored\n",
counts[cfxCNT_PYR]);
nelems -= counts[cfxCNT_PYR];
}
if (!nnodes || !nelems)
cfxExportFatal ("no nodes and/or elements");
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 41
Mesh and Results Export API
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
42 of ANSYS, Inc. and its subsidiaries and affiliates.
Creating a Customized Export Program
The following code writes first the word "coordinates" and the number of nodes that will be written.
The pointer nodes is initialized to point at the data for the first node and the node data is written
into the geometry file. For each node, a node number is written, followed by the three coordinates
of that node. Note that n ranges between 0 and nnodes-1. This program adds 1 to each node
number so that the nodes in the geometry file are numbered between 1 and nnodes. When it has
finished, the cfxExportNodeFree routine frees the memory that was used to store the node
data, and finally the word "done" is printed on the screen to alert you that it has finished writing
the node data.
/* write nodes */
fprintf( fp, "coordinates\n");
fprintf( fp, "%8d\n", nnodes );
nodes = cfxExportNodeList();
printf (" writing %d nodes ...", nnodes);
fflush (stdout);
for (n = 0; n < nnodes; n++, nodes++) {
fprintf( fp, "%8d %12.5e %12.5e %12.5e\n", n + 1, nodes->x,
nodes->y, nodes->z );
}
cfxExportNodeFree();
printf (" done\n");
Firstly, some general information is written. Then the data for each element type is written in turn.
/* write elements */
fprintf( fp, "part 1\n" );
fprintf( fp, "volume elements\n");
printf (" writing %d elements...", nelems);
fflush (stdout);
For tetrahedral elements, the word "tetra4" is written to the file, followed by the number of tetra-
hedral elements written.
/* tets */
fprintf( fp, "tetra4\n");
fprintf( fp, "%8d\n", counts[cfxCNT_TET] );
The following code is executed only if the number of tetrahedral elements is non-zero. Assuming
this, elems is set to point to the list of elements stored in the results file. The index n loops over
all the elements. For each element, the following step is carried out: “If the element is a tetrahedron,
then loop over its four vertices and write their node numbers to the geometry file, then start a new
line (ready for the next set of data).” The output produced can be seen in the examples of the ex-
ported files in the next section.
if (counts[cfxCNT_TET]) {
elems = cfxExportElementList();
for (n = 0; n < nelems; n++, elems++) {
if (cfxELEM_TET == elems->type) {
for (i = 0; i < elems->type; i++)
fprintf (fp, "%8d", elems->nodeid[i]);
putc (‘\n’, fp);
}
}
}
For wedges (triangular prisms) and hexahedral elements, the same procedure is followed. However,
there is a slight difference in the way that the fprintf line is written for hexahedral elements.
This is because the order that the element nodes are written to the geometry file is different to the
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 43
Mesh and Results Export API
order in which they were read from the results file. This may need to be done if a post-processor
has a different convention for node order than the one that the cfx5export node routines have.
The order the nodes are written in will affect which node is connected to which. The node ordering
for exported elements is illustrated in cfxExportElementList (p. 57).
/* wedges */
fprintf( fp, "penta6\n");
fprintf( fp, "%8d\n", counts[cfxCNT_WDG] );
if (counts[cfxCNT_WDG]) {
elems = cfxExportElementList();
for (n = 0; n < nelems; n++, elems++) {
if (cfxELEM_WDG == elems->type) {
for (i = 0; i < elems->type; i++)
fprintf (fp, "%8d", elems->nodeid[i]);
}
putc (‘\n’, fp);
}
}
/* hexes */
fprintf( fp, "hexa8\n");
fprintf( fp, "%8d\n", counts[cfxCNT_HEX] );
if (counts[cfxCNT_HEX]) {
elems = cfxExportElementList();
for (n = 0; n < nelems; n++, elems++) {
if (cfxELEM_HEX == elems->type)
fprintf (fp, "%8d%8d%8d%8d%8d%8d%8d%8d\n",
elems->nodeid[0], elems->nodeid[1],
elems->nodeid[3], elems->nodeid[2],
elems->nodeid[4], elems->nodeid[5],
elems->nodeid[7], elems->nodeid[6]);
}
}
Then the geometry file is closed and the memory occupied by the element data is freed.
printf (" done\n");
fclose (fp);
cfxExportElementFree();
The first job is to make sure that there are some results for export. First, the code checks that there
is a nonzero number of variables that have the specified user level. Then it counts the number of
scalar and vector variables that will be exported. To be exported, a variable must:
2. Either be a variable with useful values everywhere in the zone or be a variable that has values only
on the boundaries (in which case it will be exported only if you asked to "include boundary node
only data" by specifying the option -i when starting the export program, which translated to setting
bnddat = 1 when the arguments were processed).
Review the cfxExportVariableSize routine if this logic is unclear. For details, see cfxExportVari-
ableSize (p. 65).
Once results are identified, the code calculates the variable namelen, which is the length of the
longest variable name to be exported (the alias variable was set when processing the arguments
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
44 of ANSYS, Inc. and its subsidiaries and affiliates.
Creating a Customized Export Program
passed to the export program, and depends upon whether you wanted to use long names or short
names). If there are no vector or scalar variables to be exported, the export program exits.
/* output results file */
nscalars = nvectors = namelen = 0;
if ((nvalues = cfxExportVariableCount(level)) > 0) {
for (n = 1; n <= nvalues; n++) {
cfxExportVariableSize (n, &dim, &length, &i);
if ((1 != dim && 3 != dim) ||
(length != nnodes && length != bnddat))
continue;
if (1 == dim)
nscalars++;
else
nvectors++;
i = strlen (cfxExportVariableName (n, alias));
if (namelen < i)
namelen = i;
}
}
if (0 == (nscalars + nvectors)) {
cfxExportDone ();
exit (0);
}
The following code checks that the results file can be opened for writing to, and exits if not. The
number of scalar and vector variables are written to the file, followed by some numbers (which
EnSight, for example, requires) that are always the same for any export of this kind.
sprintf (fileName, "%s.res", baseFileName);
if (NULL == (fp = fopen (fileName, "w+"))) {
sprintf (errmsg, "can’t open <%s> for writing", fileName);
cfxExportFatal (errmsg);
}
printf ("writing Template results file to <%s>\n", fileName);
fflush (stdout);
fprintf( fp, "%d %d 0\n", nscalars, nvectors );
fprintf( fp, "%d\n", t2 - t1 + 1 );
for(i = t1; i <= t2; i++) {
fprintf( fp, "%13.4e", cfxExportTimestepTimeGet(i));
if(!(i % 6)) fprintf( fp, "\n");
}
fprintf( fp, "\n");
if(isTimestep && t1 != t2)
fprintf( fp, "0 1\n");
Next, for each scalar variable, a line is written that contains the filename where the scalar will be
written, and then the name of the variable. Note that the filename is not the basename, but the
basename with all the directory structure (if any) stripped off the front. For details, see Checking
File Names (p. 40). This is done because these file will be written in the same directory as this
Template results file, so there is no need for directory information.
if ( nscalars ) {
for (n = 1; n <= nvalues; n++) {
cfxExportVariableSize (n, &dim, &length, &i);
if (1 == dim && (length == nnodes || length == bnddat))
if(!isTimestep)
fprintf (fp, "%s%s.s%2.2d %s\n", pptr, zoneExt,
n, cfxExportVariableName(n, alias));
else if(t1 == t2)
fprintf (fp, "%s%s_t%d.s%2.2d %s\n", pptr, zoneExt,
cfxExportTimestepNumGet(t1), n,
cfxExportVariableName(n, alias));
else
fprintf (fp, "%s%s_t%*.*s.s%2.2d %s\n", pptr, zoneExt,
nTimeDig, nTimeDig, wildcard, n,
cfxExportVariableName(n, alias));
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 45
Mesh and Results Export API
}
}
The same information is then written for each vector variable and the Template results file is closed.
if ( nvectors ) {
for (n = 1; n <= nvalues; n++) {
cfxExportVariableSize (n, &dim, &length, &i);
if (3 == dim && (length == nnodes || length == bnddat))
if(!isTimestep)
fprintf (fp, "%s%s.v%2.2d %s\n", pptr, zoneExt,
n, cfxExportVariableName(n, alias));
else if(t1 == t2)
fprintf (fp, "%s%s_t%d.v%2.2d %s\n", pptr, zoneExt,
cfxExportTimestepNumGet(t1), n,
cfxExportVariableName(n, alias));
else
fprintf (fp, "%s%s_t%*.*s.v%2.2d %s\n", pptr, zoneExt,
nTimeDig, nTimeDig, wildcard, n,
cfxExportVariableName(n, alias));
}
}
fclose( fp );
The following code reads the information for each variable, after you decide that it should be ex-
ported - the logic is very similar to that used when counting the relevant variables when creating
the Template results file. The marked if loop executes if the variable needs to be exported. It
checks to make sure that the variable information can be read, and (assuming it can) then builds
the filename and checks to see if it can be opened. Continuing, it writes to the screen where it is
putting the variable, and then loops through all the values, writing them to the file, inserting a new
line every six values. After each variable, the memory used to store that variable is restored.
After all the variable files have been written, the program calls the cfxExportDone routine, which
close the CFX results file, and frees up any remaining memory. This routine must be the last call to
any of the API routines. The program then exits.
Note:
This program makes no use of any of the region routines, which enable access to
boundary condition data, nor the volume routines that enable access to the subdomains
that are defined for a problem.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
46 of ANSYS, Inc. and its subsidiaries and affiliates.
Creating a Customized Export Program
In this example, the CFX results file contains three variables at user level 1: pressure, temperature and
velocity. This is in a file named file.res. No timesteps or domains were specified, and the basename
was specified as an example.
Five files are produced: the geometry file example.geom, the Template results file example.res,
and three variable files called example.s01, example.s02 and example.v03, which contain
the results for pressure, temperature and velocity, respectively. For details, see:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 47
Mesh and Results Export API
3.1.2.1. example.geom
The content of this file appears as:
Template Geometry file exported from CFX
node id given
element id off
coordinates
2365
1 2.00000e+00 0.00000e+00 0.00000e+00
2-2.00000e+00-6.51683e-07 0.00000e+00
3 2.00000e+00 0.00000e+00 2.00000e+00
4-2.00000e+00-6.51683e-07 2.00000e+00
5 3.00000e+00 1.00000e+00 5.00000e-01
....
....
....
2362-1.13337e+00 2.18877e-01 4.02491e-01
2363-1.12115e+00-3.66598e-01 2.22610e-01
2364 1.36924e+00 4.78359e-01 1.22588e-01
2365-3.30703e-01 1.38487e+00 2.23515e+00
part 1
volume elements
tetra4
11435
754 230 12 145
755 216 8 122
756 212 125 215
....
....
....
2365 496 475 474
penta6
0
hexa8
0
3.1.2.2. example.res
The content of this file appears as:
2 1 0
1
0.0
0 1
example.s01 Pressure
example.s02 Temperature
example.v03 Velocity
3.1.2.3. example.s01
The content of this file appears as:
Pressure
1.42748e+04 1.42621e+04 1.43425e+04 1.43350e+04 1.44118e+04 1.44777e+04
1.38639e+04 1.37352e+04 1.44130e+04 1.44755e+04 1.37733e+04 1.37626e+04
....
....
....
1.39092e+04 1.40699e+04 1.24139e+04 1.34786e+04 1.34859e+04 1.37959e+04
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
48 of ANSYS, Inc. and its subsidiaries and affiliates.
Creating a Customized Export Program
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 49
Mesh and Results Export API
if (!*place) {
if (++argind >= argc) {
fprintf (stderr, "missing argument for option `%c’\n", argopt);
exit (1);
}
place = argv[argind];
}
argarg = place;
nextarg = 1;
}
return (argopt); /* return option letter */
}
3.2. Compiling Code with the Mesh and Results Export API
Compilation of a customized executable must be performed using an appropriate compiler and compiler
flags. The supported compilers are listed in Compiler Requirements for All Windows Versions in the
ANSYS, Inc. Installation Guides and Compiler Requirements for All Linux Versions in the ANSYS, Inc. Install-
ation Guides.
The customized executable must be linked with the provided Mesh and Results Export API library and
the provided I/O library as detailed in Linking Code with the Mesh and Results Export API (p. 50).
3.3. Linking Code with the Mesh and Results Export API
In order to build a customized export utility, it must be linked with several libraries. These libraries are
located in <CFXROOT>/lib/<os>/:
You can also write the export program in Fortran and then compile it. An example command line
follows:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
50 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
The supported compilers are listed in Compiler Requirements for All Windows Versions in the ANSYS,
Inc. Installation Guides.
where <CFXROOT> is the directory in which CFX is installed and <OSDIR> is a directory name cor-
responding to the architecture of the machine.
In this example, your own export program is named export.c and the executable file will be called
export.exe. You should ensure that the libraries to which you are linking (which are in the path
given after -L) appear on the command line after the source file (or object file if you are just linking
to an existing object).
The compiler flags and required libraries may vary, depending on the compiler and the custom pro-
gram.
The supported compilers are listed in Compiler Requirements for All Linux Versions in the ANSYS, Inc.
Installation Guides.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 51
Mesh and Results Export API
The following constants are defined in the header file and should be used as arguments to the
Volume routines:
#define cfxVOL_NODES 0
#define cfxVOL_ELEMS 1
The following constants are defined in the header file and should be used as arguments to the
Region routines:
#define cfxREG_NODES 0
#define cfxREG_FACES 1
In the case of nodes, the global node number is returned, while in the case of faces, the returned
value is a combination of the global element number and local face number of the element. The
following macros are available to enable you to extract the element and face number from the
combined value:
#define cfxFACENUM(face) ((face) & 7)
#define cfxELEMNUM(face) ((face) >> 3)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
52 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
enum cfxCounts {
cfxCNT_NODE = 0, /* number of nodes */
cfxCNT_ELEMENT, /* number of elements */
cfxCNT_VOLUME, /* number of volumes */
cfxCNT_REGION, /* number of regions */
cfxCNT_VARIABLE, /* number of variables */
cfxCNT_TET, /* number of tetrahedral elements */
cfxCNT_PYR, /* number of pyramid elements */
cfxCNT_WDG, /* number of wedge elements */
cfxCNT_HEX, /* number of hexahedral elements */
cfxCNT_SIZE /* size of count array */
};
where x, y, and z are the coordinates of the node. A pointer to an array of these structures is re-
turned by cfxExportNodeList. For details, see cfxExportNodeList (p. 56).
where type is the element type and nodeid is an array of node numbers that define the topology
of the element. A pointer to an array of these structures is returned by cfxExportElementList.
For details, see Element Types (p. 52) and cfxExportElementList (p. 57).
3.4.2.1. cfxExportInit
int cfxExportInit (char *resfile, int counts[cfxCNT_SIZE])
Opens the CFX results file named resfile and initializes the Export API. This should be the first
call made to the API.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 53
Mesh and Results Export API
The routine returns the total number of zones. If the array counts is supplied to the routine (that
is, it is not NULL), the array is filled with values representing the total number of nodes, elements,
volumes, regions and variables for all the zones are returned in this array.
3.4.2.2. cfxExportDone
void cfxExportDone ()
Closes the CFX results file and destroys any internal storage used by the API. This should be the final
call made to the Export API.
3.4.2.3. cfxExportError
void cfxExportError (void (*callback) (char *errmsg))
Specify a callback function that will be executed when a fatal error is generated by a call to cfx
ImportFatal (see cfxImportFatal (p. 18)). The argument, callback, is the function that will be
called, it should take an argument that is the error message passed to cfxImportFatal. It is the re-
sponsibility of the function to terminate the application if required.
3.4.2.4. cfxExportFatal
void cfxExportFatal (char *errmsg)
Generate a fatal error message (errmsg) and close the ANSYS CFX results file. This routine also
calls a callback function, if one has been specified by cfxExportError (see cfxExportError (p. 54)).
If no callback function has been specified the function also terminates the application. There is no
return from this call.
3.4.3.1. cfxExportZoneCount
int cfxExportZoneCount ()
3.4.3.2. cfxExportZoneSet
int cfxExportZoneSet (int zone, int counts[cfxCNT_SIZE])
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
54 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
The value of zone should be between 1 and the value returned by cfxExportZoneCount (see
cfxExportZoneCount (p. 54)) or 0 if the global zone is to be accessed.
The function returns 0 if the value of zone is invalid or the value zone if setting of the zone was
successful.
The argument counts can be passed as a NULL pointer. In this case no information is returned to
the calling function other than the return value mentioned above. If counts is specified it must be
at least cfxCNT_SIZE in size, not specifying an array large enough can result in errors. In the case
when counts is supplied correctly the total number of nodes, elements, volumes, regions and vari-
ables will be returned.
3.4.3.3. cfxExportZoneGet
int cfxExportZoneGet ()
3.4.3.4. cfxExportZoneFree
void cfxExportZoneFree ()
While a zone is being accessed, internal storage is allocated, this storage should be deallocated
when no longer required. This can be done by calling cfxExportZoneFree or by calling cfxEx
portNodeFree, cfxExportElementFree, cfxExportVolumeFree, cfxExportRegionFree
and cfxExportVariableFree. Details on each of these routines is available; see:
3.4.3.5. cfxExportZoneIsRotating
int cfxExportZoneIsRotating(double rotationAxis[2][3], double *angularVelocity)
Query whether the current zone is rotating and describe axis and angular velocity of the rotation
if applicable. Returns 1 if the current zone is rotating and 0 if it is not; for the combined zone the
return value is always -1. If successful the rotation axis is returned in rotationAxis and the ve-
locity in angularVelocity in radians/second.
3.4.3.6. cfxExportZoneMotionAction
int cfxExportZoneMotionAction(const int zone, const int flag)
Specify whether grid coordinates and variables should have the appropriate rotation applied to
them if the zone is rotating so that grid coordinates appear in their correct locations and velocities
(for examples) take this rotation into consideration. If cfxExportZoneList and cfxExportVari
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 55
Mesh and Results Export API
ableList should return rotated values, flag should be set to cfxMOTION_USE. The default be-
havior for a particular zone will be used if cfxMOTION_IGNORE is specified or this function is not
called. If zone is not valid or flag is not cfxMOTION_USE, cfxMOTION_IGNORE the return value
will be -1 otherwise 0 is returned.
It should be noted that the nodes for a zone are not loaded into the Export API until either cfxEx
portNodeList (see cfxExportNodeList (p. 56)) or cfxExportNodeGet (see cfxExportNode-
Get (p. 56)) are called. This reduces memory overheads in the API by not allocating space until required.
When access to nodes in the current zone is no longer required, a call to cfxExportNodeFree
(see cfxExportNodeFree (p. 56)) should be made to deallocate any internal storage.
3.4.4.1. cfxExportNodeCount
int cfxExportNodeCount ()
3.4.4.2. cfxExportNodeList
cfxNode *cfxExportNodeList ()
Return a pointer to an array of cfxNode elements (see cfxnode (p. 26)) containing the coordinate
values of each node in the current zone. The first node in the zone is the first element of the array,
the second is the second and so on.
The memory allocated to represent this information should be deallocated using cfxExportNode
Free (see cfxExportNodeFree (p. 56)) when no longer required.
3.4.4.3. cfxExportNodeGet
int cfxExportNodeGet (int nodeid, double *x, double *y, double *z)
The index (nodeid) is specified between 1 and the number of nodes returned by cfxExportNo
deCount (see cfxExportNodeCount (p. 56)). If the value of nodeid is out of range the return value
is 0 otherwise it is nodeid.
3.4.4.4. cfxExportNodeFree
void cfxExportNodeFree ()
Deallocate any internal storage allocated by the Export API after calls to cfxExportNodeList
(see cfxExportNodeList (p. 56)) and cfxExportNodeGet (see cfxExportNodeGet (p. 56)) have
been made in the current zone.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
56 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
3.4.4.5. cfxExportNodeUnits
const char* cfxExportNodeUnits()
Return a character string that represents the units associated with the mesh, for example, m.
When access to elements in the current zone is no longer required a call to cfxExportElementFree
(see cfxExportElementFree (p. 58)) should be made to deallocate any internal storage.
3.4.5.1. cfxExportElementCount
int cfxExportElementCount ()
3.4.5.2. cfxExportElementList
cfxElement *cfxExportElementList ()
Return a pointer to an array of cfxElement elements (see cfxelem (p. 26)) containing the type and
vertices of each element in the current zone. The first element in the zone is the first element of
the array, the second the second and so on.
The memory allocated to represent this information should be deallocated using cfxExportEle
mentFree (see cfxExportElementFree (p. 58)) when no longer required.
The following diagrams show the order of the nodes and connections that ANSYS CFX uses for
exporting elements:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 57
Mesh and Results Export API
Note:
The vertex ordering for the import API is different. For details, see cfxImportEle-
ment (p. 19).
3.4.5.3. cfxExportElementGet
int cfxExportElementGet (int elemid, int elemtype, int *nodelist)
Query the type and vertices of a specific element in the current zone.
The index (elemid) is specified between 1 and the number of elements returned by cfxExpor
tElementCount (see cfxExportElementCount (p. 57)). If the value of elemid is out of range the
return value is 0 otherwise it is elemid.
The type of the element is returned in elemtype and the vertices defining the element in nodelist.
Note that nodelist must be large enough to hold the element number of vertices in the element
(normally an array of 8 integers is used as this allows space enough for all element types to be
handled).
3.4.5.4. cfxExportElementFree
void cfxExportElementFree ()
Deallocates any internal storage allocated by making calls to cfxExportElementList (see cfx-
ExportElementList (p. 57)) or cfxExportElementGet (see cfxExportElementGet (p. 58)).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
58 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
When access to region in the current zone is no longer required a call to cfxExportRegionFree
(see cfxExportRegionFree (p. 60)) should be made to deallocate any internal storage.
3.4.6.1. cfxExportRegionCount
int cfxExportRegionCount ()
3.4.6.2. cfxExportRegionSize
int cfxExportRegionSize (int regnum, int type)
Query the number of faces (if type is cfxREG_FACES) or nodes (if type is cfxREG_NODES) defined
in the region identified by regnum in the current zone.
The function returns the number of faces or nodes in the current zone or 0 if either regnum is out
of range or type is invalid.
3.4.6.3. cfxExportRegionName
char *cfxExportRegionName (int regnum)
Query the name of the region in the current zone identifies by regnum.
The function returns the name of the region or NULL if the region number supplied is out of range.
The pointer returned points to static storage, which will be overwritten by the next call to cfxEx
portRegionName.
3.4.6.4. cfxExportRegionList
int *cfxExportRegionList (int regnum, int type)
Query the nodes (type is cfxREG_NODES) or faces (cfxREG_FACES) that define a region. This
function returns a pointer to an array of node ids or face ids that define the region identified by
regnum or NULL if the region number is out of range or the type is not recognized. If type is specified
as cfxREG_FACES, the returned ids will represent faces. The element number and local element
face number may be extracted from each face id returned by using the macros cfxELEMNUM and
cfxFACENUM. The node numbers for the face may be obtained by calling cfxExportFaceNodes.
For details, see cfxExportFaceNodes (p. 60).
3.4.6.5. cfxExportRegionGet
int cfxExportRegionGet (int regnum, int type, int index, int *id)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 59
Mesh and Results Export API
Query the index’th element (type is cfxREG_ELEM) or index’th node (type is cfxREG_NODE) that
defines a region regnum in the current zone.
If regnum is out of range or type is not recognized or index is out of range, 0 is returned.
Otherwise id will contain the id of the appropriate node or face defining the region and the function
will return index.
If type is specified as cfxREG_FACES, the returned id will represent the identity of a face. The
element number and local element face number may be extracted from the id by using the macros
cfxELEMNUM and cfxFACENUM.
3.4.6.6. cfxExportRegionFree
void cfxExportRegionFree (int regnum)
Deallocate any internal data storage associated with the region defined by regnum.
Within CFX faces are either represented as Triangles (three vertices) or Quadrilaterals (two vertices).
Each face in a CFX .res file will be parented by a single 3D element. The parent element of a face can
be returned by the cfxELEMNUM macro with the global face ID, and the local face of that element
can be determined by calling cfxFACENUM with the same global face ID
3.4.7.1. cfxExportFaceNodes
int cfxExportFaceNodes (int faceid, int *nodes)
Requests the vertices for the face identified by faceid. The argument faceid should be constructed
from the element number and local face number using the following formula:
The number of vertices defining the face are returned if faceid is valid, otherwise 0 is returned.
The node numbers are returned in the array nodes, which should be dimensioned to a minimum
size of 4 in the calling routine.
The face numbers and associated node indices are tabulated here:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
60 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
Note:
The face numbers and associated node indices are different when importing elements.
For details, see cfxImportGetFace (p. 21).
When access to volume information in the current zone is no longer required a call to cfxEx
portVolumeFree (see cfxExportVolumeFree (p. 62)) should be made to deallocate any internal
storage.
3.4.8.1. cfxExportVolumeCount
int cfxExportVolumeCount ()
3.4.8.2. cfxExportVolumeSize
int cfxExportVolumeSize (int volnum, int type)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 61
Mesh and Results Export API
Query the number of nodes (if type is cfxVOL_NODES) or number of elements (if type is cfx
VOL_ELEMS) defining the volume indexed by volnum in the current zone. The return value will
be 0 if volnum is out of range or type is invalid.
3.4.8.3. cfxExportVolumeName
char *cfxExportVolumeName (int volnum)
Query the name of the volume in the current zone indexed by volnum. Returns NULL if the volnum
is out of range.
Note:
The returned pointer points to internal storage, which will be overwritten by the next
call to cfxExportVolumeName.
3.4.8.4. cfxExportVolumeList
int *cfxExportVolumeList (int volnum, int type)
Query the nodes (type is cfxVOL_NODES) or elements (cfxVOL_ELEMS) that define a volume.
This function returns a pointer to an array of node ids or element ids that define the volume iden-
tified by volnum or NULL if the volume number is out of range or the type is not recognized.
3.4.8.5. cfxExportVolumeGet
int cfxExportVolumeGet (int volnum, int type, int index, int *id)
Query the [index]th element (type is cfxVOL_ELEM) or [index]th node (type is cfxVOL_NODE)
that defines a volume volnum in the current zone.
If volnum is out of range or type is not recognized or index is out of range, 0 is returned.
Otherwise id will contain the id of the appropriate node or element in defining the volume and
the function will return index.
3.4.8.6. cfxExportVolumeFree
void cfxExportVolumeFree (int volnum)
Deallocate any internal data storage associated with the volume defined by volnum.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
62 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
zone are no longer required a call to cfxExportBoundaryFree (see cfxExportBoundaryFree (p. 64))
should be made to deallocate any internal storage.
3.4.9.1. cfxExportBoundaryCount
int cfxExportBoundaryCount ()
The function returns the number of boundary conditions in the current zone.
3.4.9.2. cfxExportBoundaryName
const char *cfxExportBoundaryName (const int bcidx)
Query the name of the boundary condition in the current zone identified by bcidx.
The function returns the name of the boundary condition or NULL if the bcidx supplied is out of
range.
The pointer returned points to static storage, which will be overwritten by the next call to cfxEx
portBoundaryName.
Note:
The following routines use bcidx, which must lie between 1 and cfxExportBound
aryCount() and use index which must lie between 1 and cfxExportBoundarySize
(bcidx, type).
3.4.9.3. cfxExportBoundaryType
const char *cfxExportBoundaryType (const int bcidx)
Query the type (for example, Inlet, Outlet, and so on) of the boundary condition in the current zone
identified by bcidx.
The function returns the type of the boundary condition or NULL if the bcidx supplied is out of
range.
The pointer returned points to static storage, which will be overwritten by the next call to cfxEx
portBoundaryType.
3.4.9.4. cfxExportBoundarySize
int cfxExportBoundarySize (const int bcidx, const int type)
Query the number of faces (if type is cfxREG_FACES) or nodes (if type is cfxREG_NODES) defined
in the boundary condition identified by bcidx in the current zone.
The function returns the number of faces or nodes or 0 if either bcidx is out of range or type is
invalid.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 63
Mesh and Results Export API
3.4.9.5. cfxExportBoundaryList
int *cfxExportBoundaryList (const int bcidx, const int type)
Query the faces (if type is cfxREG_FACES) or nodes (if type is cfxREG_NODES) that define a
boundary condition.
This function returns a pointer to an array of node ids or face ids that define the location of the
boundary condition identified by bcidx or NULL if bcidx is out of range or the type is not recog-
nized. If type is specified as cfxREG_FACES, the returned ids will represent faces. The element
number and local element face number may be extracted from each face id returned by using the
macros cfxELEMNUM and cfxFACENUM respectively. The node numbers for the face may be ob-
tained by calling cfxExportFaceNodes. For details, see cfxExportFaceNodes (p. 60).
The returned pointer points to static data that should be destroyed using cfxExportBoundary
Free. Subsequent calls to cfxExportBoundaryList will overwrite the array.
3.4.9.6. cfxExportBoundaryGet
int cfxExportBoundaryGet (const int bcidx, const int type, const int index, int *id)
Query the index'th face (type is cfxREG_FACES) or index'th node (type is cfxREG_NODES) that
defines the boundary condition location indexed by bcidx in the current zone. If bcidx is out of
range or type is not recognized or index is out of range (not between 1 and cfxExportBound
arySize), 0 is returned. Otherwise id will contain the identifier of the appropriate node or face
defining the boundary condition location and the function will return index.If type is specified as
cfxREG_FACES, the returned id will represent the identity of a face. The element number and
local element face number may be extracted from the id by using the macros cfxELEMNUM and
cfxFACENUM respectively.
3.4.9.7. cfxExportBoundaryFree
void cfxExportBoundaryFree (const int bcidx)
Deallocate any internal data storage associated with the boundary condition defined by bcidx.
3.4.10.1. cfxExportVariableCount
int cfxExportVariableCount(int usr_level)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
64 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
Query the number of variables at interest level usr_level or below. If usr_level is 0, then the
total number of variables is returned.
3.4.10.2. cfxExportVariableSize
int cfxExportVariableSize (int varnum, int *dimension, int *length, int *bdnflag)
Query the dimension, dimension, and length, length, for the variable identified by varnum,
which should be from 1 to the number of variables, returned by cfxExportVariableCount
(cfxExportVariableCount (p. 64)). The length, length, will either be 1 or the same as the number
of nodes returned by cfxExportNodeCount (see cfxExportNodeCount (p. 56)). If 1, then the
variable has meaningful values only at the boundary nodes, with a constant value in the interior.
The function also returns bdnflag, which indicates if the variable contains corrected boundary
node values (1) or not (0).
The function returns varnum if successful, or 0 if the variable number is out of range.
3.4.10.3. cfxExportVariableName
char *cfxExportVariableName (int varnum, int alias)
The return value of the function is NULL if the variable number is out of range or the name of the
variable.
The pointer returned points to static storage, which will be overwritten by the next call to cfxEx
portVariableName.
The argument alias indicates whether the short name (alias=0) or long name (alias=1)
should be returned. For example, the short and long names for the total temperature variable are
TEMPTOT and Total Temperature, respectively.
3.4.10.4. cfxExportVariableList
float *cfxExportVariableList (int varnum, int correct)
Returns NULL if the variable number is out of range or the variable data if successful.
The flag correct indicates whether to correct boundary node data (correct=1) or not (correct=0),
assuming that it exists.
The data is in the same order as the nodes returned from cfxExportNodeList (see cfxExport-
NodeList (p. 56)).
For multidimensional variables, the data is stored with dimension consecutive values for each node.
The storage for the data is created by the Export API when this function is called. When the data
is no longer required a call to cfxExportVariableFree (see cfxExportVariableFree (p. 66))
should be made by the calling function.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 65
Mesh and Results Export API
3.4.10.5. cfxExportVariableGet
int cfxExportVariableGet (int varnum, int correct, int index, float *value)
Request the values of the variable identified by varnum at the location given by index, which
should be from 1 to the length of the variable, inclusively.
The flag correct indicates whether to correct boundary node data (correct=1) or not (cor
rect=0), assuming that it exists.
3.4.10.6. cfxExportVariableFree
void cfxExportVariableFree (int varnum)
Deallocate the internal data storage for the variable identified by varnum for the current zone.
3.4.10.7. cfxExportVariableQuantityDimensions
const float* cfxExportVariableQuantityDimensions(const int varnum)
Take an argument that is the index of the variable in cfxExportVariableList, and return an
array of floats of size cfxNUM_QUANTITIES. Each entry will be 0 if that indexed quantity does
not apply to this variable, or will otherwise be the power to which the unit associated with the in-
dexed quantity is raised.
3.4.10.8. cfxExportVariableUnitsString
const char* cfxExportVariableUnitsString(const int varnum)
Take an argument that is the index of the variable in cfxExportVariableList and return a
combined units string. You can use this function to avoid having to process the dimensions using
the cfxExportVariableQuantityDimensions function.
3.4.11.1. cfxExportTimestepCount
int cfxExportTimestepCount ()
3.4.11.2. cfxExportTimestepTimeGet
float cfxExportTimestepTimeGet( const int tsIndex )
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
66 of ANSYS, Inc. and its subsidiaries and affiliates.
Details of the Mesh Export API
The timestep index tsIndex must be between 1 and the return value of cfxExportTimestep
Count().
3.4.11.3. cfxExportTimestepNumGet
int cfxExportTimestepNumGet ( const int tsIndex )
The timestep index tsIndex must be between 1 and the return value of cfxExportTimestep
Count().
3.4.11.4. cfxExportTimestepSet
int cfxExportTimestepSet ( const int tsNumber )
Note:
tsNumber is not necessarily the same as the associated timestep index as is supplied
to the other routines in this section.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 67
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
68 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 4: Remeshing Guide
Periodic remeshing is an important part of running analyses that involve significant mesh deformation.
Remeshing is often required simply to maintain acceptable mesh quality, as described in Discretization
Errors in the CFX-Solver Theory Guide and Measures of Mesh Quality in the CFX-Solver Modeling Guide.
A schematic illustrating the integration of remeshing into the general simulation workflow is shown in
the figure below.
Figure 4.1: Integration of a Remeshing Loop into the General Simulation Workflow
As shown in Figure 4.1: Integration of a Remeshing Loop into the General Simulation Workflow (p. 69),
in addition to the Preprocessing and Solution steps of the standard simulation workflow, the
remeshing loop includes three additional steps:
• Data Extraction
• Geometry Modification
• Mesh Recreation.
In the context of remeshing, those steps are responsible for completing the following sub-steps;
• Data Extraction: Extract any data needed to guide geometry modifications and mesh re-creation from
the most recent analysis results and monitor point values.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 69
Remeshing Guide
• Geometry Re-Creation: Update the analysis’ geometry so that it conforms to that of the most recent
analysis results (that is, account for mesh deformation).
• Mesh Re-Creation: Generate new mesh(es) that correspond to the updated geometry.
• Preprocessing: Insert the new mesh(es) into the analysis definition, and generate an updated CFX-
Solver Input File.
• Solution: Interpolate the previously generated analysis results onto the new mesh, re-partition the
mesh if a parallel run mode is selected, and continue the solution process.
As described in Remeshing Tab in the CFX-Pre User's Guide, there are two options available for remeshing:
User Defined and ICEM CFD Replay. As outlined in the discussions that follow, the Preprocessing and
Solution steps (and their respective sub-steps) are automatically executed for both remeshing options.
Although the remaining steps are automatically executed for the ICEM CFD Replay remeshing option,
they become the responsibility of a user defined external command for the User Defined remeshing
option.
This remeshing option is ideally suited for users who have previously completed an ‘in-house’ remeshing
solution involving scripts or varying degrees of manual user-intervention. When this option is used, the
following steps are automatically executed:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
70 of ANSYS, Inc. and its subsidiaries and affiliates.
User Defined Remeshing
• Insert the new mesh(es) into the analysis definition, and generate an updated CFX-Solver Input file
• Interpolate the previously generated analysis results onto the new mesh, re-partition the mesh if a
parallel run mode is selected, and continue the solution process.
The following examples outline the use of the User Defined remeshing option:
Once the sequence of key-frame meshes has been generated, they should be placed in a location
that will be accessible during the analysis’ execution. The analysis definition is then modified to include
one or more control conditions that will interrupt the solver at the iteration or time step at which a
key-frame mesh should be inserted. A configuration is subsequently defined (unless this has already
been done), and a remeshing definition is created with the following settings:
• Set the Activation Condition(s) to the previously created interrupt control condition(s).
• Set the External Command to the command that will be used to generate the replacement mesh
file.
• Set the Replacement File to the name of the file that will be generated by the external command.
The External Command is typically a shell script or batch file that completes the following tasks:
• Determine which key-frame mesh to use. This will require parsing the run’s output file for the iteration
or time step number, or the actual simulation time. Output generated from the cfx5mondata ex-
ecutable can also be parsed instead of the run’s output file. For details, see Exporting Monitor Data
from the Command Line in the CFX-Solver Manager User's Guide.
• Copy the key-frame mesh to the path the specified by the Replacement File setting.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 71
Remeshing Guide
In such cases, the analysis definition is modified to include one or more control conditions that will
interrupt the solver when, for example, mesh quality deteriorates significantly. A configuration is
subsequently defined (unless this has already been done), and a remeshing definition is created with
the following settings:
• Set the Activation Condition(s) to the previously created interrupt control condition(s).
• Set the External Command to the command that will be used to generate the replacement mesh
file.
• Set the Replacement File to the name of the file that will be generated by the external command.
The External Command is typically a shell script or batch file that completes the following tasks:
• Extract geometry data from the most recent solution of the analysis, and either update or replace
the original geometry. This may be done using mesh-to-geometry conversion tools available in
software such as ANSYS ICEM CFD, or by extracting monitor point data values (for example, the Total
Centroid Displacement variable) using the cfx5mondata executable. For details, see Exporting
Monitor Data from the Command Line in the CFX-Solver Manager User's Guide.
• Create a replacement mesh file using the updated or newly generated geometry. This may be done
in any suitable mesh generation application.
Note that some mesh-to-geometry conversion tools are unable to extract the latest mesh coordinates
from the most recent CFX-Solver Results file. If this is the case, then introduce a call to CFX-Pre
(within the External Command) that executes a session file that simply loads the latest CFX-Solver
Results file and writes a new CFX-Solver Input file. That CFX-Solver Input file will contain the required,
latest mesh coordinates.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
72 of ANSYS, Inc. and its subsidiaries and affiliates.
ICEM CFD Replay Remeshing
When this option is used, the following steps are automatically executed:
• Extract geometry and mesh control data and write them to the cfx_params.rpl replay file in the
run directory. The data includes:
– Centroid displacements for boundaries that are included in ANSYS ICEM CFD Part Maps
– Scalar parameters.
• Run (in batch) the ANSYS ICEM CFD mesh generation program using the master replay file. This master
replay file executes the following tasks:
– Load the reference geometry from the Geometry File identified in the Remesh definition.
– Apply displacements (including scaling and any offsets) corresponding to all ANSYS ICEM CFD Part
Map definitions contained in the Remesh definition. This is done using the default geometry replay
file provided, or using the user defined replay file if specified in the ICEM CFD Geometry Control
setting.
– Apply ICEM CFD Mesh Controls defined in the Remesh definition. This is done using the provided
controls, or using the user-defined replay file if specified in the ICEM CFD Mesh Control setting.
• Insert the new mesh(es) into the analysis definition, and generate an updated CFX-Solver Input file.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 73
Remeshing Guide
• Interpolate the previously generated analysis results onto the new mesh, re-partition the mesh if a
parallel run mode is selected, and continue the solution process.
You must create the reference Geometry File and the Mesh Replay File because these are specific to
each case. However, the generic default replay files (icemcfd_Remesh.rpl, icemcfd_GeomMod.rpl,
and icemcfd_MeshMod.rpl) used by this option are provided in the <CFXROOT>/etc/Remeshing
directory. These files may be edited to provide installation-wide changes to the ICEM CFD Replay
remeshing behavior. Alternatively, the geometry and mesh modification files may be copied and edited
to provide case-specific changes.
Note:
As indicated previously, only translational mesh motion is automatically handled by the ICEM
CFD Replay remeshing option. This is accomplished by applying the displacements of centroids
of boundaries in the ANSYS CFX analysis definition to parts in the ANSYS ICEM CFD geometry.
All other mesh motion (such as rotation about the centroid or another point, or general de-
formation) will not be applied, and an inconsistency in the analysis geometry before and
after remeshing will be introduced.
The first step involves creating the reference Geometry File within the ANSYS ICEM CFD environment.
If the geometry was not created within that environment, use one of the File > Import Geometry
options in the ANSYS ICEM CFD environment. At this point, ensure that all required Parts (or Families)
are defined and named so that they can be referenced when completing the ICEM CFD Replay
remeshing definition later in CFX-Pre. Finally, store the geometry in the ICEM CFD native geometry
file format (namely, a .tin file).
The second step involves generating the Mesh Replay File, again, from within the ANSYS ICEM CFD
environment. Start with the previously created geometry loaded, and work sequentially through the
mesh generation process until acceptable mesh controls have been specified. This may require fine
tuning, which will involve the regeneration of your mesh after moving the geometry through its ex-
pected range of motion. Once you are satisfied with the mesh control settings, purge the last mesh
using File > Mesh > Close Mesh, and reload the original reference geometry. Complete the following
tasks to generate the required Mesh Replay File:
1. Use File > Replay Scripts > Replay Control to begin recording the commands for the Mesh Replay
File. The Replay Control dialog box is displayed.
2. Revisit all of the mesh related tabs and settings used to generate the mesh, clicking either the Apply
or OK to commit the settings into the Replay Control panel.
4. In the Replay Control panel, clear the Record (after current) toggle and select Save to write the settings
to replay file.
You may also want to export the mesh that was (re)generated for use in the simulation definition (as
in the next step).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
74 of ANSYS, Inc. and its subsidiaries and affiliates.
Directory Structure and Files Used During Remeshing
The third step involves defining the simulation within CFX-Pre. Complete the following tasks to prepare
the simulation:
Note:
See also the discussion in Mesh Re-Initialization During Remeshing (p. 76).
3. Define the flow analysis including the definition of one or more solver interrupt controls, as described
in Interrupt Control in the CFX-Pre User's Guide, to identify the condition(s) under which solver execution
will be interrupted.
4. Define a configuration and complete the ICEM CFD Replay remeshing setup as described in ANSYS
ICEM CFD Replay Remeshing in the CFX-Pre User's Guide. The Geometry File and Mesh Replay File
created above are referenced here. Note also, that references to one or more of the previously defined
solver interrupt control conditions are required to activate remeshing.
5. Complete any execution controls for the simulation and either start the solver or write the CFX-Solver
Input file for later use.
The first instance of remeshing occurred when the solver was interrupted after the third time step.
Following this instance of remeshing, all CFX-Solver Results files (such as transient, backup, and
remeshing) contained in the run directory, case_001.dir, were moved into the final solution directory,
case_001. The results file written when the solver was interrupted before remeshing was renamed to
3_oldmesh.res. Any text output to the console window during remeshing was redirected to the file
named 3_remesh.out, which is also placed in the final solution directory.
The second, and currently running, instance of remeshing began when the solver was interrupted after
the fifth time step. The results file written by the solver still has the generic name, res, and monitor
data (contained in the mon file) has not yet been inserted into the results file.
Just after inserting the new mesh(es) into the analysis definition, the files contained in the final solution
and run directories change slightly. The results and console output files are renamed (to
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 75
Remeshing Guide
5_oldmesh.res and 5_remesh.out, respectively) and moved from the run directory into the final
solution directory. An automatically generated session file, meshUpdate.pre, is used by CFX-Pre to
generate the updated the solver input file, 5_newmesh.def, and each of these files are present in the
run directory. These files are, however, replaced or removed during the next instance of remeshing or
when the analysis ends and the run directory is deleted.
• The total mesh displacement variable is relative to a specific mesh topology. Because the mesh topo-
logy changes, this variable is reset each time remeshing occurs.
• The new variable called total centroid displacement tracks the displacement of each
boundary’s centroid since the beginning of the analysis (that is, relative to the original mesh).
• The specified displacement based mesh motion is relative to the initial mesh and must therefore in-
clude an offset to account for mesh re-initialization. The Mesh Initialisation Time variable
corresponds to the time at which mesh re-initialization last occurred. This can be used to evaluate
the required offset for time varying mesh displacement.
Note:
Total Centroid Displacement is the sum of total mesh displacement and an offset
vector. The value of the offset is determined by the displacement of the boundary’s centroid
from its original position to its initial position. When using Total Centroid Displace
ment in a non-remeshing case, the original and the initial position are the same, resulting
in an offset value of zero. In this case, there seems to be no difference between the variables,
Total Centroid Displacement and Total Mesh Displacement. However,
when using Total Centroid Displacement in a remeshing case, the original position
is defined at the start of the simulation, while the initial position is defined after the last
remesh; this results in an offset contribution that is non-zero.
An example of the expressions used to evaluate an applied displacement that includes the required
offset to account for mesh re-initialization is given below. In this example, the applied displacement
is evaluated as the desired displacement minus the value of the desired displacement at the Mesh
Initialisation Time.
Disp Desired = 1[m]*0.5*(1-cos(2.[s^-1]*pi*t))
Disp Mesh ReInit = 1[m]*0.5*(1-cos(2.[s^-1]*pi*Mesh Initialisation Time ))
Disp Applied = Disp Desired - Disp Mesh ReInit
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
76 of ANSYS, Inc. and its subsidiaries and affiliates.
Additional Considerations
This model for software license handling may cause problems in multi-user environments, but work
is underway to provide a broader range of handling options for future releases.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 77
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
78 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 5: Reference Guide for Mesh Deformation and
Fluid-Structure Interaction
This guide is part of a series that provides advice for using CFX in specific engineering application areas.
It is aimed at users with little or moderate experience using CFX for applications involving Mesh Deform-
ation and/or Fluid Structure Interaction.
• Further mesh deformation is likely to yield elements with negative volumes, which is a fatal condition
Some of the most common causes for mesh folding during deformation are identified in the following
sections.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 79
Reference Guide for Mesh Deformation and Fluid-Structure Interaction
Folded meshes often result from the application of inconsistent motion specifications.
5.1.4. Solving the Mesh Displacement Equations and Updating Mesh Coordin-
ates
During each outer iteration or timestep, the mesh displacement equations are solved to the specified
convergence level and the resulting displacements are applied to update the mesh coordinates. This
occurs before proceeding to solve the general transport (for example, hydrodynamics, turbulence,
and so on) equations.
Unlike other equation classes, the convergence level (that is, controls and criteria) applied to mesh
displacement equations is unaffected by changes made to the basic settings for all other equations.
The default convergence controls and criteria for the mesh displacement equation are tabulated below,
and are changed by visiting the Mesh Displacement entry in the Equation Class Settings tab under
Solver Control.
Setting Value
Maximum Number of Coefficient 5
Loops
Minimum Number of Coefficient 1
Loops
Residual Type RMS
Residual Target 1.0E-4
Mesh folding occurs and is detected when the displacements are used to update the mesh coordinates.
Folded meshes can occur if the displacement equations are incompletely solved. In this case, the
unconverged displacement solution field does not vary smoothly enough to ensure that adjacent
mesh nodes move by similar amounts.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
80 of ANSYS, Inc. and its subsidiaries and affiliates.
Mesh Deformation
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 81
Reference Guide for Mesh Deformation and Fluid-Structure Interaction
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
82 of ANSYS, Inc. and its subsidiaries and affiliates.
Mesh Deformation
Mesh Displacement is the principal variable that is solved for by the mesh motion model (see
Mesh Deformation in the CFX-Solver Modeling Guide). This variable represents the displacement relative
to the previous mesh locations. Conversely, Total Mesh Displacement is a derived quantity
that represents the displacement relative to the initial mesh.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 83
Reference Guide for Mesh Deformation and Fluid-Structure Interaction
simulation type (that is, steady-state or transient) used for the initial or restart run does not affect
behavior.
In the discussion that follows, examples are presented to demonstrate the FSI capabilities using CFX
by itself or with other CAE packages like ANSYS Mechanical. These examples are grouped according to
the degree of coupling that must be maintained during the simulation in order to ensure that accurate
results are obtained.
You can couple CFX to an external solver using System Coupling. For more information about simulations
involving System Coupling and CFX, refer to Coupling CFX to an External Solver: System Coupling
Simulations in the CFX-Solver Modeling Guide.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
84 of ANSYS, Inc. and its subsidiaries and affiliates.
Fluid Structure Interaction
1. Load the fluids results file, from which you want to transfer results, into CFD-Post
2. Select File > Import > Import Mechanical CDB Surface. The Import Mechanical CDB Surface
dialog box appears.
• Select the CDB file that specifies the surface mesh of the solid object to which to transfer data.
Also select the Associated Boundary for the surface to map onto, and make other selections as
appropriate.
• Select the XML document that provides all transfer information. Click OK, and the surface data
is loaded.
4. Select File > Export > Export Mechanical Load File. The Export Mechanical Load File dialog box
appears.
5. In the Export Mechanical Load File dialog box, select a filename to which to save the data. For
the Location parameter value, select the imported ANSYS mesh object. Under File Format select
ANSYS Load Commands (FSE or D). (Alternatively, you can select WB Simulation Input (XML) to
get XML output.) Also select the appropriate data to export: Normal Stress Vector, Tangential Stress
Vector, Stress Vector, Heat Transfer Coefficient, Heat Flux, or Temperature. Click Save, and the data
file is created.
The one-way FSI data transfer described above is performed automatically when using the FSI:
Fluid Flow (CFX) > Static Structural custom system in ANSYS Workbench. For details, see the
FSI: Fluid Flow (ANSYS CFX) > Static Structural in the Workbench User's Guide section in the ANSYS
documentation.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 85
Reference Guide for Mesh Deformation and Fluid-Structure Interaction
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
86 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 6: CFX Best Practices Guide for Numerical Accuracy
This guide provides best practice guidelines for Computational Fluid Dynamics (CFD) simulation and
documentation of the verification, validation, and demonstration test cases. It describes:
This guide is aimed at users who have moderate or little experience using ANSYS CFX. It is part of a
series that provides advice for using ANSYS CFX in specific engineering application areas. The current
guidelines are adapted from Best Practice Guidelines developed for the nuclear reactor safety applications
[143 (p. 378)].
An essential quantity in the quality assurance procedure is the definition of target variables. They will
mainly be scalar (integral) quantities (for instance, forces, heat transfer rates, and maximum temperature)
or one-dimensional distributions, such as the wall heat transfer along a certain line. Convergence
studies can be based on these variables without a reference to the grid used in the simulation. They
can also be used for an asymptotic evaluation of convergence on unstructured meshes. Even more
important, these quantities are of immediate meaning to engineers and enable them to understand
the uncertainty from a physical standpoint. A danger of integral or local scalar quantities is that they
might not be sensitive enough to detect local changes in the solutions under grid refinement. This
should be kept in mind during the analysis.
In order to tackle the problem, it is necessary to first define the different type of errors that can impact
a CFD simulation. It is then required that you list the most promising strategies in order to reduce or
avoid these errors. Based on these strategies, procedures have to be defined that can be used for the
test case simulations.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 87
CFX Best Practices Guide for Numerical Accuracy
It might be not possible to rigorously perform the error estimation and reduction procedures described
in the following sections for the complex demonstration cases. However, the best attempt should be
made to follow the principal ideas and to avoid single grid solutions without sensitivity studies. For
these cases, it is even more important to follow a stringent documentation procedure and to list the
possible deficiencies and uncertainties in the simulations.
The strategies for the reduction and evaluation of numerical errors have been developed for single-
phase flows. There is no principal difference between the single- and multi-phase flow formulations.
They are both based on (ensemble) averaged equations, and are mathematically similar. From a physical
standpoint, there are however significant additional challenges due to the presence of the different
phases, besides the obviously higher demands on model formulation. One of the additional complication
lies in the presence of sharp interfaces between the phases, which require a higher degree of grid res-
olution than usually necessary for single-phase flows. In addition, multi-phase flows have a higher affinity
to physical instabilities that might be suppressed on coarse grids, but appear under grid refinement.
(This effect is sometimes also observed in single-phase flows. An example is the blunt trailing edge of
an airfoil, where extreme grid refinement will eventually capture the vortex shedding of the mixing
layer). It is to be kept in mind that the brute application of procedures might not lead to the desired
results. Also in these cases, the spirit behind the guidelines should be followed and carried as far as
possible.
Validation studies have to be based on experimental data. These data can introduce significant errors
into the comparison. It is therefore required to select the project test cases with attention to potential
error sources and experimental uncertainties. Definitions on the different types of test cases as well as
on the requirements for the project are given in Selection and Evaluation of Experimental Data (p. 108).
Numerical errors result from the differences between the exact equations and the discretized equations
solved by the CFD code. For consistent discretization schemes, these errors can be reduced by an
increased spatial grid density and/or by smaller timesteps.
Modeling errors result from the necessity to describe flow phenomena such as turbulence, combustion,
and multi-phase flows by empirical models. For turbulent flows, the necessity for using empirical
models derives from the excessive computational effort to solve the exact equations1 with a Direct
Numerical Simulation (DNS) approach. Turbulence models are therefore required to bridge the gap
between the real flow and the statistically averaged equations. Other examples are combustion
models and models for interpenetrating continua, for example, two-fluid models for two-phase flows.
User errors result from incorrect use of CFD software and are usually a result of insufficient expertise
by the CFD user. Errors can be reduced or avoided by additional training and experience in combin-
ation with high-quality project management and by provision and use of Best Practice Guidelines
and associated checklists.
1
The Navier-Stokes equations for single-phase, Newtonian fluids
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
88 of ANSYS, Inc. and its subsidiaries and affiliates.
Definition of Errors in CFD Simulations
Application uncertainties are related to insufficient information to define a CFD simulation. A typical
example is insufficient information on the boundary conditions.
Software errors are the result of an inconsistency between the documented equations and the actual
implementation in the CFD software. They are usually a result of programming errors.
The most relevant errors from a practical standpoint are solution errors2. They are the difference
between the exact solution of the model equations and the numerical solution. The relative solution
error can be formally defined as:
(6.1)
Equation 6.1 (p. 89) is valid for every grid point for which the numerical solution exists. A global
number can be defined by applying suitable norms, as:
(6.2)
The goal of a numerical simulation is to reduce this error below an acceptable limit.
Obviously, this is not a straightforward task, as the exact solution is not known and the error can
therefore not be computed. Exceptions are simple test cases for code verification where an analyt-
ical solution is available.
Given a grid spacing , and the truncation error order of a consistent discretization scheme, , a
Taylor series can be written to express the exact solution as:
(6.3)
2
Sometimes also called ‘discretization errors’
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 89
CFX Best Practices Guide for Numerical Accuracy
In other words, the numerical solution converges towards the exact solution with the power of
the grid spacing. Analogous definitions are available for time discretization errors.
(6.4)
where is the derivative of the exact solution at a given location. An example is a central
difference for a spatial derivative:
(6.5)
This formulation has a truncation error of order 2 and is therefore second-order accurate. The
overall truncation error order of the spatial discretization scheme is determined by the lowest order
truncation error after all terms have been discretized.
In the term of Equation 6.5 (p. 90), the leading term is proportional to . First-order
upwind differencing of the convective terms yields truncation errors with leading term
proportional to . This term then contributes to the diffusion term (numerical/false diffusion),
which is most dangerous in 3D problems with grid lines not aligned to the flow direction. These
schemes enhance the dissipation property of the numerical algorithm (see for example, Ferziger
and Peric [141 (p. 377)]) and are not desirable in high-quality CFD simulations.
From a practical standpoint, it is important to understand that for a first-order method, the error
is reduced to 50% by a doubling of the grid resolution in each spatial direction. For a second-order
method, it is reduced to 25% for the same grid refinement.
The error in the time discretization can again be obtained by a Taylor series expansion of the nu-
merical formulation of this equation. With the example of a backward Euler integration:
(6.7)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
90 of ANSYS, Inc. and its subsidiaries and affiliates.
Definition of Errors in CFD Simulations
(6.8)
An additional complication for implicit methods comes from the inclusion of the unknown in
the right hand side of Equation 6.7 (p. 90). In order to benefit from an implicit method, a linearization
of has to be included:
(6.9)
This constitutes an implicit formulation with first-order accuracy. A second-order time differencing
is not compatible with this linearization of the right hand side, as the linearization introduced a
first-order error in . In order to be able to satisfy the implicit dependency of the right hand side
on the time level more closely, inner iterations (or coefficient loops) are frequently introduced:
(6.11)
where an additional iteration over the index is carried out. This equation can be reformulated
as:
(6.12)
This equation can be converged completely (left hand side goes to zero) in in order to solve the
original exact implicit formulation given by Equation 6.7 (p. 90). It is obvious that it is not necessary
to converge the coefficient loop to zero, while the right hand side has a finite (first-order) error in
. It can be shown that for a first-order time integration, one coefficient loop is consistent with
the accuracy of the method. In a case where a second-order accurate scheme is used in the time
derivative, two coefficient loops will ensure overall second-order accuracy of the method. Note,
however, that this is correct only if the coefficient loops are not under-relaxed in any way.
For explicit methods, no coefficient loops are required and the time discretization error is defined
solely from a Taylor series expansion.
Zero iteration error would mean that the left hand side is converged to zero, leading to the con-
verged solution . However, in practical situations, the iterative process is stopped at a
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 91
CFX Best Practices Guide for Numerical Accuracy
certain level, in order to reduce the numerical effort. The difference between this solution and the
fully converged solution defines the iteration error.
The iteration error is usually quantified in terms of a residual or a residual norm. This can be the
maximum absolute value of the right hand side, , for all grid points, or a root mean square
of this quantity. In most CFD methods, the residual is nondimensionalized to enable a comparison
between different applications with different scaling. However, the non-dimensionalization is different
for different CFD codes, making general statements as to the required absolute level of residuals
impractical. Typically, the quality of a solution is measured by the overall reduction in the residual,
compared to the level at the start of the simulation.
The iteration error should be controlled with the use of the target variables. The value of the target
variable can be plotted as a function of the convergence level. In case of iterative convergence,
the target variable should remain constant with the convergence level. It is desirable to display the
target variable in the solver monitor during the simulation.
If the asymptotic range of the convergence properties of the numerical method is reached, the
difference between solutions on successively refined grids can be used as an error estimator. This
allows the application of Richardson extrapolation to the solutions on the different grids (Roache
[139 (p. 377)]). In the asymptotic limit, the solution can be written as follows:
(6.14)
In this formulation, is the grid spacing (or a linear measure of it) and the are functions inde-
pendent of the grid spacing. The subscript, , refers to the current level of grid resolution. Solutions
on different grids are represented by different subscripts.
The assumption for the derivation of an error estimate is that the order of the numerical discretiz-
ation is known. This is usually the case. Assuming a second-order accurate method, the above ex-
pansion can be written for two different grids:
(6.15)
Neglecting higher-order terms, the unknown function can be eliminated from this equation. An
estimate for the exact solution is therefore:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
92 of ANSYS, Inc. and its subsidiaries and affiliates.
Definition of Errors in CFD Simulations
(6.16)
The difference between the fine grid solution and the exact solution (defining the error) is therefore:
(6.17)
For an arbitrary order of accuracy, , of the underlying numerical scheme, the error is given by:
(6.18)
In order to build the difference between the solutions and , it is required that the coarse and
the fine grid solution is available at the same location. In the case of a doubling of the grid density
without a movement of the coarse grid nodes, all information is available on the coarse grid nodes.
The application of the correction to the fine-grid solution requires an interpolation of the correction
to the fine grid nodes (Roache [139 (p. 377)]). In the case of a general grid refinement, the solutions
are not available on the same physical locations. An interpolation of the solution between the dif-
ferent grids is then required for a direct error estimate. It has to be ensured that the interpolation
error is lower than the solution error in order to avoid a contamination of the estimate.
Richardson interpolation can also be applied to integral quantities (target variables), such as lift or
drag coefficients. In this case, no interpolation of the solution between grids is required.
Note that the above derivation is valid only if the underlying method has the same order of accuracy
everywhere in the domain and if the coarse grid is already in the asymptotic range (the error de-
creases with the order of the numerical method). In addition, the method magnifies round-off and
iteration errors.
The intention of the Richardson interpolation was originally to improve the solution on the fine
grid. This requires an interpolation of the correction to the fine grid and introduces additional inac-
curacies into the extrapolated solution, such as errors in the conservation properties of the solution.
A more practical use of the Richardson extrapolation is the determination of the relative solution
error, :
(6.19)
An estimate, , of this quantity can be derived from Equation 6.16 (p. 93):
(6.20)
It can be shown (Roache [139 (p. 377)]) that the exact relative error and the approximation are related
by:
(6.21)
Equation 6.20 (p. 93) can also be divided by the range of or another suitable quantity in order
to prevent the error to become infinite as goes to zero.
In order to arrive at a practical error estimator, the following definitions are proposed:
Field error:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 93
CFX Best Practices Guide for Numerical Accuracy
(6.22)
Maximum error:
(6.23)
RMS error:
(6.24)
(6.25)
where is the defined target variable (list, drag, heat transfer coefficient, maximum temperature,
mass flow, and so on).
Similar error measures can be defined for derived variables, which can be specified for each test
case. Typical examples would be the total mass flow, the pressure drop, or the overall heat transfer.
This will be the recommended strategy, as it avoids the interpolation of solutions between the
coarse and the fine grid.
For unstructured meshes, the above considerations are valid only in cases of a global refinement
of the mesh. Otherwise, the solution error will not be reduced continuously across the domain. For
unstructured refinement the refinement level, , can be defined as follows:
(6.26)
where is the number of grid points and is the dimension of the problem.
It must be emphasized that these definitions do not impose an upper limit on the real error, but
are estimates for the evaluation of the quality of the numerical results. Limitations of the above
error estimates are:
For three-dimensional simulations, the demand that the coarse grid solution be in the asymptotic
range is often hard to ensure. It is therefore required to compute the error for three different grid
levels, to avoid fortuitous results. If the solution is in the asymptotic range, the following indicator
should be close to constant:
(6.27)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
94 of ANSYS, Inc. and its subsidiaries and affiliates.
Definition of Errors in CFD Simulations
The classical model used in almost all industrial CFD applications is a turbulence model. It is based
on time or ensemble averaging of the equations resulting in the so-called Reynolds Averaged Navier-
Stokes (RANS) equations. Due to the averaging procedure, information from the full Navier-Stokes
equations is lost. It is supplied back into the code by the turbulence model. The most widely used
industrial models are two-equation models, such as the or models.
The statistical model approach reduces the resolution requirements in time and space by many orders
of magnitude, but requires the calibration of model coefficients for certain classes of flows against
experimental data. There is a wide variety of models that are introduced to reduce the resolution re-
quirements for CFD simulations, including:
• Turbulence models
• Multi-phase models
• Combustion models
• Radiation models.
In combustion models, the reduction can be both in terms of the chemical species and in terms of
the turbulence-combustion interaction. In radiation, the reduction is typically in terms of the wavelength
and/or the directional information. For multi-phase flows, it is usually not possible to resolve a large
number of individual bubbles or droplets. In this case, the equations are averaged over the different
phases to produce continuous distributions for each phase in space and time.
As all of these models are based on a reduction of the ‘real’ physics to a reduced ‘resolution’, inform-
ation has to be introduced from outside the original equations. This is usually achieved by experimental
calibration, or by available DNS (p. 88) results.
Once a model has been selected, the accuracy of the simulation cannot be increased beyond the
capabilities of the model. This is the largest factor of uncertainty in CFD methods, as modeling errors
can be of the order of 100% or more. These large errors occur in cases where the CFD solution is very
sensitive to the model assumptions and where a model is applied outside its range of calibration.
Because of the complexity of industrial simulations, it cannot be ensured that the models available
in a given CFD code are suitable for a new application. While in most industrial codes a number of
different models are available, there is no a priori criterion as to the selection of the most appropriate
one. Successful model selection is largely based on the expertise and the knowledge of the CFD user.
• Problem description
• Computing power
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 95
CFX Best Practices Guide for Numerical Accuracy
• CFD software
According to the ERCOFTAC Best Practice Guidelines [140 (p. 377)], some of the sources for user errors
are:
• Lack of experience
Often, user errors are related to management errors when insufficient resources are assigned to a
project, or inexperienced users are given a too complex application. Typical user errors are:
• Postprocessing errors.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
96 of ANSYS, Inc. and its subsidiaries and affiliates.
General Best Practice Guidelines
have on the equations to be solved by the software is different from the actual equations solved by
the code. This difference can be a result of:
• Documentation errors
A careful study of the CFD code documentation and other literature on the numerical methods as
well as the physical models is highly recommended. Furthermore, benchmark studies are recommended
to enable you to understand the capabilities and limitations of CFD methods. A comparison of different
CFD methods is desirable, but not always possible.
• Local details. In general, geometrical features with dimensions below the local mesh size (for example,
wall roughness or porous elements) are not included in the geometrical model. These should be incorpor-
ated through a suitable model.
In the case that the geometry is imported from CAD-data, the data should be checked beforehand.
Frequently, after the import of CAD-data, the CAD-data has to be adapted (cleaned) before it can be
used for mesh generation. It is essential for mesh generation to have closed volumes. The various
CAD-data formats do not always contain these closed volumes. Therefore, the CAD-data has to be
altered in order to create the closed volumes. It has to be ensured that these changes do not influence
the flow to be computed.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 97
CFX Best Practices Guide for Numerical Accuracy
A good mesh quality is essential for performing a good CFD analysis. Therefore, assessment of the
mesh quality before performing a large and complex CFD analysis is very important. Most of the mesh
generators and CFD solvers offer the possibility of checking the mesh on several cells or mesh para-
meters, such as aspect ratio, internal angle, face warpage, right handiness, negative volumes, cracks,
and tetrahedral quality. The reader is referred to the user's guides of the various mesh generators
and CFD solvers for more information on these cells and mesh parameters.
– Aspect ratios should not be larger than 20 to 50 in regions away from the boundary.
– Aspect ratios may, and should, be larger in the boundary layers. For well resolved boundary layers at
high Re numbers, the near-wall aspect ratios can be of the order of 103 for single-precision runs or 104
for double-precision runs.
• Avoid non-scalable grid topologies. Non-scalable topologies can occur in block-structured grids and are
characterized by a deterioration of grid quality under grid refinement.
• Avoid non-orthogonal, for example, unstructured tetrahedral meshes, in (thin) boundary layers.
• Use a finer and more regular grid in critical regions, for example, regions with high gradients or large
changes such as shocks.
• Avoid the presence of arbitrary grid interfaces, mesh refinements, or changes in element types in critical
regions. An arbitrary grid interface occurs when there is no one-to-one correspondence between the cell
faces on both sides of a common interface, between adjacent mesh parts.
If possible, determine the size of the cells adjacent to wall boundaries where turbulence models are
used, before grid generation has started.
Numerical diffusion is high when computational cells are created that are not orthogonal to the fluid
flow. If possible, avoid computational cells that are not orthogonal to the fluid flow.
Judge the mesh quality by using the possibilities offered by the mesh generator. Most mesh generators
offer checks on mesh parameters, such as aspect ratio, internal angle, face warpage, right handiness,
negative volumes, cracks, and tetrahedral quality.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
98 of ANSYS, Inc. and its subsidiaries and affiliates.
General Best Practice Guidelines
It should be demonstrated that the final result of the calculations is independent of the grid that is
used. This is usually done by comparison of the results of calculations on grids with different grid
sizes.
Some CFD methods enable the application of grid adaptation procedures. In these methods, the grid
is refined in critical regions (high truncation errors, large solution gradients, and so on). In these
methods, the selection of appropriate indicator functions for the adaptation is essential for the success
of the simulations. They should be based on the most important flow features to be computed.
As a general rule, any important shear layer in the flow (boundary layer, mixing layer, free jets, wakes,
and so on) should be resolved with at least 10 nodes normal to the layer. This is a very challenging
requirement that often requires the use of grids that are aligned with the shear layers.
In principle, modeling errors can only be estimated in cases where the validation of the model is
‘close’ to the intended application. Model validation is essential for the level of confidence you can
have in a CFD simulation. It is therefore required that you gather all available information on the
validation of the selected model, both from the open literature and from the code developers (vendors).
In case that CFD is to be applied to a new field, it is recommended that you carry out additional val-
idation studies, in order to gain confidence that the physical models are adequate for the intended
simulation.
If several modeling options are available in the code (as is usually the case for turbulence, combustion
and multi-phase flow models), it is recommended that you carry out the simulation with different
models in order to test the sensitivity of the application with respect to the model selection.
In case you have personal access to a modeling expert in the required area, it is recommended that
you interact with the model developer or expert to ensure the optimal selection and use of the
model.
The amount of information that has to be provided by the turbulence model can be reduced if the
large time and length scales of the turbulent motion are resolved. The equations for this so-called
Large Eddy Simulation (LES) method are usually filtered over the grid size of the computational cells.
All scales smaller than the resolution of the mesh are modeled and all scales larger than the cells
are computed. This approach is several orders of magnitude more expensive than a RANS (p. 95)
simulation and is therefore not used routinely in industrial flow simulations. It is most appropriate
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 99
CFX Best Practices Guide for Numerical Accuracy
for free shear flows, as the length scales near the solid walls are usually very small and require small
cells even for the LES (p. 99) method.
RANS (p. 95) methods are the most widely used approach for CFD simulations of industrial flows.
Early methods, using algebraic formulations, have been largely replaced by more general transport
equation models, for both implementation and accuracy considerations. The use of algebraic
models is not recommended for general flow simulations, due to their limitations in generality and
their geometric restrictions. The lowest level of turbulence models that offer sufficient generality
and flexibility are two-equation models. They are based on the description of the dominant length
and time scale by two independent variables. Models that are more complex have been developed
and offer more general platforms for the inclusion of physical effects. The most complex RANS (p. 95)
model used in industrial CFD applications are Second Moment Closure (SMC) models. Instead of two
equations for the two main turbulent scales, this approach requires the solution of seven transport
equations for the independent Reynolds stresses and one length (or related) scale.
The challenge for the user of a CFD method is to select the optimal model for the application at
hand from the models available in the CFD method. In most cases, it cannot be specified beforehand
which model will offer the highest accuracy. However, there are indications as to the range of ap-
plicability of different turbulence closures. This information can be obtained from validation studies
carried out with the model.
In addition to the accuracy of the model, consideration has to be given to its numerical properties
and the required computer power. It is often observed that more complex models are less robust
and require many times more computing power than the additional number of equations would
indicate. Frequently, the complex models cannot be converged at all, or, in the worst case, the
code becomes unstable and the solution is lost.
It is not trivial to provide general rules and recommendations for the selection and use of turbulence
models for complex applications. Different CFD groups have given preference to different models
for historical reasons or personal experiences. Even turbulence experts cannot always agree as to
which model offers the best cost-performance ratio for a new application.
These models have typically been optimized for aerodynamic flows and are not recommended
as general-purpose models.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
100 of ANSYS, Inc. and its subsidiaries and affiliates.
General Best Practice Guidelines
as the results are strongly dependent on the user input. Alternative formulations are available,
see for example, the Shear Stress Transport (SST) model, Menter [9 (p. 358)].
An important weakness of standard two-equation models is that they are insensitive to streamline
curvature and system rotation. Particularly for swirling flows, this can lead to an over-prediction
of turbulent mixing and to a strong decay of the core vortex. There are curvature correction
models available, but they have not been generally validated for complex flows.
The standard two-equation models can also exhibit a strong build-up of turbulence in stagnation
regions, due to their modeling of the production terms. Several modifications are available to
reduce this effect, for instance by Kato and Launder [128 (p. 375)]. They should be used for flows
around rods, blades, airfoils, and so on.
One of the weak points of the SMC (p. 100) closure is that the same scale equations are used as
in the two-equation framework. As the scale equation is typically one of the main sources of
uncertainty, it is found that SMC (p. 100) models do not consistently produce superior results
compared to the simpler models. In addition, experience has shown that SMC (p. 100) models are
often much harder to handle numerically. The model can introduce a strong nonlinearity into
the CFD method, leading to numerical problems in many applications.
SMC (p. 100) models are usually not started from a pre-specified initial condition, but from an
already available solution from a two-equation (or simpler) model. This reduces some of the nu-
merical problems of the SMC (p. 100) approach. In addition, it offers an important sensitivity study,
as it allows quantifying the influence of the turbulence model on the solution. It is therefore re-
commended that you fully converge the two-equation model solution and save it for a compar-
ison with the SMC (p. 100) model solution. The difference between the solutions is a measure of
the influence of the turbulence model and therefore an indication of the modeling uncertainty.
This is possible only in steady-state simulations. For unsteady flows, the models usually have to
be started from the initial condition.
LES (p. 99) simulations do not easily lend themselves to the application of grid refinement studies
both in the time and the space domain. The main reason is that the turbulence model adjusts
itself to the resolution of the grid. Two simulations on different grids are therefore not comparable
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 101
CFX Best Practices Guide for Numerical Accuracy
by asymptotic expansion, as they are based on different levels of the eddy viscosity and therefore
on a different resolution of the turbulent scales. From a theoretical standpoint, the problem can
be avoided, if the LES (p. 99) model is not based on the grid spacing, but on a pre-specified filter-
width. This would enable reaching grid-independent LES (p. 99) solutions above the DNS (p. 88)
limit. However, LES (p. 99) is a very expensive method and systematic grid and timestep studies
are prohibitive even for a pre-specified filter. It is one of the disturbing facts that LES (p. 99) does
not lend itself naturally to quality assurance using classical methods. This property of the
LES (p. 99) also indicates that (nonlinear) multigrid methods of convergence acceleration are not
suitable in this application.
On a more global level, the grid convergence can be tested using averaged quantities resulting
from the LES (p. 99) simulation. The averaged LES (p. 99) results can be analyzed in a similar way
as RANS (p. 95) solutions (at least qualitatively). Again, it is expensive to perform several LES (p. 99)
simulations and grid refinement will therefore be more the exception than the rule.
Due to the high computing requirements of LES (p. 99), modern developments in the turbulence
models focus on a combination of RANS (p. 95) and LES (p. 99) models. The goal is to cover the
wall boundary layers with RANS (p. 95) and to enable unsteady (LES (p. 99)-like) solutions in
largely separated and unsteady flow regions (for example, flow behind a building, or other blunt
bodies). There are two alternatives of such methods available in ANSYS CFX.
The first alternative is called Scale-Adaptive-Simulation (SAS) model (Menter and Egorov
[130 (p. 376)], [131 (p. 376)], [144 (p. 378)], [145 (p. 378)]). It is essentially an improved Unsteady RANS
(URANS) method that develops LES (p. 99)-like solutions in unstable flow regimes.
The second alternative is called Detached Eddy Simulation (DES) (Spalart [146 (p. 378)]), implemented
in the version of Strelets [58 (p. 365)]. The current recommendation is to use the SAS (p. 102)
model, as it has less grid sensitivity than the DES (p. 102) formulation. In case that SAS (p. 102)
does not provide an unsteady solution, the DES (p. 102) model should be applied. It should be
noted that both model formulations require small timesteps with a Courant number of CFL<1.
You are encouraged to read the original references before applying these models.
Standard wall functions are based on the assumption that the first grid point off the wall (or
the first integration point) is located in the universal law-of-the-wall or logarithmic region. Wall
functions eliminate the need to resolve the very thin viscous sublayer, leading to a reduction
in the number of cells and to a more moderate (and desirable) aspect ratio of the cells (ratio
of the longest to the smallest side in a structured grid). High aspect ratios can result in numer-
ical problems due to round-off errors.
On the other hand, standard wall function formulations are difficult to handle, because you
have to ensure that the grid resolution near the wall satisfies the wall function requirements.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
102 of ANSYS, Inc. and its subsidiaries and affiliates.
General Best Practice Guidelines
If the grid becomes too coarse, the resolution of the boundary layer is no longer ensured. If
the resolution becomes too fine, the first grid spacing can be too small to bridge the viscous
sublayer. In this case, the logarithmic profile assumptions are no longer satisfied. You have to
ensure that both limits are not overstepped in the grid generation phase.
The lower limit on the grid resolution for standard wall functions is a severe detriment to a
systematic grid refinement process, as required by the best practice approach. That is, instead
of an improved accuracy of the solution with grid refinement, the solution will deteriorate from
a certain level on, leading eventually to a singularity of the numerical method. Standard wall
functions are therefore not recommended for systematic grid refinement studies. Recently, al-
ternative formulations (scalable wall functions) have become available, Menter and Esch
[142 (p. 378)], which enable a systematic grid refinement when using wall functions.
The use of low-Reynolds (low-Re) number formulations of turbulence models for the integration
of the equations through the viscous sublayer is generally more accurate, as no additional as-
sumptions are required concerning the variation of the variables near the wall. On the downside,
most low-Re extensions of turbulence models are quite complex and can reduce the numerical
performance or even destabilize the numerical method. In addition, classical low-Re models
require a very fine near-wall resolution of at all wall nodes. This is very hard to ensure
for all walls of a complex industrial application. In the case that significantly coarser grids are
used, the wall shear stress and the wall heat transfer can be reduced significantly below their
correct values.
In ANSYS CFX, hybrid methods are available for all -equation based turbulence models
(automatic near-wall treatment), which automatically switch from a low-Re formulation to wall
functions based on the grid spacing you provide. These formulations provide the optimal
boundary condition for a given grid. From a best practice standpoint, they are the most desirable,
as they enable an accurate near-wall treatment over a wide range of grid spacings. However,
accurate boundary layer simulations do not depend only on the near-wall spacing, but also
require a minimum of at least 10 grid nodes inside the boundary layer.
• Avoid the use of classical wall functions, as they are inconsistent with grid refinement.
• Avoid strict low-Re number formulations, unless it is ensured that all near-wall cells are within the
resolution requirements of the formulation.
• In combination with the model, use scalable wall functions. They can be applied to a range of
grids without immediate deterioration of the solution (default in ANSYS CFX).
• For more accurate simulations, use an automatic wall treatment in combination with SST (p. 100)
turbulence model (default in ANSYS CFX).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 103
CFX Best Practices Guide for Numerical Accuracy
is based on the introduction of a molecular and a turbulent Prandtl number. The treatment of the
energy equation is therefore similar to the treatment of the momentum equations. No additional
transport equations are required for the turbulent heat transfer prediction. The boundary conditions
are the same as for the momentum equations and follow the same recommendations.
For SMC (p. 100) models, three additional transport equations must be solved for the turbulent heat
transfer vector in order to be consistent with the overall closure level. Only a few CFD methods
offer this option. In most cases, the heat transfer is computed from an eddy diffusivity with a constant
turbulent Prandtl number.
Depending on the flow simulation, different types of models are available. The main distinction of
the models is given below.
Lagrange models solve a separate equation for individual particles, bubbles, or droplets in a sur-
rounding fluid. The method integrates the three-dimensional trajectories of the particles based on
the forces acting on them from the surrounding fluid and other sources. Turbulence is usually ac-
counted for by a random motion, superimposed on the trajectory.
Lagrange models are usually applied to flows with low particle (bubble) densities. In these flows,
the interaction between the particles can usually be neglected, thereby reducing the complexity
of the problem significantly.
Additional models are required for flows with mass transfer between the phases (condensation,
evaporation, boiling). These models can be applied in the form of correlations for a large number
of particles (bubbles) in a given control volume, or directly at the interface between the resolved
phase boundary.
In the case that the assumptions have to be made concerning any input to a CFD analysis, they have
to be communicated to the partners in the project. Alternative assumptions have to be proposed
and the sensitivity of the solution to these assumptions has to be evaluated by case studies (alteration
of inflow profiles, different locations for arbitrary boundary conditions, and so on).
Recommendations are:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
104 of ANSYS, Inc. and its subsidiaries and affiliates.
General Best Practice Guidelines
– Geometry reduction
• Perform a sensitivity analysis with at least two settings for each arbitrary parameter.
This criteria should help to avoid the use of measures that are insensitive to the resolution,
such as pressure-based variables in boundary layer simulations.
4. Can be computed inside the solver and displayed during run time (optimal).
It is optimal if the variable can be computed during run time and displayed as part of the conver-
gence history. This enables you to follow the development of the target variable during the iterative
process.
In addition to the residual reduction, it is therefore required to monitor the solution during conver-
gence and to plot the pre-defined target quantities of the simulation as a function of the residual
(or the iteration number). A visual observation of the solution at different levels of convergence is
recommended.
It is also recommended that you monitor the global balances of conserved variables, such as mass,
momentum and energy, vs. the iteration number.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 105
CFX Best Practices Guide for Numerical Accuracy
It is desirable to have the target variable written out at every timestep in order to display it during
the simulation run.
Depending on the numerical scheme, the recommendations may also be relevant to the iterative
convergence within the timestep loop for transient simulations.
As the order of the scheme is usually given (mostly second-order), spatial discretization errors can
be influenced only by the provision of an optimal grid. It is important for the quality of the solution
and the applicability of the error estimation procedures defined in Solution Error Estimation (p. 92),
that the coarse grid already resolves the main features of the flow. This requires that the grid points
are concentrated in areas of large solution variation. For the reduction of spatial discretization errors,
it is also important to provide a high-quality numerical grid.
For grid convergence tests, the simulations are carried out for a minimum of three grids. The target
quantities will be given as a function of the grid density. In addition, an error estimate based on
the definition given in Solution Error Estimation (p. 92) (Equation 6.25 (p. 94)) will be carried out.
It is also recommended that you compute the quantity given by Equation 6.27 (p. 94) to test the
assumption of asymptotic convergence.
It is further recommended that the graphical comparison between the experiments and the simu-
lations show the grid influence for some selected examples. The following information should be
provided:
• Provide three (or more) grids using the same topology (or for unstructured meshes, a uniform refinement
over all cells).
– Ensure convergence of the target variable in the time- or iteration domain. See Iteration Errors (p. 91)
and Minimizing Iteration Errors (p. 105).
• Compute and report error measure for target variable(s) based on Equation 6.25 (p. 94).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
106 of ANSYS, Inc. and its subsidiaries and affiliates.
General Best Practice Guidelines
• Check if the solution is in the asymptotic range using Equation 6.27 (p. 94).
It should be noted that under strong grid and timestep refinement, sometimes flow features are
resolved that are not relevant for the simulation. An example is the (undesirable) resolution of the
vortex shedding at the trailing edge of an airfoil or a turbine blade in a RANS (p. 95) simulation
for very fine grids and timesteps. Another example is the gradual switch to a DNS (p. 88) for the
simulation of free surface flows with a Volume of Fluid (VOF) method (for example, drop formation,
wave excitation for free surfaces, and so on). This is a difficult situation, as it usually means that no
grid/timestep converged solution exists below the DNS (p. 88) range, which can usually not be
achieved.
In principle, the time dependency of the solution can be treated as another dimension of the
problem with the definitions in Solution Error Estimation (p. 92). However, a four-dimensional grid
study would be very demanding. It is therefore more practical to carry out the error estimation in
the time domain separately from the space discretization. Under the assumption that a sufficiently
fine space discretization is available, the error estimation in the time domain can be performed as
a one-dimensional study.
Studies should be carried out with at least two and if possible three different timesteps for one
given spatial resolution. Again, the error estimators given in Solution Error Estimation (p. 92)
(Equation 6.25 (p. 94)) can be used, if is replaced by the timestep. The following information
should be provided:
• Error estimate based on Equation 6.25 (p. 94) for (time averaged) target variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 107
CFX Best Practices Guide for Numerical Accuracy
In most cases, pre-existing software will be used. It is assumed that all CFD packages have been suf-
ficiently tested to ensure that no software verification studies have to be carried out in the project
(except for newly developed modules). In case that two CFD packages give different results for the
same application, using the same physical models, the sources for these differences will have to be
evaluated. In case of code errors, they will be reported to the code developers and if possible removed.
There is no philosophical difference between the different types of test cases. The same test case can
be used for the different phases of model development, implementation, validation, and application,
depending on the status of the model and the suitability of the data.
6.4.1.1. Description
For CFD code verification, convergence can be tested against exact analytical solutions like:
For the verification of newly implemented models, verification can only in limited cases be based
on analytical solutions. An example is the terminal rise velocity of a spherical bubble in a calm fluid.
In most other cases, simple experiments are used for the verification. It is recommended that you
compute the test cases given by the model developer in the original publication of the model, or
other trustworthy publications. Quite often experimental correlations can be applied, without the
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
108 of ANSYS, Inc. and its subsidiaries and affiliates.
Selection and Evaluation of Experimental Data
need for comparison with one specific experiment. For instance for turbulence model verification,
the most frequently used correlations are those for flat plate boundary layers.
6.4.1.2. Requirements
The only requirement for verification data is that they enable a judgement of the correct implement-
ation of the code and/or the models. This requires information from other sources concerning the
performance of the model for the test case. Strictly speaking, it is not required that the simulations
are in good agreement with the data, but that the differences between the simulations and the
data are as expected.
The test suite for model verification must be diverse enough to check all aspects of the implement-
ation. As an example, a fully developed channel flow does not enable a test of the correct imple-
mentation of the convective terms of a transport equation. The test suite should also enable testing
the correct interaction of the new model with other existing features of the software.
Software verification for physical models should be carried out in the same environment that the
end-user has available. Testing of the new features in an expert environment might miss some of
error sources, such as the GUI.
Verification cases should be selected before the model is implemented. They must be considered
an integral part of the model implementation.
6.4.2.1. Description
Examples of validation cases are flows with a high degree of information required to test the different
aspects of the model formulation. In an ideal case, a validation test case should be sufficiently
complete to enable an improvement of the physical models it was designed to evaluate. Increasingly,
validation data are obtained from DNS (p. 88) studies. The main limitation here is in the low-
Reynolds number and the limited physical complexity of DNS (p. 88) data. Typically, validation
cases are geometrically simple and often based on two-dimensional or axisymmetric geometries.
6.4.2.2. Requirements
Validation cases are selected to be as close as possible to the intended application of the model.
As an example, the validation of a turbulence model for a flat plate boundary layer does not ensure
the applicability of the model to flows with separation (as is known from the model). It is well
accepted by the CFD community and by model developers that no model (turbulence, multi-phase
or other) will be able to cover all applications with sufficient accuracy. This is the reason why there
are always multiple models for each application. The validation cases enable the CFD user to select
the most appropriate model for the intended type of application.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 109
CFX Best Practices Guide for Numerical Accuracy
Test case selection requires that the main features of the CFD models that are to be tested be
clearly identified. They must then be dominant in the validation case. Validation cases are often
‘single physics’ cases, but it will be more and more necessary to validate CFD methods for combined
effects.
The requirements for validation cases are that there should be sufficient detail to be able to compute
the flow unambiguously and to evaluate the performance of the CFD method for a given target
application.
Completeness of information is one of the most important requirements for a validation test case.
This includes all information required to run the simulation, like:
• Geometry
• Boundary conditions
While the first three demands are clearly necessary to be able to set up and run the simulation, the
knowledge of all physical effects taking place in the experiment is not always considered. However,
it is crucial to have a clear understanding of the overall flow in order to be able to judge the quality
of a test case. Typical questions are:
• Are all the relevant physical effects known (multi-phase, transition, and so on)?
• Have any corrections been applied to the data and are they appropriate?
Completeness of information is also essential for the comparison of the simulation results with the
experimental data. A validation case should have sufficient detail to identify the sources for the
discrepancies between the simulations and the data. This is a vague statement and cannot always
be ensured, but a validation experiment should provide more information than isolated point
measurements. Profiles and distributions of variables at least in one space dimension should be
available (possibly at different locations). More desirable is the availability of field data in two-di-
mensional measuring planes including flow visualizations.
Completeness also relates to the non-dimensionalization of the data. Frequently the information
provided is not sufficient to reconstruct the data in the form required by the validation exercise.
In case that the data provided are not sufficient, the impact of the missing information has to be
assessed. Most crucial is the completeness of the data required to set up the simulation. In case of
missing information, the influence of this information deficit has to be assessed. Typical examples
are incomplete inlet boundary conditions. While the mean flow quantities are often provided, other
information required by the method, as profiles for turbulent length scales and volume fractions
is frequently missing. The importance of this deficit can be estimated by experience with similar
flows and by sensitivity studies during the validation exercise.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
110 of ANSYS, Inc. and its subsidiaries and affiliates.
Selection and Evaluation of Experimental Data
Next to the completeness of the data, their quality is of primary importance for a successful validation
exercise. The quality of the data is mainly evaluated by error bounds provided by the experiment-
alists. Unfortunately, most experiments still do not provide this information. Moreover, even if error
estimates are available, they cannot exclude systematic errors by the experimentalist.
In addition to error bounds, it is therefore desirable to have an overlap of experimental data that
enable testing the consistency of the measurements. Examples are the same data from different
experimental techniques. It is also a quality criterion when different experimental groups in different
facilities have carried out the same experiment. Consistency can also be judged from total balances,
like mass, momentum and energy conservation. Quality and consistency can frequently be checked
if validation exercises have already been carried out by other CFD groups, even if they used different
models.
The availability of the data has to be considered before any CFD validation is carried out. This includes
questions of ownership. For most CFD code developers, data that cannot be shown publicly are
much less valuable than freely available experimental results.
6.4.3.1. Description
For an aerodynamic study, a typical hierarchy would be:
6.4.3.2. Requirements
Typically, the detail of the experimental data is much lower than for verification or validation cases.
Completeness of information to set up the test case is of similar importance as for validation cases
and involves the same aspects as listed below:
• Geometry
• Boundary conditions
Typically, the level of completeness of the data for demonstration cases is much lower than for
validation cases. It is therefore even more essential to identify the missing information and to carry
out sensitivity studies with respect to these data.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 111
CFX Best Practices Guide for Numerical Accuracy
In terms of postprocessing, demonstration cases often do not provide a high degree of detail. They
are usually not appropriate to identify specific weaknesses in the physical models or the CFD codes.
Typically, only the point data or global parameters, as efficiencies, are provided.
Even though the density of data is usually lower, the quality should satisfy the same criteria as for
validation cases. Error estimates are desirable and so are independent measurements.
Due to the limited amount of data available, the information is usually not sufficient to carry out
consistency checks.
The requirements in terms of availability/openness are usually lower than for validation cases, as
the demonstration applies usually to a smaller audience. A demonstration case might be carried
out for a single customer or one specific industrial sector. It has to be ensured, as in all cases, that
the data can be shown to the target audience of the simulation.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
112 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 7: CFX Best Practices Guide for Cavitation
This guide is part of a series that provides advice for using CFX in specific engineering application areas.
It is aimed at users with moderate or little experience using CFX for applications involving cavitation.
Cavitation is the formation of vapor bubbles within a liquid where flow dynamics cause the local static
pressure to drop below the vapor pressure. The bubbles of vapor usually last a short time, collapsing
when they encounter higher pressure. Cavitation should not be confused with boiling. When a liquid
boils, thermal energy drives the local temperature to exceed the saturation temperature.
Cavitation is a concern in several application areas, including pumps, inducers, marine propellers, water
turbines, and fuel injectors. One of the major problems caused by cavitation is a loss of pressure rise
across a pump. Other problems include noise, vibration, and damage to metal components.
• Define an Eulerian multiphase simulation that uses one fluid for the liquid state and one fluid for the vapor
state, then use an interphase mass transfer cavitation model (see Cavitation Model in the CFX-Solver Modeling
Guide) to transfer mass between the two fluids.
• If thermodynamic equilibrium can be assumed, you can model cavitation (also flashing) by defining an
equilibrium phase change simulation using a homogeneous binary mixture for both states (liquid and vapor).
For details, see Setting up an Equilibrium Phase Change Simulation in the CFX-Solver Modeling Guide.
Recommendations
• Initially establish the flow without cavitation, for example, by using a high outlet pressure or by turning off
interphase mass transfer, depending on the case.
• In an equilibrium phase change simulation, initially maintain a large enough time step to avoid instabilities
when cavitation starts.
• You may need to reduce the time step, especially if the cavitation boundary moves.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 113
CFX Best Practices Guide for Cavitation
Both pump performance without cavitation and the affects of cavitation on performance will be discussed.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
114 of ANSYS, Inc. and its subsidiaries and affiliates.
Liquid Pumps
NPSH is the Net Positive Suction Head, a quantity directly related to the inlet total pressure by the
relation:
(7.1)
where p T,inlet is the inlet total pressure, p v is the vapor pressure, is density, and g is the acceleration
due to gravity. As the inlet total pressure drops, so does the NPSH value, and the amount of cavitation
increases.
To generate this diagram, RPM and flow rate are fixed, and the pressure rise is measured at progress-
ively lower inlet total pressures. For the part of the test where the inlet total pressure is sufficiently
high to prevent cavitation, the pressure rise across the pump is constant, equal to the amount predicted
by the first performance diagram. This results in a horizontal trend in the performance curve as the
inlet total pressure is dropped. Because the pressure rise remains constant, the total pressure at the
outlet drops by the same amount as at the inlet. Using CFX software, a mass flow outlet boundary
condition can be specified to fix the flow rate while the inlet total pressure is varied.
When the inlet total pressure reaches a sufficiently low value, cavitation occurs. A further reduction
in inlet total pressure causes more cavitation, which almost always causes a large loss of pressure
rise. In rare cases, pressure rise can actually increase slightly with small amounts of cavitation. Even
in such cases, however, a further increase in cavitation causes a sudden loss of pressure rise. In the
lab, the pressure rise will eventually become insufficient to maintain the required flow rate. Using
CFX software, the solution will eventually fail to converge. Before this point, data should be collected
with a sufficient resolution (sufficiently small changes in inlet pressure) to resolve the part of the
performance curve where the pressure starts to drop. The point of cavitation is often marked by the
NPSH at which the pressure rise has fallen by a few percent.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 115
CFX Best Practices Guide for Cavitation
If you have trouble getting a converged solution, try running a simulation with cavitation turned
off, then use the result as an initial guess for a simulation with cavitation turned on.
3. Calculate the pressure rise across the pump and the NPSH value, then plot a point in the performance
diagram.
5. Repeat starting from step 2, using the previous solution as the initial guess, until cavitation has caused
a significant loss of pump head.
7.2.4. Setup
To facilitate setting up typical domain settings for the cavitation of water, you may load a single-domain
mesh, then run the template .ccl file:
CFX/etc/model-templates/cavitating_water.ccl
This file should be examined in a text editor before using it so that you understand which settings
it specifies.
For the domain fluids list, specify both a liquid and a vapor for the same material. In most cases, it is
sufficient to use a constant-density vapor.
Under Fluid Models for the domain, it is strongly recommended that you select Homogeneous
Model under Multiphase Options. You do not need to select Free Surface Model for the purpose
of simulating cavitation.
Under Fluid Pairs for the domain, select the fluid pair from the list and, for Mass Transfer, set Option
to Cavitation. Select the Rayleigh Plesset cavitation model or a User Defined Cavitation Model.
For the Rayleigh Plesset model, the Mean Diameter for cavitation bubbles represents the mean
nucleation site diameter and must be specified. The default value of 2e-06 m is a reasonable value
in most cases. The Saturation Pressure must be defined unless the materials you have selected are
the components of a homogeneous binary mixture. In the latter case, the saturation properties will
already be defined in the mixture definition, but you may still choose to override the Saturation
Pressure by specifying it on the Fluid Pairs tab.
When initializing the domain, set the volume fraction of vapor to zero and the volume fraction of liquid
to unity. These settings (represented by the Automatic setting for Volume Fraction) are used by
default in CFX.
Set up the problem with one of the following boundary condition combinations:
The inlet boundary condition should specify that the volume fraction of vapor is zero.
Turbulence models should be chosen as usual (for example, k-epsilon or SST). For turbulence induced
cavitation, consider using the DES model.
For advection scheme, use high resolution, or a specified blend factor of unity.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
116 of ANSYS, Inc. and its subsidiaries and affiliates.
Liquid Pumps
If editing a material, remember that the vapor pressure is on an absolute scale; it does not depend
on the specified reference pressure.
Cavitation models cannot be combined with other types of interphase mass transfer, such as thermal
phase changes.
If performing a series of simulations using one solution to initialize the next, solve the cases in order
of decreasing pressure (for example, approaching cavitation).
7.2.6. Postprocessing
A contour plot of volume fraction for the vapor can show where cavitation bubbles exist.
To calculate the inlet and outlet pressures, use the function calculator.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 117
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
118 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 8: CFX Best Practices Guide for Combustion
This guide is part of a series that provides advice for using CFX in specific engineering application areas.
It is aimed at users with moderate or little experience using CFX for applications involving combustion.
8.1.1. Setup
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 119
CFX Best Practices Guide for Combustion
For the preliminary analysis of high speed turbulent flow, the Eddy Dissipation combustion model
is a sensible choice, but cannot simulate burning velocities or flame position.
The Laminar Flamelet model is applicable for turbulent flow with non-premixed combustion, and
provides a robust solution at a low computational expense for multi-step reactions. The Flamelet
model uses a chemistry library, meaning that only two additional transport equations are solved
to calculate multiple species. As a result, the Flamelet model is a very good choice for modeling
the formation of various pollutants during the combustion process. The Flamelet model predicts
incomplete combustion to some extent (CO in exhaust gas), which helps to predict reduction in
temperature (unlike EDM).
8.1.2. Reactions
During the initial analysis of a combustor, the highest values of temperature and outgoing heat flux
are likely to be of primary concern. For this purpose, a single-step Eddy Dissipation reaction can be
used. Such a reaction is likely to overpredict the temperature, and will not predict emissions correctly,
but can provide a conservative indicator of the expected temperature levels.
Other reaction steps might then be added to the simulation to account for the formation of combustion
byproducts. Each reaction step has its own separate time scale. As a result, convergence can become
very difficult when a multi-step reaction contains more than about 5 steps.
For the Eddy Dissipation Model, multistep convergence can be aided by first running a simplified
single-step simulation and using the results from the run as an initial values file for a multi-step run.
You may restart a Flamelet model from a cold solution. You should avoid restarting with the Flamelet
model from an EDM solution. You may restart an EDM case from a Flamelet model solution.
The High Resolution advection scheme is always recommended for combustion simulations because
it is bounded and prevents over/undershoots. Care must be taken, however, to provide a mesh of
sufficient quality to resolve most of the flow features. A very poor mesh will result in the scheme using
a blend factor close to zero (therefore not providing a solution as accurate as expected).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
120 of ANSYS, Inc. and its subsidiaries and affiliates.
Combustion Modeling in HVAC Cases
For simulations that include Finite Rate Chemistry, small temperature variations can result in large
changes in reaction rate. When a solution is converging, temperature values may change sufficiently
to make the solution unstable. To aid convergence, add a TEMPERATURE DAMPING CCL structure
within a SOLVER CONTROL block, as follows:
FLOW:
SOLVER CONTROL:
TEMPERATURE DAMPING:
Option = Temperature Damping
Temperature Damping Limit = <Real number>
Under Relaxation Factor = <Real number>
END
END
END
Depending on the location of the SOLVER CONTROL block, the temperature damping may be applied
to a particular domain or phase. Set the Temperature Damping Limit to 0 so that positive
damping is always applied. The Under Relaxation Factor can be set to multiply changes in
temperature by a value between 0 and 1. You should try a factor of 0.2 if you are having trouble
converging a solution.
8.1.4. Postprocessing
Some of the most common plots to create in CFD-Post include:
• Mass Fractions: fuel, O2, products, intermediate species (CO), pollutants (NO)
• Reaction Rates
The variable "<my reaction>.Molar Reaction Rate" is available for every "Single Step" reaction (EDM,
FRC or combined model).
• Plots of the turbulent Damköhler number (the ratio of the turbulent time scale to the chemical time scale)
Using a combusting fire simulation is the most accurate way to model fires in all HVAC cases. It is par-
ticularly important in cases when the fire is under-ventilated, or when the ventilation cannot be easily
predicted. The drawback is the additional computational expense involved in solving a full combustion
model as part of the main solution.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 121
CFX Best Practices Guide for Combustion
8.2.1. Set Up
Most simulations are set up as transient. The choice of timestep is generally model dependent, but
will usually fall into the range 0.5 s to 2 s. The Total Energy heat transfer model should be selected
to fully model buoyancy.
Note:
When modeling buoyancy, it is very important to correctly specify the buoyancy reference
density when opening boundary conditions are used.
The RNG turbulence model is a good choice for combusting flows, with either no buoyancy terms
in equations or buoyancy terms in both the equations (with C3=1). The SST model is also reasonable,
but may not converge well for natural convection. The SSG model is accurate, but convergence may
be very slow.
The most common fuels used are hydrocarbons such as methane, diesel and petroleum. Cellulosic
materials, plastics and wood are also used. The simulation will dictate the type of materials to use as
a fuel.
The Eddy Dissipation Model is widely used, combined with an Additional Variable for toxins. The
flamelet model is more rigorous, and is a better choice when the fire is under ventilated.
The presence of an instantaneous fuel supply is sometimes not physical, and can slow convergence.
In many transient cases, the amount of fuel available can be controlled by using time-dependent
expressions.
8.2.3. Postprocessing
The most common parameters of interest in a combusting fire model are simulation-dependent, but
will usually include one of more of the following:
• Temperature
• Visibility
• Wall Temperature
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
122 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 9: CFX Best Practices Guide for HVAC
This guide discusses best practices for setting up, solving, and postprocessing an HVAC simulation:
9.1. HVAC Simulations
9.2. Convergence Tips
This guide is part of a series that provides advice for using CFX in specific engineering application areas.
It is aimed at users with moderate or little experience using CFX for HVAC1 applications.
• Buoyancy
• Thermal radiation
• Fans/pumps
• Thermostats.
9.1.1.1. Buoyancy
Most HVAC cases involve flow that is affected by buoyancy. Buoyancy can be activated on the Basic
Settings tab of the Domain details view.
Two buoyancy models are available: Full and Boussinesq. These models are automatically selected
according to the properties of the selected fluid(s).
1
HVAC is a reference to Heating, Ventilation (or Ventilating), and Air Conditioning. Often, it is also used as a reference to refrigeration.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 123
CFX Best Practices Guide for HVAC
• The Full buoyancy model is used if fluid density is a function of temperature and/or pressure (which
includes all ideal gases and real fluids). In this case, a Buoyancy Reference Density must be set as the
expected average density of the domain.
• The Boussinesq model is used if fluid density is not a function of temperature or pressure. In this case,
a Buoyancy Reference Temperature must be set as the expected average temperature of the domain.
When fluid properties are functions of pressure, the absolute pressure is used to evaluate them.
The calculation of absolute pressure requires a Buoyancy Reference Location to be defined,
preferably by specifying coordinates.
When modeling fire, it is recommended that you choose a compressible fluid because density
variations will be significant. An incompressible fluid should be chosen only if density variations
are small (a few percent or less).
To set up radiation for a solid domain, visit the Solid Models panel for that domain (each solid
domain must be set up separately). The only radiation model available for solid domains is Monte
Carlo.
Note:
If any solid domain uses the Monte Carlo radiation model (that is, if it uses radiation
at all), then all fluid domains using a radiation model must use the Monte Carlo model.
The material used in a domain that transmits radiation has radiation properties that specify Ab-
sorption Coefficient, Scattering Coefficient, and the Refractive Index. These properties may
be edited in the Materials details view.
Note:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
124 of ANSYS, Inc. and its subsidiaries and affiliates.
HVAC Simulations
Thermal radiation properties are specified on the Boundary Details panel for each boundary of
a domain that transmits radiation. For opaque surfaces, the properties that must be specified are:
Emissivity and Diffuse Fraction. For inlets, outlets, and openings, you may specify either the
Local Temperature or an External Blackbody Temperature.
The Monte Carlo and Discrete Transfer models allow radiation sources to be specified on the
Sources panel for any subdomain or wall boundary. For subdomains, radiation sources per unit
volume are specified; for boundaries, radiation fluxes are specified. Radiation sources may be
directed or isotropic. Multiple isotropic sources and up to one directed source may be specified
for any given wall boundary or subdomain.
Material properties related to radiation, thermal radiation properties for boundaries, and source
strengths can be specified as expressions that depend on one or more of the built-in variables:
Wavelength in Vacuum (or wavelo), Frequency (or freq), Wavenumber in Vacuum (or waveno).
A domain representing an opaque solid should not have a radiation model set. The boundaries
of radiation-transmitting domains that interface with such a solid domain should be specified as
opaque.
External windows of a room can be modeled as solid domains which interface with the room
(air) domain; they may also be modeled as an external boundary of the room domain. In either
case, the exterior boundary must be modeled as an opaque wall. A diffuse and a directed radiation
source emitted from the opaque surface can be used to simulate sunlight. In order to simulate
the motion of the sun, the direction vector for directed radiation can be specified by CEL expres-
sions that depend on time (t). Radiation escaping through a window can be modeled by specifying
a non-zero emissivity (to cause radiation absorption) and either:
• Specifying a heat transfer coefficient via a CEL expression that accounts for the thermal energy lost
When using solid domains that transmit radiation, a spectral radiation model is recommended.
If a simulation contains no solid domains that transmit radiation, a gray radiation model can be
used for rough calculations but a spectral model should be used for more detailed modeling.
Boundaries between domains that model heat transfer have temperatures and thermal fluxes cal-
culated automatically, and should not have thermal boundary conditions specified. External
boundaries (which can represent solids that are not explicitly modeled) require the specification of
a thermal boundary condition.
Boundary conditions other than thermal boundary conditions (for example, wall roughness) may
be specified on the boundaries of a fluid domain that interface with a solid domain.
Sources of thermal energy and/or radiation can be added to a subdomain of a CHT domain.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 125
CFX Best Practices Guide for HVAC
The mesh resolution in a boundary layer affects the prediction of convective heat transfer and the
temperature gradient near the wall. For walls without a specified temperature, the temperature
gradient near the wall affects the calculated wall temperature and, consequently, the amount of
radiation emitted (provided that the emissivity of the wall is non-zero).
9.1.1.5. Fans
Fans should be represented by momentum sources if they are embedded in the domain. Fans can
also be represented by an inlet or outlet boundary condition or both.
9.1.1.6. Thermostats
A Thermostat can be defined using a User Fortran routine. Refer to the HVAC tutorial for details.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
126 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 10: CFX Best Practices Guide for Multiphase
This guide is part of a series that provides advice for using CFX in specific engineering application areas.
It is aimed at users with moderate or little experience using CFX for applications involving multiphase
flows.
In the context of CFX, a multiphase flow is a flow composed of more than one fluid. Each fluid may
possess its own flow field, or all fluids may share a common flow field. Unlike multicomponent flow1,
the fluids are not mixed on a microscopic scale; rather, they are mixed on a macroscopic scale, with a
discernible interface between the fluids. CFX includes a variety of multiphase models to allow the sim-
ulation of multiple fluid streams, bubbles, droplets, and free surface flows.
10.1.1. Setup
The choice of a steady-state or transient simulation depends on the type of simulation you want to
analyze. For example, an analysis using a steady-state simulation is often satisfactory for monitoring
global quantities. A transient simulation can be used to observe transient effects, such as recirculation
zones.
Most bubble columns use two fluids: one continuous fluid and one dispersed fluid. The model
is typically used in the continuous fluid, and the dispersed phase zero equation is used for the dispersed
phase.
Non-drag forces become less significant with increasing size of the bubble column. For smaller
columns, non-drag forces may be significant.
1
Note that a fluid in a multiphase flow may be a multicomponent mixture.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 127
CFX Best Practices Guide for Multiphase
A degassing boundary condition is generally employed at the top of the bubble column. The degassing
boundary behaves as an outlet boundary to the dispersed phase, but as a wall to the continuous
phase.
A reasonable estimate of the time scale is given by a factor of the length of the domain divided by
the velocity scale (for example, 0.5 * L/U).
10.1.3. Postprocessing
The main design objective for bubble columns is efficient mixing, which is strongly influenced by the
dispersed phase. Mixing efficiency can be measured in a number of ways. One example is to measure
the gas hold-up in the riser as a function of the superficial gas velocity. This would require solving
for the gas volume fraction for a number of simulations, each with a different mass flow rate of the
dispersed phase at the sparger. Another option would be to use the same input parameters, this time
measuring the liquid velocity in the downcomer.
10.2.1. Setup
Mixing vessels generally use two domains. The impeller domain is a small, rotating domain that encloses
the impeller. The rest of the tank is represented by a stationary domain. Different types of domain
interfaces are available for the connection between the stationary and the rotating domains. The re-
commended types are:
The choice of a steady-state or transient simulation is dependent on the type of interface that exists
between the two domains. Where a Frozen Rotor interface is used, a steady-state simulation is usually
carried out. Performing a transient simulation allows you to use the transient rotor/stator frame change
model to account for transient effects.
The initial guess for velocity can be set to zero in the relative frame for each domain.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
128 of ANSYS, Inc. and its subsidiaries and affiliates.
Free Surface Applications
10.3.1. Setup
The choice of using a steady-state or transient simulation is problem-dependent. There are two
models available for free surface flow: homogeneous and inhomogeneous. The homogeneous model
can be used when the interface between the two phases remains well defined and none of the dis-
persed phase becomes entrained in the continuous phase. An example of homogeneous free surface
flow is flow in an open channel. A breaking wave is one example of an inhomogeneous flow case.
The same choice of turbulence model as for single phase simulations is appropriate. When using the
inhomogeneous model, you should use the homogeneous turbulence option in CFX-Pre. The Buoyancy
Reference Density should be set to the density of the least dense fluid.
When setting boundary conditions, the volume fractions can be set up using step functions to set
the liquid height at each boundary. An outlet boundary having supercritical flow should use the Su-
percritical option for Mass And Momentum. This requires that you set the relative pressure of the
gas above the free surface at the outlet.
For most free surface applications, the initial conditions can use step functions to set the volume
fractions of the phases as a function of height. The initial condition for pressure should be set to hy-
drostatic conditions for the specified volume fraction initialization and the buoyancy reference
density.
The timestep for free surface flows should be based on a L/U (Length/Velocity) scale. The length scale
should be a geometric length scale. The velocity scale should be the maximum of a representative
flow velocity and a buoyant velocity, which is given by:
In addition, it is sometimes helpful to reduce the timestep for the volume fraction equations by an
order of magnitude below that of the other equations.
A technique to increase the mesh density in the region of a liquid-gas interface is to create a subdomain
that occupies the same region as the liquid (or gas) phase, and inflate the mesh in both directions
from the edge of the subdomain, as shown in Figure 10.1: An exaggerated view of three inflation
layers on each side of the uppermost subdomain boundary surface. (p. 130). The inflation layers can
increase the resolution in the region of the interface and enhance the results.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 129
CFX Best Practices Guide for Multiphase
Figure 10.1: An exaggerated view of three inflation layers on each side of the uppermost
subdomain boundary surface.
• Multiphase flow
In this situation, the default value of 1.0 is converted internally to 0.75. If you override the default with
a smaller value, the new value is also multiplied internally by 0.75.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
130 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 11: CFX Best Practices Guide for Turbomachinery
Turbomachinery applications can generally be divided into three main categories: gas compressors and
turbines, liquid pumps and turbines, and fans and blowers. Each category is discussed in a separate
section below.
This guide is part of a series that provides advice for using CFX in specific engineering application areas.
It is aimed at users with moderate or little experience using CFX for applications involving turboma-
chinery.
The industry-standard Shear Stress Transport model is the recommended choice for these cases. When
using the Shear Stress Transport model, ensure a resolution of the boundary layer of more than 10
points. For details, see The k-omega and SST Models in the CFX-Solver Modeling Guide.
A common boundary condition configuration is to specify the total pressure and total temperature
at the inlet and either the mass flow, exit corrected mass flow, or static pressure at the outlet, depend-
ing on the flow condition. Other configurations are also commonly used.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 131
CFX Best Practices Guide for Turbomachinery
A good estimate of the timestep is within the region to , where is the angular velocity
of the rotating domain in radians per second. Selecting an automatic timestep will result in a timestep
of .
If you have trouble converging a simulation involving real gases, try to obtain a solution first using
an ideal gas. Ideal gases are available in the real gas library.
If you have trouble converging a problem with many stages, you may find that solving for a reduced
number of stages can give you a better understanding of the physics, and may allow you to restart
a multi-stage problem with a better initial guess. You can also try ramping up boundary conditions
and the RPM.
Low pressure ratio Gas compressors (1.1 or less) can be treated more like liquid pumps. For details,
see Liquid Pumps and Turbines (p. 134).
Performance along a speedline is typically measured in terms of a pressure ratio and an efficiency. A
full performance map is obtained by examining the performance across a range of rotation rates; that
is, multiple speedlines. A plot containing multiple speedlines is called the performance map of the
machine. Computing speedlines and performance maps requires many individual computations (one
per mass flow), therefore it is desirable to automate the process.
Depending on the machine type, you can use the following boundary conditions to effectively compute
speedlines:
• For low speed compressors and turbines (subsonic), liquid pumps: Specify Total Pressure and Temper-
ature at the inlet and a Mass Flow Rate condition or a Exit Corrected Mass Flow Rate condition at
the outlet. This enables you to easily vary the mass flow across the full speedline while maintaining
stationary inlet total conditions. For compressors, the specification of the mass flow rate at the outlet
is essential towards the low flow end of a speedline where the machine pressure ratio is insensitive
to the mass flow rate. For this reason, you should not specify a Static Pressure condition at the
outlet boundary for these machines.
• For high speed turbines and compressors (transonic): In these machines, the mass flow through the
system is limited by a choked condition. If the specified exit mass flow exceeds the choke flow rate,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
132 of ANSYS, Inc. and its subsidiaries and affiliates.
Gas Compressors and Turbines
the net mass downstream of the choke condition will decrease until it reaches zero density, causing
the solver to fail. It is therefore important to avoid an exit mass flow near choke.
Similarly, at lower mass flow rates, close to stall, the pressure ratio is either constant or decreas-
ing. A pressure specified outlet is generally unstable in this regime because there are multiple
mass flow rates that may satisfy the outlet condition. Therefore a pressure boundary condition
should be avoided in this range.
This presents a problem with running speedlines using pressure and mass flow conditions,
because neither boundary condition can be used across the entire speedline.
While the exit pressure and mass flow rate may be asymptotic over portions of a speedline,
the exit corrected mass flow remains non-asymptotic and is therefore applicable across the
entire operating range. Thus, it is recommended that you use the Exit Corrected Mass Flow
Rate outlet boundary condition for running speedlines.
Some advantages of using the Exit Corrected Mass Flow Rate outlet boundary condition are:
• It allows you to specify the exit corrected mass flow, which is a function of the outlet mass flow rate, total
conditions, and a user-supplied reference condition.
• It makes it possible to automate the speedline analysis by enabling you to specify one boundary condition
type that functions well across the entire speedline.
• It improves stability when a run is started with poor initial conditions, allowing for the use of a much larger
timescale factor, so that all runs can be started from a simple or automatic initial guess. This allows points
along the speedline to be computed independently rather than using each existing solution to initialize
the next.
• Typically in compressor operations, a fixed value of Exit Corrected Mass Flow Rate represents a fixed
running or “op” line. As a result, you could keep the Exit Corrected Mass Flow Rate boundary condition
fixed and vary the rotational speed to generate the compressor performance along an op line. This is
useful when comparing designs.
For more details on the mathematical treatment of exit corrected mass flow rate as an outlet
boundary condition, see Exit Corrected Mass Flow Rate in the CFX-Solver Theory Guide.
11.1.4. Postprocessing
CFD-Post offers a powerful array of postprocessing tools for turbomachinery applications, including
turbo-specific plots and performance calculation macros. To use many of the Turbo Post tools, you
must first initialize each domain by specifying the locations of turbo regions and instancing information.
The Turbo Calculator from the Turbo menu in CFD-Post allows you to perform calculations on the
type of application you are modeling. The macro prints a report in HTML showing a number of calcu-
lated variables, including torque, head and flow coefficients, blade loading, and efficiency.
You can also create your own macros to customize postprocessing using Power Syntax, which is based
on the Perl language.
The optimal performance characteristics can be determined by creating a curve of pressure ratio
versus flow rate.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 133
CFX Best Practices Guide for Turbomachinery
In Figure 11.1: Flow Rate vs Pressure Rise for a Gas Compressor (p. 134), Region 1 shows an area where
a large change in mass flow rate represents a small change in pressure rise. When modeling flow in
this region, a mass flow rate specified outlet is better than a pressure specified outlet. Region 2 shows
an area where a small change in flow rate represents a large pressure variation. This region is close
to “choking”, and a pressure-specified or exit corrected mass flow rate outlet is the best choice. For
details, see Convergence Tips (p. 132).
The and Shear Stress Transport models are appropriate choices for modeling turbulence. When
using the Shear Stress Transport model, ensure a resolution of the boundary layer of more than 10
points. For details, see The k-epsilon Model in the CFX-Solver Modeling Guide.
When setting boundary conditions, a total pressure specified inlet and a mass flow outlet are a recom-
mended practice. The total pressure inlet condition is often more appropriate than the uniform velocity
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
134 of ANSYS, Inc. and its subsidiaries and affiliates.
Fans and Blowers
or mass flow inlet condition for cases that assume that the machine is drawing fluid directly from a
static reservoir.
As with gas compressors, a good estimate of the timestep is within the region to , where
is the angular velocity of the rotating domain in radians per second. Selecting an automatic timestep
will result in a timestep of .
This document deals with obtaining solutions for cases without cavitation, but cavitation may be
present. For advice on how to deal with cavitation, see CFX Best Practices Guide for Cavitation (p. 113).
11.2.3. Postprocessing
If a total pressure inlet boundary condition is used (recommended where possible), it will also provide
a useful starting point for streamlines that are colored by total pressure during postprocessing. The
uniform total pressure distribution means lines will begin with a uniform color. It may be harder to
visually resolve these pressure values if an inlet velocity profile is used.
Boundary conditions, turbulence models and choice of timestep are the same as for liquid pumps
and turbines.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 135
CFX Best Practices Guide for Turbomachinery
Air foil drag is significant and boundary layer friction is an important modeling issue for fans and
blowers. A good resolution of the boundary layer, requiring a high concentration of nodes close to
the blade surfaces, is therefore important. The Shear Stress Transport model can provide relatively
accurate results where the boundary layer is sufficiently resolved by the mesh.
11.3.3. Postprocessing
A similar postprocessing approach to pumps and turbines is also useful for fans and blowers. For
details, see Postprocessing (p. 135). See the following figure for a plot of flow rate vs pressure rise for
a blower.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
136 of ANSYS, Inc. and its subsidiaries and affiliates.
Domain Interface Setup
The Frozen Rotor model must be used for non-axisymmetric flow domains, such as impeller/volute,
turbine/draft tube, propeller/ship and scroll/volute cases. It can also be used for axial compressors
and turbines. The Frozen Rotor model has the advantages of being robust, using less computer re-
sources than the other frame change models, and being well suited for high blade counts. The
drawbacks of the model include inadequate prediction of physics for local flow values and sensitivity
of the results to the relative position of the rotor and stator for tightly coupled components.
Note:
The dynamic re-intersection of the interface at the start of each time step may result in a
different interface topology, which in turn may require more or less memory. Unlike the
static interfaces (Frozen Rotor, Stage), which are only intersected once (first time step of
a serial run or partitioner in a parallel run), the initial memory estimate might not be suffi-
cient for the whole run. To avoid potential memory problems, it might be necessary to
start the simulation with more conservative (larger) memory factors.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 137
CFX Best Practices Guide for Turbomachinery
• To avoid numerical errors, the aspect ratio of elements on the domain interface should be between 0.1:1
and 10:1, as measured by x/y in Figure 11.2: Element Aspect Ratio at Domain Interface (p. 138).
• Where circular domain interfaces exist, they must be axisymmetric in shape as shown in Figure 11.3: Im-
peller/Volute (p. 138).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
138 of ANSYS, Inc. and its subsidiaries and affiliates.
Domain Interface Setup
Figure 11.4: Possible Domain Interface Positions with Step Change in Passage Height
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 139
CFX Best Practices Guide for Turbomachinery
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
140 of ANSYS, Inc. and its subsidiaries and affiliates.
Domain Interface Setup
As an example, Figure 11.7: Domain Interface Between Blade Rows in an Axial Machine (p. 142) shows
two blade rows of an axial machine with a frozen rotor interface between them. The flow moves from
left to right everywhere except in a small region just downstream of the trailing edge of the first row
of blades. In this case, the domain interface, shown as a dashed line, should be located to the right
of this region, as shown.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 141
CFX Best Practices Guide for Turbomachinery
A transient blade row simulation is also needed for aeromechanical (for example, flutter and forced
response), aerothermodynamic (for example, hot streak analysis) and aeroacoustics analysis.
In general, a transient blade row analysis is more demanding on computer resources than a steady-
state analysis.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
142 of ANSYS, Inc. and its subsidiaries and affiliates.
Transient Blade Row
In general, the transient blade row simulation becomes more efficient on the small sector model with
respect to the full wheel model as the number of blade counts in the original machine increases. For
example, in some cases it is better to do a transient blade row simulation on a full wheel rather than
a reduced geometry with pitch change models if the blade count is very small. Axial machines can
have a large number of blades per row (for example, 100 blades or more) so the cost savings with
transient blade row methods can be very large (of the order of 100x for such a machine). For radial
machines, the blade count is typically much smaller (for example, 5-20 blades) resulting in reduced
potential cost savings for the pitch change models.
The Profile Transformation method can be used for single-stage or multistage machines for all flow
physics including liquids and gases, at any range of Mach number.
The Profile Transformation method can be used on small to moderate pitch-ratio configurations.
There is no formal limit on the pitch ratio for the Profile Transformation method, but the model
error grows proportionally with the pitch ratio between components. For large pitch-ratio modeling,
the error can be minimized by adding more than one blade passage per row to reduce the pitch
ratio of the ensemble.
The Profile Transformation method can also be mixed freely with stage interfaces, as well as with
the Time Transformation method, making it a highly useful and flexible approximation.
For small to moderate pitch ratios (0.75-1.4), usually one blade passage per row is needed. However,
this pitch-ratio range can be substantially reduced for a very low rotation machine. If stability of
the method is reached, then adding a second blade passage may be necessary to regain stability.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 143
CFX Best Practices Guide for Turbomachinery
The Time Transformation method usually reaches periodically established flow regimes after just a
few blade passing periods.
The Time Transformation method does not make any prior assumptions about the main frequencies
involved in the simulation. However, this pitch-change method is only applicable to compressible
flows.
For multistage modeling, the Time Transformation TRS interface can be combined with Profile
Transformation TRS. Sometimes the accuracy provided by the Time Transformation method can
impact performance predictions. For subsonic compressors, the Time Transformation method gives
a more accurate resolution of the surge point, but perhaps gives a similar performance prediction
as Profile Transformation and even steady-state analysis away from stall. For transonic compressors,
the Time Transformation method can give an overall improvement in the accuracy of the performance
map due to the strong interactions between components. This is caused by the shocks interacting
between components. The choked mass flow and the surge point may both change noticeably for
the Time Transformation method compared to Profile Transformation method and steady-state
method.
Time Transformation TRS can be combined with stage interfaces to model multistage turbomachines.
The Fourier Transformation method is capable of modeling both compressible and incompressible
flows. For optimum computational efficiency, it is recommended that you use the Fourier Trans-
formation method when the pitch ratio is too large to be modeled sensibly with the Time Trans-
formation method.
The Fourier Transformation method is the best method to use for blade flutter analysis. The Fourier
Transformation method allows you to specify the nodal diameter (phase shift) for fluttering blade
rows.
A transient blade row simulation with the Fourier Transformation method is more efficient with
respect to the reference solution when the machine has a large number of blades per row. Therefore,
it may not be useful to perform transient blade row simulation with the Fourier Transformation
method on turbomachines with a low blade count.
The Fourier Transformation TRS interface can be combined with stage interfaces to model multistage
turbomachines but can not be combined with Profile Transformation TRS or Time Transformation
TRS interfaces.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
144 of ANSYS, Inc. and its subsidiaries and affiliates.
Transient Blade Row
• Use flow field monitors to check pressure, temperature and velocity variation. The solution is usually
deemed converged when the monitor repeats the same pattern over a common period. Sometimes
local flow field monitors do not show perfect repeatability within a common period due to local flow
instabilities. The Frequency Filtering option was added to the Fourier Transformation model to
avoid instabilities. The setting for enabling frequency filtering is described in Frequency Filtering in
the CFX-Pre User's Guide.
• Use monitors of integrated quantities such as pressure surface loads, stage pressure ratio, or stage
efficiency. Integrated quantity monitors tend to be less influenced by local instabilities and can give
a better sense of the overall solution convergence than local flow field monitors. Monitoring of in-
stantaneous integrated quantities is not recommended for Time Transformation. Instead, you should
monitor integrated quantities using monitor averaging.
• Use monitor averaging to assess the convergence of the periodic monitors. By selecting an appropriate
averaging range, you can monitor the average of the variation to determine if the solution has reached
a transient periodic state.
• Check that the residuals of all equations are converging sufficiently at every time step.
• For time accurate solutions, convergence must be achieved without reaching the maximum number
of coefficient loops. If convergence is not achieved, a mesh issue could be the problem preventing
the solution from converging, requiring a re-examination of the mesh quality.
Also see Using Interrupt Control in Cases with Transient Convergence Behavior in the CFX-Solver
Modeling Guide.
• At the exit use a mass flow boundary from a stall point toward a near-choke point and pressure
boundary from a near-choke point to a deep-choke point.
• Use the exit corrected mass flow rate boundary condition, which enables you to traverse the speed
line without changing the boundary condition type.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 145
CFX Best Practices Guide for Turbomachinery
It is very important to note that a mass flow boundary at the exit should not be used with an in-
compressible flow setting. For a more accurate representation of the pressure field at the outlet of
an axial machine, use a radially distributed pressure profile. If you want to compare a transient
solution obtained from reduced geometry having pitch-change models (for example, Time Trans-
formation or Fourier Transformation) with a solution obtained from a full domain model, then it is
best to select a boundary condition setup that minimizes the differences between the two simula-
tions. Therefore, on the exit boundary it is recommended that you use a pressure profile without
circumferential variation (thus, set Pressure Profile Blend = 1). The pressure profile can
vary radially.
• The flow solution obtained via a time-marching method typically has large frequency content and captures
most of the flow characteristics, particularly when not using any pitch-change approximation. The amount
of frequency content and flow details captured by transient flow are controlled by the true time-step size
or the number of time steps per period.
• For a Harmonic Analysis, the solution contains only the frequency associated with targeted fundamental
frequencies and retained harmonics (see Harmonic Analysis in the CFX-Solver Theory Guide). The targeted
fundamental frequency, such as the blade passing frequency, is usually known in advance. Frequencies
that are not associated with the blade passing frequency are not known before obtaining the HA solution
and therefore will not be captured; they will be filtered out and not be part of the solution.
Additional factors that affect the accuracy and efficiency of the harmonic solution method:
• Number of harmonics retained (M): The more complex the flow features in the transient flow (for example,
sharp discontinuities), the greater the number of harmonics that must be retained in order to resolve the
flow features. Typically, if the flow contains no discontinuity or translating sharp wakes then a single
harmonic is sufficient to resolve the flow. Flow that contains moving discontinuities and/or wakes requires
three to five harmonics to be retained. Of course, the more harmonics that are retained, the more expensive
the Harmonic Analysis becomes, reducing efficiency with respect to a true transient simulation.
• Number of pseudo time steps per period: In order to obtain a harmonic solution quickly, the number of
pseudo-time steps should be minimized. This can be done by increasing the pseudo-time step size or by
lowering the number of pseudo-time steps per period, within limits: an excessively large pseudo-time
step and/or small number of pseudo-time steps per period can adversely affect solution stability. The
number of pseudo-time steps per period should normally be in the range of 15 to 30.
Note:
To properly measure the accuracy and efficiency of the harmonic solution method with
respect to the transient time-marching solution method, it is of paramount importance
that you run the time-marching solution with a sufficient number of time steps per period
(to achieve a time-step-independent solution) and a sufficient number of blade passings
or cycles to reach a fully converged steady-periodic state.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
146 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 12: Best Practices: Scale-Resolving Simulations in ANSYS
CFD
While today’s CFD simulations are mainly based on Reynolds-Averaged Navier-Stokes (RANS) turbulence
models, it is becoming increasingly clear that certain classes of flows are better covered by models in
which all or a part of the turbulence spectrum is resolved in at least a portion of the numerical domain.
Such methods are termed Scale-Resolving Simulation (SRS) models in this paper.
There are two main motivations for using SRS models in favor of RANS formulations. The first reason
for using SRS models is the need for additional information that cannot be obtained from the RANS
simulation. Examples are acoustics simulations where the turbulence generates noise sources, which
cannot be extracted with accuracy from RANS simulations. Other examples are unsteady heat loading
in unsteady mixing zones of flow streams at different temperatures, which can lead to material failure,
or multi-physics effects like vortex cavitation, where the unsteady turbulence pressure field is the cause
of cavitation. In such situations, the need for SRS can exist even in cases where the RANS model would
in principle be capable of computing the correct time-averaged flow field.
The second reason for using SRS models is related to accuracy. It is known that RANS models have their
limitations in accuracy in certain flow situations. RANS models have shown their strength essentially
for wall-bounded flows, where the calibration according to the law-of-the-wall provides a sound
foundation for further refinement. For free shear flows, the performance of RANS models is much less
uniform. There is a wide variety of such flows, ranging from simple self-similar flows such as jets, mixing
layers, and wakes to impinging flows, flows with strong swirl, massively separated flows, and many
more. Considering that RANS models typically already have limitations covering the most basic self-
similar free shear flows with one set of constants, there is little hope that even the most advanced
Reynolds Stress Models (RSM) will eventually be able to provide a reliable foundation for all such flows.
(For an overview of RANS modeling, see Durbin, Pettersson and Reif, 2003 [5] (p. 233); Wilcox, 2006
[39] (p. 235); or Hanjalic and Launder, 2011 [13] (p. 234).)
For free shear flows, it is typically much easier to resolve the largest turbulence scales, as they are of
the order of the shear layer thickness. In contrast, in wall boundary layers the turbulence length scale
near the wall becomes very small relative to the boundary layer thickness (increasingly so at higher Re
numbers). This poses severe limitations for Large Eddy Simulation (LES) as the computational effort re-
quired is still far from the computing power available to industry (Spalart, 1997 [30] (p. 235)). (For an
overview of LES modeling, see Geurts, 2004 [12] (p. 234), and Wagner et al., 2007 [36] (p. 235).) For this
reason, hybrid models are under development where large eddies are resolved only away from walls
and the wall boundary layers are covered by a RANS model. Examples of such global hybrid models
are Detached Eddy Simulation (DES, see Spalart, 2000 [31] (p. 235)) or Scale-Adaptive Simulation (SAS,
see Menter and Egorov, 2010 [18] (p. 234)). More recent developments include the Shielded Detached
Eddy Simulation (SDES) and the Stress-Blended Eddy Simulation (SBES).
A further step is to apply a RANS model only in the innermost part of the wall boundary layer and then
to switch to a LES model for the main part of the boundary layer. Such models are termed Wall-Modeled
LES (WMLES) (for example, Shur et al., 2008 [27] (p. 235)). Finally, for large domains, it is frequently ne-
cessary to cover only a small portion with SRS models, while the majority of the flow can be computed
in RANS mode. In such situations, zonal or embedded LES methods are attractive because they enable
you to specify ahead of time the region where LES is required. Such methods are typically not new
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 147
Best Practices: Scale-Resolving Simulations in ANSYS CFD
models in the strict sense, but enable the combination of existing models/technologies in a flexible
way in different portions of the flowfield. Important elements of zonal models are interface conditions,
which convert turbulence from RANS mode to resolved mode at pre-defined locations. In most cases,
this is achieved by introducing synthetic turbulence based on the length and time scales from the RANS
model.
There are many hybrid RANS-LES models, often with somewhat confusing naming conventions, that
vary in the range of turbulence eddies they can resolve. For a general overview of SRS modeling concepts,
see Fröhlich and von Terzi, 2008 [8] (p. 234), Sagaut et al, 2006 [25] (p. 235).
SRS models are very challenging in their proper application to industrial flows. The models typically
require special attention to various details such as:
• Model selection
• Grid generation
• Numerical settings
• Solution interpretation
• Postprocessing
• Quality assurance
Unfortunately, there is no unique model covering all industrial flows, and each individual model poses
its own set of challenges. In general, when using a CFD code, you must understand the intricacies of
the SRS model formulation in order to be able to select the optimal model and to use it efficiently. This
report is intended to support you in the basic understanding of such models and to provide best
practice guidelines for their usage. The discussion is focused on the models available in the ANSYS CFD
software.
This document is intended as an addition to the code-specific Theory and User Documentation available
for both ANSYS Fluent and ANSYS CFX . The Theory and User Documentation describes in detail how
to select and activate these models, so that information is not repeated here. This document is intended
to provide a general understanding of the underlying principles and the associated limitations of each
of the described modeling concepts. It also covers the types of flows for which the models are suitable
as well as flows where they will likely not work well. Finally, the impact of numerical settings on model
performance is discussed.
In accordance with the intention of providing recommendations for day-to-day work, several appendices
can be found at the end of this document for quick reference of the most important points.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
148 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
• Combination of all RANS models with all non-dynamic LES models (Fluent)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 149
Best Practices: Scale-Resolving Simulations in ANSYS CFD
modeled entirely by the RANS model and only the slow super-imposed motion is resolved in time. A
borderline case for this scenario is the flow over bluff bodies, like a cylinder in crossflow. For such
flows, the URANS simulation provides unsteady solutions even without an independent external forcing.
The frequency of the resulting vortex shedding is not necessarily much lower than the frequencies
of the largest turbulent scales. This scenario is depicted in Figure 12.1 (p. 150), which shows that URANS
models (in this case SST) produce a single mode vortex shedding even at a relatively high number
of . The vortex stream extends far into the cylinder wake, maintaining a single frequency. This
result is in contradiction to experimental observations of a broadband turbulence spectrum.
As shown in a series of publications (for example, Menter and Egorov, 2010 [18] (p. 234), Egorov et
al., 2010 [6] (p. 233)), a class of RANS models can be derived based on a theoretical concept dating
back to Rotta (see Rotta, 1972 [24] (p. 235)). These models perform like standard RANS models in
steady flows, but enable the formation of a broadband turbulence spectrum for certain types of un-
stable flows (for the types of flows, see Section 12.2 (p. 170)). Such models are termed Scale-Adaptive
Simulation (SAS) models. This scenario is illustrated by Figure 12.2 (p. 150), which shows the same
simulation as in Figure 12.1 (p. 150) but with the SAS-SST model. The behavior seen in Figure 12.1 (p. 150)
is therefore not inherent to all RANS models, but only to those derived in a special fashion.
Figure 12.1: URANS computations of a flow past a circular cylinder (SST model)
Figure 12.2: SAS simulation of flow past a circular cylinder (SAS-SST model)
The SAS concept is described in much detail in the cited references and will not be repeated here.
However, the basic model formulation must be provided for a discussion of the model’s characteristics.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
150 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
The difference between standard RANS and SAS models lies in the treatment of the scale-defining
equation (typically -, -, or -equation). In classic RANS models, the scale equation is modeled
based on an analogy with the -equation using simple dimensional arguments. The scale equation
of SAS models is based on an exact transport equation for the turbulence length scale as proposed
by Rotta. This method was re-visited by Menter and Egorov, 2010 [18] (p. 234) and avoids some limit-
ations of the original Rotta model. As a result of this re-formulation, it was shown that the second
derivative of the velocity field must be included in the source terms of the scale equation. The original
SAS model (Menter and Egorov, 2010 [18] (p. 234)) was formulated as a two-equation model, with the
variable for the scale equation:
(12.1)
(12.2)
(12.3)
The main new term is the one including the von Karman length scale , which does not appear in
any standard RANS model. The second velocity derivative allows the model to adjust its length scale
to those structures already resolved in the flow. This functionality is not present in standard RANS
models. This leads to the behavior shown in Figure 12.2 (p. 150), which agrees more closely with the
experimental observations for such flows.
The term can be transformed and implemented into any other scale-defining equation resulting
in SAS capabilities as in the case of the SAS-SST model. For the SAS-SST model, the additional term
in the -equation resulting from the transformation has been designed to have no (or at least min-
imal) effect on the SST model’s RANS performance for wall boundary layers. It can have a moderate
effect on free shear flows (Davidson, 2006 [4] (p. 233)).
The SAS model will remain in steady RANS mode for wall bounded flows, and can switch to SRS mode
in flows with large and unstable separation zones (see Section 12.2 (p. 170)).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 151
Best Practices: Scale-Resolving Simulations in ANSYS CFD
mode. The formulation is mathematically relatively simple and can be built on top of any RANS tur-
bulence model. DES has attained significant attention in the turbulence community as it was the first
SRS model that allowed the inclusion of SRS capabilities into common engineering flow simulations.
Within DES models, the switch between RANS and LES is based on a criterion like the following:
(12.4)
where is the maximum edge length of the local computational cell. The actual formulation for
a two-equation model (for example, the -equation of the model) is:
(12.5)
(12.6)
As the grid is refined below the limit the DES-limiter is activated and switches the model
from RANS to LES mode. For wall boundary layers, this translates into the requirement that the RANS
formulation is preserved as long as the following condition holds: , where is the boundary
layer thickness. The intention of the model is to run in RANS mode for attached flow regions, and to
switch to LES mode in detached regions away from walls. This switch suggests that the original DES
formulation, as well as its later versions, require a grid and time step resolution to be of LES quality
once they switch to the grid spacing as the defining length scale. Once the limiter is activated, the
models lose their RANS calibration and all relevant turbulence information must be resolved. For this
reason, for example in free shear flows, the DES approach offers no computational savings over a
standard LES model. However, it allows you to avoid the high computing costs of covering the wall
boundary layers in LES mode.
It is also important to note that the DES limiter can already be activated by grid refinement inside
attached boundary layers. This is undesirable as it affects the RANS model by reducing the eddy vis-
cosity; this can lead to Grid-Induced Separation (GIS), as discussed by Menter and Kuntz, 2002
[19] (p. 234), where the boundary layers can separate at arbitrary locations depending on the grid
spacing. In order to avoid this limitation, the DES concept has been extended to Delayed-DES (DDES)
by Spalart et al., 2006 [32] (p. 235), following the proposal of Menter and Kuntz, 2002 [19] (p. 234) of
“shielding” the boundary layer from the DES limiter. The DDES extension was also applied to the DES-
SA formulation resulting in the DDES-SA model, as well as to the SST model giving the DDES-SST
model.
For two-equation models, the dissipation term in the -equation is thereby re-formulated as follows:
(12.7)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
152 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
(12.8)
The function is designed in such a way as to give inside the wall boundary layer and
away from the wall. The definition of this function is intricate as it involves a balance between
proper shielding and not suppressing the formation of resolved turbulence as the flow separates
from the wall. As the function blends over to the LES formulation near the boundary layer
edge, no perfect shielding can be achieved. The limit for DDES is typically in the range of
and therefore allows for meshes where is a factor of five smaller than for DES, without negative
effects on the RANS-covered boundary layer. However, even this limit is frequently reached and GIS
can appear even with DDES.
There are a number of DDES models available in ANSYS CFD. They follow the same principal idea
with respect to switching between RANS and LES mode. The models differ therefore mostly by their
RANS capabilities and should be selected accordingly.
(12.9)
The shielding function provides much stronger shielding than the corresponding function
above. For this reason, the natural shielding of the model based on the mesh length definition, ,
can be reduced. The mesh length scale used in the SDES model is defined as follows:
(12.10)
The first part represents the conventional LES grid length scale definition, and the second part is
again based on the maximum edge length as in the DES formulation. However, the factor 0.2 ensures
that for highly stretched meshes, the grid length scale is a factor of 5 smaller than for DES/DDES.
Since the grid length scale enters quadratically into the definition of the eddy viscosity in LES mode,
this means a reduction by a factor of 25 in such cases. It will be shown that this drastically reduces
the frequently observed problem of slow ‘transition’ of DES/DDES models from RANS to LES. Note
that the combination of this more ‘aggressive’ length scale with the conventional DDES shielding
function would severely reduce the shielding properties of DDES and is therefore not recommended.
The SDES constant is also different from in the DES/DDES formulation, where it is calibrated
based on decaying isotropic turbulence (DIT) with the goal of matching the turbulence spectrum re-
lative to data after certain running times. However, in engineering flows, one typically has to deal
with shear flows, for which a reduced Smagorinsky constant should be used. This is achieved by setting
=0.4. The combination of the re-definition of the grid length scale and the modified constant
leads to a reduction in the eddy viscosity by a factor of around 60 in separating shear flows on
stretched grids. It will be shown later that this results in a much more rapid transition from RANS to
LES.
The shielding function is formulated such that it provides essentially asymptotic shielding on any
grid. In flat plate tests, the limit was pushed below .
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 153
Best Practices: Scale-Resolving Simulations in ANSYS CFD
The following test case shows the improved shielding properties of SDES/SBES models relative to
DDES. The flow is a diffuser flow in an axisymmetric geometry featuring a small separation bubble.
Due to the adverse pressure gradient, the boundary layer grows strongly and shielding is difficult to
achieve due to the strong increase in .
The computational domain is shown in Figure 12.3: The domain and grid for the separated flow in
CS0 diffuser (p. 154). The length of the domain in the streamwise direction is about 7.8· [m] ( is
the diameter of the cylinder and corresponds to the separation point in the experiment). For
this flow, a standard RANS grid is used with steps in the streamwise and circumferential directions
of and respectively (the grid step in the circumferential direction is
changing in the radial direction due to the axisymmetric geometry). Here is the boundary
layer thickness at the inlet section. The height of the wall cell is chosen to satisfy the condition
in the entire domain and around 30 cells cover the boundary layer.
Figure 12.3: The domain and grid for the separated flow in CS0 diffuser
As seen from the contours of the SBES and DDES blending functions shown in Figure 12.4: Contours
of blending functions overset by vorticity iso-lines for CS=0 diffuser for SBES and DDES models (p. 155),
SBES covers the entire boundary layer including the rapid growth area of the boundary layer due to
the separation bubble, while DDES preserves only the portion of the domain at the inlet. This means
that under adverse pressure gradient conditions, the shielding properties of DDES are substantially
impaired.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
154 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
Figure 12.4: Contours of blending functions overset by vorticity iso-lines for CS=0 diffuser for
SBES and DDES models
Similar observations can be made for the eddy viscosity fields shown in Figure 12.5: Contours of eddy
viscosity ratio for CS0 diffuser for SBES and DDES models (p. 156). The eddy viscosity levels of SBES
correspond to those of the SST model (not shown), while the DDES model produces much reduced
levels in the adverse pressure gradient region.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 155
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.5: Contours of eddy viscosity ratio for CS0 diffuser for SBES and DDES models
where is the RANS part and is the LES part of the modeled stress tensor. In case both
model portions are based on eddy-viscosity concepts, the formulation simplifies to:
(12.12)
Such a formulation would not be feasible without strong shielding. When using the conventional
shielding functions from the DDES model, the corresponding model would not be able to maintain
a zero pressure gradient RANS boundary layer on any grid.
The SBES model formulation is currently recommended relative to other global hybrid RANS-LES
methods. It offers the following advantages:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
156 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
(12.13)
The main deficiency of the Smagorinsky model is that its eddy-viscosity does not go to zero for lam-
inar shear flows (only ). For this reason, this model also requires a near-wall damping
function in the viscous sublayer. It is desirable to have a LES formulation that automatically provides
zero eddy-viscosity for simple laminar shear flows. This is especially important when computing flows
with laminar turbulent transition, where the Smagorinsky model would negatively affect the laminar
flow. The simplest model to provide this functionality is the WALE (Wall-Adapting Local Eddy-viscosity)
model of Nicoud and Ducros, 1999 [22] (p. 234). The same effect is also achieved by dynamic LES
models, but at the cost of a somewhat higher complexity. None of the classical LES models addresses
the main industrial problem of excessive computing costs for wall-bounded flows at moderate to
high Reynolds numbers.
There are numerous cases at very low Reynolds numbers where LES can be an industrial option. Under
such conditions, the wall boundary layers are likely laminar and turbulence forms only in separated
shear layers and detached flow regions. Such situations can be identified by analyzing RANS eddy
viscosity solutions for a given flow. In the case where the ratio of turbulence to molecular viscosity
is smaller than inside the boundary layer, it can be assumed that the boundary
layers are laminar and no resolution of near-wall turbulence is required. Such conditions are observed
for flows around valves or other small-scale devices at low Reynolds numbers.
LES can also be applied to free shear flows, where resolution requirements are much reduced relative
to wall-bounded flows.
LES is based on filtering the Navier-Stokes equations over a finite spatial region (typically the grid
volume) and aimed at only resolving the portions of turbulence larger than the filter width. Turbu-
lence structures smaller than the filter are then modeled, typically by a simple Eddy Viscosity
model.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 157
Best Practices: Scale-Resolving Simulations in ANSYS CFD
(12.14)
where is the spatial filter. Filtering the Navier-Stokes equations results in the following form
(density fluctuations neglected):
(12.15)
The equations feature an additional stress term due to the filtering operation:
(12.16)
Despite the difference in derivation, the additional sub-grid stress tensor is typically modeled as in
RANS using an eddy viscosity model:
(12.17)
The important practical implication from this modeling approach is that the modeled momentum
equations for RANS and LES are identical if an eddy-viscosity model is used in both cases. The
modeled Navier-Stokes equations have no knowledge of their derivation. The only information they
obtain from the turbulence model is the level of the eddy viscosity. Depending on that, the equations
will operate in RANS or LES mode (or in some intermediate mode). The formal identity of the filtered
Navier-Stokes and the RANS equations is the basis of hybrid RANS-LES turbulence models, which
can obviously be introduced into the same set of momentum equations. Only the model (and the
numerics) have to be switched.
Classical LES models are of the form of the Smagorinsky, 1963 [29] (p. 235) model:
(12.18)
where is a measure of the grid spacing of the numerical mesh, is the strain rate scalar and
is a constant. This is obviously a rather simple formulation, indicating that LES models will not
provide a highly accurate representation of the smallest scales. From a practical standpoint, a very
detailed modeling might not be required. A more appropriate goal for LES is not to model the impact
of the unresolved scales onto the resolved ones, but to model the dissipation of the smallest resolved
scales. This can be seen from Figure 12.6 (p. 159) showing the turbulence energy spectrum of a
Decaying Isotropic Turbulence (DIT) test case; that is, initially stirred turbulence in a box, decaying
over time (Comte-Bellot and Corrsin, 1971 [3] (p. 233)). is the turbulence energy as a function
of wave number . Small values represent large eddies and large values represent small eddies.
Turbulence moves down the turbulence spectrum from the small wave number to the high wave
numbers. In a fully resolved simulation (Direct Numerical Simulation, or DNS), the turbulence is
dissipated into heat at the smallest scales ( in Figure 12.6 (p. 159)), by viscosity. The dissipation
is achieved by:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
158 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
(12.19)
where is typically a very small kinematic molecular viscosity. The dissipation is still of finite
value as the velocity gradients of the smallest scales are very large.
LES computations are usually performed on numerical grids that are too coarse to resolve the
smallest scales. In the current example, the cut-off limit of LES (resolution limit) is at around .
The velocity gradients of the smallest resolved scales in LES are therefore much smaller than those
at the DNS limit. The molecular viscosity is then not sufficient to provide the correct level of dissip-
ation. In this case, the proper amount of dissipation can be achieved by increasing the viscosity,
using an eddy-viscosity:
(12.20)
The eddy viscosity is calibrated to provide the correct amount of dissipation at the LES grid limit.
The effect can be seen in Figure 12.6 (p. 159), where a LES of the DIT case is performed without a
LES model and with different LES models. When the LES models are activated, the energy is dissipated
and the models provide a sensible spectrum for all resolved scales. LES is not modeling the influence
of unresolved small scale turbulence onto the larger, resolved scales, but the dissipation of turbulence
into heat (the dissipated energy is typically very small relative to the thermal energy of the fluid
and does not have to be accounted for, except for high Mach number flows).
Figure 12.6: Turbulence spectrum for DIT test case after t=2. Comparison of results without
Sub-Grid Scale model (no LES) with WALE and Smagorinsky LES model simulations
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 159
Best Practices: Scale-Resolving Simulations in ANSYS CFD
This discussion shows that LES is a fairly simple technology, which does not provide a reliable
backbone for modeling. This is also true for more complex LES models like dynamic models. Dynamic
eddy viscosity LES models (see Geurts, 2004 [12] (p. 234)) are designed to estimate the required
level of dissipation at the grid limit from flow conditions at larger scales (typically twice the filter
width), thereby reducing the need for model calibration. Such models, however, also only provide
a suitable eddy viscosity level for energy dissipation. As a result, within the LES framework, all features
and effects of the flow that are of interest and relevance to engineers have to be resolved in space
and time. This requirement makes LES a very CPU-expensive technology.
Even more demanding is the application of LES to wall-bounded flows, which is the typical situation
in engineering flows. The turbulent length scale, , of the large eddies can be expressed as:
(12.21)
where is the wall distance and a constant. Even the (locally) largest scales become very small
near the wall and require a high resolution in all three space dimensions and in time.
The linear dependence of on indicates that the turbulence length scales approach zero near
the wall, which would require an infinitely fine grid to resolve them. This is not the case in reality,
as the molecular viscosity prevents scales smaller than the Kolmogorov limit. This is manifested by
the viscous or laminar sublayer, a region very close to the wall, where turbulence is damped and
does not need to be resolved. However, the viscous sublayer thickness is a function of the Reynolds
number, Re, of the flow. At higher Re numbers, the viscous sublayer becomes decreasingly thinner
and thereby allows the survival of smaller and smaller eddies, which need to be resolved. This is
depicted in Figure 12.7 (p. 161) showing a sketch of turbulence structures in the vicinity of the wall
(for example, channel flow with flow direction normal to observer). The upper part of the picture
represents a low Re number and the lower part a higher Re number situation. The gray box indicates
the viscous sublayer for the two Re numbers. The structures inside the viscous sublayer (circles inside
the gray box) are depicted but not present in reality due to viscous damping. Only the structures
outside of the viscous sublayer (that is, above the gray box) exist and need to be resolved. Due to
the reduced thickness of the viscous sublayer in the high Re case, substantially more resolution is
required to resolve all active scales. Wall-resolved LES is therefore prohibitively expensive for
moderate to high Reynolds numbers. This is the main reason why LES is not suitable for most en-
gineering flows.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
160 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
Figure 12.7: Sketch of turbulence structures for wall-bounded channel flow with viscous
sublayer (a) Low Re number (b) High Re number (Grey area: viscous sublayer)
The Reynolds number dependence of wall-resolved LES can be estimated for a simple periodic
channel flow as shown in Figure 12.8 (p. 161) ( -streamwise, -wall-normal, -spanwise, is the
channel height).
(12.22)
(12.23)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 161
Best Practices: Scale-Resolving Simulations in ANSYS CFD
where is the non-dimensional grid spacing in the streamwise direction, in the spanwise
and the number of cells across half of the channel height. With the definitions:
(12.24)
one can find the number, of cells required as a function of , for resolving this
limited domain of simple flow (see Table 12.1 (p. 162)).
(12.25)
(For the practitioner: the Reynolds, , number based on the bulk velocity is around a factor of ten
larger than the Reynolds number, , based on friction velocity. Note that is based on ).
The number of cells increases strongly with number, demanding high computing resources
even for very simple flows. The CPU power scales even less favorably, as the time step must also
be reduced to maintain a constant CFL number ( ).
The Re number scaling for channel flows could be reduced by the application of wall functions
with increasing values for higher numbers. However, wall functions are a strong source of
modeling uncertainty and can undermine the overall accuracy of simulations. Furthermore, the
experience with RANS models shows that the generation of high quality wall-function grids for
complex geometries is a very challenging task. This task is even more challenging for LES applications,
where you would have to control the resolution in all three space dimensions to conform to the
LES requirements (for example, and then depend on ).
For external flows, there is an additional Re number effect resulting from the relative thickness of
the boundary layer (for example, boundary layer thickness relative to chord length of an airfoil). At
high Re numbers, the boundary layer becomes very thin relative to the body’s dimensions. Assuming
a constant resolution per boundary layer volume, Spalart et al., 1997 [30] (p. 235), 2000 [31] (p. 235)
provided estimates of computing power requirements for high Reynolds number aerodynamic
flows under the most favorable assumptions. Even then, the computing resources are excessive
and will not be met even by optimistic estimates of computing power increases for several decades,
except for simple flows.
While the computing requirements for high Re number flows are dominated by the relatively thin
boundary layers, the situation for low Re number technical flows is often equally unfavorable, as
effects such as laminar-turbulent transition dominate and need to be resolved. Based on reduced
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
162 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
geometry simulations of turbomachinery blades (see Michelassi, 2003 [20] (p. 234)), an estimate for
a single turbine blade with end-walls is given in Table 12.2 (p. 163).
Table 12.2: Computing power estimate for a single turbomachinery blade with end-walls
Considering that the goal of turbomachinery companies is the simulation of entire machines (or at
least significant parts of them), it is unrealistic to assume that LES will become a major element of
industrial CFD simulations even for such low Re number ( ) applications. However, LES can
play a role in the detailed analysis of elements of such flows like cooling holes or active flow control.
All the above does not mean that LES of wall-bounded flows is not feasible at all, but just that the
costs of such simulations are high. Figure 12.9 (p. 164) shows the grid used for a LES around a NACA
0012 airfoil using the WALE model. The computational domain is limited in the spanwise direction
to 5% of the airfoil chord length using periodic boundary conditions in that direction. At a Reynolds
number of a spanwise extent of 5% has been estimated as the minimum domain size
that allows turbulence structures to develop without being synchronized across the span by the
periodic boundary conditions. The estimate was based on the boundary layer thickness at the
trailing edge as obtained from a precursor RANS computation. This boundary layer thickness is
about 2% chord length. The grid had 80 cells in the spanwise direction and overall cells.
The simulation was carried out at an angle of attack of , using ANSYS Fluent in incompressible
mode. The chord length was set to , the freestream velocity, and the
fluid is air at standard conditions. The time step was set to giving a Courant
number of inside the boundary layer. Figure 12.10 (p. 165) shows turbulence structures
near the leading edge (a) and the trailing edge (b). Near the leading edge, the laminar-turbulent
transition can clearly be seen. The transition is triggered by a laminar separation bubble. Near the
trailing edge, the turbulence structures are already relatively large, but still appear unsynchronized
in the spanwise direction (no large scale 2D structures with axis orientation in the spanwise direction).
The simulation was run for ~104 time steps before the averaging procedure was started. The time
averaging was conducted for time steps. Figure 12.11 (p. 165) shows a comparison of the
wall pressure coefficient and Figure 12.12 (p. 166) of the wall shear stress coefficient on the
suction side of the airfoil in comparison to a RANS computation using the SST model (Menter, 1994
[16] (p. 234)). No detailed discussion of the simulation is intended here, but the comparison of the
wall shear stress with the well-calibrated RANS model indicates that the resolution of the grid is
still insufficient for capturing the near-wall details. For this reason, the wall shear stress is significantly
underestimated by about 30% compared to the SST model in the leading edge area. As the trailing
edge is approached, the comparison improves, mainly because the boundary layer thickness is in-
creased whereas the wall shear stress is decreased, which produces a higher relative resolution in
the LES. Based on this simulation, it is estimated that a refinement by a factor of 2, in both
streamwise and spanwise directions, would be required in order to reproduce the correct wall shear
stress. While such a resolution is not outside the realm of available computers, it is still far too high
for day-to-day simulations.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 163
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.9: Details of grid around a NACA 4412 airfoil (a) Grid topology (b) Leading edge
area (c) Trailing edge area
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
164 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
Figure 12.10: Turbulence structures of WALE LES computation around a NACA 4412 airfoil (a)
Leading edge (b) Trailing edge (Q-criterion, color- spanwise velocity component)
Figure 12.11: Wall pressure coefficient Cp on the suction side of a NACA 4412 airfoil:
comparison of RANS-SST and LES-WALE results
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 165
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.12: Wall shear stress coefficient Cf on the suction side of a NACA 4412 airfoil:
comparison of RANS-SST and LES-WALE results
Overall, LES for industrial flows will be restricted in the foreseeable future to flows not involving
wall boundary layers, or wall-bounded flows in strongly reduced geometries, preferentially at low
Re numbers.
The limitations of the conventional LES approach are the driving force behind the development of
hybrid RANS-LES models that are described in the later parts of this report.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
166 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
Figure 12.13: Concept of WMLES for high Re number flows (a) Wall-resolved LES. (b) WMLES
The WMLES formulation in ANSYS CFD is based on the formulation of Shur et al., 2008 [27] (p. 235):
(12.26)
where is the wall distance, is the von Karman constant, is the strain rate and is a near-wall
damping function. This formulation was adapted to suit the needs of the ANSYS general purpose
CFD codes. Near the wall, the min-function selects the Prandtl mixing length model whereas away
from the wall it switches over to the Smagorinsky model. Meshing requirements for the WMLES ap-
proach are given in Section 12.2.3.3 (p. 196).
For wall boundary layer flows, the resolution requirements of WMLES depend on the details of the
model formulation. In ANSYS Fluent and ANSYS CFX they are (assuming for this estimate that is
the streamwise, the wall normal and the spanwise direction as shown in Figure 12.14 (p. 168)):
(12.27)
where , , and are the numbers of cells per boundary layer thickness, , in the streamwise,
wall normal, and spanwise directions respectively, (see Figure 12.14 (p. 168)). About 6000-8000 cells
are needed to cover one boundary layer volume . This is also the minimal resolution for clas-
sical LES models at low Reynolds numbers. Actually, for low Reynolds numbers, WMLES turns essentially
into classical LES. The advantage of WMLES is that the resolution requirements relative to the
boundary layer thickness remain independent of the Reynolds number.
While WMLES is largely Reynolds number-independent for channel and pipe flows (where the
boundary layer thickness must be replaced by half of the channel height) there remains a Reynolds
number sensitivity for aerodynamic boundary layer flows, where, the ratio of the boundary layer
thickness, , to a characteristic body dimension, , is decreasing with increasing Reynolds number.
In aerodynamic boundary layer flows, there are more boundary layer volumes to consider at increased
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 167
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Reynolds numbers. It should also be noted that despite the large cost savings of WMLES compared
to wall-resolved LES, the cost increase relative to RANS models is still substantial. Typical RANS com-
putations feature only one cell per boundary layer thickness in streamwise and spanwise directions
( ). In addition, RANS steady-state simulations can be converged in the order of ~102–103
iterations, whereas unsteady simulations typically require ~104–105.
For wall-normal resolution in WMLES, it is recommended that you use grids with at the
wall. If this cannot be achieved, the WMLES model is formulated to tolerate coarser values
( -insensitive formulation) as well.
Figure 12.14: Sketch of boundary layer profile with thickness , x-streamwise direction, y-normal
direction, and z-spanwise direction
For channel and pipe flows, the above resolution requirements for the boundary layer should be ap-
plied, only replacing the boundary layer thickness, , with half the channel height, or with the pipe
radius in the grid estimation. This estimate would result in a minimum of ~120 cells in the circumfer-
ential direction ( ) for a fully developed pipe flow.
It should be noted that reductions in grid resolution similar to WMLES can be achieved with classical
LES models when using LES wall functions. However, the generation of suitable grids for LES wall
functions is very challenging as the grid spacing normal to the wall and the wall-parallel grid resolution
requirements are coupled and strongly dependent on number (unlike RANS where only the wall-
normal resolution must be considered).
In ANSYS Fluent, the WMLES formulation can be selected as one of the LES options; in ANSYS CFX it
is always activated inside the LES zone of the Zonal Forced LES (ZFLES) method.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
168 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulation (SRS) Models – Basic Formulations
In ANSYS Fluent, an Embedded LES formulation is available (Cokljat et al., 2009 [2] (p. 233)). It allows
the combination of most RANS models with all non-dynamic LES models in the predefined RANS and
LES regions respectively. The conversion from modeled turbulence to resolved turbulence is achieved
at the RANS-LES interface using the Vortex Method (Mathey et al., 2003 [15] (p. 234)).
In CFX, a similar functionality is achieved using a method called Zonal Forced LES (ZFLES) (Menter et
al., 2009 [17] (p. 234)). The simulation is based on a pre-selected RANS model. In a LES zone, specified
via a CEL expression, forcing terms in the momentum and turbulence equations are activated. These
terms push the RANS model into a WMLES formulation. In addition, synthetic turbulence is generated
at the RANS-LES interface,
There is an additional option in ANSYS Fluent that involves using a global turbulence model (SAS,
DDES, SDES, SBES), and activates the generation of synthetic turbulence at a pre-defined interface.
The code takes care of balancing the resolved and modeled turbulence through the interface. This
option can be used to force global hybrid models into unsteadiness for cases where the natural flow
instability is not sufficient. Unlike ELES, the same turbulence model is used upstream and downstream
of the interface. In ELES, different models are used in different zones on opposite sides of the interface.
Such forcing can also be achieved in ANSYS CFX by specifying a thin LES region and using the SAS
or SBES model globally. The SBES model is most suitable for this scenario.
In most practical cases, the geometry does not enable fully periodic simulations. It can however feature
fully developed profiles at the inlet (again typically pipe/channel flows). In such cases, you can perform
a periodic precursor simulation on a separate periodic domain and then insert the unsteady profiles
obtained at any cross-section of that simulation to the inlet of the complex CFD domain. This approach
requires either a direct coupling of two separate CFD simulations or the storage of a sufficient number
of unsteady profiles from the periodic simulation to be read in by the full simulation.
In a real situation, however, the inlet profiles might not be fully developed and no simple method
exists for producing consistent inlet turbulence. In such cases, synthetic turbulence can be generated,
based on given inlet profiles from RANS. These are typically obtained from a precursor RANS compu-
tation of the domain upstream of the LES inlet.
There are several methods for generating synthetic turbulence. In ANSYS Fluent, the most widely
used method is the Vortex Method (VM) (see Mathey et al., 2003 [15] (p. 234)), where a number of
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 169
Best Practices: Scale-Resolving Simulations in ANSYS CFD
discrete vortices are generated at the inlet. Their distribution, strength, and size are modeled to
provide the desirable characteristics of real turbulence. The input parameters to the VM are the two
scales (k and or k and ) from the upstream RANS computation. CFX uses the generation of syn-
thetic turbulence through suitable harmonic functions as an alternative to the VM (see Menter et al.,
2009 [17] (p. 234)).
The characteristic of high-quality synthetic turbulence in wall-bounded flows is that it recovers the
time-averaged turbulent stress tensor quickly downstream of the inlet. This can be checked by plotting
sensitive quantities like the time-averaged wall shear stress or heat transfer coefficient and observing
their variation downstream of the inlet. It is also advisable to investigate the turbulence structures
visually by using, for example, an isosurface of the -criterion, (where is the Strain
rate, and is the vorticity rate). This can be done even after a few hundred time steps into the sim-
ulation.
Because synthetic turbulence never coincides in all aspects with true turbulence, you should avoid
putting an inlet/interface at a location with strong non-equilibrium turbulence activity. In boundary
layer flows, that means that the inlet or RANS-LES interface should be located several (at least 3-5)
boundary layer thicknesses upstream of any strong non-equilibrium zone (such as a separation). The
boundary layers downstream of the inlet/interface need to be resolved with a sufficiently high spatial
resolution (see Section 12.2.3.3 (p. 196)).
From a physical standpoint, such flows are characterized by the formation of new turbulence
downstream of the body. This turbulence is independent from, and effectively overrides, the turbu-
lence coming from the thin, attached boundary layers around the body. The turbulence in the at-
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
170 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
tached boundary layers has very little effect on the turbulence in the separated zone. The attached
boundary layers can, however, define the separation point/line on a smoothly curved body and so
affect the size of the downstream separation zone. This effect can be tackled by a suitable underlying
RANS model.
Typical members of this family of flows are given in the list below. Such flows are very common in
engineering applications and are also the type of flows where RANS models can exhibit a significant
deterioration of their predictive accuracy.
– Baffles in mixers
– Stalled wings/sails
– Re-entry vehicles
– Trains/trucks/cars in crossflow
– Cavities
– Flows with large separation zones (relative to attached boundary layer thickness)
– Impinging/colliding jets
– Jets in crossflow
The color scheme of the preceding points above identifies flows that are clearly within the definition
of globally unstable flows (black) and those where the type of the flow depends on details of its
regime/geometry (gray). Such flows fall in-between globally and locally unstable flows (see Sec-
tion 12.2.2 (p. 182)).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 171
Best Practices: Scale-Resolving Simulations in ANSYS CFD
12.2.1.2. Modeling
Of all flows where SRS modeling is required, globally unstable flows are conceptually the easiest
to handle. Typically they can be captured by a global RANS-LES model such as SAS, DDES, SDES,
or SBES. Such models cover the attached and mildly separated boundary layers in RANS mode,
thereby avoiding the high costs of resolving wall turbulence. Due to the strong flow instability past
the separation line, there is no need for specifying unsteady inlet turbulence nor to define specific
LES zones. Globally unstable flows are also the most beneficial for SRS, as experience shows that
RANS models can fail with significant margins of error for such flows. A large number of industrial
flows fall into this category.
The safest SRS model for such flows is the SAS approach. It offers the advantage that the RANS
model is not affected by the grid spacing and thereby avoids the potential negative effects of
(D)DES-type models (gray zones or grid induced separation). The SAS concept reverts back to
(U)RANS in case the mesh/time step is not sufficient for LES and thereby preserves a backbone of
modeling that is independent of space and time resolution, though at the increased cost that is
associated with any transient SRS calculation. SAS also avoids the need for shielding, which for in-
ternal flows with multiple walls can suppress turbulence formation in DDES models.
The alternatives to SAS are DDES, SDES, and SBES. If proper care is taken to ensure LES mesh
quality in the detached flow regions, these models will be operating in the environment for which
they were designed, typically providing high-quality solutions. DDES has shown advantages for
flows at the limit of globally unstable flows (see Figure 12.52 (p. 212)) where the SAS model can
produce URANS-like solutions. In cases like these, DDES still provides SRS in the separated regions.
As noted, the DDES has been superseded by the SDES and SBES model family.
For globally unstable flows, the behavior of all global hybrid models is often very similar.
The estimate for the lowest possible mesh resolution in the detached SRS region is based on the
assumption that the largest relevant scales are similar in size to the width of the instability zone.
For a bluff body, the width is the diameter D of the body; for a combustor, the width is the diameter
of the core vortex; for a jet in crossflow, the width is the diameter of the jet; and so on. Experience
shows that the minimum resolution for such flows is of the order:
(12.28)
This resolution requires more than 20 cells per characteristic diameter, (in some applications with
very strong instabilities, even 10 cells across the layer may be sufficient). As is generally the case
for SRS, it is best to provide isotropic (cubic) cells, or at least to avoid large aspect ratios (aspect
ratios smaller than 5 would be optimal, but cannot always be achieved in complex geometries).
With the above estimate for , there is a good chance of resolving the main flow instability and
the resulting strong turbulent mixing processes associated with the global flow instability (an effect
often missed by RANS models). For acoustics simulations, it might also be important to resolve the
turbulence generated in the (often thin) shear layer that is separating from the body. Resolving
this turbulence poses a much more stringent demand on grid resolution on the simulation, as the
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
172 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
shear layer scales with the boundary layer thickness at separation and so can be much smaller than
the body dimension. This situation is covered in Section 12.2.2 (p. 182).
In ANSYS CFX, the default hybrid numerical option switches explicitly between the High Resolution
Scheme (in the RANS region) and the CD scheme (in the LES region). For most applications, it appears
that the use of the BCD scheme should also be favored in ANSYS CFX (see also Sec-
tion 12.3.1.1 (p. 217))
12.2.1.5. Examples
The following examples have been computed before the availability of the SBES model family. They
are therefore based on the SAS/DDES model formulations. Due to the strong flow instability in
these flows, the choice of model formulation is marginal and all hybrid models provide fairly similar
solutions.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 173
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.15: Turbulence structures for flow around a generic fighter aircraft (Q-criterion)
as computed by SAS-SST model
It should be noted that not all flows produce such strong instability as the triangular cylinder,
and a higher grid resolution might be required for flows with less instability. Figure 12.17 (p. 175)
shows that the grid does not provide resolution of the boundary layer on the walls of the trian-
gular body. This is not a problem in the current case because the wall boundary layer has no in-
fluence on the global flow, as it separates at the corners of the triangle. In real flows, this might
not always be the case and the boundary layer should be resolved with a RANS-type mesh (that
is, a finer mesh in the near-wall region with higher aspect ratios being acceptable).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
174 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.17 (p. 175) shows a visual representation of the flow using the DDES-SST and the SAS-
SST models with the Q-criterion (see Section 12.5.1 (p. 222)). Both simulations have been carried
out using the BCD scheme. Both models generate resolved turbulence structures in agreement
with the expectation for the grid provided. Figure 12.18 (p. 176) shows a comparison with the
experimental data (Sjunnesson et al., 1992 [28] (p. 235)) for the wake velocity profiles as well as
for turbulence characteristics.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 175
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.18: Velocity profiles and turbulence RMS profiles for three different stations
downstream of the triangular cylinder (x/a=0.375, x/a=1.53, x/a=3.75). Comparison of
SAS-SST, DES-SST models, and experiment. (a) U-velocity, (b) urms, (c) vrms, (d) u’v’
Figure 12.19 (p. 176) shows a comparison of the CD and the BCD scheme for the triangular cylinder
using the SAS-SST model. The turbulence content is almost identical, except that some smaller
scales are present in the CD simulation downstream of the body. A comparison with experimental
data showed results that are almost identical to the ones shown in Figure 12.18 (p. 176) and inde-
pendent of whether the CD or the BCD scheme was used.
Figure 12.19: SAS-SST simulation for flow around a triangular cylinder using the BCD and
the CD scheme for the convective fluxes
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
176 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
wall boundary layers are not important, which means that this test case is also accessible to pure
LES simulations. However, in many industrial combustion chambers wall boundary layers and
auxiliary pipe flows have to be considered, which makes them unsuitable for pure LES.
There are two co-axial inlet streams and both are swirling in the same direction. The swirl is
generated by means of the two circumferential arrays of blades, which are not included in the
current computational domain. The axisymmetric velocity profiles with the circumferential com-
ponent corresponding to the given swirl number are used as the inlet boundary conditions. The
swirl gives the flow a strong global instability, which can be captured well by global SRS models.
Figure 12.20 (p. 177) shows the geometry. The grid shown in Figure 12.21 (p. 178) consists of
tetrahedral elements. As stated, the wall boundary layers are not important and are
therefore not resolved on this tetrahedral mesh. The simulation was run with ANSYS CFX, which
internally converts the grid to a polyhedral grid with control volumes around the grid
points for the node-based solver. This means that the polyhedral grid cells are larger than the
visual impression from Figure 12.21 (p. 178) with ~20–30 cells covering the relevant length scale
, shown in Figure 12.21 (p. 178). The grid does not feature any near-wall boundary layer resolution.
It is recommended that you provide such a boundary layer grid for industrial flows (typically more
than 10 structured cells across the boundary layer), as in some geometries the separation charac-
teristics near the burner entrance can depend on such details. The convection scheme selected
was the default hybrid scheme; however, BCD should also work well.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 177
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.21: Unstructured grid on the symmetry plane and boundary locations for the ITS
swirl burner and relevant length scale, L
The flow structures from the SAS-SST computations of the non-reacting and the reacting flow at
a given instance in time are shown in Figure 12.22 (p. 179) using the -criterion ( ,
see Section 12.5.1 (p. 222)). The isosurface in Figure 12.22 (p. 179) is given by
. The main turbulence structures seem to be captured well in the
simulations. Clearly, small-scale turbulence cannot be resolved on such a grid. The grid resolution
used here should not be considered as a recommendation for combustion chambers, but as the
lowest limit for which such SRS models can be applied.
Figure 12.23 (p. 180) shows a comparison of the standard RANS and SAS results at a given
distance from the burner entrance. It shows the level of improvement that results from the ap-
plication of SRS methods. Many more details of this simulation can be found in Egorov et al.,
2010 [6] (p. 233) or in a more detailed analysis of a more complex combustion chamber in
Widenhorn et al., 2009 [38] (p. 235).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
178 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.22: SAS solution for ITS combustion chamber (a) Non-reacting, (b) Reacting flow
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 179
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.23: Reacting flow velocity profiles at the axial distance from the inlet x=103 mm
(a) Axial velocity, (b) Tangential velocity
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
180 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 181
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Consider the computation of a mixing layer starting from two wall boundary layers with different
freestream velocities in RANS mode (see Figure 12.24 (p. 182)). As the flat plate ends, the two
boundary layers form a turbulent mixing layer, which quickly becomes independent of the turbulence
of the two boundary layers on the flat plate (yellow circles). The mixing layer instability (red) provides
for a de-coupling of the boundary layer and the mixing layer turbulence. For this reason, you can
neglect the boundary layer turbulence downstream of the trailing edge (the dashed yellow
boundary layer turbulence sketched in Figure 12.24 (p. 182)) and concentrate on using SRS mode
to resolve the mixing layer turbulence, which will quickly dominate the flow.
Figure 12.24: Schematic of locally unstable flow: Mixing layer originating from a flat plate
with two boundary layers of different freestream velocity. Full yellow circles are boundary
layer turbulence. Dashed yellow circles are remains of the boundary layer turbulence. Red
arrows are new mixing layer turbulence
• Generic Flows
– All equilibrium free-shear flows emanating from walls (jets, wakes, mixing layers)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
182 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
12.2.2.2. Modeling
The goal in SRS is to cover the boundary layer turbulence (solid yellow circles in Figure 12.24 (p. 182))
in RANS and the mixing layer turbulence (red in Figure 12.24 (p. 182)) in resolved mode. This can
only be achieved if the impact of the RANS turbulence model is significantly reduced downstream
of the trailing edge; otherwise the formation of unsteady structures would be suppressed.
The SAS model will typically not switch to SRS mode in such situations, independent of the mesh
provided, as the eddy-viscosity produced in the mixing layer will be too large for the flow instability
at hand. From a pure turbulence modeling standpoint, this is often acceptable, as such flows are
typically covered with reasonable accuracy by using RANS models (mixing layers, wakes, back step,
and so on). However, in cases where unsteady information is required for other reasons (for example,
acoustics), the SAS model will likely not be suitable, unless an interface is used that converts modeled
turbulence energy into resolved energy (see Section 12.1.7 (p. 168)).
The DDES, SDES and SBES models allow SRS behavior because the shielding function is turned off
past the trailing edge of the plate and, assuming a fine (LES) grid is provided downstream of the
plate, the eddy-viscosity is reduced. These models then switch to LES mode in the wake, and the
mixing-layer instability is strong enough to generate resolved turbulence relative quickly (within a
few boundary layer thicknesses). It is important to point out that the ability of the DDES/SDES/SBES
models to generate unsteady structures in the mixing layer depends on the grid provided in that
area. Assuming an overly coarse grid (for example, in the spanwise direction), the grid limiter would
not engage and the model would stay in RANS mode, which will not enable the formation of resolved
structures. Remember that, for the DES model, the length scale is defined as:
(12.29)
where is the largest edge length for each cell. For this case, assume that the grid in the
plane shown in Figure 12.24 (p. 182) is very fine (of LES quality), and is the grid resolution
in the spanwise ( ) direction. Conversely, if is very coarse, the DES limiter would always select
the RANS length scale and the model would remain in RANS mode in the wake region. No un-
steady structures would develop as the RANS model will damp them out. As the grid in the -dir-
ection is refined, the DES limiter will be activated at some location downstream of the trailing edge
where (note that grows as the mixing layer becomes thicker). With further grid refine-
ment, the location of the implicit RANS-LES interface would move closer to the trailing edge.
Eventually, the entire mixing layer would be covered by LES. This behavior of (D)DES is both a dis-
advantage and an advantage. The disadvantage and the danger lie in the strong grid sensitivity
introduced explicitly into the turbulence model. As a result, when using (D)DES (as well as SDES/SBES),
you must be very careful to provide a suitable grid for a given application when using DDES. The
advantage is that the model can be applied to locally unstable flows without the definition of an
explicit RANS-LES interface. However, the grid sensitivity can be reduced by employing an interface
which converts modeled turbulence to resolved turbulence using the DDES/SDES/SBES model up-
stream and downstream of the interface (see Section 12.1.7 (p. 168)).
The most general approach to the flows discussed here is the use of the embedded or zonal RANS-
LES methods, where the boundary layers are covered by a RANS model and the mixing layer by a
LES model. The models are explicitly switched from RANS to LES at a pre-defined interface upstream
or at the trailing edge. In order to obtain a proper LES solution, a grid with LES resolution is required
in the mixing layer. Frequently a non-conformal interface between the RANS and the LES part is
used to reduce the grid resolution in the upstream RANS region. For a fully consistent simulation,
one must introduce synthetic turbulence at the RANS-LES interface. By such injection of synthetic
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 183
Best Practices: Scale-Resolving Simulations in ANSYS CFD
turbulence, the balance between RANS and LES turbulence across the interface is preserved (that
is, the yellow dashed circles in Figure 12.24 (p. 182) are accounted for).
The recommendation for flows with local instabilities is to use ELES/ZLES models if the geometry
and the application enable the definition of well-defined interfaces (for example, internal flows, like
pipe flows). Synthetic turbulence should be introduced at these interfaces in order to preserve the
balance between the RANS and LES turbulence content. Should the geometry/application be
complex such that the definition of explicit RANS and LES zones is not easily possible (for example,
turbomachinery flows, external flows), apply the DDES/SDES/SBES model. However, ensure careful
tailoring of the grid with sufficient resolution on the LES region to avoid undefined model behavior
somewhere between RANS and LES mode. It is advisable to refrain from using conventional DES
in flows with extensive boundary layers, because the danger of affecting the boundary layers is too
high. For such flows, the newest members of the family, namely the SBES models, are recommended.
It is very important to understand that for locally unstable flows, failure to capture the instability
of the Separating Shear Layer (SSL) can have a pronounced effect on the solution downstream. The
turbulence field is a result of this initial instability and missing it can severely limit the resolved
content of the simulation and contaminate an expensive SRS solution. This danger is much reduced
with ELES/ZLES models, (relative to DDES) because the flow enters the SSL with a prescribed syn-
thetic turbulent content from the RANS-LES interface.
(12.30)
It is important to emphasize that this quantity should be evaluated based on a precursor RANS
solution. This implies that such a solution exists and is meaningful. If the precursor solution is not
available, then you can estimate the ratio based on the thickness of SSL. For equilibrium mixing
layers, the following ratio is approximately correct:
(12.31)
where is the thickness of the mixing layer. The value of RL should be:
(12.32)
where 0.2 should be considered an extreme lower limit of resolution and 0.1 the desirable lower
limit. Again, higher grid resolution should be used if computing power permits. The value of
corresponds to a resolution of 15 cells across the mixing layer. This amount of cells is not a very
fine grid resolution, but equal resolution should ideally be provided in all three space dimensions.
In addition, the SSL can be thin relative to the body dimensions, resulting in very high computa-
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
184 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
tional costs. The initial SSL instability is akin to a Helmholtz instability and is initially two-dimensional.
A doubled grid spacing in the spanwise direction is therefore acceptable.
It is not always possible to achieve such resolution directly from the onset of the separating shear
layer, especially if this layer is very thin relative to the body dimensions. This inability is not neces-
sarily a problem as, typically, the thickness of the SSL increases strongly downstream of the separ-
ation point/line. Therefore is decreasing relatively quickly and reaches sufficiently low values to
provide the required resolution. It is important to note that for cases where the small scales play
a significant role, such as in acoustics simulations, the delay of the initial instability can result in a
loss of spectral information at high wave numbers (small scales). It is advisable to visually inspect
the displayed results for the presence of the unsteady turbulent structures at the intended locations.
Of special concern are geometries with high aspect ratios, meaning a large domain size in the dir-
ection perpendicular to the SSL (long cylinders in crossflow, stalled wings of high aspect ratios, and
so on). In such situations, it is not always possible to sufficiently resolve the third direction. It might
then be necessary to solve only a portion of the real flow domain in SRS mode, either by using
suitable boundary conditions (for example, periodicity in the spanwise direction), or by restricting
the SRS to a limited portion of the domain.
Experience suggests that the BCD scheme is also the most suitable choice when using ELES/ZLES
methods. In some applications with high demands on accuracy and where a high quality isotropic
mesh can be provided in the LES region, the application of the CD scheme in the LES zone might
be advantageous.
12.2.2.5. Examples
12.2.2.5.1. Mixing Layer
The single-stream mixing layer flow is experimentally investigated in Morris and Foss, 2003
[21] (p. 234). The experimental section consists of a flat plate which suddenly terminates at a
corner step (Figure 12.25: The domain and grid for the single stream mixing layer flow (p. 186)),
which induces the formation of the mixing layer from the separation point. The experiment is
carried out at a Reynolds number of based on the momentum thickness of the
incoming boundary layer and on the free-stream velocity .
The inlet of the computational domain shown in Figure 12.25: The domain and grid for the single
stream mixing layer flow (p. 186) is located at , while the outlet boundary is located
at ( corresponds to the step location). The size of the domain in the wall
normal direction is upstream of the step and downstream of it. Finally, in the
spanwise direction the domain is wide.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 185
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Two computational grids are considered (Figure 12.25: The domain and grid for the single stream
mixing layer flow (p. 186)). Mesh 1 consists of about hexahedral cells with the maximum
grid step of downstream of the step. Mesh 2 consists of hexahedral cells and has
a maximum grid step of in the mixing layer region (spanwise direction). It should be
noted that both meshes have the same node distribution upstream of the step with the grid
steps in the wall normal direction chosen to satisfy in the entire domain.
The boundary conditions are specified as follows (Figure 12.25: The domain and grid for the single
stream mixing layer flow (p. 186)). A constant velocity is specified at the flat plate inlet. Following
the experimental setup, a velocity of is set at the bottom inlet below the mixing layer
to provide the correct entrainment rate for a shear layer at zero pressure gradient and to ensure
that the freestream velocity gradient in the streamwise direction is approximately zero. A constant
pressure is set at the outlet boundary. No-slip conditions are utilized at solid walls. Finally, peri-
odic conditions are employed in the spanwise direction.
Figure 12.25: The domain and grid for the single stream mixing layer flow
As seen from the instantaneous structures visualized with the use of isosurfaces of the Q-criterion
(Figure 12.26: Isosurfaces of the Q-criterion colored with the velocity magnitude (p. 187)), SBES
and SDES provide a swift development of three-dimensional turbulence downstream of the step,
while DDES yields almost two-dimensional structures in the entire domain regardless of the used
grid. For SDES, this rapid transition relative to DDES is based on the alternative definition of the
grid length scale and the reduced constant. For SBES, it is based on the activation of the
low eddy viscosity levels from the WALE model in the LES domain.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
186 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.26: Isosurfaces of the Q-criterion colored with the velocity magnitude
Due to the much faster transition from RANS to LES, both, the SDES and the SBES model show
superior agreement with the experiments in terms of the velocity profiles compared to DDES
(see Figure 12.27: Profiles of the mean velocity at different sections (x/θ=19.3, 29.6, 40.6, and 54.2)
for mixing layer test case (p. 188)). Similar performance could be obtained with DDES only under
severe grid refinement – meaning that SDES/SBES can produce more realistic solutions on much
coarser grids than required for DDES.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 187
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.27: Profiles of the mean velocity at different sections (x/θ=19.3, 29.6, 40.6, and
54.2) for mixing layer test case
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
188 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
The computational domain (Figure 12.28: The domain and grid for the backstep test case (p. 189))
extends from at the inlet to at the outlet ( corresponds to the step
location), while in the spanwise direction it has the length of . The computational grid shown
in the figure consists of hexahedral cells with maximum steps in the streamwise and
spanwise directions of and respectively, which corresponds to and to
in the wall units. The steps in the wall normal direction correspond to along all
walls in the domain.
Figure 12.28: The domain and grid for the backstep test case
The boundary conditions are specified as shown in Figure 12.28: The domain and grid for the
backstep test case (p. 189). The inflow profiles are obtained from the precursor SST-RANS simulation
of the developing plane channel flow up to the experimental boundary layer thickness of .
Periodic conditions are applied in the spanwise direction. No-slip conditions are specified on the
solid walls. At the outlet boundary, a constant pressure is specified, while the other transported
quantities are extrapolated from the domain interior.
A non-dimensional time step of ensures that the CFL number is less than one in
the entire domain. The instantaneous flow fields are averaged over 5000 time steps in order to
achieve a sufficient time sample for the unsteady statistics.
As seen from iso-surfaces of the Q-criterion shown in Figure 12.29: Isosurfaces of the Q-criterion
colored with the velocity magnitude for backstep test case (p. 190), SBES and SDES provide visually
similar turbulent structures downstream of the step, while relatively larger structures are observed
for DDES. It can also be seen that the blending functions of SBES and SDES, relative to that of
DDES, cover a smaller portion of the flow near the bottom wall (Figure 12.30: Contours of the
blending function with the vorticity iso-lines for backstep test case (p. 191)), while, in the channel
center, the SDES and SBES models work in the RANS mode. DDES also remains in RANS mode
there, but this is not visible due to the lack of grid information in the DDES shielding function.
DDES provides a larger eddy viscosity level in the mixing zone relative to those of SBES and SDES,
as can be seen from Figure 12.31: Contours of the eddy viscosity ratio for backstep test case (p. 192).
Again, this explains the larger turbulent structures observed in this region with DDES.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 189
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.29: Isosurfaces of the Q-criterion colored with the velocity magnitude for backstep
test case
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
190 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.30: Contours of the blending function with the vorticity iso-lines for backstep
test case
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 191
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.31: Contours of the eddy viscosity ratio for backstep test case
However, despite the above differences, the skin friction coefficient distribution depicted in Fig-
ure 12.32: Distribution of the skin friction coefficient for backstep test case (p. 193) along the
bottom wall shows that the results of all the models are in good agreement with the experimental
data. However, the DDES model shows a slightly overly large separation zone and a slight over-
prediction of -recovery downstream of the reattachment point. Finally, the mean and RMS
velocity profiles for all the considered models agree fairly well with the experimental data. The
better prediction for the backstep as compared to the mixing layer above is not surprising because
the mesh for the backstep has been designed for the DDES model. It features lower grid spacing
(relative to the upstream boundary layer thickness) in spanwise direction compared to the mixing
layer case.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
192 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.32: Distribution of the skin friction coefficient for backstep test case
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 193
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.33: Profiles of the mean and RMS velocity at different sections (x/H=3.2, 4.55,
5.87, and 7.2) for backstep test case
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
194 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
• Generic Flows
12.2.3.2. Modeling
For stable flows, the use of embedded or zonal RANS-LES methods with a well-defined interface
between the RANS and the LES zone is essential. Synthetic turbulence must be introduced at the
RANS-LES interface to ensure a proper balance between the modeled and the resolved content of
turbulence. The introduction of resolved/synthetic turbulence allows the balance between RANS
and LES turbulence across the interface to be preserved (assuming the synthetic turbulence is of
sufficient quality). Neither DDES nor SAS-type models are able to switch from RANS to SRS mode
in such stable situations. Even in cases where resolved turbulence is specified at the inlet (or an
interface) the SAS model will typically switch back to its underlying RANS mode after some
boundary layer thicknesses (for example, Davidson, 2006 [4] (p. 233)). The DDES model does remain
in LES mode but with a significant error in the logarithmic layer. The SBES model is able to perform
in WMLES mode and provide proper velocity profiles downstream of synthetically generated turbu-
lence.
Even an explicit switch from a RANS to a LES model (and the corresponding grid refinement in the
LES zone) at the interface without an introduction of synthetic turbulence does not work well. If
sufficient resolution is provided in the LES zone, the flow would eventually go through a transitional
process and recover the fully turbulent state. However, such a process would require many
boundary layer thicknesses, with an entirely unbalanced model formulation in-between. This
method is not acceptable in most technical flows and must be avoided.
In such stable flows, the most suitable selection of hybrid RANS-LES models are Embedded- or
Zonal models, where the RANS and the LES zones are user-defined and synthetic turbulence is in-
jected at the RANS-LES interface. As mentioned previously, the RANS-LES interface should be placed
in a non-critical region of the flow (equilibrium flow), since existing synthetic turbulence generators
do not provide realistic turbulent fluctuations for strongly non-equilibrium flows. As a result, placing
the interface in such regions results in a too-slow relaxation from synthetic to "real" turbulence
(typically, several boundary layer thicknesses).
As an alternative, the RANS and LES simulations can be carried out separately. The RANS domain
would include the full geometry whereas the LES solution can be carried out on a smaller portion
of the original domain. This separate LES domain would be identical to the LES zone in the equivalent
ELES set-up. The information from the larger RANS solution can then be mapped onto the bound-
aries of the LES domain. Synthetic turbulence should be introduced at the inlet of the LES domain.
This approach can be used if you are confident that the physical decoupling has very little or no
effect onto the overall flow topology. The advantage of the decoupled method over the ELES ap-
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 195
Best Practices: Scale-Resolving Simulations in ANSYS CFD
proach is that the RANS solution does not have to carry the burden of the excessive temporal res-
olution that the LES domain would have otherwise required. However, you should be aware that
some scripting is required for mapping the results from RANS to LES in the decoupled approach.
The models selected in the RANS and LES zone depend on the flow physics. In the RANS zone, a
suitable model for the flow should be selected. In the LES zone, the use of a WMLES formulation
is typically recommended for wall boundary layers in order to avoid the unfavorable Reynolds
number scaling of classical LES models. For free shear flows, the WALE model should provide op-
timal performance.
The meshing requirements are those of the underlying turbulence models. In the RANS zone typical
RANS resolution requirements should be satisfied (20–30 cells across the wall boundary layer with
possibly a and 15–20 cells across free shear flows).
In the LES zone, the resolution requirements depend on the details of the LES model formulation
and the flow type. For free shear flows, cubic grid cells with a minimum of cells per shear
layer thickness should be used. For wall-bounded flows, the resolution requirements are those de-
scribed in Section 12.1.5.1 (p. 157) for classical LES and in Section 12.1.6 (p. 166) for WMLES.
For wall-bounded flows, it is clear that large domains cannot be covered in SRS mode, even when
using WMLES. In most cases you would limit the domain size of the LES zone by one or more of
the following concepts:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
196 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
– Apply periodic boundary conditions where appropriate. The domain size has to cover a minimum of
3–5 boundary layer thicknesses in the spanwise direction to avoid inaccuracies caused by the spanwise
periodicity condition. Care must be taken that this requirement is satisfied for the entire LES domain.
In case the boundary layer grows in the streamwise direction, the most downstream location is relevant
for the estimate.
– In cases where no periodicity can be applied, place the spanwise interfaces into a region of limited
interest.
• Place the upstream RANS-LES interface economically to reduce the size of the LES domain. However,
the interface should be located in a zone of undisturbed equilibrium flow. Place the RANS-LES interface
at a minimum of ~3 boundary layer thicknesses upstream of the zone of interest (for example, a separ-
ation region). Limit the size of the RANS-LES interface to the shear layer to capture; that is, do not extend
the interface far into the freestream, as the code will then generate resolved turbulence in freestream
regions where no LES is required. The Vortex Method (VM) would also generate a large number of vortices
if the RANS-LES interface were too large.
• Place the downstream LES-RANS interface economically to reduce the size of LES domain. However, do
not place the interface immediately downstream of the zone of interest, but place it several boundary
layer thicknesses farther downstream to avoid any negative influence of the downstream RANS model
(this approach enables the boundary layer to recover several boundary layer thicknesses downstream
of a separation before switching back to RANS)
• Limit the height of the LES zone, but allow for some space above the boundary layer. Typically the LES
zone should be about twice as thick as the boundary layer.
In order to check the quality of the simulation, sensitive quantities like time-averaged wall shear
stress should be plotted across the RANS-LES zones. There should be no large jump in those
quantities and the unavoidable disturbance caused by the interface should be recovered before
entering the zone of interest.
12.2.3.5. Examples
12.2.3.5.1. Periodic Channel
The periodic channel flow is not an ELES, but a WMLES application. This section of the report
shows that as WMLES is typically used in the LES portion of ELES/ZLES applications. The entire
domain is WMLES and there are no RANS-LES interfaces. Simulations of this flow have been carried
out assuming incompressible fluid at several Reynolds numbers based on friction velocity and
channel height , Re = 395, 760, 1100, 2400, and 18000. The flow is driven by a constant
pressure gradient , where is the pressure and is the density. This pressure
gradient is taken into account in the governing equations via a source term in the momentum
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 197
Best Practices: Scale-Resolving Simulations in ANSYS CFD
equations, which allows imposing periodic boundary conditions not only in the spanwise direction
, but also in the streamwise direction . Note that within such an approach, the bulk velocity
of the flow is not specified and should be obtained as a part of the solution, which means that
it could be different with different turbulence models. Alternatively, you can specify the mass
flow and the solver will adjust the imposed pressure gradient accordingly.
The size of the computational domain shown in Figure 12.35 (p. 198) is equal to in the
streamwise direction and in the spanwise direction. For all considered Reynolds numbers,
the computational grid is unchanged in the streamwise and spanwise directions with a uniform
grid-spacing of and respectively. This gives 10 cells per channel half width, ,
( being the relevant boundary layer thickness) in the streamwise and 20 cells per in the
spanwise direction. Different grids have been used in the wall-normal direction. This arrangement
provides a sufficient resolution ( near the wall) at different Reynolds numbers. Note,
however, that all simulations could have been performed on the finest grid. The non-dimensional
time step is , which ensures that the CFL number is in the entire domain.
The solution was averaged in time over 5000 time steps. Table 12.3 (p. 198) gives the details of
the grids used in the simulations and the resulting non-dimensional grid spacing. Note that
classical wall-resolved LES would require values of , , demonstrating the substantial
savings that can be achieved with WMLES for higher Re numbers. The range in Table 12.3 (p. 198)
covers the range of values in the wall normal direction, with the largest values located at the
center of the channel.
Figure 12.35: Computational domain and grid for WMLES of channel flow
Number of Number of
Cells Nodes
395 384 000 40.0 20.0
760 480 000 76.9 38.5
1100 480 000 111.4 55.7
2400 528 000 243.0 121.5
18000 624 000 1822.7 911.4
Figure 12.36 (p. 199) shows the turbulence structures using the -criterion ( ). The
isosurface is colored by the streamwise velocity.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
198 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.36: Turbulence structures for WMLES of channel flow at lowest Reynolds number
(Q=350 [s-2])
Figure 12.37 (p. 199) shows the flow in a horizontal cut through the domain for the lowest and
the highest Reynolds numbers. The thin region of RANS modeling near the wall for the high
Reynolds number is indicated by the high eddy-viscosity (note the different scales in the plot for
the eddy-viscosity ratio for the different Reynolds numbers). RANS modeling in this context is as
described in Section 12.1.6 (p. 166), based on the near-wall mixing length formulation.
Figure 12.37: Flow visualization for WMLES of channel flow (a) Vorticity rate Omega, (b)
Absolute value of velocity U, (c) Ratio of eddy-viscosity to molecular viscosity
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 199
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Results of the WMLES formulation and their comparison with the empirical correlation of Reichardt,
1951 [23] (p. 234) are shown in Figure 12.38 (p. 200). You can see that the WMLES solutions repro-
duce the logarithmic layer with good accuracy. There is a slight kink at the switch from the RANS
to the LES formulation, but it is moderate and does not affect global properties such as the wall
shear stress.
The above simulations have been carried out with ANSYS Fluent. Similar results can be obtained
with ANSYS CFX where WMLES is the default formulation inside the LES zone of the ZFLES
method.
Figure 12.38: Resolved normal stresses, turbulent kinetic energy, and mean velocity profiles
for WMLES at different Reynolds numbers
The same test case has been computed with the global hybrid RANS-LES models. In order to
push them into unsteady SRS mode, the simulations are started from the WMLES solution above.
Please note that the DDES model is not shown because it would produce a severe shift in the
logarithmic velocity profile. The IDDES model shown for comparison has been calibrated for
WMLES applications; it does however have only limited shielding capabilities and is therefore not
suitable for general industrial applications.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
200 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
As seen from Figure 12.39: Isosurfaces of the Q-criterion colored with the velocity mag-
nitude (p. 201), all the models provide resolved turbulent structures for both considered Reynolds
numbers. The results of SBES (combination of SST and WALE) and IDDES are visually close to each
other with a finer resolution provided by the IDDES model. The near wall resolved turbulence is
noticeably reduced by SDES for both Reynolds numbers.
As seen from Figure 12.40: Profiles of the eddy viscosity ratio for different models (p. 202), SDES
lacks resolved turbulence near the wall due to a substantially higher peak of the eddy viscosity
resulting from a noticeable shift of the RANS-LES interface away from the wall. SBES also yields
a noticeably higher eddy viscosity peak than IDDES but much reduced relative to SDES.
Figure 12.39: Isosurfaces of the Q-criterion colored with the velocity magnitude
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 201
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.40: Profiles of the eddy viscosity ratio for different models
Interestingly, the profiles of the mean velocity as shown in Figure 12.41: Profiles of the mean ve-
locity for different models (p. 202) are in good agreement with each other and with the empirical
correlation for all models. It should be noted, that, despite SDES yielding the smallest magnitude
of the LLM (Figure 12.41: Profiles of the mean velocity for different models (p. 202)), it noticeably
underestimates the total turbulence kinetic energy (Figure 12.42: Profiles of the total turbulence
kinetic energy for different models (p. 202)) for both Reynolds numbers. This indicates that the
wall modeled LES capability of SDES is not optimal for the given meshes. At the same time, the
profiles of the total kinetic energy of SBES and IDDES are relatively close to each other, which
means that the models have similar wall modeled LES capabilities. The results also indicate that
further improvements in terms of WMLES resolution could be obtained by moving the RANS-LES
interface slightly closer to the wall.
Figure 12.42: Profiles of the total turbulence kinetic energy for different models
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
202 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
there is no periodicity in the streamwise direction. In the current simulations, the Vortex Method
(VM) was used for these purposes (Mathey et al., 2003 [15] (p. 234)).
A computational domain for this test case is shown in Figure 12.43 (p. 203). The characteristic
length, which determines the geometry, is the plate length, , of 1 [m] in the current study. Di-
mensions of the computational domain in , , and directions are equal to , , and
respectively.
Figure 12.43: Computational domain for a Wall Boundary Layer test case
The simulations have been performed for an incompressible fluid. A summary of physical para-
meters is presented in Table 12.4 (p. 203).
1000 10 000
Inlet boundary layer 0.032 0.032
thickness
0.001 0.001
1.0 1.0
The geometry and the computational grid used for the test case are shown in Figure 12.44 (p. 204).
The base grid is uniform in the - and -directions with steps 0.004 [m] and 0.002 [m] respectively.
In the wall normal direction the grid was expanded by a factor of 1.15. For all computations the
value of is less than 1, which means that the governing equations are integrated to the wall.
A complete summary of all used grids is presented in Table 12.5 (p. 204).
Figure 12.44 (b) (p. 204) presents all the boundary condition types used in the simulations. The
cyan color shows one of the periodic planes, the red color the no-slip wall boundary, the blue
color the outlet boundary, the green color the inlet boundary, and the yellow color the symmetry
boundary.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 203
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.44: Computational grid (a), (c) and applied boundary conditions (b)
Number of Number of
Cells Nodes
1000 1 085 000 68.0 34.0
10 000 1 333 000 680.0 340.0
Two cases have been computed using the numerical grids with the parameters shown in
Table 12.5 (p. 204). They have different inlet Reynolds numbers that are based on the boundary
layer momentum thickness ( ).
The Non-Iterative Time Advancement (NITA) algorithm based on the Fractional Time Step method
was applied with the second order scheme for the approximation of time derivatives. The con-
vective terms in the momentum equations have been approximated with the second order
Central Difference scheme and the Green-Gauss cell-based method was used for interpolation of
variables on cell faces. The Standard option was selected for the pressure interpolation scheme.
Visualizations of the flow at two values of are shown in Figure 12.45 (p. 205). Isosurfaces of
the -criterion that are equal to and colored with the velocity magnitude are depicted.
It can be seen that the turbulence structures are well-developed and do not show any visual
decay or disruption downstream of the inlet. This indicates that the Vortex Method provides
sufficiently realistic turbulent content at the inlet boundary.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
204 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.45: Isosurfaces of Q-criterion (Q=200 [s–2]) colored with velocity for a flat plate
at two different Reynolds numbers
Figure 12.46 (p. 206) shows the skin-friction coefficient for the two Reynolds numbers. The results
demonstrate that the inlet wall friction provided by the RANS inlet velocity profiles is maintained
without any major disruption. This indicates again that the vortex method produces sensible
synthetic inlet turbulence. In addition, the models react properly to the Reynolds number variation,
suggesting that the WMLES can maintain a boundary layer accurately even at high Reynolds
numbers, where standard LES models would fail due to a lack of resolution. Figure 12.46 (a) (p. 206)
shows, in part (a), the impact of the pressure interpolation scheme, which has proven to be crit-
ical for locally stable flows. It is worth re-iterating that the PRESTO scheme requires slightly more
‘running length’ to recover the correct levels of turbulence and wall shear stress.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 205
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.46: Skin friction distributions along a flat plate predicted by WMLES at two
Reynolds numbers (a) Re theta=1000 with different numerical settings (b) Re theta =10 000
Figure 12.47 (p. 206) shows Reynolds stresses and velocity profiles from the simulations. The figure
suggests that, just as for the channel flow, the quality of the simulations is fairly high in terms
of both the mean flow prediction (the logarithmic profile is reproduced faithfully) and Reynolds
stresses (they are well within the range expected from known DNS studies of the flat plate
boundary layer).
Figure 12.47: Profiles of resolved normal and shear Reynolds stresses and mean velocity in
the flat plate boundary layer predicted by WMLES at two Reynolds numbers (a) Re
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
206 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
theta=1000 with different numerical settings (b) Re theta=10 000 with the second order
pressure interpolation
The above simulations have been carried out with ANSYS Fluent. Similar results can be obtained
with ANSYS CFX where WMLES is the default formulation inside the LES zone of the ZFLES
method.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 207
Best Practices: Scale-Resolving Simulations in ANSYS CFD
The flow was computed with ANSYS Fluent 13.0 using the SST model in the RANS zone, the
vortex method at the RANS-LES interface and the algebraic WMLES option in the LES zone. The
Reynolds number, based on the free-stream velocity, , and hump chord, , is equal to .
The simulation was carried out in the full domain, which extends from to (0 corres-
ponds to the hump beginning). In the spanwise direction, the extent of the domain is . The
inflow boundary conditions for RANS have been set based on the preliminary flat plate boundary
layer computations up to the flow section ( ), where the parameters of the
incoming boundary layer have been measured in the experiment. At the upper wall of the
channel, free-slip wall conditions have been specified.
The grid in the LES zone (see Figure 12.49 (p. 208)) consists of cells and was de-
signed to provide cells per boundary layer volume in the streamwise, wall normal,
and spanwise directions. The RANS grid is much coarser, especially in the spanwise direction.
Figure 12.49 (p. 208) also presents a visualization of the turbulent structures in the LES zone that
suggests a high resolution provided by the simulation (note that the momentum thickness
Reynolds number at the inlet to the LES domain is relatively high ( )). In retrospect, the
set-up might not be fully optimal, as the RANS-LES interface is placed relatively close to the non-
equilibrium/separation zone of the boundary layer. There are only about two boundary layer
thicknesses between the interface and the bend of the geometry. A more optimal grid should
cover more of the upstream boundary layer and enable the synthetic turbulence to develop over
a longer running length.
Figure 12.49: (a) Grid used for the NASA hump simulation (b) Turbulent structures in the
LES domain (Q-criterion colored with spanwise velocity component)
Figure 12.50 (p. 209) shows the skin-friction and wall-pressure coefficient distributions from the
simulations. It can be seen that the use of ELES combined with the WMLES model in the LES zone
results in very close agreement with the data, even though the skin-friction is known to be very
sensitive to simulation details. A comparison of the results obtained using WMLES with those
obtained using the standard WALE model in the LES zone is shown in Figure 12.50 (p. 209). The
results suggest that the latter performs considerably worse than the former. In particular, in the
simulations using the WALE model, the wall shear stress drops immediately after the RANS-LES
interface to unrealistically small values due to the lack of resolution. The results with this model
further downstream are therefore no longer reliable as the wall shear stress has a strong influence
on the overall boundary layer development. Further investigations of this flow are on-going, so
the results should not be considered final, but are provided to demonstrate the basic concepts.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
208 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.50: (a) Skin-friction, cf, and (b) Wall pressure coefficients, cp, from NASA hump
flow simulations. Comparison of WMLES and WALE LES methods in the LES domain
The set-up consists of a horizontal pipe for the cold water flow, and a vertically oriented pipe for
the hot water flow. The hot water pipe is attached to the upper side of the horizontal cold water
pipe. In the experiments, the length of the straight pipes upstream of the T-junction is more than
80 diameters for the cold water inlet, and approximately 20 diameters for the hot water inlet.
The flow conditions are listed in Table 12.6 (p. 209).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 209
Best Practices: Scale-Resolving Simulations in ANSYS CFD
A sketch of the domain is depicted in Figure 12.51 (p. 211). The domain dimensions are as follows.
The hot leg inlet is located at the section, the cold leg inlet is located at the
section, and the outlet is located at , with being the diameter of the cold leg of the
pipe. When ELES was used, two additional interfaces have been introduced in the domain, where
the synthetic fluctuations generated with the use of the Vortex Method have been specified.
These sections have been placed at in the hot leg and at in the cold leg.
The computational grid for this flow is composed of about 4.9 million hexahedral cells (see Figure
12.51 (p. 211)). The wall normal grid spacing was set to 0.0001 [m], which yields in
the entire domain. The grid spacing in the axial and circumferential directions was set as follows:
• For the cold water pipe where the inlet boundary layer thickness is equal to 0.07 [m], the
grid spacing was chosen and , which yields
and .
• For the hot water pipe the inlet boundary layer thickness was set to 0.022 [m] and the grid
spacing was chosen and , which yields
and .
• In wall units, the grid spacing is ( , ) (195, 80) for the hot water pipe and
( , ) (115, 70) for the cold water pipe, which means that the flow requires
near-wall turbulence modeling. The time step was set to 0.001 [s], which leads to CFL~1 in the
central mixing zone.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
210 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.51: Geometry and grid of T-Junction test case with measurement planes
The boundary conditions for this case have been specified as follows. For the inlet boundaries,
the precursor simulations of the pipe flow have been performed using the SST model. For the
cold water pipe, a fully developed pipe flow was calculated using the SST model and the profiles
of velocity and turbulence quantities have been specified at the inlet boundary. For the hot leg
and the pipe, the profiles in the experiments were not fully developed. For this reason, a separate
pipe flow simulation was conducted using constant inlet values for velocity and turbulence. The
inlet profiles for the hot leg have then been extracted from this precursor simulation at the location
where they matched the experimental profiles most closely.
It bears repeating that this flow is not easily categorized into one of the three groups described
above, but might be described as between globally unstable and locally unstable. It was originally
computed with the global SAS and DDES models. Although both simulations turn into a proper
SRS mode in the interaction zone of the two streams, the results turned out to be very sensitive
to numerical details and solver settings, especially for the SAS model. As an illustration, in Figure
12.52 (p. 212), the turbulence structures are shown as predicted by the SAS-SST model with the
use of the CD and BCD numerical schemes. The effect of the scheme on the resolved flow is
striking. This effect is an indication that the underlying flow instability is not very strong and can
only be represented by the SAS model with the use of a low dissipative numerical scheme such
as CD in this particular case. Under such conditions, it is not advisable to apply global methods
like SAS (and to a lesser extent, DDES), as will be seen from the temperature distributions later.
It is important to emphasize that in more unstable flows, the difference between CD and BCD is
not nearly as strong and often barely noticeable.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 211
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.52: Turbulence structures for SAS-SST model (a) Central Difference (CD) scheme,
(b) Bounded Central Difference (BCD) scheme
It is therefore recommended to apply the ELES model with synthetic turbulence specified at
predefined RANS-LES interfaces located in both pipes upstream of the interaction zone. Switch
from the RANS to LES at these interfaces using the vortex method. In this case, the SST model
was employed in the RANS zone and the WMLES approach was used in the LES part of the domain.
As seen in Figure 12.53 (p. 213), with this approach resolved turbulence is generated well-upstream
of the interaction zone and is then maintained through the interaction zone independent of the
numerical scheme (CD or BCD).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
212 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Figure 12.53: Vorticity contours for ELES/WMLES simulation (a) CD scheme, (b) BCD scheme
Figure 12.54 (p. 214) shows velocity profiles of different velocity components at different measure-
ment locations (see Figure 12.51 (p. 211)). Figure 12.54 (a) (p. 214) shows results for the DDES,
ELES/WMLES, and SAS simulations using the CD scheme. All simulations agree well with each
other and with the experimental data. Figure 12.54 (b) (p. 214) shows the same models, but
computed using the BCD scheme. As discussed, the SAS/BCD model shows marked differences
compared to the experimental data, as already expected from Figure 12.52 (p. 212). It stays in
URANS mode, which for this case turns out to be inadequate. The other models are less sensitive
to the numerical set-up and provide almost identical results when using the BCD and the CD
scheme.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 213
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Figure 12.54: Comparison of the experimental and computational velocity profiles for
T-Junction flow for different turbulence models (a) CD scheme (b) BCD scheme (note that
scales of coordinate axes change by large factors between curves)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
214 of ANSYS, Inc. and its subsidiaries and affiliates.
Generic Flow Types and Basic Model Selection
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 215
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Details of the resolved turbulence can be seen in Figure 12.59 (p. 217), which shows the region
just downstream of the pipe intersection on the Top wall ( - Figure 12.51 (p. 211)) where the
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
216 of ANSYS, Inc. and its subsidiaries and affiliates.
Numerical Settings for SRS
temperature predictions between ELES and DDES differ the most (Figure 12.55 (p. 215)). ELES
shows significantly stronger resolved turbulence activity than DDES, confirming the arguments
above. More recent simulations of this flow using the SBES model show similar solutions to DDES,
but with smaller resolved turbulence structures.
Figure 12.59: Comparison of turbulence structures on the Top wall downstream of the pipe
intersection (a) DDES model (b) ELES model
12.3.1.1. Momentum
SRS models, as described in Scale-Resolving Simulation (SRS) Models – Basic Formulations (p. 149),
serve the main purpose of dissipating the energy out of the turbulence spectrum at the limit of
the grid resolution. The eddy viscosity is defined to provide the correct dissipation at the larger
LES scales. This assumes that the numerical scheme is non-dissipative and that all dissipation results
from the LES model. For this reason, one is required to select a numerical scheme in the LES region
with low dissipation, relative to the dissipation provided by a subgrid LES model. Another strategy
is to avoid the introduction of the LES (subgrid) eddy viscosity and provide all damping through
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 217
Best Practices: Scale-Resolving Simulations in ANSYS CFD
the numerical scheme. This approach is called MILES (Monotone Integrated Large Eddy Simulation)
(Boris et al., 1992 [1] (p. 233)). In ANSYS CFD, the standard LES methodology is followed, whereby
the dissipation is introduced by a LES eddy viscosity model and the numerical dissipation is kept
at a low value.
In order to achieve low numerical dissipation, you cannot use the standard numerical schemes for
convection that were developed for the RANS equations (Second Order Upwind Schemes, or SOU),
which are dissipative by nature. In contrast, LES is carried out using Central Difference (CD) schemes.
In industrial simulations, second order schemes are typically employed, however, in complex geo-
metries with non-ideal grids, CD methods are frequently unstable and produce unphysical wiggles
(see Figure 12.60 (p. 218)), which can eventually destroy the solution. To overcome this problem,
variations of CD schemes have been developed with more dissipative character, but still much less
dissipative than Upwind Schemes. An example is the Bounded Central Difference (BCD) scheme of
Jasak et al., 1999 [14] (p. 234).
Figure 12.60: Example of scheme oscillations in T-Junction flow shown by vorticity: (a) CD,
(b) BCD
The CD scheme can be used successfully for (WM)LES of simple flows on optimal grids (typically
hexahedral grids with low skew) such as channel or pipe flows. For more complex geometries, ELES
allows the reduction of the LES domain to a limited region with high quality grids. Under such
conditions, CD can be employed inside the LES portion of the grid, while using a standard upwind
biased scheme for the RANS part of the domain.
For global models, like SAS or DDES/SDES/SBES, involving RANS and LES portions without a well-
defined interface between them, most cases require the use of the BCD scheme, which can also
handle both the RANS and LES domains with acceptable accuracy.
When using ELES in ANSYS Fluent, one can also switch the numerical scheme between the RANS
and the LES regions (see Cokljat et al., 2009 [2] (p. 233)) by hand.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
218 of ANSYS, Inc. and its subsidiaries and affiliates.
Numerical Settings for SRS
In ANSYS CFX, the default for the SAS and SBES models is a numerical scheme that switches explicitly
between a second order upwind and the CD scheme, based on the state of the flow, using a switch
proposed by Strelets, 2001 [33] (p. 235). This switching scheme is relatively complex and it is advisable
to apply the less complex BCD scheme that is also available in the code. In ANSYS CFX there is an
additional parameter for the BCD scheme that allows a continuous variation of the scheme from
BCD to CD. The parameter is called CDS Bound. CDS Bound=1 applies only to BCD and CDS Bound=0
applies only to CD.
Note:
For SBES, numerical problems have been observed on complex grids with second order
turbulence numerics. First order numerics is therefore recommended. Note that this has
little effect on the accuracy, because the RANS region is typically insensitive to this
switch. In the LES region, the two-equation model is, in any case, overwritten by the
selected LES model.
The time steps should be selected to achieve a Courant number of in the LES part of the
domain. For complex geometries and grids with high stretching factors, the definition of the CFL
number is not always very reliable (for example, if the flow passes through a region of highly
stretched cells). In such situations, estimates can be built upon the physical dimensions of the shear
layer to be resolved. If cubic cells are required for resolving a shear layer (say across
a mixing layer of thickness ) and a certain CFL number is to be achieved, then a time step of
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 219
Best Practices: Scale-Resolving Simulations in ANSYS CFD
(12.33)
is required. Considering that is proportional to the RANS turbulent length scale (with a constant
of order 1), this estimate may be further simplified to:
(12.34)
where . This simplification means that the time step can be estimated on a pre-cursor
RANS simulation.
You can also apply a more global estimate by assessing the through flow time, which is the time
required by a fluid element to pass through the LES domain of length with velocity : .
With an estimate of how many cells, , will be passed along this trajectory, one obtains
.
For the ITA schemes (everything except NITA), the segregated solvers are typically faster than the
coupled solver. The optimal choice is in most cases the SIMPLEC scheme. The default under-relaxation
parameters for this scheme are set for steady-state simulations. For SRS model simulations, they
should be changed to values as close as possible to 1 to improve iterative convergence. Typically,
the number of inner iteration loops required with SIMPLEC depends on the complexity of the flow
problem. The most critical quantity is the mass conservation. Mass residuals should decrease by at
least one order of magnitude every time step. With high under-relaxation and good grid quality,
good solutions can often be achieved even with only two inner loops.
The coupled solver is slower per iteration, but it can lead to more robust convergence, and for
complex cases can be advantageous. For the coupled solver, one would typically also specify under-
relaxation values of (or close to) 1. The number of inner loops is typically 2-5. In ANSYS CFX,
the coupled solver is used in all simulations.
For flows with additional physics (multiphase, combustion, and so on), the number of inner iterations
per time step can increase for all solvers.
It is important to emphasize that the optimal under-relaxation factors and the optimal number of
inner iterations is case-dependent. Some optimization might be required for achieving the most
efficient results.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
220 of ANSYS, Inc. and its subsidiaries and affiliates.
Initial and Boundary Conditions
For pure LES or WMLES, ANSYS Fluent offers an option for initializing the flow by converting turbulence
from RANS to LES mode (solve/initialize/init-instantaneous-vel) using a synthetic
turbulence generation routine. This option should be used with caution as it can, at times, have a
detrimental effect on the robustness of the simulation. It should be executed mainly for cases where
no synthetic turbulence is generated at an inlet/interface and where the inherent flow instability is
not strong enough to generate resolved turbulence on its own. A typical example would be the LES
of a channel flow with periodic boundary conditions in the streamwise direction. For such flows, the
solver could return a laminar solution even at super-critical (turbulent) Reynolds numbers if no initial
disturbance is provided.
In ANSYS CFX, synthetic turbulence is generated automatically in the first time step inside the LES
region of a ZLES set-up.
For global models (SAS, DDES/SDES/SBES), use standard (typically steady-state) RANS inlet conditions.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 221
Best Practices: Scale-Resolving Simulations in ANSYS CFD
For LES, one would typically have to apply wall functions in order to avoid the large resolution re-
quirements near the wall. The wall resolution in streamwise ( ), normal ( ) and spanwise ( ) direc-
tions are coupled.
(12.35)
Symmetry and slip wall conditions can be used if the resolved turbulence is confined to regions not
touching these boundaries.
Periodicity conditions can lead to problems for axi-symmetric situations. As the radius approaches
zero, the circumferential size of the domain goes to zero, and periodicity conditions would not enable
turbulence structures of finite size to exist. An example is the flow in an axi-symmetric pipe. If you
were to compute that flow in a pipe segment with periodicity conditions in the circumferential direc-
tion, you would restrict the size of the resolved eddies to zero near the axis. This effect is not correct
and would substantially alter the solution. Such a simulation would therefore have to be carried out
in full mode. Note that the situation would be different in the case of the flow through a ring
segment, where the axis is excluded from the SRS domain. Periodicity could be applied in the case
of with being the outer radius, the inner radius of the segment and being
a constant of the order 1 or larger.
(12.36)
where in different definitions the constant might be different (for historic reasons, in ANSYS
Fluent and in ANSYS CFD-Post). The value of the constant is typically unimportant as we
are only interested in visual impressions when using this quantity. In this definition, is the absolute
value of the Strain Rate and is the absolute value of vorticity.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
222 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing and Averaging
(12.37)
The rationale behind this definition is that we want to visualize vorticity, which characterizes turbulence
vortices, but also to subtract the mean shear rate in order to avoid displaying steady shear layers
(where ).
There are different definitions of , some of them non-dimensional. Avoid using non-dimensional
values as they can be mainly used for visualization of free vortices and their dynamics (for example,
tip vortex of an airplane wing). In turbulent flows, they can elevate very weak turbulence structures
to the same level as the strong ones and thereby produce an incorrect picture.
In ANSYS Fluent, the variable is called “ criterion” (under Turbulence) and in ANSYS CFD-Post
“Velocity.Invariant ” in the variable list. Both codes also have a non-dimensional version of (ANSYS
Fluent: “Normalized q criterion ,” ANSYS CFD-Post: “Location / Vortex Core Region, Method = -Cri-
terion”), which are not very descriptive for turbulence vortex fields.
The dimensional -values can be very large and can vary greatly in the domain. Frequently, values
up to can be found in high Re number flows. In such cases, isosurfaces in the range of
are typically sensible. You must experiment with some values for the isosurface before
obtaining a suitable picture. It might be helpful to first plot on a fixed surface as a contour plot
and select the correct scaling from that contour plot. Use positive values for the isosurface. Do not
use for visualization, as it will show very weak structures not relevant to turbulence visualizations.
It is also advisable to color the isosurface of with some other variable. Interesting quantities are
the eddy-viscosity ratio ( ), or a velocity component that is small or zero in RANS (such as the
spanwise velocity), or the CFL number, and so on. The visual inspection should be done continuously
during the entire start-up and run time of the simulations (once per day or after every 1000 time
steps). It serves the following purposes (see for example Figure 12.16 (p. 175) and Figure 12.17 (p. 175)):
• Check the size of the resolved eddies and see if they are as one would expect from the grid resolution.
• Check the CFL number on these eddies. It should be smaller than CFL 1. Check the eddy-viscosity ratio.
It should be much smaller than RANS.
• Check for global SRS turbulence models (SAS/DDES/SDES/SBES) if the turbulence structures develop early
in the separating shear layer or if a noticeable delay is observed (see Figure 12.26: Isosurfaces of the Q-
criterion colored with the velocity magnitude (p. 187)).
• Check for ELES/Unsteady inlet conditions, if synthetic turbulence is reasonable and does not decay (such
as in Figure 12.45 (p. 205)).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 223
Best Practices: Scale-Resolving Simulations in ANSYS CFD
• Check the progress of the simulation towards a statistically converged solution. This means that the resolved
turbulence requires some time until it has developed and has been transported through the domain.
Time-averaging has to wait until that stage has been achieved.
• Include pictures of turbulence structures in any reports of the test case (slides, reports, publications, service
requests).
• If possible make animations, which help to understanding of the flow physics and is also helpful for others
to understand the flow.
• Add monitoring points at interesting locations and plot their development in time to demonstrate statist-
ical convergence.
For all examples in this report, visual representations of the flows are included. These serve as a
guideline on how to process the results.
12.5.2. Averaging
Unsteady simulations with scale resolution require special care in postprocessing and averaging. En-
gineers are usually interested only in time-averaged results and not in the details of the unsteady
flowfield. It is therefore important to follow a systematic approach when computing such quantities.
The typical process is to start from a RANS solution (or reasonable initial condition). When switching
to any SRS model, the flow will require some time to statistically settle into a new state for the following
reasons:
• The resolved turbulence requires some time to develop and be transported through the domain.
• The global flow topology might change from the initial (RANS) solution.
• Other physical effects might require longer start-up times (such as multi-phase).
The general strategy is therefore to run the simulation for some start-up time , before activating
the averaging process (or initiating the acquisition of, for example, acoustics information). When
should this process be started and how long does it take until the flow is statistically steady? This is
the stage where any increase in would not change the averaged solutions. Unfortunately
depends strongly on the flowfield and no general guidelines can be given. For some flows, the flow
develops quickly (in a few thousand time steps). For others it takes tens of thousands of steps to
reach that point. However, a first estimate can be obtained by estimating throughflow time, . This
is the time that the mean flow requires to pass one time through the domain where
is the length of the domain and is the mean flow velocity. The turbulence statistics typically
require several (3-5) throughflow times to establish themselves. Again, this is just a rough estimate
and can depend on the particular flow.
In order to determine more systematically, one must monitor the simulation. It is advisable to
monitor some local and some global quantities.
• Continuously inspect the solution visually with the aid of regular images and updated animations.
• Inspect solution variables at monitor points in the critical zone of simulation (pressure, velocity, temper-
ature, and so on) as a function of time. The amplitude and frequency of local oscillations should become
regular before the averaged statistics can be gathered.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
224 of ANSYS, Inc. and its subsidiaries and affiliates.
Summary
• Monitor global quantities (forces on body, massflow, integrated swirl, and so on). Interesting quantities
are often those that would be zero for RANS (spanwise forces, and so on) as they are sensitive to the SRS
characteristics. They also help to evaluate the overall symmetry of the solution (they should fluctuate
around zero) and to determine slow transients (quantities that fluctuate around zero but with low overlaid
frequencies).
Only when all indicators show that the flow is no longer changing statistically (meaning only the
details of the turbulence structures are a function of time) should the averaging be activated. It is
important to document the number of steps that have already occurred when averaging was started
and how many steps have been averaged. With respect to averaged quantities:
• Monitor time-averaged quantities and ensure that they are not “drifting.” They will drift initially, but should
then settle to an asymptotic value.
• Ensure that they satisfy the symmetry conditions of the flow. Any asymmetry is an indicator of non-con-
vergence (exceptionally, there are flows that develop physical asymmetries despite a symmetric set-up.
Example: some symmetric diffusers separate from one side and stay attached on the other).
• In zonal/embedded simulations, check if averaged quantities are reasonably smooth across RANS-LES in-
terfaces (they will never be perfectly smooth, but should also not change drastically).
12.6. Summary
An overview of hybrid Scale-Resolving Simulation (SRS) technologies was given. Due to the nature of
the subject, only a rough outline of the models could be provided. The rational and the advantages/dis-
advantages of each model family have been discussed. Based on the description of the models, an at-
tempt has been made to categorize flows into sub-classes, and to map the modeling strategies onto
these classes. It should be emphasized again, that the proposed categories are not easily and clearly
defined and have significant overlap. Still it is considered necessary to explain that no single SRS model
is suitable for all applications and it is not possible to generalize about which model should be used
for which type of flow.
In principle, ELES and ZFLES, in combination with WMLES, are suitable for all flows, but require a sub-
stantial amount of preprocessing work to define the corresponding zones and provide suitable grids
for all of them. For complex applications, this is not always feasible/practical, and global models (SAS,
DDES, SDES, SBES) are favored. Studies have shown a clear superiority of the SBES model over all the
other global hybrid RANS-LES formulations. The SBES model is therefore recommended for such applic-
ations. However, as detailed, all of these models work only if a sufficient level of instability is present
in the flow. If in doubt, it is better to select the safer option over the more convenient one.
Details on many aspects of SRS have been provided, ranging from numerics, to grid resolution all the
way to postprocessing. Numerous examples have been shown to enable the reader to properly place
the intended application into this framework. It is anticipated that the document will evolve over time,
as new questions are posed by users and as the SRS models themselves will evolve.
12.6.1. Acknowledgment
The material in this report was prepared with the help of members of the turbulence team at ANSYS
Jochen Schütze, Yuri Egorov, Richard Lechner, as well as with the help of the colleagues at NTS in St.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 225
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Petersburg Mikhail Gritskevich and Andrey Garbaruk. Aleksey Gerasimov at ANSYS has provided a
very thorough review, which has resulted in the removal of numerous inconsistencies and has signi-
ficantly improved the quality and readability of the document. Some of the test cases have been run
in the framework of the EU projects DESIDER and ATAAC.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
226 of ANSYS, Inc. and its subsidiaries and affiliates.
Summary
• Check Q-criterion
carefully during run time
to ensure SRS structures
Detached • Use for globally unstable • DDES is not available for CFX
Eddy flows and with care also
Simulation for locally unstable flows • More aggressive than SAS in terms of
(DES) unsteadiness
• Always use DDES over
DES to reduce the • Careful grid generation important,
impact of the DES limiter otherwise danger of gray zones or
on attached boundary grid-induced separation
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 227
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Applications Comments
layers, and use the DDES
shielding function
• Use CFL~1
• Check -criterion
carefully during run time
to ensure SRS structures
Stress-Blended • Optimal model that • This is the model of choice for globally
Eddy features asymptotic and locally unstable flows.
Simulation shielding of the RANS
(SBES) boundary layer as well • Can also be used in WMLES mode, once
as explicit switch to LES content is introduce upstream. This
existing algebraic LES can be achieved by synthetic turbulence
model. Can also be run or by a previous RANS-LES transition
in WMLES mode. upstream (for example backstep).
Large • Use for free shear flows • Typically too expensive for
Eddy wall-bounded flows
Simulation • Use if boundary layers
(LES) are laminar
• Use CFL~1
• Apply synthetic
turbulence at inlets
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
228 of ANSYS, Inc. and its subsidiaries and affiliates.
Summary
Applications Comments
• Check -criterion
carefully during run time
to ensure SRS structures
Wall • Use for wall boundary • Scales much more favorably with
Modeled layers at moderate and Reynolds number than standard LES but
LES high Reynolds numbers still very expensive
(WMLES)
• Resolve boundary layer • Limit wall region to a small portion of
volume ( ) by flow domain (ELES)
cells
• Note that the SBES model (SST+WALE)
• Use CFL~1 can also provide WMLES capabilities.
• Apply synthetic
turbulence at inlets
• Check -criterion
carefully during run time
to ensure SRS structures
• Use CFL~1
• Apply synthetic
turbulence at RANS-LES
interface
• Check -criterion
carefully during run time
to ensure SRS structures
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 229
Best Practices: Scale-Resolving Simulations in ANSYS CFD
Applications Comments
• If large RANS-LES
interface cannot be
avoided increase (and
check) the number of
vortices specified. Can
be as high as 104.
• Use CFL~1
• Check Q-criterion
carefully during run time
to ensure SRS structures
Harmonic • Restrict inlet zone to the • Grid in LES region of interface must be
Turbulence LES minimal section of LES quality
Generator where turbulence must
(HTG) - be converted (do not
CFX extend LES zone far into
the freestream)
– Baffles in mixers
– Stalled wings/sails
– Trains/trucks/cars in crossflow
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
230 of ANSYS, Inc. and its subsidiaries and affiliates.
Summary
– Impinging/colliding jets
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 231
Best Practices: Scale-Resolving Simulations in ANSYS CFD
– Cavity flows
– Boundary layers
– Channel/pipe flows
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
232 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulations References
• Global model
• CFL number<1.
[1] Boris, J. P., Grinstein, F. F., Oran, E. S., and Kolbe, R. S. “New insights into Large Eddy Simulation”. Fluid
Dynamic Research. Vol. 10. 199-228. 1992.
[2] Cokljat D., Caradi D., Link G., Lechner R., and Menter F.R. “Embedded LES Methodology for General-
Purpose CFD Solvers”. 22-24 June 2009. Proc. Turbulent Shear Flow Phenomena, 6th Int. Symp.
Turbulence and Shear Flow Phenomena. Seoul, Korea. . 1191-1196.
[3] Comte-Bellot, G., and Corrsin, S. “Simple Eulerian time correlation of full- and narrow-band velocity
signals in grid-generated, “isotropic” turbulence”. Journal of Fluid Mechanics. Vol. 48, Part 2. 273-
337. 1971.
[4] Davidson, L. “Evaluation of the SAS-SST Model Channel Flow, Asymmetric Diffuser and Axi-Symmetric
Hill”. Proceedings European Conference on Computational Fluid Dynamics . ECCOMAS CFD. .
2006.
[5] Durbin, P., and Pettersson Reif, B.A. Statistical theory of turbulent flows. John Wiley and Sons, Ltd. UK.
2003.
[6] Egorov Y., Menter F.R., and Cokljat D. “Scale-Adaptive Simulation Method for Unsteady Flow Predictions.
Part 2: Application to Aerodynamic Flow”. Flow Turbulence and Combustion. Vol. 85, No. 1. 139-
165. 2010.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 233
Best Practices: Scale-Resolving Simulations in ANSYS CFD
[7] Fröhlich J., Mellen C.P., Rodi W., Temmerman L., and Leschziner M. “Highly resolved large-eddy simu-
lation of separated flow in a channel with streamwise periodic constrictions”. Journal of Fluid
Mechanics. Vol. 526. 19–66. 2005.
[8] Fröhlich J., and von Terzi, D. “Hybrid LES/RANS methods for simulation of turbulent flows”. Progress in
Aerospace Sciences. Vol. 44, Issue 5. 349-377. 2008.
[9] Girimaji, S. S. “Partially-Averaged Navier-Stokes Method: A RANS to DNS Bridging Method”. 2004.
[10] Girimaji, S., and Abdul-Hamid, K.S. “Partially-averaged Navier-Stokes model for turbulence: implement-
ation and validation”. AIAA Aerospace Sciences Meeting and Exhibit. Reno, Nevada. . 2005-0502.
2005.
[11] Gritskevich, M.S. Garbaruk, A.V., Schütze, J., and Menter F.R. “Sensitization of DDES and IDDES Formu-
lations to the Shear-Stress Transport Model”. Flow Turbulence and Combustion. 2012.
[12] Geurts, B. J.. Elements of direct and large-eddy simulation. Edwards Inc. Philadelphia, USA. 2004.
[13] Hanjalic, K., and Launder, B. Modelling Turbulence in Engineering and the Environment. Cambridge
University Press. Cambridge, UK. 2011.
[14] Jasak H., Weller H.G., and Gosman A.D. “High Resolution Differencing Scheme for Arbitrarily Unstructured
Meshes”. International Journal for Numerical Methods in Fluids. Vol. 31. 431-449. 1999.
[15] Mathey, F., Cokljat, D., Bertoglio, J.P., and Sergent, E. “Specification of LES Inlet Boundary Condition
Using Vortex Method. 4th International Symposium on Turbulence, Heat and Mass Transfer. An-
talya, Turkey. . 2003.
[16] Menter, F. R. “Two-equation eddy-viscosity turbulence models for engineering applications”. AIAA
Journal. Vol. 32, No. 8. 1598–1605. 1994.
[17] Menter F.R., Garbaruk A., and Smirnov P. “Scale adaptive simulation with artificial forcing”. Proc. 3rd
Symposium on Hybrid RANS-LES Methods . . 2009.
[18] Menter, F.R., and Egorov, Y. “Scale-Adaptive Simulation Method for Unsteady Flow Predictions. Part 1:
Theory and Model Description”. Flow, Turbulence and Combustion . Vol. 85, No. 1. 113– 138. 2010.
[19] Menter, F.R., and Kuntz, M. “Adaptation of Eddy-Viscosity Turbulence Models to Unsteady Separated
Flow Behind Vehicles”. Proc. Conf. The Aerodynamics of Heavy Vehicles: Trucks, Busses and Trains.
Asilomar, California. Springer . . 2002.
[20] Michelassi V., Wissink, J. G., and Rodi W. “Direct numerical simulation, large eddy simulation and un-
steady Reynolds-averaged Navier-Stokes simulations of periodic unsteady flow in a low-pressure
turbine cascade: A comparison”. Journal of Power and Engineering . Vol 217, Number 4. 403– 411.
2003.
[21] Morris S. C. and Foss J. F.. “Turbulent boundary layer to single-stream shear layer: the transition region”.
Journal of Fluid Mechanics Fluid Mech.. Vol 494. 187–221. 2003.
[22] Nicoud, F., and Ducros, F. “Subgrid-scale stress modelling based on the square of the velocity gradient
tensor”. Flow, Turbulence and Combustion . Vol. 62. 183– 200. 1999.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
234 of ANSYS, Inc. and its subsidiaries and affiliates.
Scale-Resolving Simulations References
[25] Sagaut, P., Deck, S., and Terracol, M. Multiscale and multiresolution approaches in turbulence. Imper-
ial College Press. London. 2006.
[26] Schildmacher, K.-U., Koch, R., Wittig, S., Krebs, W., and Hoffmann, S. “Experimental investigations of
the temporal air-fuel mixing fluctuations and cold flow instabilities of a premixing gas turbine
burner”. ASME Paper 2000-GT-0084. 2000.
[27] Shur, M.L., Spalart, P.R., Strelets, M.K., and Travin, A.K. “A hybrid RANS-LES approach with delayed-DES
and wall-modeled LES capabilities”. International Journal of Heat and Fluid Flow . Vol. 29. 1638-
1649. 2008.
[28] Sjunnesson, A., Henriksson, R., and Lofstrom, C. “CARS measurements and Visualization of Reacting
Flows in Bluff Body Stabilized Flame”. AIAA Paper 1992–3650. 1992.
[29] Smagorinsky, J. “General Circulation Experiments with the Primitive Equations”. Monthly Weather Review.
Vol. 91. 99 – 165. 1963.
[30] Spalart, P.R., Jou, W., Strelets, M., and Allmaras, S. “Comments on the feasibility of LES for wings, and
on a hybrid RANS/LES approach”. Advances in DNS/LES. 1st AFOSR Int. Conf. on DNS/LES. . 1997.
[31] Spalart, P. R. “Strategies for turbulence modelling and simulations”. International Journal of Heat and
Fluid Flow. Vol. 21. 2. 2000.
[32] Spalart, P., Deck, S., Shur, M., Squires, K., Strelets, M., and Travin, A. “A New Version of Detached Eddy
Simulation, Resistant to Ambiguous Grid Densities”. Journal of Theoretical and Computational Fluid
Dynamics. Vol. 20. 181 –195. 2006.
[33] Strelets, M. “Detached Eddy Simulation of massively separated flows”. AIAA Paper 2001-879. 2001.
[34] Travin, A., Sur M., Strelets, M., and Spalart P. “Physical and numerical upgrades in the detached eddy
simulation of complex turbulent flows , In Advances in LES of complex flows ”. eds. R. Friedrich, W.
Rodi . Kluwer Acad. New York. 239-254. 2000.
[35] Vogel, J.C., and Eaton, J.K. “Combined heat transfer and fluid dynamic measurements downstream of
a backward-facing step”. Journal of Heat and Mass Transfer. Vol. 107. 922 –929. 1985.
[36] Wagner, C., Hüttl, T., and Sagaut, P. “Large-eddy simulation for acoustics”. Cambridge University Press.
2007.
[37] Westin, J., Alavyoon F., Andersson, L. Veber, P., Henriksson, M., and Andersson, C. “Experiments and
Unsteady CFD-Calculations of Thermal Mixing in a T-Junction” . OECD/NEA/IAEA Workshop on the
Benchmarking of CFD Codes for Application to Nuclear Reactor Safety (CFD4NRS). Munich, Ger-
many. . 1–15. 2006.
[38] Widenhorn, A., Noll, B., and Aigner, M. “Numerical Study of a Non-Reacting Turbulent Flow in a Turbine
Model Combustor”. AIAA Paper 2009-647, Orlando Florida . 2009.
[39] Wilcox, D.C. “Turbulence Modeling for CFD”. DCW Industries Inc. 3rd Edition. 2006.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 235
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
236 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 13: CFX Command Language (CCL)
The CFX Command Language (CCL) is the internal communication and command language of ANSYS
CFX. It is a simple language that can be used to create objects or perform actions in the post-processor.
All CCL statements can be classified into one of three categories:
• Object and parameter definitions, which are described in Object Creation and Deletion.
• CCL actions, which are commands that perform a specific task (such as reading a session file) and which are
described in Command Actions in the CFD-Post User's Guide.
• Power Syntax programming, which uses the Perl programming language to allow loops, logic, and custom
macros (subroutines). Power Syntax enables you to embed Perl commands into CCL to achieve powerful
quantitative postprocessing. For details, see Power Syntax in ANSYS CFX (p. 341).
State files and session files contain object definitions in CCL. In addition, session files can also contain
CCL action commands. You can view and modify the CCL in these files by using a text editor.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 237
CFX Command Language (CCL)
• If the object type does not need a name, it is called a singleton object. Only one object of a given singleton
type can exist.
Objects and parameters may be placed in any order, provided that the information is set prior to
being used further down the file. If data is set in one place and modified in another, the latter
definition overrides the first.
In CFD-Post, all object definitions are only one object level deep (that is, objects contain parameters,
but not other objects).
Case sensitivity is not ideal for typing in many long parameter names, but it is essential for bringing
the CFX Expression Language (CEL) into CCL. This is because some names used to define CCL objects
(such as Fluids, Materials and Additional Variables) are used to construct corresponding
CEL names.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
238 of ANSYS, Inc. and its subsidiaries and affiliates.
CFX Command Language (CCL) Syntax
• Parameter names, and predefined object names, are mixed case. The CFX Expression Language tries to
follow the following conventions:
1. Major words start with an upper case letter, while minor words such as prepositions and conjunctions
are left in lower case (for example, Mass Flow in).
2. Case is preserved for familiar names (for variables k or r), or for abbreviation RNG.
• In simple syntax, a CCL name must be at least one character. This first character must be alphabetic;
there may be any number of subsequent characters and these can be alphabetic, numeric, space or tab.
– Spaces appearing before or after a name are not considered to be part of the name.
– Multiple spaces and tabs appearing inside a name are treated as a single space.
13.1.3.3. Indentation
Nothing in the file is sensitive to indentation, but indentation can be used for easier reading.
Object names must be unique within the given scope, and the name must not contain an underscore.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 239
CFX Command Language (CCL)
The difference between a singleton object and a named object is that (after the data has been
processed), a singleton can appear just once as the child of a parent object. However, there may
be several instances of a named object of the same type defined with different names.
13.1.3.8. Parameters
A parameter consists of a parameter name at the start of a line followed by an = character followed
by a parameter value. A parameter may belong to many different object types. For example, U
Velocity = 1.0 [m/s] may belong to an initial value object and U Velocity = 2.0
[m/s] may belong to a boundary condition object. Both refer to the same definition of U velocity
in the rules file.
13.1.3.9. Lists
Lists are used within the context of parameter values and are comma separated.
13.1.3.10.1. String
• Any characters can be used in a parameter value.
• String values or other parameter type values are normally unquoted. If any quotes are present, they
are considered part of the value. Leading and trailing spaces are ignored. Internal spaces in parameter
values are preserved as given, although a given application is free to subsequently assume a space
condensation rule when using the data.
• The characters $ and # have a special meaning. A string beginning with $ is evaluated as a Power
Syntax variable, even if it occurs within a simple syntax statement. This is useful for performing more
complex Power Syntax variable manipulation, and then using the result as part of a parameter or
object definition. The appearance of # anywhere in the CCL file denotes the start of a comment.
• The characters such as [, ], {, and } are special only if used in conjunction with $. Following a $,
such characters terminate the preceding Perl variable name.
• Other characters that might be special elsewhere in power syntax are escaped automatically when
they appear in parameter values. For example, @, % and & are escaped automatically (that is, you do
not need to precede these characters with the escape character \ when using them in parameter
values).
• Parameter values can contain commas, but if the string is processed as a List or part of a List then the
commas may be interpreted as separators (see below under List data types).
Some examples of valid parameter values using special characters in power syntax are:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
240 of ANSYS, Inc. and its subsidiaries and affiliates.
CFX Command Language (CCL) Syntax
Parameter values for data types other than String will additionally conform to one of the following
definitions.
13.1.3.10.3. Integer
Sequence of digits containing no spaces or commas. If a real is specified when an integer is
needed, the real is rounded to the nearest integer.
13.1.3.10.5. Real
A single-precision real number that may be specified in integer, floating point, or scientific format,
followed optionally by a dimension. Units use the same syntax as CEL.
Expressions are allowed to include commas inside function call argument lists.
Example usage:
a = 12.24
a = 1.224E01
a = 12.24 [m s^-1]
The list syntax 5*2.0 to represent 5 entries of the value 2.0 is not supported within CCL and
hence within CFD-Post.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 241
CFX Command Language (CCL)
13.1.3.10.7. Logical
Several forms are acceptable: YES, TRUE, 1 or ON are all equivalent; NO or FALSE or 0 or OFF
are all equivalent; initial letter variants Y, T, N, F are accepted (O is not accepted for On/Off); all
case variants are accepted. Logical strings are also case insensitive (YeS, nO).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
242 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 14: CFX Expression Language (CEL)
CFX Expression Language (CEL) is an interpreted, declarative language that has been developed to enable
CFX users to enhance their simulations without recourse to writing and linking separate external Fortran
routines.
You can use CEL expressions anywhere a value is required for input in ANSYS CFX.
You can also monitor the value of an expression during the solution using monitor points.
Note:
CFX-Pre and CFD-Post evaluate CEL expressions with single (not double) precision.
Important:
There is some CEL that works elsewhere in ANSYS CFX, but not in CFD-Post. Any expression
created in CFX-Pre and used as a Design Exploration output parameter could potentially
cause fatal errors during the Design Exploration run, so you should create all expressions for
Design Exploration output parameters in CFD-Post.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 243
CFX Expression Language (CEL)
b = 3.743
g = 9.81 [m s^-2]
The dimensions of the quantities of interest for CFD calculations can be written in terms of mass,
length, time, temperature and angle. The concept of units is fundamental to the behavior of values
and expressions.
Values can be used directly, or they can be used as part of an expression. For example, you can use
an expression to add two values together:
<Expr_1> = <Value_1> + <Value_2>
In this example, you may want to predefine <Value_1> and <Value_2>, but this is not required.
However, in order to add two quantities together, they must have the same dimension; that is, it is
meaningful to add a quantity in inches to one expressed in meters, but it is not meaningful to add
one expressed in kilograms to one in square feet.
Units follow the conventions in the rest of CFX, in that a calculation has a set of solution units (by
default, SI units), and that any quantity can be defined either in terms of the solution units, or any
other set of units with the correct form.
An expression does not have its own units string, but if it references quantities that have dimensions,
these will determine the resulting units for the expression. For example, if an expression depends
inversely on the square of the x coordinate, then it has implied dimensions of length to the power -2.
To avoid these ambiguities, ANSYS CFX first checks to see if "@<locator>" is a physics name; if this
is not found, the name is checked in the list of mesh names. Thus if "in1" is both the name of a
physics area and the name of a mesh area, "@<locator>" is taken to indicate the physics area.
ANSYS CFX also has @REGION CEL syntax so that you can identify a named area as being a mesh
area. Thus to identify the mesh area in1, you would use the syntax:
@REGION:in1
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
244 of ANSYS, Inc. and its subsidiaries and affiliates.
CEL Fundamentals
Note that if <locator> does not appear as a physics name or a mesh name, the expression fails.
Note:
For any CCL expression that is defined for a location (such as a domain, boundary, sub-
domain), coordinates (x, y, z, r, theta) are interpreted in the local frame but variables are
normally interpreted in the global frame.
• a number, optionally with associated units. This defines a constant. Constants without units are termed
dimensionless.
• for mathematical expressions, one or more references to mathematical constants, system variables, or
existing user variables, 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.
• for logical expressions involving relational operators, one or more references to mathematical constants
or results from mathematical expressions, separated by <= (is less than or equal to), < (is less than), == (is
equal to), != (is not equal to), > (is greater than) and >= (is greater than or equal to) with optional
grouping of these by parentheses.
• for logical expressions involving logical operators, one or more references to logical constants or results
from relational operations separated by ! (negation), && (logical AND) and || (logical OR), with optional
grouping by parentheses.
The logical constants are false and true. Results of logical expressions are either false or true,
which are evaluated as 0 and 1 (corresponding to false and true, respectively) when a numer-
ical representation is required.
The use of constants may be of benefit in generating complicated expressions or if you have several
expressions that use the same constants.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 245
CFX Expression Language (CEL)
The precedence of logical and relational operators is as follows (from highest to lowest):
• The relational operators involving less than or greater than (<=, <, > and >=) as in x >= y.
• The relational operator is equal to and is not equal to (== and !=) as in x != y.
For example, you may have an equation, A + B/C, that consists of three complex terms, A, B, and
C. In this case, you could use three lines to simplify creating the expression:
A +
B
/ C
Note that the operator may be used at the end of a line (A +) or at the beginning of a line (/ C).
You do not need to enter the operator twice.
Once the expression has been created, it will appear in the Existing Definitions list box as if it were
generated on a single line (A + B/C).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
246 of ANSYS, Inc. and its subsidiaries and affiliates.
CEL Operators, Constants, and Expressions
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 247
CFX Expression Language (CEL)
where:
• true_expr: is the mathematical expression used to determine the result if the conditional test is
true.
• false_expr : is the mathematical expression used to determine the result if the conditional test
is false.
Note:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
248 of ANSYS, Inc. and its subsidiaries and affiliates.
CEL Examples
• a use phase.
The definition phase consists of creating a set of values and expressions of valid syntax. The purpose
of the Expression details view is to help you to do this.
These are only equivalent because all units are to the power of unity and units other than [K] appear
no more than once in each expression. The following expression will not produce the expected
result:
Temperature = 0 [C] + 30 [C]
This is equivalent to 576.30 [K] because each value is converted to [K] and then summed. The
two expression below are equivalent (as expected) because the offset in scales is ignored for non-
unit powers of temperature:
Specific Heat = 4200 [J kg^-1 C^-1]
Specific Heat = 4200 [J kg^-1 K^-1]
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 249
CFX Expression Language (CEL)
Given this information it is possible to calculate the fluid dynamic viscosity based on the Reynolds
number. The Reynolds number is given by:
where is density, U a velocity scale, L a length scale and the dynamic viscosity. The velocity scale
is taken as the inlet velocity, the length scale as the inlet width and the density is calculated as the
average density over the inlet area.
The LIBRARY section of the CCL (CFX Command Language) file appears as follows:
LIBRARY :
CEL :
EXPRESSIONS :
Re = 4.29E6 [ ]
Vel = 60 [m s^-1]
L=1.044[m]
Visc=areaAve(density)@in*Vel*L/Re
END
END
MATERIAL : Air Ideal Gas
Option = Pure Substance
PROPERTIES :
Option = Ideal Gas
Molar Mass = 2.896E1 [kg kmol^-1]
Dynamic Viscosity = Visc
Specific Heat Capacity = 1.E3 [J kg^-1 K^-1]
Thermal Conductivity = 2.52E-2 [W m^-1 K^-1]
END
END
END
This shows that four CEL expressions have been created. The first three expressions define constant
values that are used in the Visc expression. The Visc expression calculates the dynamic viscosity
based on the equation for Reynolds number given above. Within the expression the function
areaAve(density)@in is used to evaluate the average density at the inlet.
The Visc expression can now be used to replace the value of Dynamic Viscosity in the MATER
IAL > PROPERTIES section.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
250 of ANSYS, Inc. and its subsidiaries and affiliates.
CEL Examples
Fluid from a main and a side inlet enter at temperatures of 275 K and 375 K respectively. The temper-
ature of the fluid entering from the third inlet depends on the outlet temperature. When the outlet
temperature is greater than 325 K, the fluid from the third inlet is set to 275 K. When the outlet tem-
perature is less than 325 K, the fluid from the third inlet is set to 375 K. In addition an expression is
used to set the dynamic viscosity to be a linear function of temperature.
The LIBRARY section of the .ccl (CFX Command Language) file appears as follows. Note that the “\”
character indicates a line continuation in CCL.
LIBRARY:
MATERIAL: Water at STP Modified
Option = Pure Substance
PROPERTIES:
Option = General Fluid
Density = 9.999E2 [kg m^-3]
Dynamic Viscosity = VisT
Specific Heat Capacity = 4.21E3 [J kg^-1 K^-1]
Thermal Conductivity = 5.69E-1 [W m^-1 K^-1]
END # PROPERTIES
END # MATERIAL Water at STP Modified
CEL:
EXPRESSIONS:
Tupper = 375.0 [ K ] # Upper temp.
Tlower = 275.0 [ K ] # Lower temp.
Visupper = 0.000545 [ N s m^-2 ] # Vis. at Tupper
Vislower = 0.0018 [ N s m^-2 ] # Vis. at Tlower
VisT = Vislower+(Visupper-Vislower)*(T-Tlower)/ \
(Tupper-Tlower)
# Vis.-Temp. relationship
Tm=(Tupper+Tlower)/2
Tout=areaAve(Water at STP Modified.T)@outlet
Tcontrol=Tlower*step((Tout-Tm)/1[K]) \
+Tupper*step((Tm-Tout)/1[K])
END # EXPRESSIONS
END # CEL
END # LIBRARY
The first four expressions, Tupper, Tlower, Visupper and Vislower are simply constant values
to define temperature and viscosity values. The expression VisT produces a linear function for the
dynamic viscosity taking a value of Visupper at Tupper and a value of Vislower at Tlower.
The expression Tm sets the desired value of the outlet temperature. In this case it is set to a mean
value of the two inlet temperatures.
Finally the expression Tcontrol is used to set the temperature of the third inlet. Two step functions
are used so that the temperature is equal to Tlower when Tout-Tm is positive (that is, the outlet
temperature is greater than Tm), and is equal to Tupper when Tout-Tm is positive.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 251
CFX Expression Language (CEL)
When you click Apply, the value is shown below the editor.
Tip:
Alternatively, type the expression in a table cell and prefix with ‘=’ sign. The cell displays
the result when you click outside of the cell.
The second example is a variable expression that plots the pressure coefficient variation on a surface
or a line:
1. Click the Expressions tab, then right-click in the Expressions area and select New.
5. Select Insert > Location > Line and use the details view to position the line in the simulation.
From the details view Color tab, plot the user variable on a surface or a line (just as you would
with any other variable).
Because the byte codes are interpreted, there is no need to re-link executable programs to perform a
different calculation. Furthermore, many of the problems encountered by writing and linking in separate
routines, for instance in C or Fortran, are averted, and the time taken to set up and debug complicated
problems reduced considerably.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
252 of ANSYS, Inc. and its subsidiaries and affiliates.
CEL Technical Details
The link between CEL and the CFX-Solver is accomplished through an internal program called genicode.
Genicode generates intermediate code from your CEL definitions and writes to a file that is then inter-
preted by the CFX-Solver during the solution process.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 253
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
254 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 15: Functions in ANSYS CFX
This chapter describes predefined functions in ANSYS CFX:
15.1. CEL Mathematical Functions
15.2. Quantitative CEL Functions in ANSYS CFX
15.3. Functions Involving Coordinates
15.4. CEL Functions with Multiphase Flow
15.5. Quantitative Function List
Note:
In the Function column in the table below, [a] denotes any dimension of the first operand.
besselJ( [ ], [ ] )b Dimensionless
besselY( [ ], [ ] )b Dimensionless
cos( [radians] ) Any Dimensionless
cosh( [ ] ) Any Dimensionless
exp( [ ] ) Any Dimensionless
c Dimensionless Dimensionless
int([ ])
loge( [ ] )d Dimensionless
log10( [ ] )e Dimensionless
min( [a], [a] ) Any [a]
max( [a], [a] ) Any [a]
mod( [a], [a] )f Any [a]
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 255
Functions in ANSYS CFX
Examples:
int(1) = 1
int(2.5) = 2
int(-3.1) = -3
int(-4.8) = -4
The int() function requires a dimensionless argument but will not report an error if the argument of the function has a dimension
of radians or degrees.
d
ln(x) is valid as an alias for loge(x)
e
log(x) is valid as an alias for log10(x)
f
mod(x, y) returns the remainder on dividing x by y; the function is not defined for y = 0.
g
The nint function requires a dimensionless argument and is defined as:
Examples:
nint(2.6) = 3
nint(2.5) = 3
nint(2.4) = 2
nint(1) = 1
nint(-1) = -1
nint(-2.4) = -2
nint(-2.5) = -3
nint(-2.6) = -3
Note that the nint() function will not report an error if the argument of the function has a dimension of radians or degrees.
h
step(x) is 0 for negative x, 1 for positive x and 0.5 for x=0. x must be dimensionless.
i
tan(x) is undefined for x=n /2, where n=1, 3, 5, ...
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
256 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative CEL Functions in ANSYS CFX
Important:
You must use consistent units when adding, subtracting, or comparing values.
There are some differences between CEL functions in CFX-Pre and CFX-Solver and those in
CFD-Post. For details, see below.
The syntax used for calling these functions when used within CEL expressions is:
[<Phase_Name>.][<Component_Name>.]<Function>([<Operand>])@<Location>
where:
• Terms enclosed in square brackets [ ] are optional and terms in angle brackets < > should be replaced
with the required entry.
• <Phase_Name>: specifies a valid name of a phase. The phase can be fluid, particle, solid, fluid pair, or
polydispersed fluid. For multi-phase cases in CFX-Pre, if the phase name is not specified in the <Operand>,
then the phase name associated with the domain, subdomain, domain boundary, initialization or function
in which the operand is being evaluated will be used. For multi-phase cases in CFX-Pre, a discussion of the
handling of the phase name when it is not used to qualify (prepended to) <Function> and/or <Operand>
can be found in CEL Functions with Multiphase Flow (p. 260). For multi-phase cases in CFD-Post, if the phase
name is not specified then the bulk quantity (if available for the CFX-Solver Results file) is used.
• <Component_Name>: specifies a valid name of a component material, size group, or reaction. For multi-
component cases in CFX-Pre, if the component name is not specified in the <Operand>, then the component
name associated with the domain, subdomain, domain boundary, initialization or function in which the
operand is being evaluated is used.
• <Function>: specifies the CEL function to evaluate. See Quantitative Function List (p. 261). The function
can be further qualified by appending _Coordinate_Direction. In CFX-Pre, if the coordinate frame is
not specified (in _Coordinate_Direction ) then the function will use the coordinate frame associated
with the object (such as for a material, domain, subdomain, domain boundary, source point, monitor point,
initialization, reference location or spark ignition object) in which it is being invoked.
• <Operand>: specifies the argument of the function (if required). The operand can be either a valid math-
ematical CEL expression (only in CFD-Post) or specified using the following general variable syntax:
[<Phase_Name>.][<Component_Name>.]<Variable_Name>[.<Variable_Operator>][.Difference]
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 257
Functions in ANSYS CFX
In CFX-Pre the operand cannot be a CEL expression or any operand qualified by <Variable_Oper
ator>. However, you can create an Additional Variable based on any expression and then use the
Additional Variable as the operand. In this case, it is important to qualify component variables with
their respective component names; any unqualified variables are assumed to be in the context of
the mixture rather than any particular mixture component.
The operand always uses the conservative values unless the Boundcon variable operator is specified
(for details, see Data Acquisition Routines in the CFX-Solver Modeling Guide). For primitive or composite
mesh regions, conservative values will be used even if the Boundcon variable operator is specified.
The operand must be valid for the physical models being used over the entire location. For example,
if the location spans fluid and solid domains, then the operand cannot be Pressure.
In CFD-Post, difference variables created during case comparison are appended by .Difference.
• <Variable_Name>: specifies the base name of the variable. You can use the short or long form for variable
names. In CFX-Pre the variable name can be further qualified by appending _<Coordinate_Direction>.
This is useful for specifying a particular component of a vector or tensor, for example Velocity_y_myLoc
alFrame. In CFX-Pre, if the variable name corresponds to that of a component of a vector or a tensor and
coordinate frame is not prescribed (as part of the coordinate direction) then the global coordinate frame is
used. An exception applies for the position vector x, y, z (or r, theta, z) components, which are always
local, see Functions Involving Coordinates (p. 260).
• <Variable_Operator> specifies the name of the variable operator. The variable operators are.
All but the <Derived> operator are available in CFX-Pre and the CFX-Solver. See Data Acquisition
Routines in the CFX-Solver Modeling Guide. The <Derived> variable operator is available only in
CFD-Post, for example Absolute Helicity derived for use with Vortex Cores, see Vortex Core
Region in the CFD-Post User's Guide. In CFX-Pre the variable operator can be further qualified by ap-
pending _<Coordinate_Direction>.
The Magnitude and Curl operators may only be applied to vector variables. All other operators
may be applied to scalar variables and vector components.
• <Location>: specifies the location over which the function is to be applied. The syntax of location is:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
258 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative CEL Functions in ANSYS CFX
[Case:<Case_Name>.][REGION:]<Location_Name>
The case syntax [Case:<Case_Name>.] is only available in CFD-Post. When multiple cases are
loaded, this syntax is used to narrow down the locator to the desired case.
In CFD-Post [<Location_Name>] can be any loaded or user-defined location (for example, a point,
domain boundary, plane, mesh region, or injection region). The syntax REGION:<Region Name>
can also be used in CFD-Post to refer to any mesh region. If a mesh region is present with the same
name as, for example, a domain boundary, then the mesh region is imported into CFD-Post with a
Region suffix. For example, if there is both a domain boundary and a mesh region called in1 in
the CFX-Solver Results file, then in CFD-Post the mesh region will appear in CFD-Post as in1 Region.
The syntax in1 will refer to the domain boundary, and either of in1 Region or REGION:in1 can
be used to refer to the mesh region as desired.
Note:
You cannot use a composite region that consists of a mixture of regions from more than
one of the following categories: 2D regions, 3D regions, injection regions.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 259
Functions in ANSYS CFX
Note:
These functions are available in CFX-Pre and CFX-Solver without restrictions, and in CFD-Post
with the restriction that you cannot use short names.
If the function is fluid-specific, various behaviors are possible depending on the function type:
• For massFlow and massFlowAve, if the phase name is not specified for the function, then the bulk mass
flows will be used. See cases 1 to 7 in the table below.
– if a fluid-specific operand is specified and no fluid is specified for the function, then the fluid specified for
the operand will be assumed for the function as well. See case 8 in the table below.
– if the function is specified and no fluid is specified for the operand, then the fluid specified for the function
will be assumed for the operand as well. See cases 7 and 9 in the table below.
• If both the function or operand are fluid-specific, and a phase name is not given for either, the solver will
stop with an error. See case 10 in the table below.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
260 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
In the table that follows, <Expression> applies to CFD-Post only. CFX-Pre and CFX-Solver can only accept
variables as arguments to quantitative functions. Note that for CFX-Pre and CFX-Solver, an Additional
Variable can be used to pass an expression indirectly into a quantitative function.
The behavior of the functions in the table below depends on the type of <Location>. Typically:
• On domains and subdomains, the functions use vertex (node) values for the operand.
• On a boundary, the functions use conservative values for the operand unless this is overridden by the
Boundcon variable operator in CFX-Pre.
• On user locations in CFD-Post, the functions use values interpolated from nodal values.
Supports “@<Location>”.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 261
Functions in ANSYS CFX
Supports “@<Location>”.
areaAve(<Variable|Expression>) Area-weighted average of All
<Variable|Expression> on a 2D
region, such as boundary,
interface, or injection region. For
an injection region, only the
cumulative geometry of the
injection positions is considered,
not the location of the entire
injection region.
Supports “@<Location>”.
Supports “@<Location>”.
areaInt(<Variable|Expression>) Area-weighted integral of All
<Variable|Expression> on a 2D
region, such as boundary,
interface, or injection region. For
an injection region, only the
cumulative geometry of the
injection positions is considered,
not the location of the entire
injection region.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
262 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
Supports “@<Location>”.
Supports “@<Location>”.
ave(<Variable|Expression>) Arithmetic average of All
<Variable|Expression> over nodes
within a domain, subdomain, or
injection region. For an injection
region, an average value is
calculated at each position, and
then these are averaged over all
positions.
Supports “@<Location>”.
Supports “@<Location>”.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 263
Functions in ANSYS CFX
Supports “@<Location>”.
Supports “@<Location>”.
Supports “@<Location>”.
Supports “@<Location>”.
Supports “@<Location>”.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
264 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
Supports “@<Location>”.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 265
Functions in ANSYS CFX
Supports “@<Location>”.
Supports “@<Location>”.
Supports “@<Location>”.
Supports “@<Location>”.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
266 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
Supports “@<Location>”.
Supports “@<Location>”.
Supports “@<Location>”.
Supports “@<Location>”.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 267
Functions in ANSYS CFX
Supports “@<Location>”.
15.5.1. area
The area function is used to calculate the area of a 2D locator.
area[_<Axis>[_<Coord Frame>] ]()@<Location>
where:
• <Axis> is x, y, or z
• <Location> is any 2D region (such as a boundary or interface) or injection region. For an injection region,
only the cumulative geometry of the injection positions is considered, not the location of the entire injection
region.
An error is raised if the location specified is not a 2D object. If an axis is not specified, the total area
of the location is calculated.
The specification of an axis is optional. If an axis is not specified, the value held in the object will
be used. To calculate the total area of the location, the axis specification should be left blank (that
is, type a comma after the location specification).
>calculate area, myplane calculates the area of the locator myplane projected onto a
plane normal to the axis specification in the CALCULATOR object.
>calculate area, myplane, calculates the area of the locator myplane. Note that adding
the comma after myplane removes the axis specification.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
268 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
15.5.2. areaAve
The areaAve function calculates the area-weighted average of a variable or expression on a 2D
location. The area-weighted average of a variable or expression is the average value of the variable
or expression on a location with the mesh element sizes taken into account. Without the area
weighting function, the average of all the nodal variable or expression values would be biased towards
values in regions of high mesh density.
areaAve[_<Axis>[_<Coord Frame>] ](<Variable|Expression>)@<Location>
where:
• <Axis> is x, y, or z.
• <Location> is any 2D region (such as a boundary or interface) or injection region. For an injection region,
only the cumulative geometry of the injection positions is considered, not the location of the entire injection
region. An error is raised if the location specified is not a 2D object.
You can create an expression using this, and then create a user variable using the expression. The
user variable can then be plotted on objects like any other variable.
Note:
Projected areaAve (for example, areaAve_x) works as expected only for surfaces that do
not fold in the selected direction. In extreme case, if the surface is fully closed, the projected
average will result in a randomly large number, as the projected area will be zero.
Note that flow direction is not considered because the magnitude of a vector quantity at each
node is calculated.
• You can use the scalar components of Velocity (such as Velocity u) to include a directional sign.
This example will calculate the area-weighted average value of Velocity u, with negative values of
Velocity u replaced by zero. Note that this is not the average positive value because zero values
will contribute to the average.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 269
Functions in ANSYS CFX
15.5.3. areaInt
The areaInt function integrates a variable over the specified 2D location. To perform the integration
over the total face area, select the None option from the Axis drop-down menu. If a direction is se-
lected, the result is an integration over the projected area of each face onto a plane normal to that
direction. Each point on a location has an associated area that is stored as a vector and therefore has
direction. By selecting a direction in the function calculator, you are using only a single component
of the vector in the area-weighting function. Because these components can be positive or negative,
depending on the direction of the normal on the location, it is possible for areas to cancel out. An
example of this would be on a closed surface where the projected area will always be zero (the results
returned will not in general be exactly zero because the variable values differ over the closed surface).
On a flat surface, the normal vectors always point in the same direction and never cancel out.
areaInt[_<Axis>[_<Coord Frame>] ](<Variable|Expression>)@<Location>
where:
• <Axis> is x, y, or z.
Axis is optional; if not specified the integration is performed over the total face area. If axis is spe-
cified, then the integration is performed over the projected face area. A function description is
available.
• <Location> is any 2D region (such as a boundary or interface) or injection region. For an injection region,
only the cumulative geometry of the injection positions is considered, not the location of the entire injection
region. An error is raised if the location specified is not a 2D object.
Axis is optional. If it is not specified, the value held in the object will be used. To perform the integ-
ration over the total face area, the axis specification should be blank (that is, type a comma after
the location name). A function description is available in areaInt (p. 270).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
270 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
• This example integrates Pressure over the projected area of Plane 1 onto a plane normal to the X
axis. The result is the pressure force acting in the X direction on Plane 1. This differs slightly from
using the force function to calculate the X-directional force on Plane 1. The force function includes
forces due to the advection of momentum when calculating the force on an internal arbitrary plane or
a non-wall boundary (inlets, and so on).
15.5.4. ave
The ave function calculates the arithmetic average of a variable or expression on the specified location.
Note:
CFD-Post and CFX-Solver may compute slightly different average values due to differences
in how the average is computed:
• CFD-Post computes the arithmetically averaged vertex value for the location. Specifically, the
average is computed by summing the vertex values and then dividing by the number of vertices.
• CFX-Solver computes the arithmetically averaged face value for the location. Specifically, the
average is computed by summing the face values and then dividing by the number of faces.
The value for a particular face is computed by arithmetically averaging the vertex values of the
face.
• Computation in CFX-Solver and CFD-Post can be made more consistent by using expert para-
meter bcp arithmetic aver sum option. For details, see Discretization Parameters
in the CFX-Solver Modeling Guide.
Results will be biased towards areas of high nodal density on the location. To obtain a mesh inde-
pendent result, you should use the lengthAve, areaAve, volumeAve or massFlowAve functions.
ave(<Variable|Expression>)@<Location>
where:
• <Location> is any 3D region (such as a domain or subdomain) or injection region. For an injection region,
an average value is calculated at each position, and then these are averaged over all positions.
The ave function can be used on point, 1D, 2D, or 3D locations, or injection regions.
ave(Yplus)@Default calculates the mean Yplus values from each node on the default walls.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 271
Functions in ANSYS CFX
Note:
The average of a vector value is calculated as an average of its magnitudes, not the magnitude of
component averages. As an example, for velocity:
(15.1)
where
(15.2)
15.5.5. count
The count function returns the number of nodes on the specified location.
count()@<Location>
where:
• <Location> is valid for point, 1D, 2D, or 3D locations, and injection regions. For an injection region, this
function returns the number of unique vertices affected by the injection region positions.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
272 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
15.5.6. countTrue
The countTrue function returns the number of mesh nodes on the specified region that evaluate
to “true”, where true means greater than or equal to 0.5. The countTrue function is valid for 1D,
2D, and 3D locations.
countTrue(<Expression>)@<Location>
• In CFD-Post, an expression that contains the logical operators =, >, <, <=, or >=.
In CFX-Solver:
>calculate countTrue(TemperatureLE), Domain1
15.5.7. force
This function returns the force exerted by the fluid on the specified 2D locator in the specified direction.
[<Phase>.]force[_<Axis>[_<Coord Frame>] ]()@<Location>
where:
• [<Phase>.] is an optional prefix that is not required for single-phase flows. For details, see CEL Functions
with Multiphase Flow (p. 260).
• <Axis> is x, y, or z
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 273
Functions in ANSYS CFX
Water at RTP.force_x()@wall1 returns the total force in the X direction acting on wall1
due to the fluid Water at RTP.
The force on a boundary is calculated using momentum flow data from the results file, if it is available.
The result can be positive or negative, indicating the direction of the force. For non-boundary locators,
an approximate force is always calculated.
• If the locator is a wall boundary, the force is equal to the pressure force.
• For all other locators, the force is equal to the pressure force plus the mass flow force (due to the advection
of momentum).
• In all cases, if wall shear data exists in the results file, the viscous force is added to the calculated force.
The force function enables you to select the fluids to use when performing your calculation. The
result returned is the force on the locator due to that fluid/those fluids. Because the pressure force
is the same at each node irrespective of the choice of fluids, the only difference is in the viscous
forces (on wall boundaries) or the mass flow forces.
It is important to note that forces arising as a result of the reference pressure are not included in the
force calculation. You can include reference pressure effects in the force calculation in the CFX-Solver
by setting the expert parameter include pref in forces = t.
When performing transient simulations with rotating reference frames, forces may be reported in
either the stationary frame or the rotating frame. The forces reported by the CFX-Solver out file are
always given in the rotating frame. The forces reported by CFD-Post are reported in the stationary
frame if the ‘Angular shift for Transient Rotating Domains’ option is active, as discussed in Angular
Shift for Transient Rotating Locations in the CFD-Post User's Guide.
• This calculates the forces on inlet1 due to pressure and the advection of momentum.
15.5.8. forceNorm
Returns the per unit width force on a line in the direction of the specified axis. It is available only for
a polyline created by intersecting a locator on a boundary. Momentum data must also be available.
The magnitude of the value returned can be thought of as the force in the specified direction on a
polyline, if the polyline were 2D with a width of one unit.
[<Phase>.]forceNorm[_<Axis>[_<Coord Frame>] ]()@<Location>
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
274 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
where:
• [<Phase>.] is an optional prefix that is not required for single-phase flows. For details, see CEL Functions
with Multiphase Flow (p. 260).
• <Axis> is x, y, or z
• <Location> is any 1D location. An error will be raised if the location specified is not one-dimensional.
forceNorm_y()@Polyline1 calculates the per unit width force in the Y direction on the selected
polyline.
15.5.9. inside
The inside CEL function is essentially a step function variable, defined to be unity within a subdomain
and zero elsewhere. This is useful for describing different initial values or fluid properties in different
regions of the domain. It is similar to the CEL subdomain variable, but allows a specific 2D or 3D
location to be given. For example, 273 [K] * inside()@Subdomain 1 has a value of 273 [K]
at points in Subdomain 1 and 0 [K] elsewhere. The location does not need to be a subdomain, but
can be any 2D or 3D named sub-region of the physical location on which the expression is evaluated.
For immersed solids simulations, the location can also be a specific immersed solid domain, and the
inside function will be updated automatically at the beginning of each time step.
inside()@<Location>
where:
• <Location> is any 2D or 3D named sub-region of the physical location on which the expression is
evaluated.
<Location> can also be an immersed solid domain on which the expression is evaluated dynam-
ically.
Note:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 275
Functions in ANSYS CFX
15.5.10. length
Computes the length of the specified line as the sum of the distances between the points making
up the line.
length()@<Location>
where:
• <Location> is any 1D location. Specifying a 2D location will not produce an error; the sum of the edge
lengths from the elements in the locator will be returned.
Note:
While using this function in Power Syntax, the leading character is capitalized to avoid
confusion with the Perl internal command “length”.
15.5.11. lengthAve
Computes the length-based average of the variable or expression on the specified line. This is the
1D equivalent of the areaAve function. The results is independent of the nodal distribution along
the line because a weighting function assigns a higher weighting to areas of sparse nodal density.
lengthAve(<Variable|Expression>)@<Location>
where:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
276 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
15.5.12. lengthInt
Computes the length-based integral of the variable or expression on the specified line. This is the 1D
equivalent of the areaInt function.
lengthInt(<Variable|Expression>)@<Location>
where:
15.5.13. mass
mass()@<Location>
where:
15.5.14. massAve
massAve(<Variable|Expression>)@<Location>
where:
15.5.15. massFlow
Computes the mass flow through the specified 2D location.
[<Phase>.]massFlow()@<Location>
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 277
Functions in ANSYS CFX
where:
• [<Phase>.] is an optional prefix that is not required for single-phase flows. For details, see CEL Functions
with Multiphase Flow (p. 260).
• <Location> is any fluid surface (such as Inlets, Outlets, Openings and fluid-fluid interfaces) or injection
region. For an injection region, the cumulative mass flow from all positions is considered.
• The mass flow is calculated using mass flow data from the results file, if it is available1. Otherwise, an ap-
proximate mass flow is calculated.
• For multiphase cases, the mass flow through a boundary on a GGI interface evaluated in CFD-Post is an
approximation to the 'exact' mass flow evaluated by the solver. This approximation vanishes as the mesh
is refined or as the volume fraction on the interface becomes uniform.
• If the locator is an edge based locator (such as a slice plane or isosurface), the domain mass flow data
from the results file will be used.
• The massFlow function (and related functions massFlowAve and massFlowAveAbs) in CFD-Post
can be inaccurate when evaluated on a physical locator (cut plane, isosurface, etc.) that cuts through a
GGI interface, due to inaccuracies in evaluating the conserved mass flow (from integration point data)
along the intersection of the physical locator and the GGI interface. In this situation, calculating the ap-
proximate mass flow would be more accurate. The approximate mass flow can be calculated with an ex-
pression of the form: sum(Approximated Mass Flow)@[locator]. For example, sum(Approx
imated Mass Flow)@Plane 1. Alternatively, the approximate mass flow can be calculated using an
expression of the form: areaInt_x(Velocity u * Density)@myLoc + areaInt_y(Velocity
v * Density)@myLoc + areaInt_z(Velocity w * Density)@myLoc.
The massFlow function enables you to select the fluids to use when performing your calculation.
The result returned is the mass flow of the selected fluids through the locator.
If a user specifies a boundary mass source, this mass source is not included in the massFlow calculator.
This will affect all massFlow related calculations, such as massFlowInt().
1
The availability depends on the setting for Output Boundary Flows for the file (see Output Boundary Flows Check Box in the CFX-Pre
User's Guide for details).
In addition to this, mass flow information written to a backup file at time zero is not accurate. To calculate accurate mass flow
from a backup file, use information from the backup file written after the first timestep/iteration of the run.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
278 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
is determined by from the right-hand rule and the manner in which the plane or surface is construc-
ted. For example, the surface normal for a Z-X plane has the same sense and direction as the Y
axis.
15.5.16. massFlowAve
Computes the average of a variable or expression on the specified 2D location. The massFlowAve
function enables you to select the fluids to use for the calculation. The returned result is the average
variable or expression value, evaluated according to the formula:
(15.3)
where represents the variable or expression being averaged and represents the local mass flow
(net local mass flow if more than one fluid is selected). Each summation term is evaluated on, and
corresponds to, a node on the 2D locator. The mass flow for each term is derived from summing
contributions from the surrounding solver integration points. As a result, the denominator evaluates
to the net mass flow through the 2D locator.
In cases where there is significant flow, but little or no net flow through the 2D locator (as can happen
with recirculation), the denominator of the averaging formula becomes small, and the resulting average
value may become adversely affected. In such cases, the massFlowAveAbs (see mass-
FlowAveAbs (p. 280)) function is a viable alternative to the massFlowAve function.
[<Phase>.]massFlowAve(<Variable|Expression>)@<Location>
where:
• [<Phase>.] is an optional prefix that is not required for single-phase flows. For details, see CEL Functions
with Multiphase Flow (p. 260).
• <Location> is any fluid surface (such as Inlets, Outlets, Openings and fluid-fluid interfaces) or injection
region. For an injection region, the mass flow at each affected vertex is used. An error is raised if the location
specified is not 2D.
Examples:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 279
Functions in ANSYS CFX
This example calculates the average velocity on Plane1 weighted by the mass flow for all fluids
assigned to each point on Plane1:
15.5.17. massFlowAveAbs
This function is similar to the massFlowAve function (see massFlowAve (p. 279)), except that each
local mass flow value used in the averaging formula has the absolute function applied. That is:
(15.4)
[<Phase>.]massFlowAveAbs(<Variable|Expression>)@<Location>
where:
• [<Phase>.] is an optional prefix that is not required for single-phase flows. For details, see CEL Functions
with Multiphase Flow (p. 260).
• <Location> is any fluid surface (such as Inlets, Outlets, Openings and fluid-fluid interfaces) or injection
region. For an injection region, the mass flow at each affected vertex is used. An error is raised if the location
specified is not 2D.
In cases where there is significant flow, but little or no net flow through the 2D locator (as can happen
with recirculation), the massFlowAveAbs function is a viable alternative to the massFlowAve
function (see massFlowAve (p. 279)).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
280 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
evaluates to a value of greater magnitude than the net mass flow through the 2D locator (although
this is not necessarily harmful to the resulting average value).
Note:
The values of variables other than mass flow are stored at the mesh nodes and are applied
to the locator nodes by linear interpolation. For the mass flow variable, CFD-Post uses
either:
• Approximate mass flow values based on mesh nodal values of velocity (and density, if available)
Note:
15.5.19. massFlowInt
Integrates a variable or expression over the specified 2D location. A weighting function is applied to
the variable or expression value at each point based on the mass flow assigned to that point. You
can also specify the fluid(s) used to calculate the mass flow at each locator point.
[<Phase>.]massFlowInt(<Variable|Expression>)@<Location>
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 281
Functions in ANSYS CFX
where:
• [<Phase>.] is an optional prefix that is not required for single-phase flows. For details, see CEL Functions
with Multiphase Flow (p. 260).
• <Location> is any fluid surface (such as Inlets, Outlets, Openings and fluid-fluid interfaces) or injection
region. For an injection region, the mass flow at each affected vertex is used. An error is raised if the location
specified is not 2D.
15.5.20. massInt
The mass-weighted integration of a variable or expression within a domain or subdomain.
massInt(<Variable|Expression>)@<Location>
where:
15.5.21. maxVal
Returns the maximum value of the specified variable or expression on the specified locator. You
should create a user variable if you want to find the maximum value of an expression.
maxVal(<Variable|Expression>)@<Location>
where:
• <Location> is, in the context of CFX-Solver, a 2D region or 3D region (such as a domain or subdomain)
or, in the context of CFD-Post, a Point object or a 1D, 2D, or 3D locator, or injection region. For an injection
region, the maximum over the affected vertices is used.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
282 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
15.5.22. minVal
Returns the minimum value of the specified variable or expression on the specified locator. You should
create a user variable if you want to find the minimum value of an expression.
minVal(<Variable|Expression>)@<Location>
where:
• <Location> is, in the context of CFX-Solver, a 2D region or 3D region (such as a domain or subdomain)
or, in the context of CFD-Post, a Point object or a 1D, 2D, or 3D locator, or injection region. For an injection
region, the minimum over the affected vertices is used
15.5.23. probe
Returns the value of the specified variable or expression on the specified Point object.
probe(<Variable|Expression>)@<Location>
where:
• <Location> is any point object (such as a Source Point or Cartesian Monitor Point).
Important:
This calculation should be performed only for point locators described by single points.
Incorrect solutions will be produced for multiple point locators.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 283
Functions in ANSYS CFX
15.5.24. rbstate
Returns the value of the specified rigid body state variable, or axis component thereof, on the specified:
• Position
• Linear Velocity
• Linear Acceleration
• Euler Angle
• Angular Velocity
• Angular Acceleration
Syntax:
rbstate(<rbvar>[<Axis>])@<Location>
where:
• <Axis> is X, Y, or Z.
For the Euler Angle rigid body state variable, an axis must be specified. For all of the other rigid
body state variables, the axis is optional. If you do not specify an axis, the magnitude of the vector
is returned. For example, if the variable is Position and you do not specify an axis, the distance
from the origin will be returned.
• <Location> is any rigid body object or any immersed solid domain that is governed by a rigid body
solution.
Results are given with respect to the global coordinate frame (Coord 0).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
284 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
15.5.25. rmsAve
The rmsAve function calculates the RMS average of a variable or expression on the specified location.
• CFX-Solver computes the RMS average of the vertex values for a 3D location.
• CFX-Solver computes the RMS average of the face values for a 2D location. The value for a particular face
is computed by arithmetically averaging the vertex values of the face.
rmsAve(<Variable|Expression>)@<Location>
where:
15.5.26. sum
The sum function calculates the sum of a variable or expression on the specified location.
Note:
• CFD-Post computes the sum of the vertex values for the location.
• CFX-Solver computes the sum of the face values for a 2D location. The value for a particular
face is computed by arithmetically averaging the vertex values of the face.
sum(<Variable|Expression>)@<Location>
where:
• <Location> is, in the context of CFX-Solver, a 2D region or 3D region (such as a domain or subdomain)
or, in the context of CFD-Post, a Point object or a 1D, 2D, or 3D locator, or injection region. For an injection
region, an average value is calculated at each position, and then these are summed over all positions.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 285
Functions in ANSYS CFX
15.5.27. torque
Returns the torque on a 2D locator about the specified axis. The force calculated during evaluation
of the torque function has the same behavior as the force function. For details, see force (p. 273). You
can select the fluids involved in the calculation.
[<Phase>.]torque_[<Axis>[_<Coord Frame>] ]()@<Location>
where:
• [<Phase>.] is an optional prefix that is not required for single-phase flows. For details, see CEL Functions
with Multiphase Flow (p. 260).
• <Axis> is x, y, or z
• <Coord Frame>
• <Location> is any 2D region (such as a wall). If the location specified is not 2D, an error is raised.
15.5.28. volume
Calculates the volume of a 3D location.
volume()@<Location>
where:
• <Location> is any 3D region (such as a domain or subdomain). An error is raised if the location specified
is not a 3D object. For details, see volume (p. 286).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
286 of ANSYS, Inc. and its subsidiaries and affiliates.
Quantitative Function List
15.5.29. volumeAve
Calculates the volume-weighted average of a variable or expression on a 3D location. This is the 3D
equivalent of the areaAve function. The volume-weighted average is the average value on a location
weighted by the volume assigned to each vertex on a location. Without the volume weighting function,
the average of all the nodal values would be biased towards values in regions of high mesh density.
The following example demonstrates use of the function.
volumeAve(<Variable|Expression>)@<Location>
where:
15.5.30. volumeInt
Integrates the specified variable or expression over the volume location. This is the 3D equivalent of
the areaInt function.
volumeInt(<Variable|Expression>)@<Location>
where:
• <Location> is any 3D region (such as a domain or subdomain). An error is raised if the location specified
is not a 3D object.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 287
Functions in ANSYS CFX
For example, volumeInt(Density)@StaticMixer will calculate the total fluid mass in the domain
StaticMixer.
Note:
Because the Density variable represents the average density during the timestep rather
than the density at the end of the timestep, the volumeInt(Density) does not accur-
ately give the mass of fluid at the end of a timestep. Use the mass() function instead.
The volumeInt function does not take into account the porosity of the location specified
for porous domains. To include the porosity effect in your calculation, you need to manually
multiply your argument by:
• The Volume Porosity if you want to evaluate the integral on the fluid side
• (1-Volume Porosity) if you want to evaluate the integral on the solid side
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
288 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 16: Variables in ANSYS CFX
This chapter describes the variables available in ANSYS CFX:
16.1. Hybrid and Conservative Variable Values
16.2. List of Field Variables
16.3. Particle Variables Generated by the Solver
16.4. Miscellaneous Variables
The solution values on the boundary vertices, called conservative values, are the values obtained from
solving the conservation equations for the boundary control volumes. These values are not necessarily
the same as the specified boundary condition values, although the specified boundary value is used to
close boundary fluxes for the boundary control volume. For example, on a no-slip wall, the wall velocity
is used to compute the viscous force for the boundary face of the boundary control volume, but the
resulting control volume equation solution will not necessarily be the wall velocity. The conservative
values are representative of the boundary control volume, not the boundary itself. For visualization
purposes, it is often useful to view the specified boundary condition value for the boundary vertices
rather than the conservative values. This is especially true when the value of a conservative solution
variable (such as pressure or temperature, for instance) is specified at a particular boundary condition.
The specified boundary values are called hybrid values. CFD-Post uses hybrid values by default for most
variables. Hybrid values are obtained by overwriting the conservative results on the boundary nodes
produced by the CFX-Solver with values based on the specified boundary conditions. This ensures, for
example, that the velocity is displayed as zero on no-slip walls. For quantitative calculations, the conser-
vative values should normally be used because they are consistent with the discrete solutions obtained
by the solver. If you want to use these values in CFD-Post, you can select them from the Variables
Editor dialog box as described above. By default, CFD-Post uses conservative values when the Calculate
command is used.
The difference between hybrid and conservative values at wall boundaries can be demonstrated using
the following figure:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 289
Variables in ANSYS CFX
Using velocity as an example, the velocity value calculated at a mesh node is based upon the ‘average’
in the control volume surrounding that node. For calculation purposes, the entire control volume is
then assumed to possess that velocity. At a boundary node, its surrounding control volume includes
an area in the bulk of the fluid (this area is highlighted around the boundary node marked 1). Hence,
the conservative velocity calculated at the wall node is not zero, but an ‘average’ over the control
volume adjacent to the boundary. At a wall boundary node the difference between conservative and
hybrid values can be illustrated by considering the case of the mass flow rate through the wall-adjacent
control volume. If a zero velocity was enforced at the boundary node, then this would produce zero
mass flow through the control volume, which is clearly not correct.
Consider the example of heat transfer from a hot solid to a cool fluid when advection dominates
within the fluid. If you create a plot across the solid-fluid interface using conservative values of
temperature, then you will see a sharp change in temperature across the interface. This is because
values are interpolated from the interface into the bulk of the solid domain using the value for the
solid-side node at the interface, while values are interpolated from the interface into the bulk of
the fluid domain using the value for the fluid-side node at the interface. This results in a temperature
discontinuity at the interface.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
290 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
• Long Variable Name: The name that you see in the user interface. This name may be used in CEL expressions.
• Short Variable Name: A shorter name that may be used in CEL expressions.
• Units: The default units for the variable. An empty entry [ ] indicates a dimensionless variable.
Note:
The entries in the Units columns are SI but could as easily be any other system of units.
– A number represents the user level (1 indicates that the variable appears in default lists, 2 and 3 indicate
that the variable appears in extended lists that you see when you click ). This number is useful when
using the CFX Export facility. For details, see File Export Utility in the CFX-Solver Manager User's Guide.
Note that the CFX-Solver may sometimes override the user-level setting depending on the physics of the
problem. In these cases, the User Level may be different from that shown in the tables that follow.
– Boundary (B): A B in this column indicates that the variable contains only non-zero values on the
boundary of the model. See Boundary-Value-Only Variables in the CFD-Post User's Guide for more details.
Boundary-Value-Only Variables in the CFD-Post User's Guide describes the useful things that you
can do with variables that are defined only on the boundaries of the model.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 291
Variables in ANSYS CFX
– R indicates the variable is available to be output to the results, transient results, and backup files
This is not a complete list of variables. Information on obtaining details on all variables is available in
RULES and VARIABLES Files in the CFX-Solver Manager User's Guide.
Note:
Variables with names shown in bold text are not output to CFD-Post. However, some of
these variables can be output to CFD-Post by selecting them from the Extra Output
Variables List on the Results tab of the Solver > Output Control details view of CFX-Pre.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
292 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
A, C, M,
P, R, TS
Velocity u [m s^-1] 1 Components of velocity.
u
v A, C, M,
Velocity P, R, TS
v w
Velocity
w
Pressure p [kg m^-1 s^-2] 1 Both Pressure and
Total Pressure are
A, C, M, measured relative to the
P, R, TS reference pressure that you
specified on the Domains
panel in CFX-Pre.
Additionally, Pressure is
the total normal stress,
which means that when
using the k-e turbulence
model, Pressure is the
thermodynamic pressure
plus the turbulent normal
stress. Static Pres
sure is the
thermodynamic pressure,
in most cases this is the
same as Pressure. For
details, see Modified
Pressure in the CFX-Solver
Theory Guide.
Static pstat [kg m^-1 s^-2] 3 CFX solves for the relative
Pressure Static Pressure
(thermodynamic pressure)
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 293
Variables in ANSYS CFX
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
294 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 295
Variables in ANSYS CFX
A B in the Type column indicates that the variable contains only non-zero values on the boundary
of the model.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
296 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 297
Variables in ANSYS CFX
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
298 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Note:
Variables with names shown in bold text are not output to CFD-Post. However, some of
these variables can be output to CFD-Post by selecting them from the Extra Output
Variables List on the Results tab of the Solver > Output Control details view of CFX-Pre.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 299
Variables in ANSYS CFX
Note:
Variables with names shown in bold text are not output to CFD-Post. However, some of
these variables can be output to CFD-Post by selecting them from the Extra Output
Variables List on the Results tab of the Solver > Output Control details view of CFX-Pre.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
300 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 301
Variables in ANSYS CFX
Note:
Variables with names shown in bold text are not output to CFD-Post. However, some of
these variables can be output to CFD-Post by selecting them from the Extra Output
Variables List on the Results tab of the Solver > Output Control details view of CFX-Pre.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
302 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
A B in the Type column indicates that the variable contains only non-zero values on the boundary
of the model.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 303
Variables in ANSYS CFX
Note:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
304 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 305
Variables in ANSYS CFX
Many variables and expressions have a long and a short form (for example, Pressure or p).
Additional Variables and expressions are available in CFD-Post. For details, see CFX Expression Language
(CEL) in CFD-Post in the CFD-Post User's Guide.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
306 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Note:
Variables with names shown in bold text in the tables that follow are not output to CFD-
Post. However, some of these variables can be output to CFD-Post by selecting them from
the Extra Output Variables List on the Results tab of the Solver > Output Control details
view in CFX-Pre.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 307
Variables in ANSYS CFX
A, C, M,
P, R, TS
Turbulence ed [m^2 s^-3] 1
Eddy
Dissipation A, C, M,
P, R, TS
Eddy eddy [kg m^-1 1
Viscosity viscosity s^-1]
A, C, M,
P, R, TS
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
308 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 309
Variables in ANSYS CFX
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
310 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
A, C, M,
P, R, TS
Absolute pabs [kg m^-1 s^-2] 2
Pressure
A, C, M,
R, TS
Reference pref [kg m^-1 s^-2] 2 The Reference
Pressure Pressure is the
C absolute pressure
datum from which all
other pressure values
are taken. All relative
pressure specifications
in CFX are relative to
the Reference
Pressure. For details,
see Setting a Reference
Pressure in the
CFX-Solver Modeling
Guide.
Distance r [m] 2 Radial spatial location.
from local
C . For details,
Z axis
see CEL Variables r and
theta (p. 316).
Radius raxis [m] 2 Radial spatial location
measured normal to
C the locally-defined axis.
When the
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 311
Variables in ANSYS CFX
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
312 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 313
Variables in ANSYS CFX
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
314 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Velocity in
Stn Frame
w
Volume vf [] 1
Fraction
A, C, M,
P, R, TS
Conservative vfc [] 2 The variable <flu
Volume id>.Conservative
Fraction A, C, M, Volume Fraction
R, TS should not usually be
used for
postprocessing.
Kinematic visckin [m^2 s^-1] 2
Viscosity
A, C, M,
P, R, TS
Wall wall [m] 2
Distance distance
A, C, M,
P, R, TS
Wall wall [W m^-2] 2 Power done by a
Power powerdens moving wall onto the
Density C, DT, R, fluid per unit area
TS
This variable is 0 at
stationary walls.
Wall Work wall [J m^-2] 2 Work done by a
Density workdens moving wall onto the
C, DT, R, fluid per unit area
TS
This variable is 0 at
stationary walls.
Wall Scale wall [m^2] 3
scale
M, R, TS
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 315
Variables in ANSYS CFX
• air | water.surface tension coefficient – the surface tension coefficient between air
and water
• air | water.area density – the interfacial area density between air and water.
For multiphase cases, a fluid prefix indicates either a specific fluid, or a specific fluid pair. The absence
of a prefix indicates a bulk or fluid independent variable, such as pressure.
For porous solids, those variables that exist in the solid are prefixed by the name of the solid phase.
The variables Radius and theta are available only when the rotational axis has been defined.
The rotational axis can either be defined in the results file or in CFD-Post through the Initialization
panel in the Turbo workspace.
Note:
r and theta are particularly useful for describing radial distributions, for instance the velocity
profile at the inlet to a pipe.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
316 of ANSYS, Inc. and its subsidiaries and affiliates.
List of Field Variables
Figure 16.1: r and theta with Respect to the Reference Coordinate Frame
where R is the radius of any point in the domain from the axis of rotation. rNoDim is only available
for domains defined with a rotating frame of reference.
The inside CEL function can be used in a similar way to the subdomain variable, but allows a
specific 2D or 3D location to be given. For example, 273 [K] * inside()@Subdomain 1
has a value of 273 [K] at points in Subdomain 1 and 0 [K] elsewhere. Furthermore, the location
can be any 2D or 3D named sub-region of the physical location on which the expression is evaluated.
The location can also be an immersed solid domain.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 317
Variables in ANSYS CFX
Accumulated Time Step (atstep) and Current Time Step (ctstep) are available for both steady-
state and transient runs, with Current Time Step being set to the same value as Accumulated
Time Step.
If multiple cases are loaded, the values obtained from evaluating these timestep-related variables
relate to the last loaded case.
An expression’s value is a real value and has specified dimensions (except where it is dimensionless
- but this is also a valid dimension setting).
For example, if t is time and L is a length then the result of L/t has the same dimensions as speed.
The + and - operators are only valid between expressions with the same dimensions and result in
an expression of those dimensions.
The * and / operators combine the dimensions of their operands in the usual fashion. X^I, where I
is an integer, results in an expression whose dimensions are those of X to the power I. The trigono-
metric functions all work in terms of an angle in radians and a dimensionless ratio.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
318 of ANSYS, Inc. and its subsidiaries and affiliates.
Particle Variables Generated by the Solver
• An expression is a simple expression if the only operations are +, -, *, / and there are no functions used
in the expression.
• An expression is a constant expression if all the numbers in the expression are explicit (that is, they do
not depend on values from the solver).
• An expression is an integer expression if all the numbers in the expression are integers and the result
of each function or operation is an integer.
For example, (3+5)/2 is a simple, constant, integer expression. However, 2*(1/2) is not a constant
integer expression because the result of 1/2 is 0.5, not an integer. Also 3.*4 is not a constant integer
expression because 3 is not an integer. Moreover, 2^3 is not a simple, constant, integer expression
because ^ is not in the list (+, -, *, /).
Expressions are evaluated at run time and in single precision floating point arithmetic.
Information on how to find dependencies for all parameters is available in the RULES and VARI
ABLES files. Both files are located in <CFXROOT>/etc/ and can be viewed in any text editor.
The expression definition can depend on any system variable. If, however, that expression depends
on a system variable that is unavailable for a particular context, then that expression will also be
unavailable.
Some variables are defined only on the boundaries of the model. When using these variables in CFD-
Post, there are a limited number of useful things that you can do with these. For details, see Boundary-
Value-Only Variables in the CFD-Post User's Guide.
The following information is given for particle variables described in this section:
• Long Variable Name: The name that you see in the user interface.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 319
Variables in ANSYS CFX
• Short Variable Name: The name that must be used in CEL expressions.
• Units: The default units for the variable. An empty entry [ ] indicates a dimensionless variable.
Note:
The entries in the Units columns are SI but could as easily be any other system of units.
User Level: This number is useful when using the CFX Export facility. For details, see File Export
Utility in the CFX-Solver Manager User's Guide. Note that the CFX-Solver may sometimes override the
user-level setting depending on the physics of the problem. In these cases, the User Level may be
different from that shown in the table below.
Boundary (B): A B in this column indicates that the variable contains only non-zero values on the
boundary of the model. See Boundary-Value-Only Variables in the CFD-Post User's Guide for more
details.
This section does not cover the complete list of variables. For information on obtaining details on all
variables, see RULES and VARIABLES Files in the CFX-Solver Manager User's Guide.
Particle track variables are not available for use in CEL expressions and general User Fortran. In addition,
they cannot be monitored during a simulation.
The following table lists particle track variables that are available in general, including in CFD-Post:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
320 of ANSYS, Inc. and its subsidiaries and affiliates.
Particle Variables Generated by the Solver
where
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 321
Variables in ANSYS CFX
<Particle
Type>.Velocity w
For Particle User Fortran, these additional track variables, which are not available in CFD-Post, can be
specified in the argument list for the user routine:
PR
PR
PR
PR
PR
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
322 of ANSYS, Inc. and its subsidiaries and affiliates.
Particle Variables Generated by the Solver
A, C, M, P,
R
Particle Energy Source Coefficient ptenysrcc [W m^-3 K^-1] 2
A, C, M, P,
R
Particle Momentum Source ptmomsrc [kg m^-2 s^-2] 2
A, C, M, P,
R
Particle Momentum Source ptmomsrcc [kg m^-3 s^-1] 2
Coefficient
A, C, M, P,
R
Total Particle Mass Source ptmassrctot [kg s^-1 m^-3] 2
A, C, M, P,
R
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 323
Variables in ANSYS CFX
A, C, M, P,
R
Particle Mass Source Coefficient ptmassrcc [kg s^-1 m^-3] 2
A, C, M, P,
R
a
The variables for multi-component take the following form: <Particle Type>.<Particle Component>.<Variable Name>
Particle source terms are accumulated along the path of a particle through a control volume and
stored at the corresponding vertex. A smoothing procedure can be applied to the particle source
terms, which may help with convergence or grid independence. For details, see Particle Source
Smoothing in the CFX-Solver Modeling Guide.
A, C, M,
P, R
Particle Absorption Coefficient ptabscoef [m^-1] 2
A, C, M,
P, R
Particles can also interact with the radiation field and either emit or absorb radiation.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
324 of ANSYS, Inc. and its subsidiaries and affiliates.
Particle Variables Generated by the Solver
A, C, M,
P, PR, R
Averaged Temperature averaged [K] 1
temperature
A, C, M,
P, PR, R
a averaged mf [] 1
Averaged Mass Fraction
A, C, M,
P, PR, R
Averaged Particle Time averaged [s] 2
pttime
A, C, M,
P, PR, R
Averaged Mean Particle Diameter (D43) averaged [m] 2
mean particle
diameter A, C, M,
P, PR, R
Averaged Arithmetic Mean Particle averaged [m] 2
Diameter (D10) arithmetic
mean particle A, C, M,
diameter P, PR, R
Averaged Surface Mean Particle Diameter averaged [m] 2
(D20) surface mean
particle A, C, M,
diameter P, PR, R
Averaged Volume Mean Particle Diameter averaged [m] 2
(D30) volume mean
particle A, C, M,
diameter P, PR, R
Averaged Sauter Mean Particle Diameter averaged [m] 2
(D32) sauter mean
particle A, C, M,
diameter P, PR, R
Averaged Mass Mean Particle Diameter averaged [m] 2
(D43) mass mean
particle A, C, M,
diameter P, PR, R
Averaged Particle Number Rate averaged [s^-1] 2
particle
number rate A, C, M,
P, PR, R
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 325
Variables in ANSYS CFX
A, C, M,
P, PR, R
Averaged Film Temperature averaged film [K] 1
temperature
A, C, M,
P, PR, R
a
This variable takes the following form: <Particle Type>.<Particle Component>.<Variable Name>
The following are the formulae for particle vertex fields' size distributions:
(16.1)
With:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
326 of ANSYS, Inc. and its subsidiaries and affiliates.
Particle Variables Generated by the Solver
• : Particle mass
• : Particle quantity
Slightly different averaging procedures apply to particle temperature and particle mass fractions:
(16.2)
With:
• : Particle temperature
(16.3)
With:
Due to the discrete nature of particles, vertex variables may show an unsmooth spatial distribution,
which may lead to robustness problems. To reduce possible problems a smoothing option is
available. For details, see Vertex Variable Smoothing in the CFX-Solver Modeling Guide.
You can use these variables to color boundaries and to compute average or integrated values of
the corresponding particle quantities.
You cannot use these variables in CEL expressions or User Fortran, and you cannot monitor them
during a simulation.
B, R
Momentum Flow Density [kg m^-1 s^-2] 2
B, R
Energy Flow Density [kg s^-3] 2
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 327
Variables in ANSYS CFX
B, R
Wall Energy Flow Density [kg s^-3] 2
B, R
Wall Mass Flow Density [kg m^-2 s^-1] 2
B, R
Erosion Rate Density [kg m^-2 s^-1] 2
B, R
Available in transient runs:
Time Integrated Mass Flow Density [kg m^-2] 2
B, R
Time Integrated Momentum Flow Density [kg m^-1 s^-1]
Time Integrated Energy Flow Density [kg s^-2] 2
B, R
Time Integrated Wall Energy Flow Density [kg s^-2] 2
B, R
Time Integrated Wall Mass Flow Density [kg m^-2] 2
B, R
Time Integrated Erosion Rate Density [kg m^-2] 2
B, R
By default, particle RMS variables are not written to the results file; unless, they have been explicitly
requested by you (selected from the Extra Output Variables List in the Output Control section
of CFX-Pre, usage in a CEL expression or in User Fortran) or if the stochastic particle collision model
is used in a simulation.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
328 of ANSYS, Inc. and its subsidiaries and affiliates.
Particle Variables Generated by the Solver
The following particle variables are available as field variables, particularly useful for simulations
that use the stochastic particle collision model:
A, C, M, P,
PR, R
RMS Temperature rms [K] 1
temperature
A, C, M, P,
PR, R
RMS Mean Particle Diameter rms mean [m] 3
particle
diameter A, C, M, P,
PR, R
RMS Particle Number Rate rms particle [s^-1] 3
number rate
A, C, M, P,
PR, R
(16.4)
With:
A smoothing option, as available for particle vertex variables, is available for particle RMS variables.
For details, see Vertex Variable Smoothing in the CFX-Solver Modeling Guide.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 329
Variables in ANSYS CFX
Note:
Variables with names shown in bold text are not output to CFD-Post. However, some of
these variables can be output to CFD-Post by selecting them from the Extra Output Variables
List on the Results tab of the Solver > Output Control details view of CFX-Pre.
• A number represents the user level (1 indicates that the variable appears in default lists, 2 and 3 indicate
that the variable appears in extended lists that you see when you click )
• P indicates the variable is available for particle user routine argument lists
• R indicates the variable is available to be output to the results, transient results, and backup files
C, M, R, TS
Autoignition autoignition [] 1
A, C, M, R, TS
Boundary bnd scale [] 3 Similar to wall
Scale scale, this
C, M, R, TS variable is used
for controlling
mesh stiffness
near boundaries
for moving
mesh problems.
Burnt burnt Tabs [K] 2
Absolute
Temperature A, C, M, R, TS
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
330 of ANSYS, Inc. and its subsidiaries and affiliates.
Miscellaneous Variables
C, M, R, TS
Electric epot 1
Potential
C, M, R, TS
Electrical conelec 3
Conductivity
C, M, R, TS
Electrical permelec 3
Permittivity
C, M, R, TS
Electromagnetic bfemag 3
Force Density
R
Equivalence equivratio [] 2
Ratio
A, C, M, R, TS
External bmagext [] 1 External
Magnetic magnetic
Induction M, R, TS induction field
specified by the
user.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 331
Variables in ANSYS CFX
C
Fuel Tracer trfuel [] 1 Residual
material model
A, C, M, R, TS or exhaust gas
recirculation
(EGR)
Granular grantemp [m^2 1
Temperature s^-2]
A, C, M, R, TS
Group I In- groupi [] 2
dex
C
Group J In- groupj [] 2
dex
C
Group I Dia- diami 2
meter
C
Group J Dia- diamj 2
meter
C
Group I massi 2
Mass
C
Group J massj 2
Mass
C
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
332 of ANSYS, Inc. and its subsidiaries and affiliates.
Miscellaneous Variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 333
Variables in ANSYS CFX
R
Mesh diffmesh [m^2 2
Diffusivity s^-1]
C, M, R, TS
Normal Area normarea [] 2 Normal area
vectors.
C
Total Force forcetden 3
Density
DT
Total ptotrel 2 Based on
Pressure in relative frame
Rel Frame A, C, M, P, R, TS total enthalpy.
Turbulent velburnturb [m s^-1] 2
Burning
Velocity A, C, R, TS
Mesh Velo- meshvel 1
city
C, M, R, TS
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
334 of ANSYS, Inc. and its subsidiaries and affiliates.
Miscellaneous Variables
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 335
Variables in ANSYS CFX
A, C, M, R, TS
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
336 of ANSYS, Inc. and its subsidiaries and affiliates.
Miscellaneous Variables
DT
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 337
Variables in ANSYS CFX
A, C, M, P, R, TS
Wall External tnwo [K] 2 User-specified
Temperature external wall
DT, R, TS temperature for
heat transfer
coefficient
boundary
conditions.
Wall Film film thickness [m] 2
Thickness
C, R
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
338 of ANSYS, Inc. and its subsidiaries and affiliates.
Miscellaneous Variables
R, M, TS
Wavelength wavelo 3
in Vacuum
C
Wavenumber waveno 3
in Vacuum
C
Normalized spdropn [m^-3] 2
Droplet
Number C, M, R, TS
Droplet spdrop 1
Number
C, M, R, TS
Dynamic Bulk dynamic bulk 1
Viscosity viscosity
A, C, M, R, TS
Total MUSIG vft [] 2
Volume
Fraction A, C, M, R, TS
Smoothed vfs [] 2
Volume
Fraction A, C, M, R, TS
Temperature Tsuperheat 3 Temperature
Superheating above saturation
C
Temperature Tsubcool 3 Temperature
Subcooling below saturation
C
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 339
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
340 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 17: Power Syntax in ANSYS CFX
Programming constructs can be used within CCL for advanced usage. Rather than invent a new language,
CCL takes advantage of the full range of capabilities and resources from an existing programming lan-
guage, Perl. Perl statements can be embedded in between lines of simple syntax, providing capabilities
such as loops, logic, and much, much more with any CCL input file.
A line of Power Syntax is identified in a CCL file by an exclamation mark (!) in the first column of a line.
In between Perl lines, simple syntax lines may refer to Perl variables and lists.
A wide range of additional functionality is made available to expert users with the use of Power Syntax
including:
• Loops
• Subroutines with argument handling (useful for defining commonly re-used plots and procedures)
• System functions
• Many other procedures (Object programming, World Wide Web access, simple embedded graphical user
interfaces).
Any of the above may be included in a CCL input file or CFD-Post session file.
Important:
You should be wary when entering certain expressions because Power Syntax uses Perl
mathematical operators. For example, in CEL, is represented as 2^2, but in Perl, it would
be written 2**2. If you are unsure about the validity of an operator, you should check a Perl
reference guide.
There are many good reference books on Perl. Two examples are Learning Perl (ISBN 1-56592-
042-2) and Programming Perl (ISBN 1-56592-149-6) from the O’Reilly series.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 341
Power Syntax in ANSYS CFX
Some additional, more complex, examples of Power Syntax subroutines can be found by viewing the
session files used for the Macro Calculator. These are located in CFX/etc/. You can execute these
subroutines from the Command Editor dialog box the same as calling any other Power Syntax subroutine.
The required argument format is:
!cpPolar(<"BoundaryList">, <"SliceNormalAxis">,
<"SlicePosition">, <"PlotAxis">, <"InletLocation">,
<"ReferencePressure">)
!compressorPerform(<"InletLocation">, <"OutletLocation">,
<"BladeLocation">, <"MachineAxis">, <"RotationalSpeed">,
<"TipRadius">, <"NumBlades">, <"FluidGamma">)
These subroutines are loaded when CFD-Post is launched, so you do not need to execute the session
files before using the functions.
Additional information on these macro functions is available in Gas Compressor Performance Macro
and Cp Polar Plot Macro.
All arguments passed to subroutines should be enclosed in quotations, for example Plane 1 must be
passed as “Plane 1” and Eddy Viscosity should be entered as “Eddy Viscosity”. Any legal
CFX Command Language characters that are illegal in Perl need to be enclosed in quotation marks.
17.1.1. Example 1: Print the Value of the Pressure Drop Through a Pipe
! $Pin = massFlowAve("Pressure","inlet");
! $Pout = massFlowAve("Pressure","outlet");
! $dp = $Pin-$Pout;
! print "The pressure drop is $dp\n";
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
342 of ANSYS, Inc. and its subsidiaries and affiliates.
Examples of Power Syntax
Note:
Function-specific Perl subroutines do not allow phase-specific evaluations; that is, you can
get only bulk results (such as mass flow for all phases). A workaround is to use "evaluate"
subroutine, which evaluates any CEL expression.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 343
Power Syntax in ANSYS CFX
The first line of Power Syntax simply defines a scalar variable called numsteps. Scalar variables (that
is, simple single-valued variables) begin with a $ symbol in Perl. The next line defines a for loop
that increments the variable i up to numsteps. Next, you determine the fraction you are along in
the loop and assign it to the variable trans. The object definitions then use trans to set their
transparency and then repeat. Note how Perl variables can be directly embedded into the object
definitions. The final line of Power Syntax (!}) closes the for loop.
Note:
Function-specific Perl subroutines do not allow phase-specific evaluations; that is, you can
get only bulk results (such as mass flow for all phases). A workaround is to use "evaluate"
subroutine, which evaluates any CEL expression.
Although this subroutine is designed for use with the next example, you can execute it on its own
by typing !makePlanes(); in the Command Editor dialog box.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
344 of ANSYS, Inc. and its subsidiaries and affiliates.
Examples of Power Syntax
! sub manifoldCalcs{
# call the previously defined subroutine (Example 3) make the
# upstream and downstream cutting planes
! makePlanes();
#
# Bound the two planes so they each just cut one side of the branch.
PLANE:plane1
Plane Bound = Circular
Bound Radius = 0.025
END
PLANE:plane2
Plane Bound = Circular
Bound Radius = 0.025
END
# Calculate mass flow through each using the predefined
# 'evaluate' Power Syntax subroutine and output the results
! ($mass1, $mfunits) = evaluate( "massFlow()\@plane1" );
! ($mass2) = evaluate( "massFlow()\@plane2" );
! $sum = $mass1+$mass2;
! print "Mass flow through branch 1 = $mass1 [$mfunits]\n";
! print "Mass flow through branch 2 = $mass2 [$mfunits]\n";
! print "Total = $sum [$mfunits]\n";
# Now calculate pressure drops and mass flows through the exits
# calculate the average pressure at the inlet
!($Pin, $punits) = evaluate( "massFlowAve(Pressure)\@in1" );
# Set-up an array that holds the approximate X location of each
# of the 4 exits. We then loop over the array to move the outlet
# plane and re-do the pressure drop calculation at each exit.
! @Xlocs = (0.15,0.25,0.35,0.45);
! $sum = 0;
! for ($i=0;$i<4;$i++) {
PLANE:outlet
Option = Point and Normal
Normal = 0,-1,-1
Point = $Xlocs[$i],-0.06,-0.2
Plane Bound = Circular
Bound Radius = 0.05
END
! ($Pout, $punits) = evaluate( "massFlowAve(Pressure)\@outlet" );
! ($massFl) = evaluate( "massFlow()\@outlet" );
! $sum += $massFl;
! $Dp = $Pin-$Pout;
! $ii = $i+1;
! print "At outlet \#$ii: Dp=$Dp [$punits], Mass Flow=$massFl [$mfunits]\n";
! } # end loop
! print "Total Mass Flow = $sum [$mfunits]\n";
!} # end subroutine
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 345
Power Syntax in ANSYS CFX
After processing these commands to define the subroutine, you can execute it, in the same way as
any other subroutine, by typing !manifoldCalcs(); in the Command Editor dialog box.
These subroutines provide access to the quantitative functionality of CFD-Post. Most of these routines
provide results in a single return value. For example, if the Perl variable $verbose = 1, then the
result is also printed to the screen. Information on the calculations performed by the subroutines is
available. For details, see Function Selection.
Each of the subroutines contains an argument list (in brackets, separated by commas). If any argument
contains more than one word (for example, Plane 1), it must be within quotes. You should enclose
all arguments within quotes to avoid making possible syntax errors.
The return values will always be in the solution units of the CFX-Solver results file, even if you have
changed the display units in the Edit menu. This means that if you have a plot of temperature in
degrees C on Plane 1, the area averaged value of temperature on Plane 1 returned by the
areaAve command will still be in degrees K.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
346 of ANSYS, Inc. and its subsidiaries and affiliates.
Predefined Power Syntax Subroutines
Assuming you have a plane named Plane 1, the following example returns the area of this plane:
! $areaVal = area("Plane 1");
! print "The area of Plane 1 is $areaVal \n";
Some subroutines return more than one value. To store return values for a subroutine that returns
two variables (such as the evaluate function), you could use the following:
! ($value, $units) = evaluate('area()@Plane 1');
! print "The area of Plane 1 is $value in units of $units \n";
Note:
In this case, if single quotes are not used around the expression, area()@Plane 1, when
calling the function, evaluate(), the @ symbol must be escaped (made literal) using the
following power syntax instead:
! ($value, $units) = evaluate("area()\@Plane 1");
! print "The area of Plane 1 is $value in units of $units \n";
This is used to avoid Perl treating the @ symbol as a special character. See evaluate(Expres-
sion) (p. 349) for details.
Returns the area of a 2D locator. For details, see area (p. 268).
Returns the area-weighted average of the variable at a 2D locator. For details, see areaAve (p. 269).
Returns the result of the variable integrated over the 2D location. For details, see areaInt (p. 270).
Returns the arithmetic average of the variable at a location. For details, see ave (p. 271).
17.2.3.5. calcTurboVariables()
void calcTurboVariables()
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 347
Power Syntax in ANSYS CFX
17.2.3.6. calculate(function,...)
real calculate(function,...)
Evaluates the named function with the supplied argument list, and returns the float result. The
function name is a required argument, which can be followed by a variable length list of arguments.
17.2.3.7. calculateUnits(function,...)
string,string calculateUnits(function,...)
Evaluates the named function with the supplied argument list, and returns the value and units.
17.2.3.8. collectTurboInfo()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.9. comfortFactors()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.11. compressorPerformTurbo()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.13. count(Location)
real count("Location")
Returns the number of nodes on the location. For details, see count (p. 272).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
348 of ANSYS, Inc. and its subsidiaries and affiliates.
Predefined Power Syntax Subroutines
Returns the number of mesh nodes on the specified region that evaluate to “true”, where true
means greater than or equal to 0.5. "Expression" should contain one of the logical operators
=, >, <, <=, or >=. The countTrue function is valid for 1D, 2D, and 3D locations. For details, see
countTrue (p. 273).
17.2.3.16. evaluate(Expression)
real,string evaluate("Expression")
Returns the value of the expression and the units. Only one expression can be evaluated each time
the subroutine is executed. The main advantage of using evaluate is that it takes any CEL expres-
sion. This means that you do not have to learn any other quantitative power syntax routines de-
scribed in this section. Also, evaluate will return the result units in addition to the value.
An example is:
evaluate("areaAve(Velocity v)\@Location 1")
In this case, another subroutine is evaluated. The evaluate command takes an any expression
as the argument, or more precisely, any expression that resolves to a quantity. This means that you
cannot use:
"2*Pressure"
or
"100 [m]"
The reason that the @ is escaped calling evaluate() is to avoid Perl treating it as a special char-
acter.
17.2.3.17. evaluateInPreferred(Expression)
real,string evaluateInPreferred("Expression")
Returns the value of the expression in your preferred units. Preferred units are the units of the data
that CFD-Post uses when information is displayed to you and are the default units when you enter
information (as contrasted with units of the data that are stored in results files). Use the Edit >
Options > Common > Units dialog box to set your preferred units.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 349
Power Syntax in ANSYS CFX
17.2.3.18. exprExists(Expression)
bool exprExists("Expression")
17.2.3.19. fanNoiseDefault()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.20. fanNoise()
This is an internal subroutine that is used only to initialize report templates.
Returns the force on a 2D locator. For details, see force (p. 273).
Returns the per unit width force on a line in the direction of the specified axis. It is available only
for a polyline created by intersecting a locator on a boundary. For details, see forceNorm (p. 274).
17.2.3.23. getBladeForceExpr()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.24. getBladeTorqueExpr()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.25. getCCLState()
This is an internal debugging call.
Returns the children of an object that belong to the specified category in a comma-separated list.
Each object type (for example, a PLANE) can have multiple categories associated with it such as
"geometry", "surface", and so on). Categories are specified in <CFXROOT>/etc/CFXPreRules.ccl
and <CFXROOT>/etc/CFXPostRules.ccl.
For example, to get a comma-separated list of all surfaces in a state at the top level (that is, not
sub-objects of other objects):
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
350 of ANSYS, Inc. and its subsidiaries and affiliates.
Predefined Power Syntax Subroutines
Returns the children of an object in a comma-separated list. If Child Type is not an empty string,
this subroutine return only children of the specified type.
17.2.3.28. getExprOnLocators()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.29. getExprString(Expression)
string getExprString("Expression")
Returns the value and the units of the expression in the form “value units”. For example: “100 m”.
17.2.3.30. getExprVal(Expression)
real getExprVal("Expression")
Returns only the "value" portion of the expression (units are not included).
Extracts the name of an object from its full path. For example:
!string = getObjectName("/USER SURFACE:User Surface 1")
returns "User Surface 1". This is the form needed for evaluating a CEL expression.
Returns the requested information for a parameter of an object. Object Path returns the name
or path of an object; "/" or an empty string specifies the root.Parameter Name returns the name
of the parameter. Info Type returns the type of data requested; this can be one of "type", "value",
"default value", or "allowed values". For example:
! $info = getParameterInfo("/USER DEFINED/POINT:Point 1", "Symbol Size", "default value");
! print "getParameterInfo returned=$info\n";
prints:
getParameterInfo returned=2.5
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 351
Power Syntax in ANSYS CFX
Returns the parameters of an object in a comma-separated list. Use 'split ","' to convert the
string into an array of strings.
17.2.3.34. getTempDirectory()
string getTempDirectory()
Takes a CCL object and parameter name and returns the value of the parameter.
17.2.3.36.1. Example
1. Create a text object called Text 1.
5. Click Process, and the string will be printed to your terminal window.
17.2.3.37. getViewArea()
string,string getViewArea()
Calculates the area of the scene projected in the view direction. Returns the area and the units in
an array of strings.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
352 of ANSYS, Inc. and its subsidiaries and affiliates.
Predefined Power Syntax Subroutines
A return of 1 indicates that the object matches the passed category; 0 otherwise. Categories are
specified in <CFXROOT>/etc/CFXPreRules.ccl and <CFXROOT>/etc/CFXPostRules.ccl.
17.2.3.39. Length(Location)
real Length("Location")
Returns the length of a line locator. For details, see length (p. 276).
Note:
While using this function in Power Syntax the leading character is capitalized to avoid
confusion with the Perl internal command “length.”
Returns the length-based average of the variable on the line locator. For details, see
lengthAve (p. 276).
Returns the length-based integral of the variable on the line locator. For details, see lengthInt (p. 277).
17.2.3.42. liquidTurbPerformTurbo()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.43. liquidTurbPerform()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.44. massFlow(Location)
real massFlow("Location")
Returns the mass flow through the 2D locator. For details, see massFlow (p. 277).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 353
Power Syntax in ANSYS CFX
Returns the average value of the variable, weighted by mass flow, through the 2D locator. For details,
see massFlowAve (p. 279).
Returns the average value of the variable, weighted by absolute mass flow, through the 2D locator.
For details, see massFlowAveAbs (p. 280).
Returns the integral of the variable, weighted by mass flow, over the 2D locator. For details, see
massFlowInt (p. 281).
Returns the maximum value of the variable at the location. For details, see maxVal (p. 282).
Returns the minimum value of the variable at the location. For details, see minVal (p. 283).
Important:
This calculation should only be performed for point locators described by single points.
Incorrect solutions will be produced for multiple point locators.
Returns the value of the variable at the point locator. For details, see probe (p. 283).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
354 of ANSYS, Inc. and its subsidiaries and affiliates.
Predefined Power Syntax Subroutines
17.2.3.52. pumpPerform()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.53. pumpPerformTurbo()
This is an internal subroutine that is used only to initialize report templates.
Returns the minimum and maximum values of the variable at the location.
17.2.3.55. reportError(String)
void reportError("String")
17.2.3.56. reportWarning(String)
void reportWarning("String")
17.2.3.57. showPkgs()
void showPkgs()
Prints to the console a list of packages available that may contain other variables or subroutines
in Power Syntax.
17.2.3.58. showSubs(packageName)
void showSubs("packageName")
Prints to the console a list of the subroutines available in the specified package. If no package is
specified, CFD-Post is used by default.
17.2.3.59. showVars(packageName)
void showVars("packageName")
Prints to the console a list of the Power Syntax variables and their current value defined in the
specified package. If no package is specified, CFD-Post is used by default.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 355
Power Syntax in ANSYS CFX
Returns the sum of the variable values at each point on the locator. For details, see sum (p. 285).
Returns the computed value of torque at the 2D locator about the specified axis. For details, see
torque (p. 286).
17.2.3.63. turbinePerform()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.64. turbinePerformTurbo()
This is an internal subroutine that is used only to initialize report templates.
17.2.3.65. verboseOn()
bool verboseOn()
17.2.3.66. volume(Location)
real volume("Location")
Returns the volume of a 3D locator. For details, see volume (p. 286).
Returns the average value of a variable over the 3D locator. For details, see volumeAve (p. 287).
Returns the integral of a variable over the 3D locator. For details, see volumeInt (p. 287).
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
356 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 18: Bibliography
This bibliography contains entries referenced in the CFX documentation.
“A Multigrid method Based on the Additive Correction Strategy”, Numerical Heat Transfer,
Vol. 9, pp. 511-537, 1986.
“A Numerical Study of the Turbulent Flow Past an Isolated Airfoil with Trailing Edge
Separation”,
Raw, M.J.,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 357
Bibliography
Hughmark, G.A.,
Modest, M.,
Menter, F.R.,
10
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
358 of ANSYS, Inc. and its subsidiaries and affiliates.
References 1-20
11
Wilcox, D.C.,
In AIAA 24th Aerospace Sciences Meeting. American Institute of Aeronautics and Astro-
nautics, 1986.
12
Menter, F.R.,
13
14
White, F.M.,
McGraw-Hill, 1991.
15
Kader, B.A.,
16
“Skin friction and velocity profile family for compressible turbulent boundary layers”,
17
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 359
Bibliography
18
Gidaspow, D.,
19
20
22
23
ISBN 0-89116-506-1.
24
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
360 of ANSYS, Inc. and its subsidiaries and affiliates.
References 21-40
25
Raw, M.J.,
AIAA 96-0297, 34th Aerospace and Sciences Meeting & Exhibit, January 15-18 1996,
Reno, NV.
26
“Chemkin -II: A Fortran Chemical Kinetics Package for the Analysis of Gas-Phase Chemical
Kinetics",
27
28
29
“Transport Phenomena”,
30
Wilcox, D.C.,
31
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 361
Bibliography
32
Menter, F. R.,
33
Menter, F. R.,
34
Smagorinsky, J.,
35
36
37
Peters, N.,
“Turbulent Combustion”,
38
“An efficient Computational Model for Premixed Turbulent Combustion at High Reynolds
Numbers Based on a Turbulent Flame Speed Closure“,
J. Engineering for Gas Turbines and Power (Transactions of the ASME), Vol. 120, pp. 526-
532, 1998.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
362 of ANSYS, Inc. and its subsidiaries and affiliates.
References 41-60
39
Hinze, J. O.,
“Turbulence”,
40
Zimont, V.L.,
42
Linan, A.,
Technical note, Inst. nac. de tec. aeron., Esteban Terradas, Madrid, Spain, 1961.
43
“Combustion”,
44
Magnussen, B. F.,
“The Eddy Dissipation Concept for Turbulent Combustion Modelling. Its Physical and
Practical Implications”,
Presented at the First Topic Oriented Technical Meeting, International Flame Research
Foundation, IJmuiden, The Netherlands, Oct. 1989.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 363
Bibliography
45
46
47
Vukalovich, M. P.,
48
“Radiative transfer”,
49
Hadvig, S.,
50
Leckner, B.,
51
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
364 of ANSYS, Inc. and its subsidiaries and affiliates.
References 41-60
52
53
Prakash, C.,
54
55
56
Proc. Conf. The Aerodynamics of Heavy Vehicles: Trucks, Busses and Trains, Asilomar, Ca,
2002.
57
“Comments on the feasibility of LES for wings, and on a hybrid RANS/LES approach”,
1st AFOSR Int. Conf. On DNS/LES, Aug.4-8, 1997, Ruston, LA. In Advances in DNS/LES, C.
Liu & Z. Liu Eds., Greyden Press, Colombus, OH.
58
Strelets, M.,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 365
Bibliography
AIAA Paper 2001-0879, 39th Aerospace Sciences Meeting and Exhibit, Reno, NV, 2001.
59
Ishii, M.,
“One-dimensional drift-flux model and constitutive equations for relative motion between
phases in various two-phase flow regimes”,
60
62
63
Hutchings, I.M.,
Proc. Conf. on Corrosion-Erosion of Coal Conversion System Materials, NACE (1979) 393.
64
65
Aungier, R.H.,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
366 of ANSYS, Inc. and its subsidiaries and affiliates.
References 61-80
66
67
Faeth, G. M.,
68
Mijnbeek, G.,
“Bubble column, airlift reactors and other reactor designs”, Operational Modes of Biore-
actors, Chapter 4,
69
Canadian Journal of Chemical Engineering, Vol. 62, pp. 573. Chemical Institute of Canada
and Canadian Society for Chemical Engineering, 1984.
70
“Prediction of gas hold-up and liquid velocity in airlift reactors using two-phase flow
friction coefficients”,
71
American Institute of Chemical Engineers Journal, Vol. 14, p. 295. American Institute of
Chemical Engineers, 1968.
72
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 367
Bibliography
American Institute of Chemical Engineers Journal, Vol. 11, p. 268. American Institute of
Chemical Engineers, 1965.
73
Hughmark, G. A.,
Industrial Engineering and Chemical Process Design and Development, Vol. 6, p. 218.
1967.
74
“The Development of a CFD Analysis and Design Tool for Air-lift Reactors”,
75
76
NASA Technical Memorandum 110446, 1997. (See also Bardina, J.E., Huang, P.G. and
Coakley, T.J., “Turbulence Modeling Validation”, AIAA Paper 97-2121.)
77
H. Schlichting.,
McGraw-Hill, 1979.
78
79
S.J. Ubhayakar, D.B. Stickler, C.W. Von Rosenburg, and R.E. Gannon;
80
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
368 of ANSYS, Inc. and its subsidiaries and affiliates.
References 81-100
Sutherland, W.,
82
83
23:8, 1984.
84
85
86
Saffman, P. G.,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 369
Bibliography
87
88
89
90
“The Favre Averaged Drag Model for Turbulent Dispersion in Eulerian Multi-Phase Flows”,
91
“Assessment of turbulent dispersion models for bubbly flows in the low Stokes number
limit”,
92
93
ISO 7730-1984(E), Moderate thermal environments - Determination of the PMV and PPD
indices and specification of the conditions for thermal comfort
1984.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
370 of ANSYS, Inc. and its subsidiaries and affiliates.
References 81-100
94
95
Pitzer, K.S., D.Z. Lippmann, R.F. Curl, C.M. Huggins, and D.E. Petersen,
96
Aungier, R.H.,
“A Fast, Accurate Real Gas Equation of State for Fluid Dynamic Analysis Applications”,
97
98
99
“Kinetic Theories for Granular Flow: Inelastic Particles in Couette Flow and Slightly Inelastic
Particles in a General Flow Field”,
100
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 371
Bibliography
Menter, F.R., Langtry, R.B., Likki, S.R., Suzen, Y.B., Huang, P.G., and Völker, S.,
“A Correlation based Transition Model using Local Variables Part 1- Model Formulation”,
102
Langtry, R.B., Menter, F.R., Likki, S.R., Suzen, Y.B., Huang, P.G., and Völker, S.,
“A Correlation based Transition Model using Local Variables Part 2 - Test Cases and In-
dustrial Applications”,
103
104
Mayle, R.E.,
105
R. Schmehl,
“Advanced Modelling of Droplet Deformation and Breakup for CFD Analysis of Mixture
Preparation”,
106
107
F.X. Tanner,
“Liquid Jet Atomization and Droplet Breakup Modeling of Non-Evaporating Diesel Fuel
Sprays”,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
372 of ANSYS, Inc. and its subsidiaries and affiliates.
References 101-120
108
109
International Journal of Multiphase Flow, Vol. 18, No. 5, pp. 635-652, 1992.
110
111
112
“CFD Analysis of Fuel Atomization, Secondary Droplet Breakup and Spray Dispersion in
the Premix Duct of a LPP Combustor”,
Proc. of 8th Int. Conf. on Liquid Atomization and Spray Systems, Pasadena, CA, USA,
2000.
113
“Grenzschicht-Theorie”.
114
W.H. Nurick,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 373
Bibliography
115
116
117
“Use of Breakup Time Data and Velocity History Data to Predict the Maximum Size of
Stable Fragments for Acceleration-Induced Breakup of a Liquid Drop”,
118
S.V. Patankar,
119
S. Majumdar,
120
“Modelling of Primary and Secondary Break-Up Processes in High Pressure Diesel Sprays”,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
374 of ANSYS, Inc. and its subsidiaries and affiliates.
References 121-140
122
123
124
“Burning Velocities of Mixtures of Air with Methanol, iso-octane and indolene at High
Pressure and Temperature”,
125
126
Senecal, P.K., Schmidt, D.P., Nouar, I., Rutland, C.J., Reitz, R.D. and Corradin, M.L.,
127
128
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 375
Bibliography
"The modelling of turbulent flow around stationary and vibrating square cylinders",
Ninth Symposium on "Turbulent Shear Flows", Kyoto, Japan, August 16-18, 1993.
129
Menter, F. R.,
130
Proc. IUTAM Symposium; One hundred years of boundary layer research, Göttingen,
2004.
131
132
133
The Aerodynamics Of Heavy Vehicles: Trucks, Buses And Trains, Monterey, Dec.2-6, 2002.
134
Rotta, J. C.,
"Turbulente Strömungen",
135
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
376 of ANSYS, Inc. and its subsidiaries and affiliates.
References 141-160
Spalart P. R.,
NASA/CR-2001-211032, 2001.
136
Wilcox, D. C.,
137
Squires, K.,
138
139
Roache, P. J.,
140
ERCOFTAC Special Interest Group on Quality and Trust in Industrial CFD, Report, 2000.
Springer, Berlin.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 377
Bibliography
142
16th Brazilian Congress of Mechanical Engineering (COBEM), Nov. 2001, Uberlandia, Brazil.
143
Menter, F.,
“CFD Best Practice Guidelines for CFD Code Validation for Reactor Safety Applications”,
Evaluation of Computational Fluid Dynamic Methods for Reactor Safety Analysis (ECORA),
European Commission, 5th EURATOM FRAMEWORK PROGRAMME, 1998-2002.
144
145
DLES 6 - 6th ERCOFTAC Workshop on Direct and Large Eddy Simulation September,
Poitiers, 2005.
146
Spalart P. R.,
147
148
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
378 of ANSYS, Inc. and its subsidiaries and affiliates.
References 141-160
149
Frank, Th.,
150
Hussmann, B. et al.,
6th International Conference on Multiphase Flows, ICMF 2007, Leipzig, Germany, 2007.
151
152
Sommerfeld, M.,
153
154
Sommerfeld, M.,
155
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 379
Bibliography
156
“A Secondary atomization Model for Liquid Droplet Deformations and Breakup under
High Weber Number Conditions”,
ILASS Americas, 18th Annual Conference on Liquid Atomization and Spray Systems,
Irvine, CA, 2005.
157
Ind. Eng. Chem. Fundam., Vol. 15, No. 1, pp. 59 – 64, 1976.
158
“Generalized Multiparameter Correlation for Nonpolar and Polar Fluid Transport Proper-
ties”,
Ind. Eng. Chem. Res., Vol. 27, pp. 671 – 679, 1988.
159
ANS Proc. 27th National Heat Transfer Conference, Minneapolis, MN, July 28-31, 1991.
160
Podowski, M. Z., Alajbegovic, A., Kurul, N., Drew, D.A. and Lahey, R. T.,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
380 of ANSYS, Inc. and its subsidiaries and affiliates.
References 161-180
Int. Conference on Convective Flow and Pool Boiling, Irsee, Germany, 1997a.
162
163
164
Heat Transfer and Boiling (Eds. E. Hahne and U. Grigull), Academic Press, 1977.
165
“Vapour bubbles growth rate and heat transfer intensity at subcooled water boiling”,
166
Cole, R.,
167
“A new correlation of pool boiling data including the fact of heating surface character-
istics”,
168
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 381
Bibliography
169
Ceumern-Lindenstjerna, W. C.,
“Bubble Departure and Release Frequencies During Nucleate Pool Boiling of Water and
Aqueous NaCl Solutions”,
170
Saffman, P. G.,
171
172
Tomiyama, A.,
ICMF'98, 3rd Int. Conf. Multiphase Flow, Lyon, France, pp. 1-18, June 8-12, 1998.
173
174
175
G. Elsässer,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
382 of ANSYS, Inc. and its subsidiaries and affiliates.
References 181-200
176
177
Frank, Th., Zwart, P. J., Krepper, E., Prasser, H. -M. and Lucas,
“Validation of CFD models for mono- and polydisperse air-water two-phase flows in
pipes”
J. Nuclear Engineering & Design, Vol. 238, pp. 647–659, March 2008.
178
Lighthill, M. J.,
179
Lighthill, M. J.,
180
“Mechanics of Fluidization”
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 383
Bibliography
182
183
A. M. Douaud, P.Eyzat,
“Four-Octane-Number Method for Predicting the Anti-Knock Behavior of Fuels and En-
gines”,
184
185
“An Empirical Formula for Computing the Pressure Rise Delay of a Fuel from Its Cetane
Number and from the Relevant Parameters of Direct-Injection Diesel Engines”,
186
187
T. Poinsot, D. Veynante,
Edwards, 2001.
188
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
384 of ANSYS, Inc. and its subsidiaries and affiliates.
References 181-200
“A complete explicit algebraic Reynolds stress model for incompressible and compressible
flows”,
189
International journal of Heat and Fluid Flow, 23(5), pp. 721-730, 2002.
190
Hellsten, A.,
191
192
“Sensitization of the SST turbulence model to rotation and curvature by applying the
Spalart-Shur correction term”,
193
194
195
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 385
Bibliography
196
Launder, B.E.,
Int. J. Heat and Fluid Flow, Vol. 10, No. 4, pp. 282-300, 1989.
197
198
199
Lilly, D.K.,
200
“Subgrid-Scale Stress Modelling Based on the Square of the Velocity Gradient Tensor”,
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
386 of ANSYS, Inc. and its subsidiaries and affiliates.
References 201-220
202
203
Hughes, T.J.R.,
204
“Unconditionally Stable Algorithms for Rigid Body Dynamics that exactly Preserves Energy
and Momentum”
205
Dover, 2004.
206
Etkin, Bernard.,
207
Conaire, Marcus Ó, Curran, Henry J., Simmie, John M., Pitz, William J., Westbrook, Charles
K.,
208
Frank, Th.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 387
Bibliography
209
210
211
Frank, Th.
212
Sommerfeld, M.
213
B. P. Leonard,
88:17–74, 1991
214
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
388 of ANSYS, Inc. and its subsidiaries and affiliates.
References 201-220
215
Erdos, J.A.
pp. 1559-1568.
216
Gerolymos G.A.
pp. 1139-1152.
217
Giles, M.
J. Propulsion, 1988.
pp. 356-362.
218
He, L.
pp. 714-722.
219
International Journal of Heat and Fluid Flow, 19, pp. 209-222, 1998.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 389
Bibliography
220
Coffee, T. P.
Spalart, P. R., Deck, S., Shur, M. L., Squires, K. D., Strelets, M. Kh., Travin, A.
Theoretical and Computational Fluid Dynamics, vol. 20, pp. 181-195, 2006.
222
C. Temperton
223
224
225
Viswanathan K.
226
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
390 of ANSYS, Inc. and its subsidiaries and affiliates.
References 221-
“Development of DDES and IDDES Formulations for the k-ω Shear Stress Transport
Model”
227
228
229
“Time Spectral Method for Periodic Unsteady Computations over Two and Three- Dimen-
sional Bodies”
43rd AIAA Aerospace Sciences Meeting and Exhibit, AIAA Paper 2005-1220, Reno (USA),
2005.
230
B. Aupoix.
“Roughness Corrections for the k- Shear Stress Transport Model: Status and Proposals”
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 391
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
392 of ANSYS, Inc. and its subsidiaries and affiliates.
Glossary
Symbols
<CFDPOSTROOT> The directory in which CFD-Post is installed; for example: C:\Program
Files\ANSYS Inc\v201\CFD-Post\
A
absolute pressure The summation of solver pressure, reference pressure, and hydro-static
pressure (if a buoyant flow) in the cavitation model. The absolute pressure
is clipped to be no less than the vapor pressure of the fluid. It is used by
the solver to calculate pressure-dependent properties (such as density
for compressible flow).
absorption coefficient A property of a medium that measures the amount of thermal radiation
absorbed per unit length within the medium.
adaption criteria The criteria that are used to determine where mesh adaption takes place.
adaption level The degree that a mesh element has been refined during adaption. Each
mesh element has an adaption level. Each time an element is split into
smaller elements, the new elements have an adaption level that is one
greater than the "parent" element. The maximum number of adaption
levels is controlled to prevent over-refinement.
adaption step One loop of the adapt-solve cycle in the mesh adaption process.
adiabatic The description of any system in which heat is prevented from crossing
the boundary of the system. You can set adiabatic boundary conditions
for heat transfer simulations in ANSYS CFX or in Fluent.
Advancing Front and Infla- The default meshing mode in CFX. The AFI mesher consists of a triangular
tion (AFI) surface/tetrahedral volume mesh generator that uses the advancing front
method to discretize first the surface and then the volume into an un-
structured (irregular) mesh. Inflation can be applied to selected surfaces
to produce prismatic elements from the triangular surface mesh, which
combine with the tetrahedra to form a hybrid mesh.
all domains In immersed-solids cases in CFD-Post, "all domains" refers to all of the
domains in the case excluding the immersed solid. This is done for
backwards compatibility.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 393
Glossary
ASM (Algebraic Slip Model) A mathematical form in which geometry may be represented, known as
parametric cubic.
aspect ratio Also known as normalized shape ratio. A measure of how close to a
regular tetrahedron any tetrahedron is. The aspect ratio is 1 for a regular
tetrahedron, but gets smaller the flatter the tetrahedron gets. Used for
judging how good a mesh is.
B
backup file An intermediate CFX-Solver Results file that can be manually generated
during the course of a solution from the CFX-Solver Manager interface
by using the Backup action button. Backup files should be generated if
you suspect your solution may be diverging and want to retain the inter-
mediate solution from which you can do a restart.
batch mode A way to run some components of ANSYS CFX without needing to open
windows to control the process. When running in batch mode, a Viewer
is not provided and you cannot enter commands at a command prompt.
Commands are issued via a CFD-Post session file (*.cse), the name of
which is specified when executing the command to start batch mode.
The session file can be created using a text editor, or, more easily, by
recording a session while running in line-interface or user-interface mode.
blend factor A setting that controls the degree of first/second order blending for the
advection terms in discrete finite volume equations.
boundary A surface or edge that limits the extent of a space. A boundary can be
internal (the surface of a submerged porous material) or external (the
surface of an airfoil).
boundary condition Physical conditions at the edges of a region of interest that you must
specify in order to completely describe a simulation.
buoyant flow Flow that is driven wholly or partially by differences in fluid density. For
fluids where density is not a function of temperature, pressure, or Addi-
tional Variables, the Boussinesq approximation is employed. If density is
a function of one of these, then the Full Buoyancy model is employed.
C
CEL (CFX Expression Lan- A high level language used within CFX to develop expressions for use in
guage) your simulations. CEL can be used to apply user-defined fluid property
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
394 of ANSYS, Inc. and its subsidiaries and affiliates.
dependencies, boundary conditions, and initial values. Expressions can
be developed within CFX using the Expression Editor.
CFD (Computational Fluid The science of predicting fluid flow, heat transfer, mass transfer (as in
Dynamics) perspiration or dissolution), phase change (as in freezing or boiling),
chemical reaction (as in combustion), mechanical movement (as in fan
rotation), stress or deformation of related solid structures (such as a mast
bending in the wind), and related phenomena by solving the mathemat-
ical equations that govern these processes using a numerical algorithm
on a computer.
CFX-Solver Input file A file that contains the specification for the whole simulation, including
the geometry, surface mesh, boundary conditions, fluid properties, solver
parameters and any initial values. It is created by CFX and used as input
to CFX-Solver.
clipping plane A plane that is defined through the geometry of a model, in front of
which no geometry is drawn. This enables you to see parts of the geo-
metry that would normally be hidden.
• Commands entered into the Tools > Command Editor dialog box
All such actions must be preceded with the > symbol. These com-
mands force CFD-Post to undertake specific tasks, usually related to
the input and output of data from the system. See also Power Syn-
tax (p. 404).
compressible flow Flow in which the fluid volume changes in response to pressure change.
Compressible flow effects can be taken into consideration when the Mach
number (M) approaches approximately 0.2.
computational mesh A collection of points representing the flow field where the equations of
fluid motion (and temperature, if relevant) are calculated.
control volume The volume surrounding each node, defined by segments of the faces
of the elements associated with each node. The equations of fluid flow
are solved over each control volume.
convergence A state of a solution that occurs when the change in residual values from
one iteration to the next are below defined limits.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 395
Glossary
corrected boundary node Node values obtained by taking the results produced by CFX-Solver
values (called "conservative values") and overwriting the results on the boundary
nodes with the specified boundary conditions.
The values of some variables on the boundary nodes (that is, on the
edges of the geometry) are not precisely equal to the specified
boundary conditions when CFX-Solver finishes its calculations. For
instance, the value of velocity on a node on the wall will not be
precisely zero, and the value of temperature on an inlet may not be
precisely the specified inlet temperature. For visualization purposes,
it can be more helpful if the nodes at the boundary do contain the
specified boundary conditions and so "corrected boundary node
values" are used. Corrected boundary node values are obtained by
taking the results produced by CFX-Solver (called "conservative val-
ues") and overwriting the results on the boundary nodes with the
specified boundary conditions. This will ensure the velocity is display
as zero on no-slip walls and equal to the specified inlet velocity on
the inlet, for example.
coupled solver A solver in which all of the hydrodynamic equations are solved simultan-
eously as a single system. The advantages of a coupled solver are that
it is faster than a traditional solver and fewer iterations are required to
obtain a converged solution. CFX-Solver is an example of a coupled
solver.
D
default boundary condition The boundary condition that is applied to all surfaces that have no
boundary condition explicitly set. Normally, this is set to the No Slip
Adiabatic Wall boundary condition, although you can change the type
of default boundary condition in CFX.
Detached Eddy Simulation A model that covers the boundary layer by a RANS model and switches
(DES) to a LES model in detached regions.
Direct Numerical Simulation A CFD simulation in which the Navier-Stokes equations are solved without
(DNS) any turbulence model.
domain Regions of fluid flow and/or heat transfer in CFX are called domains.
Fluid domains define a region of fluid flow, while solid domains are re-
gions occupied by conducting solids in which volumetric sources of en-
ergy can be specified. The domain requires three specifications:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
396 of ANSYS, Inc. and its subsidiaries and affiliates.
• The region defining the flow or conducting solid. A domain is formed
from one or more 3D primitives that constrain the region occupied by
the fluid and/or conducting solids.
• The physical nature of the flow. This determines the modeling of specific
features such as heat transfer or buoyancy.
There can be many domains per model, with each domain defined
by separate 3D primitives. Multidomain problems may be created
from a single mesh if it contains multiple 3D primitives or is from
multiple meshes.
dynamic viscosity Dynamic viscosity, also called absolute viscosity, is a measure of the res-
istance of a fluid to shearing forces.
dynamical time For advection dominated flows, this is an approximate timescale for the
flow to move through the Domain. Setting the physical time step (p. 403)
size to this value (or a fraction of it) can promote faster convergence.
E
eddy viscosity model A turbulence model based on the assumption that Reynolds stresses are
proportional to mean velocity gradients and that the Reynolds stress
contribution can be described by the addition of a turbulent component
of viscosity. An example of an eddy viscosity model is the k- model.
edge The edge entity describes the topological relationships for a curve. Adja-
cent faces share at least one edge.
expansion factor The rate of growth of volume elements away from curved surfaces and
the rate of growth of surface elements away from curved boundaries.
Expansion factor is also used to specify the rate of mesh coarsening from
a mesh control.
expression editor An interactive, form-driven facility within CFX for developing expressions.
F
face “Face” can have several meanings:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 397
Glossary
flow region A volumetric space containing a fluid. Depending on the flow character-
istics, you may have a single, uninterrupted flow region, or several flow
regions, each exhibiting different characteristics.
flow symmetry Flow where the conditions of the flow entering and leaving one half of
a geometry are the same as the conditions of the flow entering and
leaving the other half of the geometry.
fluid A substance that tends to flow and assumes the shape of its domain,
such as a gas in a duct or a liquid in a container.
G
gas or liquid surface A type of boundary that exhibits no friction and fluid cannot move
through it. Also called a symmetry boundary.
general fluid A fluid whose properties may be generally prescribed in ANSYS CFX or
Fluent. Density and specific heat capacity for general fluids may depend
on pressure, temperature, and any Additional Variables.
global model tolerance The minimum distance between two geometry entities below which CFX
considers them to be coincident. The default setting of global model
tolerance, defined in the template database, is normally .005 in whichever
geometry units you are working.
geometric symmetry The state of a geometry where each half is a mirror of the other.
group A named collection of geometric and mesh entities that can be posted
for display in viewports. The group's definition includes:
• Group name
• A list of the geometric and mesh entities that are members of the group.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
398 of ANSYS, Inc. and its subsidiaries and affiliates.
H
hexahedral element A mesh element with the same topology as a hexahedron, with six faces
and eight vertices.
home directory The directory on all Linux systems and some Windows NT systems where
each user stores all of their files, and where various set-up files are stored.
I
ideal gas A fluid whose properties obey the ideal gas law. The density is automat-
ically computed using this relationship and a specified molecular weight.
IGES (Initial Graphics Ex- An ANSI standard formatted file used to exchange data among most
change Specification) file commercial CAD systems. IGES files can be imported into CFX.
implicit geometry Geometry that exists as part of some other entity. For example, the edges
of a surface are implicit curves.
import mesh A meshing mode that enables import of volume meshes generated in
one of a number of external CFD packages. The volume mesh can contain
hexahedral, tetrahedral, prismatic, and pyramidal element types.
inactive region A fluid or porous region where flow and (if relevant) temperatures are
not being calculated, or a solid region where temperatures are not being
calculated. By default, inactive regions are hidden from view in the
graphics window.
incompressible flow Flow in which the density is constant throughout the domain.
incremental adaption The method of mesh adaption used by CFX where an existing mesh is
modified to meet specified criteria. Incremental adaption is much faster
than remeshing; however, the mesh quality is limited by that of the initial
mesh.
inertial resistance coeffi- Mathematical terms used to define porous media resistance.
cients
initial guess The values of dependent variables at the start of a steady-state simulation.
These can set explicitly, read from an existing solution, or given default
values.
initial values The values of dependent variables at the initial time of a transient simu-
lation. These can be either set explicitly, or read from an existing solution.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 399
Glossary
inlet boundary condition A boundary condition (p. 394) for which the quantity of fluid flowing into
the flow domain is specified, for example, by setting the fluid velocity or
mass flow rate.
interior boundary A boundary that enables flow to enter and exit. These types of boundaries
are useful to separate two distinct fluid regions from each other, or to
separate a porous region from a fluid region, when you still want flow
to occur between the two regions.
internal flow Flow through the interior of your geometry, such as flow through a pipe.
interpolation The process of transferring a solution from a results file containing one
mesh onto a second file containing a different mesh.
isentropic The description of a process where there is no heat transfer and entropy
is held constant.
J
JPEG file A common graphics file type that is supported by CFD-Post output op-
tions.
K
k-epsilon turbulence model A turbulence model (p. 408) based on the concept that turbulence consists
of small eddies that are continuously forming and dissipating. The k-ep-
silon turbulence model solves two additional transport equations: one
for turbulence generation (k), and one for turbulence dissipation (epsilon).
kinematic diffusivity A function of the fluid medium that describes how rapidly an Additional
Variable would move through the fluid in the absence of convection.
L
laminar flow Flow that is dominated by viscous forces in the fluid, and characterized
by low Reynolds Number.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
400 of ANSYS, Inc. and its subsidiaries and affiliates.
The velocity distributions are effectively layers of fluid moving at
different velocities relative to each other.
Large Eddy Simulation The Large Eddy Simulation model decomposes flow variables into large
Model (LES) and small scale parts. This model solves for large-scale fluctuating motions
and uses “sub-grid” scale turbulence models for the small-scale motion.
line interface mode A mode in which you type the commands that would otherwise be issued
by the user interface. A viewer is provided that shows the geometry and
the objects created on the command line. Line interface mode differs
from entering commands in the Command Editor dialog box in that line
interface action commands are not preceded by a > symbol. Aside from
that difference, all commands that work for the Command Editor dialog
box will also work in line interface mode, providing the correct syntax is
used.
locator A place or object upon which a plot can be drawn. Examples are planes
and points.
M
MAlt key (Meta key) The MAlt key (or Meta key) is used to keyboard select menu items with
the use of mnemonics (the underscored letter in each menu label). By
simultaneously pressing the MAlt key and a mnemonic is an alternative
to using the mouse to click a menu title. The MAlt key is different for
different brands of keyboards. Some examples of MAlt keys include the
" " key for Sun Model Type 4 keyboards, the "Compose Character" key
for Tektronix keyboards, and the Alt key on most keyboards for most
Windows-based systems.
mass fraction The ratio of the mass of a fluid component to the total mass of the fluid.
Values for mass fraction range from 0 to 1.
mesh A collection of points representing the flow field where the equations of
fluid motion (and temperature, if relevant) are calculated.
mesh adaption The process by which, once or more during a run, the mesh is selectively
refined at various locations, depending on criteria that you can specify.
As the solution is calculated, the mesh can automatically be refined in
locations where solution variables are changed rapidly, in order to resolve
the features of the flow in these regions.
There are two general methods for performing mesh adaption. Incre-
mental adaption takes an existing mesh and modifies it to meet the
adaption criteria. The alternative is remeshing, in which the whole
geometry is remeshed at every adaption step according to the ad-
aption criteria. In CFX, incremental adaption is used because this is
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 401
Glossary
much faster; however, this imposes the limitation that the resulting
mesh quality is limited by the quality of the initial mesh.
mesh control A refinement of the surface and volume mesh in specific regions of the
model. Mesh controls can take the form of a point, line, or triangle.
meshing mode The method you use to create your mesh of nodes and elements required
for analysis. There are two main meshing modes:
minimal results file A file that contains only the results for selected variables, and no mesh.
It can be created only for transient calculations. It is useful when you are
only interested in particular variables and want to minimize the size of
the results for the transient calculation.
multicomponent fluid A fluid consisting of more than one component. The components are
assumed to be mixed at the molecular level, though the proportions of
each component may vary in space or time. The properties of a multicom-
ponent fluid are dependent on the proportion of constituent components.
N
Navier-Stokes equations The fundamental equations of fluid flow and heat transfer, solved by
CFX-Solver. They are partial differential equations.
new model preferences Preferential settings for your model that define the meshing mode (p. 402),
the geometry units, and the global model tolerance (p. 398).
node allocation parameter A parameter that is used in mesh adaption (p. 401) to determine how
many nodes are added to the mesh in each adaption step (p. 393).
non-clipped absolute pres- The summation of solver pressure, reference pressure, and hydro-static
sure pressure (if a buoyant flow). This pressure, used by the solver to calculate
cavitation sources, can be negative or positive.
non-Newtonian fluid A fluid that does not follow a simple linear relationship between shear
stress and shear strain.
O
open area The area in a porous region that is open to flow.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
402 of ANSYS, Inc. and its subsidiaries and affiliates.
outlet A boundary condition where the fluid is constrained to flow only out of
the domain.
outline plot A plot showing the outline of the geometry. By setting the edge angle
to 0, the surface mesh can be displayed over the whole geometry.
output file A text file produced by CFX-Solver that details the history of a run. It is
important to browse the output file when a run is finished to determine
whether the run has converged, and whether a restart is necessary.
P
parallel runs Separate solutions of sections (partitions) of your CFD model, run on
more than one processor.
parametric equation Any set of equations that express the coordinates of the points of a curve
as functions of one parameter, or express the coordinates of the points
of a surface as functions of two parameters, or express the coordinates
of the points of a solid as functions of three parameters.
parametric surfaces Four sided surfaces parameterized in two normalized directions. Paramet-
ric surfaces are colored green ANSYS CFX.
Particle-Particle Collision A model in ANSYS CFX that takes inter-particle collisions and their effects
Model (LPTM-PPCM) on the particle and gas phase into consideration.
periodic pair boundary A boundary condition where the values on the first surface specified are
condition mapped to the second surface. The mapping can be done either by a
translation or a rotation (if a rotating frame of reference is used).
physical time step The time represented in each iteration of the solution.
pick list The list processor interprets the contents of all selected data boxes. All
selected data boxes in CFX expect character strings as input. The character
strings may be supplied by the graphics system when you select an entity
from a viewport, or you can type or paste in the string directly. The
character strings are called "pick lists."
plot Any means of viewing the results in CFD-Post. Types of plots include
vectors, streamlines, and contour plots.
point probes Points placed at specific locations in a computational domain where data
can be analyzed.
postprocessor The component used to analyze and present the results of the simulation.
For ANSYS CFX, the postprocessor is CFD-Post.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 403
Glossary
Power Syntax The CFX Command Language (CCL) is the internal communication and
command language of CFD-Post. It is a simple language that can be used
to create objects or perform actions in the postprocessor. Power Syntax
enables you to embed Perl commands into CCL to achieve powerful
quantitative postprocessing.
preprocessor The component used to create the input for the solver. For ANSYS CFX,
the preprocessor is CFX-Pre.
pressure In the cavitation model, pressure is the same as solver pressure, but
clipped such that the absolute pressure is non-negative. It is used for
postprocessing only.
prism or prismatic element A 3D mesh element shaped like a triangular prism (with six vertices).
Sometimes known as a wedge element.
R
reference coordinate frame The coordinate frame in which the principal directions of X or Y or Z are
taken. X is taken in the local X of that frame, and so on. If the coordinate
frame is a non-rectangular coordinate frame, then the principal axes 1,
2, and 3 will be used to define the X, Y, and Z directions, respectively.
The default is CFX global system (Coord 0).
residuals The change in the value of certain variables from one iteration to the
next.
CFX-Solver writes the residuals to the output file (p. 403) so that they
can be reviewed. Fluent allows residuals to be plotted during the
solution process.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
404 of ANSYS, Inc. and its subsidiaries and affiliates.
results file (CFX-Solver Res- A file produced by CFX-Solver that contains the full definition of the
ults file) simulation as well as the values of all variables throughout the flow do-
main and the history of the run including residuals (p. 404). A CFX-Solver
Results file can be used as input to CFD-Post or as an input file to CFX-
Solver, in order to perform a restart.
Reynolds averaged Navier- Time-averaged equations of fluid motion that are primarily used with
Stokes (RANS) equations turbulent flows.
Reynolds stress The stress added to fluid flow due to the random fluctuations in fluid
momentum in turbulent flows. When the Navier-Stokes equations (p. 402)
are derived for time averaged turbulent flow to take into account the
effect of these fluctuations in velocity, the resulting equations have six
stress terms that do not appear in the laminar flow equations. These are
known as Reynolds stresses.
Reynolds stress turbulence A model that solves transport equations for the individual Reynolds stress
model components. It is particularly appropriate where strong flow curvature,
swirl, and separation are present. Reynolds stress models in general tend
to be less numerically robust than eddy viscosity models such as the k-
epsilon turbulence model (p. 400).
RNG k-epsilon turbulence An alternative to the standard k-epsilon turbulence model (p. 400). It is
model based on renormalization group analysis of the Navier-Stokes equations.
The transport equations for turbulence generation and dissipation are
the same as those for the standard k-epsilon model, but the model con-
stants differ, and the constant C 1 is replaced by the function C 1RNG.
Rotating Frame of Refer- A coordinate system that rotates. ANSYS CFX and Fluent can solve for
ence (RFR) fluid flow in a geometry that is rotating around an axis at a fixed angular
velocity.
run A process that requires the specification of the CFX-Solver input file (and
an initial values file, if necessary), and produces an output file and a results
file (if successful).
S
Sampling Plane A locator that is planar and consists of equally-spaced points.
scalar variable A variable that has only magnitude and not direction. Examples are
temperature, pressure, speed (the magnitude of the velocity vector), and
any component of a vector quantity.
Scale Adaptive Simulation A shear stress transport model used primarily for unsteady CFD simula-
(SAS) model tions, where steady-state simulations are not of sufficient accuracy and
do not properly describe the true nature of the physical phenomena.
Cases that may benefit from using the SAS-SST model include:
• Unsteady flow behind a car or in the strong mixing behind blades and
baffles inside stirred chemical reactors
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 405
Glossary
For these problems and others, the SAS-SST model provides a more
accurate solution than URANS models, where steady-state simulations
are not of sufficient accuracy and do not properly describe the true
nature of the physical phenomena.
Second Moment Closure Models that use seven transport equations for the independent Reynolds
models stresses and one length (or related) scale; other models use two equations
for the two main turbulent scales.
session file (CFX) A file that contains the records of all the actions in each interactive CFX
session. It has the extension .ses.
Shear Stress Transport (SST) A based SST model that accounts for the transport of the turbulent
shear stress and gives highly accurate predictions of the onset and the
amount of flow separation under adverse pressure gradients.
singleton (CCL object) A singleton object that consists of an object type at the start of a line,
followed by a : (colon). Subsequent lines may define parameters and
child objects associated with this object. The object definition is termin-
ated by the string END on a line by itself. The singleton object for a ses-
sion file is declared like this:
SESSION:
Session Filename = <filename>.cse
END
slice plane A locator that is planar, and that consists of all the points that intersect
the plane and the mesh edges.
solid A material that does not flow when a force or stress is applied to it.
solid sub-domain A region of the fluid domain that is occupied by a conducting solid.
ANSYS CFX can model heat transfer in such a solid; this is known as CHT
(Conjugate Heat Transfer) (p. 395).
solver The component that solves the CFD problem, producing the required
results.
spanwise coordinate A term used in Fluent documentation that is equivalent to the ANSYS
CFX term constant span.
specific heat The ratio of the amount of heat energy supplied to a substance to its
corresponding change in temperature.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
406 of ANSYS, Inc. and its subsidiaries and affiliates.
specific heat capacity The amount of heat energy required to raise the temperature of a fixed
mass of a fluid by 1 K at constant pressure.
speed of sound The velocity at which small amplitude pressure waves propagate through
a fluid.
sphere volume A locator that consists of a collection of volume elements that are con-
tained in or intersect a user-defined sphere.
state files Files produced by CFD-Post that contain CCL commands. They differ from
session files in that only a snapshot of the current state is saved to a file.
You can also write your own state files using any text editor.
STP (Standard Temperature Defined as 0°C (273.15 K) and 1 atm (1.013x105 Pa).
and Pressure)
steady-state simulation A simulation that is carried out to determine the flow after it has settled
to a steady state. Note that, even with time constant boundary conditions,
some flows do not have a steady-state solution.
stream plot A plot that shows the streamlines of a flow. Stream plots can be shown
as lines, tubes, or ribbons.
streamline The path that a small, neutrally-buoyant particle would take through the
flow domain, assuming the displayed solution to be steady-state.
subdomains Regions within a domain where special conditions can be applied. For
example, a subdomain can be used to model a region of flow resistance
or a heat source.
subsonic flow The movement of a fluid at a speed less than the speed of sound.
surface plot A plot that colors a surface according to the values of a variable. Addi-
tionally, you can choose to display contours.
symmetry-plane boundary A boundary condition where all variables except velocity are mathemat-
condition ically symmetric and there can be no diffusion or flow across the
boundary. Velocity parallel to the boundary is also symmetric and velocity
normal to the boundary is zero.
T
template fluid One of a list of standard fluids with predefined properties that you can
use 'as is', or use as a template to create a fluid with your own properties.
thermal conductivity The property of a fluid that characterizes its ability to transfer heat by
conduction.
thermal expansivity The property of a fluid that describes how a fluid expands as the result
of an increase in temperature. Also known as the coefficient of thermal
expansion, β.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 407
Glossary
theta The angular coordinate measured about the axis of rotation following
the right-hand rule. When looking along the positive direction of the
axis of rotation, theta is increasing in the clockwise direction. Note that
the theta coordinate in CFD-Post does not increase over 360°, even for
spiral geometries that wrap to more than 360°.
tracers Particles that follow a flow pathline. Used in viewing CFD results in order
to visualize the mechanics of the fluid flow.
transitions Portions of a mesh that are the result of meshing geometry with two
opposing edges that have different mesh seeds. This produces an irreg-
ular mesh.
turbulence intensity The ratio of the root-mean-square of the velocity fluctuations to the mean
flow velocity.
turbulence length scale A physical quantity related to the size of the large eddies that contain
the energy in turbulent flows.
turbulence model A model that predicts turbulent flow (p. 409). The available turbulence
models in ANSYS CFX are:
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
408 of ANSYS, Inc. and its subsidiaries and affiliates.
• zero equation turbulence model (p. 410)
turbulent A flow field that is irregular and chaotic look. In turbulent flow, a fluid
particle's velocity changes dramatically at any given point in the flow
field, in time, direction, and magnitude, making computational analysis
of the flow more challenging.
turbulent flow Flow that is randomly unsteady over time. A characteristic of turbulent
flow is chaotic fluctuations in the local velocity.
V
variable A quantity such as temperature or velocity for which results have been
calculated in a CFD calculation.
vector plot A plot that shows the direction of the flow at points in space, using ar-
rows. Optionally, the size of the arrows may show the magnitude of the
velocity of the flow at that point. The vectors may also be colored accord-
ing to the value of any variable.
viewer area The area of ANSYS CFX that contains the 3D Viewer, Operating Points
viewer, Table Viewer, Chart Viewer, Comment Viewer, and Report
Viewer, which you access from tabs at the bottom of the area.
viewport (CFX) An assigned, named, graphics window definition, stored in the CFX
database, that can be used to display selected portions of a model's
geometry, finite elements, and analysis results. The viewport's definition
includes:
• A current group
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 409
Glossary
current viewport
The viewport currently being displayed. The following actions can be
performed only on the current viewport:
posted viewport
A viewport that has been selected for display.
target viewport
A viewport selected for a viewport modify action. Any viewport (includ-
ing the current viewport) can be selected as the target viewport.
viscosity The ratio of the tangential frictional force per unit area to the velocity
gradient perpendicular to the flow direction.
Volume of Fluid (VOF) A technique for tracking a fluid-fluid interface as it changes its topology.
method
W
wall A generic term describing a stationary boundary through which flow
cannot pass.
workspace area The area of CFX-Pre and CFD-Post that contains the Outline, Variables,
Expressions, Calculators, and Turbo workspaces, which you access from
the tabs at the top of the area. Each workspace has a tree view at the
top and an editor at the bottom (which is often called the details view).
Y
y+ (YPLUS) A non-dimensional parameter used to determine a specific distance from
a wall through the boundary layer to the center of the element at a wall
boundary.
Z
zero equation turbulence A simple model that accounts for turbulence by using an algebraic
model equation to calculate turbulence viscosity. This model is useful for obtain-
ing quick, robust solutions for use as initial fields for simulations using
more sophisticated turbulence models.
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
410 of ANSYS, Inc. and its subsidiaries and affiliates.