0% found this document useful (0 votes)
69 views130 pages

CFDCompanion

Uploaded by

Gulain Mayombo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views130 pages

CFDCompanion

Uploaded by

Gulain Mayombo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 130

Computational Fluid Dynamics

Companion

MECN4021 - Fluid Dynamics


MECN4024 - Gas Dynamics & Propulsion

R.T. Paton

© R.T. Paton 2015


Contents

Contents i

List of Figures vi

List of Symbols x

List of Acronyms xi

1 Introduction 1

2 Concepts & Terminology 2

2.1 General Flow Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.1.1 Compressibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.1.2 Viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.2 Analytical Basis of Computational Fluid Dynamics . . . . . . . . . . . . . . . 4

2.3 Range of Applicability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.4 Discretization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.5 Solution Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.6 Solution Validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.6.1 Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.6.2 Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Demonstration Problem 11

3.1 Problem description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.2 Problem presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

i
4 Introduction to the ANSYS Workbench Environment 12

4.1 Logging into the application server . . . . . . . . . . . . . . . . . . . . . . . . 12

4.2 General layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.3 Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5 Geometry 17

5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2 Fluid Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.3 Domain Symmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.4 Domain Dimensionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.4.1 Three-dimensional models . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.4.2 Two-dimensional models . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.4.2.1 Planar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

5.4.2.2 Axisymmetric . . . . . . . . . . . . . . . . . . . . . . . . . . 19

5.4.2.3 Axisymmetric Swirl . . . . . . . . . . . . . . . . . . . . . . . 19

5.5 Domain Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.6 Domain layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.6.1 Continua and Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.6.2 Mesh motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.7 Creation in ANSYS DesignModeler . . . . . . . . . . . . . . . . . . . . . . . . 24

6 Meshing 37

6.1 Mesh Sizing and Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6.1.1 Minimum mesh cell size . . . . . . . . . . . . . . . . . . . . . . . . . . 39

ii
6.1.1.1 Minimum feature length . . . . . . . . . . . . . . . . . . . . . 40

6.1.1.2 Geometric resolution . . . . . . . . . . . . . . . . . . . . . . 40

6.1.1.3 Viscous modelling . . . . . . . . . . . . . . . . . . . . . . . . 41

6.1.2 Maximum mesh cell size . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.2 Mesh motion vs fluid motion . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

6.3 Boundary Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

6.3.1 Physical boundary types . . . . . . . . . . . . . . . . . . . . . . . . . . 43

6.3.2 Inertial boundary types . . . . . . . . . . . . . . . . . . . . . . . . . . 43

6.4 Creation in ANSYS Meshing . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

7 Solver 60

7.1 Solver Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

7.1.1 Pressure-based solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

7.1.2 Density-based solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

7.1.2.1 Explicit Linearisation . . . . . . . . . . . . . . . . . . . . . . 61

7.1.2.2 Implicit Linearisation . . . . . . . . . . . . . . . . . . . . . . 61

7.2 Viscosity in CFD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

7.2.1 Commonly used viscous models in CFD . . . . . . . . . . . . . . . . . 62

7.2.1.1 κ− . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

7.2.1.2 κ−ω . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

7.2.1.3 Spalart-Allmaras . . . . . . . . . . . . . . . . . . . . . . . . . 63

7.2.1.4 Large Eddy Simulation (LES) . . . . . . . . . . . . . . . . . 64

7.3 User-Defined Functions (UDFs) . . . . . . . . . . . . . . . . . . . . . . . . . . 64

iii
7.3.1 Fluid property functions . . . . . . . . . . . . . . . . . . . . . . . . . . 65

7.3.1.1 Fluid thermodynamic properties . . . . . . . . . . . . . . . . 65

7.3.1.2 Boundary value functions . . . . . . . . . . . . . . . . . . . . 65

7.3.2 Mesh motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.3.2.1 Forced motion functions . . . . . . . . . . . . . . . . . . . . . 66

7.3.2.2 Integrated motion functions . . . . . . . . . . . . . . . . . . . 66

7.4 Mesh Motion Meshing Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 67

7.4.1 Smoothing method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

7.4.2 Dynamic layering remeshing method . . . . . . . . . . . . . . . . . . . 67

7.4.3 In-cylinder remeshing method . . . . . . . . . . . . . . . . . . . . . . . 68

7.4.4 Remeshing method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

7.5 Mesh Motion Zones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

7.5.1 Stationary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

7.5.2 Rigid Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

7.5.3 Deforming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

7.5.4 Division of mesh blocks into zones . . . . . . . . . . . . . . . . . . . . 69

7.6 Adaptive Mesh Refinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

7.7 Solution Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

7.7.1 Residuals monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

7.7.2 Flux or force monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

7.8 Transient Solutions and Time Steps Size . . . . . . . . . . . . . . . . . . . . . 73

7.8.1 Temporal resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

iv
7.8.2 Rates of flux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

7.8.3 Mesh Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

7.8.4 Number of time steps . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

7.9 Creation in ANSYS Fluent . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

8 Post-processing in ANSYS Fluent 107

8.1 Numerical post-processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

8.2 Graphical post-processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

8.3 Advanced graphical post-processing . . . . . . . . . . . . . . . . . . . . . . . . 108

8.4 Setting up animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

9 Iterative Model Development 113

9.1 Mesh Independence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

9.2 Solver Independence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

9.3 Validation & Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

9.3.1 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

9.3.2 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

10 High Performance Computing 115

Glossary 116

v
List of Figures

1 Ranges of applicability in terms of Knudsen number of various fluid modelling


approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Citrix login page for application server . . . . . . . . . . . . . . . . . . . . . . 13

3 Application dashboard of Citrix application server . . . . . . . . . . . . . . . 13

4 ANSYS Workbench when you first open it . . . . . . . . . . . . . . . . . . . . 14

5 ANSYS Workbench component systems and information toggles . . . . . . . 14

6 Layout of geometry blocks for demonstration problem . . . . . . . . . . . . . 23

7 ANSYS Workbench with a Geometry component system placed into the Pro-
ject Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

8 The most commonly used tools and areas of ANSYS DesignModeler . . . . . 25

9 Enabling Auto-constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

10 First rectangle used in the construction of the faster vehicle body . . . . . . . 27

11 A filleted corner of the first rectangle by the manual method . . . . . . . . . 28

12 Dimensions placed on faster vehicle boundary . . . . . . . . . . . . . . . . . . 28

13 Fully dimensioned fisrt vehicle sketch . . . . . . . . . . . . . . . . . . . . . . . 29

14 Concept menu items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

15 Details for new surface from sketch . . . . . . . . . . . . . . . . . . . . . . . . 30

16 Completed surface item for the first vehicle . . . . . . . . . . . . . . . . . . . 31

17 Completed surface item for the faster vehicle block . . . . . . . . . . . . . . . 31

18 First point of new block constrained to existing sketch . . . . . . . . . . . . . 32

19 Second point of new block constrained to existing sketch . . . . . . . . . . . . 32

20 Final point of new block constrained to existing sketch . . . . . . . . . . . . . 32

vi
21 First three blocks of model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

22 All blocks of model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

23 Create menu items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

24 Details of a new boolean operation . . . . . . . . . . . . . . . . . . . . . . . . 34

25 Details of the subtract boolean operation . . . . . . . . . . . . . . . . . . . . 35

26 Final blocks for model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

27 Mesh block boundary interpolation . . . . . . . . . . . . . . . . . . . . . . . . 39

28 Geometry component system linked to the geometry item of the Mesh com-
ponent system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

29 Details of the mesh specification . . . . . . . . . . . . . . . . . . . . . . . . . 45

30 Details of the global mesh sizing specification . . . . . . . . . . . . . . . . . . 46

31 Details of the global mesh inflation sizing specification . . . . . . . . . . . . . 48

32 Some operations in the mesh context menu . . . . . . . . . . . . . . . . . . . 48

33 Initial mesh based on global mesh options . . . . . . . . . . . . . . . . . . . . 49

34 Details of the initial mesh based on global mesh options . . . . . . . . . . . . 49

35 Detailed settings for the sizing mesh control method . . . . . . . . . . . . . . 50

36 Changing the mouse mode for geometry selection . . . . . . . . . . . . . . . . 51

37 Preview of edge sizing before mesh is updated . . . . . . . . . . . . . . . . . . 52

38 Meshing progress indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

39 Updated mesh including edge sizing mesh control . . . . . . . . . . . . . . . . 53

40 Detailed view of the faster vehicle mesh before the inflation method is applied 54

41 The face of the faster vehicle mesh block selected for control by the Inflation
method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

vii
42 The updated faster vehicle mesh with the inflation layer included . . . . . . . 55

43 Context menu options including Create Named Selection . . . . . . . . . . . . 56

44 Geometry selection with multiple coincident features . . . . . . . . . . . . . . 57

45 Context menu for geometry control in ANSYS Meshing including the Hide and
Suppress options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

46 All interfaces defined and indicated in the workspace . . . . . . . . . . . . . . 59

47 The Fluent Launcher configuration screen . . . . . . . . . . . . . . . . . . . . 76

48 Layout of the Fluent graphical interface . . . . . . . . . . . . . . . . . . . . . 78

49 Mesh interface specification window . . . . . . . . . . . . . . . . . . . . . . . 79

50 Mesh interfaces defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

51 Specification of the κ −  viscous model . . . . . . . . . . . . . . . . . . . . . 82

52 Specification of the fluids in the model . . . . . . . . . . . . . . . . . . . . . . 83

53 Specification of the ideal gas fluid . . . . . . . . . . . . . . . . . . . . . . . . . 84

54 Setting the operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . 84

55 Setting the pressure far field boundary condition . . . . . . . . . . . . . . . . 85

56 Compiled user-defined function (UDF) menu . . . . . . . . . . . . . . . . . . 86

57 Text User Interface (TUI) output for a successful UDF build . . . . . . . . . 88

58 UDF library manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

59 Global settings for the Dynamic Layering mesh motion method . . . . . . . . 89

60 Dynamic Mesh zone definition window . . . . . . . . . . . . . . . . . . . . . . 90

61 Rigid Body dynamic zone specification: motion attributes . . . . . . . . . . . 91

62 Rigid Body dynamic zone specification: meshing options for interior zones . . 91

63 Rigid Body dynamic zone specification: meshing options for edges . . . . . . 92

viii
64 Rigid Body dynamic mesh zones defined . . . . . . . . . . . . . . . . . . . . . 93

65 Deforming dynamic zone specification: motion attributes . . . . . . . . . . . . 94

66 Deforming dynamic zone specification: meshing options for mesh interiors . . 94

67 Cell Zone Info dialogue for dynamic meshing . . . . . . . . . . . . . . . . . . 95

68 Deforming dynamic mesh zones defined . . . . . . . . . . . . . . . . . . . . . 96

69 Residuals monitor screen including convergence limits . . . . . . . . . . . . . 97

70 Dialogue for the creation of a surface monitor . . . . . . . . . . . . . . . . . . 98

71 Details pane for the initialisation of the flow field . . . . . . . . . . . . . . . . 99

72 Details pane for the Calculation Activites Workflow item . . . . . . . . . . . . 101

73 Details pane for the Autosave item . . . . . . . . . . . . . . . . . . . . . . . . 101

74 Specification of commands to be executed during simulation . . . . . . . . . . 103

75 Commands for adaptive refinement of demonstration problem defined . . . . 103

76 Details for starting the execution of a simulation . . . . . . . . . . . . . . . . 104

77 Specification of commands to be executed during simulation . . . . . . . . . . 105

78 First attempt at determining the minimum number of iterations per time step
for convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

79 Setup pane for a force report . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

80 Setup pane for a line graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

81 Setup pane for a contour plot . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

82 Setup pane for solution animations . . . . . . . . . . . . . . . . . . . . . . . . 110

83 Definition pane for solution animations . . . . . . . . . . . . . . . . . . . . . . 111

ix
List of Symbols

The units of quantities defined by a symbol are indicated in square brackets following the
description of the symbol. Quantities with no indicated units may be assumed to be dimen-
sionless.

a Sound speed [m.s-1 ].

Kn Knudsen number.

` Characteristic length [m].

λ Mean free path length [øA].

M Mach number.

P Pressure [Pa, mmHg].

R Specific Gas Constant [kJ.kg-1 K-1 ].

Re Reynolds number.

ρ Density [kg.m-3 ].

T Temperature [K, ℃, °F].

x
List of Acronyms

2D two-dimensional.

3D three-dimensional.

CFD Computational Fluid Dynamics.

CHPC Centre for High Performance Computing.

CM Computational Mechanics.

CSIR Council for Scientific and Industrial Research.

DNS Direct Navier-Stokes.

FEA Finite Element Analysis.

GUI Graphical User Interface.

HPC High Performance Computing.

LES Large Eddy Simulation.

NS Navier-Stokes.

PDE partial differential equations.

RANS Reynolds-Averaged Navier-Stokes.

RNG Renormalization Group.

SST Shear-Stress Transport.

TUI Text User Interface.

UDF user-defined function.

xi
1 Introduction

This companion is designed as a step-by-step guide to setting up a simple problem in AN-


SYS© Fluent with relevant theory included at each step. While you may be expected to use
other Computational Fluid Dynamics (CFD) solver suites in the future, the process presen-
ted here is meant to be a generic representation of the process of setting up a model in a
typical Navier-Stokes finite volume package. The focus of this guide is on practical setup
with supplemental information of the theory and other considerations for that process. As
such, you will be required as a practitioner in your working life to read further on the theory
behind various aspects of these models to understand limitations you may encounter.

1
2 Concepts & Terminology

Before getting into the details of the use of ANSYS© Fluent it is necessary to lay a foundation
of principles and terms to be used in the development of such models.

2.1 General Flow Concepts

In order to simplify the analysis of general flow conditions several broad conditions have
been specified for which analytical results hold with various degrees of accuracy. These
conditions are also used as indicators of the general behaviour of such flows and, typically,
non-dimensional parameters are used as indicators of these conditions. Several of the general
divisions of flow types are listed.

2.1.1 Compressibility

While dealt with elsewhere in this course, several points should be reiterated here concerning
compressibilty in fluid flows.

The term compressibility refers to the changes in density that occur in fluids under certain
pressure conditions. While most liquids are only marginally compressible, with small changes
in density with changes in pressure, gases are generally considered compressible. This means
that the density of the gas would, for example, increase significantly with an increase in
pressure (if all other conditions are held constant). One of the most common working fluids
for CFD analysis, air, is generally dealt with as an ideal gas where the pressure, temperature
and density are related by:
P = ρRspecif ic T (1)

where: P is the pressure; ρ is the density; R is the specific gas constant; and T is the
temperature of the air.

The Mach number is used as an indicator of the degree of compressibility to which a particular
flow is prone. Generally it is considered that flow below Mach 0.3 is practically incompressible.
This means that the changes in density due to the deflection of the flow around the body
moving through it are neglible compared to the density at the far field conditions. Above
Mach 0.7 the flow is considered fully compressible and is prone to large changes in density,
pressure and temperature in response to the deflection around the body passing through the
flow. Between Mach 0.3 and Mach 0.7, the flow is considered somewhat compressible though

2
flow in that there may be regions of high compressibility while others may be effectively
incompressible.

The entire regime of flow is broadly divided into 3 regimes with the first subdivided into a
further 2 regimes. Below Mach 1, i.e. where the travelling speed of the body is less than the
speed of sound in the surrounding fluid, the flow is termed subsonic (or subcritical in liquid
flows). This regime is further divided into 2 further regimes though no fixed demarcation
Mach number exists. At low Mach numbers, the flow is always termed subsonic. However, at
Mach numbers approaching 1, the flow is often termed transonic. This is because the local
Mach number in these flows may be greater than 1 while the global Mach number is less than
one. Typically, once a Mach number of 0.8 has been reached the flow is termed transonic.
An example of this is flow over the wing of a commercial airliner. The Mach number of the
free-stream flow over the wing is less than 1 (typically 0.83 - 0.87) however, the flow over the
upper surface and, to a lesser extent and dependent on the wing geometry, the lower surface
is accelerated to a speed at the wing surface and in the near vicinity of M >1. Thus, while
the global flow is subsonic, the local flow at the wing surface is supersonic and experiences
significant compressibility effects.

Flows above Mach 1 are again divided into 2 regimes. Any flow with a Mach number above
1 is termed a supersonic flow. However, as the Mach number continues to increase other
thermodynamic effects in the flow become significant and such regimes are termed hypersonic
flows. No fixed Mach number is defined above which any flow would be hypersonic as the
Mach number for the onset of effects considered typical of hypersonic flow, e.g. chemical
degradation of the fluid, vary with geometry and working fluid. However, the minimum limit
for the onset of hypersonic flow is typically Mach 3 while the maximum limit above which
most flows are considered hypersonic is around Mach 7. An example of such a flow is the
re-entry of the space shuttle into the Earth’s atmosphere at Mach 25. A detached shock wave
forms at the nose of the aircraft across which the air is suddenly heated and pressurised. The
heating of the air is typically severe enough that the constituent molecules of the air; ozone,
nitrogen and others, are split and ionize. This absorbs a significant amount of the energy
changes imparted to the fluid by the shock wave and reduces the temperature of the air as
compared to that which would be estimated by an ideal gas solution. These ionized particles
are then free to react with each other and the material of the shuttle itself adding another
degree of freedom to the energy considerations of the flow.

2.1.2 Viscosity

Viscous effects are those effects in a fluid which originate at molecular level and are the result
of cohesive and adhesive attractive forces between particles. As such, viscous effects can

3
be thought of as the result of the particles of a fluid ’sticking’ to a heterogenous substance
(typically a solid surface) and then subsequent ’layers’ of fluid particles ’sticking’ to the ’layer’
adhering to that substance. A typical example of such viscous behaviour is the boundary
layer around a body moving through a fluid.

The degree to which viscous effects affect the flow around a body depends on the velocity of
the fluid passing the body and the size of the body relative to the molecules of the fluid. These
parameters are generally described using the Reynolds number. A low Reynolds number (Re)
would indicate that the viscous forces exerted on the body are comparable to the inertia forces
(momentum) of the fluid. At higher Reynolds numbers the inertia forces tend to dominate
the viscous ones and, in the limit, the flow can be considered inviscid. As an example, again
consider the boundary layer. At low Reynolds numbers (e.g. low fluid speed or highly viscous
fluid) the boundary layer is able to grow and the velocity difference across the thickness of the
layer is relatively small. Also, the viscous cohesive forces holding the ’layers’ of the boundary
layer together are comparable to the inertia forces ’washing’ the boundary layer downstream.
At high Reynolds numbers (e.g. high fluid speed or fluid of low viscosity) the inertia forces
exerted on the boundary layer are greater and the ’layers’ of the boundary layer are forced
to slip more relative to one another than in the low Reynolds number case. Thus, as the
Reynolds number increases the boundary layer gets ’thinner’ (for a given velocity change)
until a limit is reached where the thickness of the boundary layer, and thus its effect on
the surrounding flow, becomes negligible when compared to the effects of the body under
consideration, excluding the effects of turbulence and separation associated with these high
Reynolds numbers.

For a given fluid then, by transformation, the Mach number can also be used as an indicator
of the dominance of viscous effects in the flow under consideration. While no fixed rules of
thumb exist for the effects of viscosity as a function of subsonic Mach number, supersonic
flows may be considered inviscid provided that all points in the flow are supersonic. In the
presence of travelling shock waves, for example, where a boundary layer is known to develop
behind the shock wave, viscous effects would necessarily be a consideration in the numerical
solution.

2.2 Analytical Basis of Computational Fluid Dynamics

Computational Fluid Dynamics is the general term for that group of mathematical methods
used to solve the analytical equations governing fluid flows derived from the physical laws of
conservation of Mass, Energy and Momentum for a continuum. This means that the fluid
is treated as a continuous field of properties and the effects of individual particles are not
directly modelled.

4
Various such methods exist for modelling fluid flows including; source, vortex panel / vortex
sheet and potential flow methods. In most commercial packages, these equations have been
derived for flows of suitable density etc. such that the Navier-Stokes (NS) equations are
applicable. Through simplifications, these equations for general flow of compressible gases can
be adapted to model inviscid systems (Euler flow conditions). A further simplification, that
flow is fully developed (i.e. steady state) and isothermal (no thermal energy considerations),
produces the familiar Bernoulli condition. Most simulation work is done for an ideal gas i.e.
one where the pressure, density and temperature are related as given in 2.1. However, any
number of fluids, liquid or gaseous, can be modelled provided the behaviour of the fluid with
changes in temperature and pressure is well documented.

2.3 Range of Applicability

The formulation of commercial CFD packages to use the NS solver does limit the conditions
of flow that can be accurately modelled. In particular, extremely rarified gases cannot be
accurately modelled using the NS equations. These are conditions that would be experienced
by, for example, the space shuttle when re-entering the Earth’s atmosphere. In such a fluid,
the mean free path (or average distance) between particles in the fluid becomes comparable
to the dimensions of the body passing through the fluid.The Knudsen number, Kn = λ , is
`
used to represent this ratio where: λ is the Mean Free Path length and ` is the characteristic
length of the flow field. For values of Kn lower than 0.3, i.e. when the mean free path is
less than 30% of the body length, the NS (or Euler) equations are applicable. Above this
limit the fluid can no longer be modelled accurately as a continuum and a discrete particle
model becomes applicable. While discrete particle models are generally applicable, these are
computationally expensive and hence the formulations of most CFD packages are in terms
of the continuum model. The general limits of this are shown in Figure 1.

Another flow regime in which the NS equations are not directly applicable are high speed flows
in which chemical reactions occur i.e. hypersonic flow. In such flows, the thermodynamic
changes to the fluid as a result of chemical degradation mean that the ideal gas model (for
example) would over-estimate the temperatures and pressures occurring in a fluid. Many
solvers can be adapted to model these conditions by using pressure and density data as a
function of temperature based on experimental data input by the user.

2.4 Discretization

Some of the first methods of numerical solution of the fluid flow problems involved the use of
finite difference method. In such a method, the derivatives in the differential equations which

5
Discrete particle model

Boltzmann Collisionless Boltzmann

Continuum model

Euler Navier-Stokes Conservation equations do not form a closed set

0 0.01 0.1 1 10 100 ∞


Knudsen number (Kn)
Inviscid limit Free molecule limit

Figure 1: Ranges of applicability in terms of Knudsen number of various fluid modelling


approaches

describe the fluid flow are replaced by finite differences that approximate them. The domain
being studied, however, remains a single entity. The obvious drawback of such a method is
that the accuracy of the estimated value at a point in the flow field depends on the proximity
of the points of known value which were used to estimate that value. The farther a point is
in the domain from the points of known value the less accurate the estimate of a particular
flow variable would be at that point. Also, these methods effectively preclude the presence of
discontinuities in the flow field as the method presumes a continuous change in any variable
across the field.

The obvious conclusion of such error is that the estimation of values in a field in which
variables could be described by differential relationships is to limit the distance at which
these estimates are made from the points of known value. This logic led to the development
of the finite element method. In this method the domain being studied is divided into smaller
domains each with a simple variation of parameters across the extent of the sub-domains.
Finite element techniques have found useful application in mechanical stress analysis where
the variables being examined, e.g. stress and strain, are simply related.

In fluid dynamics systems the range of flow properties being examined are generally related by
higher order partial differential relationships and these prove difficult to formulate using the
finite element method. Thus the finite volume method, such as that used by ANSYS© Fluent,
was developed. It contains elements of both the finite element and finite difference schemes.
As in the finite element method, the domain being studied is sub-divided into smaller sub-
domains. This is done by creating a mesh of points, or nodes, at which flow values are

6
calculated and which represent the actual geometry of the system being studied by their
relative positions. The relationships defining the relative positions of these nodes, or edges,
define surfaces in the domain which, in a 3D environment, form closed volumes (also known
as cells), hence the name. In other words, the entire volume being studied is broken into little
blocks which fit together to approximate the shape of the domain and are forced to have the
same values of flow parameters as the adjacent block at the common boundaries.

The finite volume scheme also contains elements of the finite difference scheme as differentials
in the governing equations of the system for each cell are replaced by approximate differences.
Also, the values being calculated at points in the domain are calculated as a function of the
corresponding value at adjacent points in the domain. Thus, the finite volume method enables
complex flow fields to be examined by treating them as smaller, simpler flow fields. The cells
are assessed in such a way that the various fluxes calculated for each cell must match those
of the adjacent cell and hence these methods are conservative.

2.5 Solution Procedure

When using CFD to analyse a flow field there are 3 general steps to be followed: Pre-
processing, Solving and Post-Processing. In the first step, the mesh used to represent the
flow field in the solver is generated. The mesh is that system of nodes which describe the
geometry of the flow field and also serve as computation points for solution of the governing
equations. Thus, the finer the spacing of these nodes, the better the representation of the
geometry would be, especially in the case of curved surfaces. It is important to note that
in CFD the fluid being studied and NOT the bodies around which it is flowing
are modelled. Thus, when modelling the flow through a pipe, the volume inside of the pipe
and not the pipe walls are represented by a mesh.

The second step, the solver, is where the geometry represented by the mesh is passed to
the solver, along with information on the flow conditions at certain points in the domain
known as boundary conditions. It is the solver which actually calculates the variation of the
flow variables throughout the domain based on these boundary conditions. It is thus vitally
important that the boundary conditions specified accurately represent the real conditions
being modelled otherwise the solution rendered is effectively meaningless.

The final step in a CFD analysis is post-processing. This is where the data produced by the
solver are formatted in such a way that useful information about the flow field being studied
can be easily represented. For example, one may wish to study the variation of pressure at
a point on the surface of a body with time. In such a case the value of the pressure at each
time step of the solution would be extracted from the solution files for use in a plot.

7
2.6 Solution Validity

When using CFD to analyse a flow field there are several concepts resulting from the meth-
odology used to analyse the field which must be considered when assessing the validity of the
solution produced.

2.6.1 Convergence

When a solver is calculating the flow variables for a flow field, it uses values initially supplied
for each node as an estimate of the final value. These values are set during a process known
as initialization in which the flow variables are set at each node based on user input values
or boundary conditions. The solver then enforces the boundary conditions. This causes
a mismatch between the value defined at a particular node and the value driven by the
physics of the system. The solver then adapts the value at each node based on a weighted
average derived from the Courant-Friedrichs-Lewy condition for convergent partial differential
equations (PDE). This means that the values are adjusted to approach the value suggested
by the physics of the system but not be so vastly different from the current value that the
solutions crashes. A convergent solution is one which, over successive iterations of the solver,
approaches the analytical value (if such exists) of the differential equations being solved. In
the CFD context the values of the flow variables approach those of the real system being
modelled.

The weighting of the value changes from one iteration to the next is set in the ANSYS© Flu-
ent system by means of the Courant number. The default value is 5 and is suitable for most
systems. However, systems with very strong shock waves may require a much lower Courant
number around 0.5. A lower Courant number will typically provide a solution that is more
stable but takes longer to solve. By corollary, a higher Courant number provides a solution
that is faster but more prone to divergence. This is because a solution with a higher Cour-
ant number, if convergent, will take a lower number of iterations to reach the same level of
convergence than a solution with a lower Courant number.

In unsteady solutions, i.e. where a changing system is modelled over a period of time, the
Courant number also affects the size of the time steps used between the start and end times.
While the user can specify a particular time step, if the solver is allowed to calculate its
own time stepping (implicit time stepping), the Courant number will be used to optimise the
calculated time step. Again, the lower the Courant number, the smaller the time step and
the longer the solution will take for a given time frame.

8
In ANSYS© Fluent, convergence is monitored by means of residuals of the various flow para-
meters. These are measures of the maximum relative change of a variable from one iteration
to the next. Typically, a residual much less than one will indicate a converged solution while
residuals greater than one will be indicative of solutions that are still unresolved. In the case
of unsteady simulations the criteria for convergence may not be met at each time step but
rather it is typically considered acceptable if the residuals for each time step reduce by 4 or
more orders of magnitude.

A model which is not convergent is referred to as divergent. This results in increasingly


large changes in field values away from the physical values expected for the given boundary
conditions until the model is forced to stop by internal limitations of the solver. These limits
are typically imposed to constrain values of flow parameters such as temperature and pressure
to values experienced in the flow fields for which the Navier-Stokes equations are applicable.
For example, temperature is typically limited to a maximum of around 5000 K since fluids
above these temperatures are normally plasmas which do not follow the same behaviour as
liquids and gases because of the presence of ionisation and significant levels of thermodynamic
radiation.

2.6.2 Resolution

Resolution in CFD refers to the accurate description of flow phenomena based on the mesh
used to generate the solution i.e. if a feature is smaller in scale than the separation of nodes
in the mesh used in the solution, it may not be accurately resolved. For example, if the nodes
in a mesh are quite widely spaced, the representation of a shock wave in such a mesh would
be inaccurate as it would be averaged across the nodes on either side of it. Thus, the closer
those nodes are to each other, the better the shock wave would be represented.

A similar restriction is applicable to geometric resolution of the domain. The details of a


feature in a given domain are limited by the mesh size in that region. If the mesh is too coarse
the feature will not be adequately represented in the solver and the results obtained will not
be representative of the actual flow. A typical problem of this kind is curved surfaces. If the
cell size on the surface is too large it will be represented more as a multi-faceted polygon and
the flow over it will be disturbed accordingly. Typically, a circular arc is considered well-
represented if it ’looks smooth’ when viewed as a feature in the entire flow field or relative to
the full body. Another rule of thumb, though it can be overly conservative, is that each cell
should cover between 2% and 20% of the curve for it to be adequately represented. Discretion
must be used to determine the overall relevance of a particular curve to the flow being studied
when specifying a curve representation.

9
When meshing rectilinear geometries it is necessary that the minimum average cell height
be less than or slightly larger than the length of the shortest feature. This, again, is open
to some adjustment. If the feature is insignificant in terms of the flow behaviour then the
minimum cell height can be such that it is ’smoothed’ out of the model passed to the solver,
though in such cases it should rather be properly eradicated by means of surface merging,
for example. If, however, the small region is of particular interest, then the mesh should
be sized that a minimum of between 5 and 10 nodes lie across the feature such that it is
adequately described geometrically and in terms of the flow in that region. There are other
considerations in sizing the minimum element in a given mesh, covered in subsection 6.1.

10
3 Demonstration Problem

3.1 Problem description

The problem to be modelled will be that of one vehicle overtaking another along a straight
road. The leading vehicle will be travelling at 60 km.h-1 while the overtaking vehicle will
accelerate to a speed of 80 km.h-1 at a rate of 15 km.h-1 .s-1 . The model must describe the
flow from the point when the overtaking vehicle is 2 vehicle lengths behind the leading vehicle
until it is 2 vehicle lengths ahead. Each of the vehicles can be approximated for this two-
dimensional model as rectangles that are 3.6 x 1.8 m with rounded corners of radius 150 mm
and a separation when alongside each other of 900 mm.

3.2 Problem presentation

A short description of the considerations typically needed in defining a model will be given
before that rationale is applied to the given demonstration problem. The rationale particular
to the demonstration problem will be given in italics to make it easier to identify if necessary.
Since a given stage of the model may require understanding of procedures later in the process
it is advisable to follow this guide a second time after having created the model once.

11
4 Introduction to the ANSYS Workbench Environment

Before proceeding to the development of the model it is important to familiarise yourself with
the layout and symbols commonly used. Those particular to a particular part of the program
will be introduced in the relevant section.

4.1 Logging into the application server

The use of ANSYS within the School is through the application server.

• Within the Wits network (either directly or by VPN), navigate to


http://mech-ts1.mech.wits.ac.za/Citrix/XenApp/site/default.aspx in your browser. While
this should work in any browser, if there are problem it is suggested that you try using
Windows Internet Explorer

• If you are using the application on your personal computer for the first time, you will
need to follow these steps:

1. When prompted to do so download the Citrix Receiver installer


2. Install the Citrix Receiver by following the installation prompts given (you will
need administrator rights to do so)
3. When you get to the screen asking you to enter your email address you can exit
the installer
4. Refresh your browser page for the application server

• You should get to a landing page that looks as shown in Figure 2. Log in using your
Mech domain authentication data (i.e. what you use to log into the PC Pool in SWE)

• Once you have logged in, you will be presented with icons for applications available on
the server, as shown (for example) in Figure 3. If there is a suite of applications it will
appear as a folder icon and give all available applications within it. You will also notice
the log off button. It is important to understand at this stage that although applications
run on your terminal will appear as normal windows they are actually being run on
the application server and only the view is being presented to you. Obviousy this also
means that without a network connection to the application server you will not be able
to work.

For the purposes of this course we will be using ANSYS Fluent version 15.

12
Figure 2: Citrix login page for application server

Log off

ANSYS app folder

App icon

Figure 3: Application dashboard of Citrix application server

4.2 General layout

Once you have opened ANSYS Workbench you will be presented with a window which looks
like that shown in figure Figure 4. You can choose to have the tips shown at the start if
you wish. The Analysis Systems block includes systems that are packaged to represent the
complete work flow of various sorts of model. You can use these if you wish, but it has proved
to be more useful for a new user to work with component systems so that only part of their
work is lost when some part of the model fails.

The component systems are shown in the next tab of the navigation tree on the left of the
ANSYS Workbench window, as shown in Figure 5. The systems available in each area will
depend on the licence available to you. If there are no systems / components shown, it
typically means that licences are unavailable for some reason, typically that the licence has
expired or that the licence server is offline. There are two toggles shown in the Workbench
environment as well:

13
Analysis systems Tips

Figure 4: ANSYS Workbench when you first open it

Component systems

Messages toggle

Progress toggle

Figure 5: ANSYS Workbench component systems and information toggles

• The Progress toggle: this allows you to show or hide the progress of your mod-
els. This is more useful when a model is established and runs without the component
programs being visibly opened to do so

14
• The Messages toggle: this allows you to show or hide the messages sent through to
Workbench. These may be sent by the other programs being used or may be raised by
Workbench itself

The area previously obscured by the tips window is called the Project Schematic and is the
area in which components will be placed and linked allowing you an overview of the structure
of the model created.

4.3 Data Structure

It is important to also have some understanding of the way in which ANSYS Workbench
arranges the data in a simulation. At this stage you have no simulation defined so you won’t
be able to refer to your file system but this section should be revisited once your model has
been developed.

When you save a Workbench project, two items are created: a .wbpj file and a folder with
the name of the project followed by ” files”. It is important to realise at this point that
the .wbpj file is only the project header file which contains the information relating to the
relative layout and connections of the component and solution systems used. None of the
actual Computational Mechanics (CM) data are included in this file. Rather, all of the actual
CM data are included in various folders within the files folder. This means that if you want
to move your simulation data to another computer for assistance or to work there, you need to
take both items. It is possible to save the entire group to a repository but this is a compressed
file which will need to be uncompressed on the destination computer before the simulation
can be resumed.

If you open up the files folder you will typically see three or four items:

• dp0: The name of this folder stands for ”design point 0”. This refers to the fact that
you may create models with several design points and the data for each are separately
stored. Simple models normally have only one design point. The design point folders
are the ones which will contain the separated data for each stage of a simulation

• user files: This is a folder in which some of your user files may be stored. However,
in the case of files such as UDFs (subsection 7.3) must be stored in the design point
folders for proper use

• .project cache: This is another configuration file. You will never need to edit this

15
• .lock: This is a file created when the workbench project is open to show that it is
locked by another user. If your simulation is unexpectedly shut down (through power
loss, for example) this file will remain and Workbench will prompt you to unlock the
project. At the same time that the .lock file is created, a hidden copy of the entire files
folder is created which is where changes are actually made. Only when finally saving
the project are the changes updated in the main folders

If you open the design point folder, you will see, at various stages of a model, one or more of
the following folders:

• SYS: This is the folder in which files created by the system for use in other component
or solution systems will be saved. There may be various folders within this folder but
you normally won’t need to use this. It is worth noting that part of the meshing data
(the .msh file which can be directly imported to Fluent) is typically stored here

• global: As the name suggests this is a folder the contents of which are accessible by
any component of the simulation. Although there are folders and files which will be
automatically created there by Workbench (such as the remainder of the meshing data
(subsection 6.4)), this location is important as it is where UDFs should be placed for
inclusion in Fluent

• Geom: This folder is created if you use the DesignModeler tool (subsection 5.7) to
create the geometry for your simulation. While it is one that you normally won’t need
to access, the geometry files are stored here and copies of external geometry files that
are imported are also placed here

• FLU or FFF: These folder are created if you use a Fluent (subsection 7.9) component
system or solution system respectively. Within this folder is the folder, typically named
Fluent, where the case and data files saved by Fluent are automatically stored. This
location is particularly important to note as these are the actual CFD files that you
will need to analyse for your final results

Fluent data are stored in two associated files: the case (.cas) and data (.dat) files. The case
file contains the specification of the solver and the co-ordinates of the mesh nodes amongst
other settings. The data file contains only the associated flow field values at each of the
nodes. Often, due to the size of these files, they are saved in a compressed form using the
Linux compression tool, gunzip, in which case the file extensions are appropriately modified
to .cas.gz and .dat.gz for the case and data files respectively. Fluent can automatically
uncompress these formats but the same can also be done using Windows-based tools such as
WinRAR.

16
5 Geometry

5.1 Introduction

When defining the geometry to be used in a model, there are several considerations to be
borne in mind: domain dimensionality, symmetry, size and layout. Although these decisions
are part of the initial setup of a model, very often one has to revise the geometry in the later
iterations thereof since limitations or improvements are often only identified at those stages.
Meshing and solver constraints inform the layout of the geometry and longer experience in
CFD will enable users to develop more refined models earlier in the process.

5.2 Fluid Domain

A fundamental consideration when creating a CFD model is that it is the fluid to be studied
and not any bodies with which it is interacting that must be modelled e.g. if you want to
model the flow around a car, the geometry of your model domain will be the block of air
around the car and the car will (typically) be a ’hole’ in the domain.

5.3 Domain Symmetry

One of the simplest way to reduce the computation time of a model is to reduce the domain
size as far as possible. Before limiting the domain extent for free-flow models, it is important
to consider if symmetry may allow domain reduction. If a flow field is inherently symmetrical
then the use of a symmetry boundary condition will typically halve the computation time
(because only half of the domain is actually computed). It is this reasoning that spurred the
development of the axisymmetric model type (subsection 5.4).

It is important when considering the use of a symmetry boundary condition to be aware of


the physical implications thereof. The symmetry boundary type, by definition, cannot allow
flow to cross it as that would define a spontaneous creation or destruction of matter, violating
the continuity of mass. As a result, any flow directed toward the symmetry plane will reflect
totally from that surface. This consideration is most important in three-dimensional (3D)
models. If, for example, a single plane of symmetry is used in the definition of the model it
will preclude the possibility of helical vortex shedding in the wake of a bluff body (such as
a bullet) because a helix has no planes of linear symmetry. While this type of wake is fairly
uncommmon, unless it is known that the wake does not exhibit this behaviour, it cannot be

17
assumed. If time or computing resource pressures force you to limit the model in such a way,
this must be borne in mind when analysing the results produced.

5.4 Domain Dimensionality

One of the first considerations for a CFD model is the dimensionality i.e. what order of
spatial dimension the model will have. There are two basic types of model and one of them
is sub-divided:

• 3D

• two-dimensional (2D):

– Planar
– Axisymmetric
– Axisymmetric Swirl

5.4.1 Three-dimensional models

While a 3D model is the most complete model that you can make in CFD, the higher di-
mensional order means that, for example, a cubic volume of the same edge length as a plane
square will take 4 - 8 times as long to solve. Thus, 3D models are normally only used if abso-
lutely necessary as dictated by flow behaviour. This is easier to understand when considering
the limitation imposed by a 2D model: when a model is specified as 2D it generally limits the
flow only to the plane of the model. In other words, the value of out-of-plane flow is forced
to be zero. In many cases, especially of models used for initial estimates, this limitation is
suitable but some flow fields inherently require a full 3D description of the flow field and
cannot be modelled two-dimensionally.

5.4.2 Two-dimensional models

As explained above, a two-dimensional model will typically limit the flow to the model plane
and set the out of plane flux to zero.

18
5.4.2.1 Planar

This is the basic form of the 2D model. This is simply a representation of a field of infinite
depth in which the behaviour at any point through the depth of the field is the same for a
particular location within the plane. This is the method used for most fields described as
being two-dimensional. These models are based on effectively creating a computation block
of unit depth though the mesh itself is represented only as a plane.

5.4.2.2 Axisymmetric

A common type of flow within engineering is flow within or around bodies of revolution.
Examples of this include the flow within pipes or around a bullet. The axisymmetric formu-
lation is one which allows you to model these 3D fields using a 2D formulation because the
flow field is the same for a given circle around the axis of revolution. An axisymmetric model
is set up so that one of the boundaries is the axis of the flow field (for example the centrelines
of the pipe or bullet) which is often required to coincide with one of the principal axes of the
domain space. Normally axisymmetric models must be defined in the XY Plane and the axis
must lie along the x axis. An axisymmetric model can also have only one axis of symmetry.

Fluxes in an axisymmetric model are calculated incorporating the distance from the axis.
This means that a point twice as far from the axis with the same flow speed and density will
represent twice the mass flux because it represents the flow though a circular line with twice
the circumference. Flow in an axisymmetric model is constrained to the plane of the model
and this means that there can be no helical flow (i.e. sprial swirl) of the flow.

5.4.2.3 Axisymmetric Swirl

It is well known that many flows in engineering, such as pipe flows, involve swirl. This
means that the flow moves in the tangential, radial, and longitudinal directions. Since the
axisymmetric boundary condition prohibits out-of-plane flow, the axisymmetric swirl model
has been created to allow such helical flow. This is achieved by forcing the flow exiting one
edge of the computational domain (which can be considered as effectively a wedge) to match
that entering the other edge of the domain.

Since the case of overtaking vehicles has no axis of symmetry and has only been defined as a
2D model, the geometry to be created must be planar two-dimensional.

19
5.5 Domain Size

In the case of a constrained flow, the domain size is limited directly by the system geometry
being modelled. However, for simulations of free-air (or other unconstrained fluid) flows,
some consideration must be given to the size of the domain being modelled. If the domain is
too small for the body and effects being modelled, the enforcement of some of the boundary
conditions by the solver may produce non-physical results or cause the solution to diverge.
Conversely, if the domain is too large the solution will take considerably longer to solve as
this procedure can be computationally very expensive.

The definition of what is too small for a flow is very strongly a feature of the speed. This
is because the size of the zone affected by the presence of a change is a function of the
distance from the change that the information pertaining to that change can propagate. The
speed of propagation of information in a quiescent fluid is the sound speed. In a moving
fluid, the orientation of the flow relative to a phenomenon (an immersed body, a change
in geometry, the introduction of another fluid flow...) will affect the zone affected by the
information emanating from it i.e. if the direction of the flow is toward the phenomenon then
the zone affected by the phenomenon will be smaller (since the information is being ’washed’
downstream) while if the flow is away from the body then the zone affected will be larger
(since the information is being ’washed’ downstream).

Typically, the information most relevant in this is the pressure or velocity changes resulting
from these phenomena which affect other flow properties e.g. the higher pressure / stagnation
of flow at the nose of a car will cause the air upstream of the car to start ’lift’ over the body
of the car some distance upstream of the car itself. The higher the velocity of the flow /
body, the shorter the distance upstream and the longer the distance downstream that the
field could be affected by the body.

A typical rule of thumb for subsonic flows is that an absolute minimum of 5 characteristic
lengths, though 10 is generally considered more acceptable, must be modelled around a
body. This is to ensure that the effects of the body in the flow are suitably dissipated at
the domain boundary to approximate the far-field condition. Thus, for example, an airfoil
section with chord c should be modelled in a domain with a minimum radius of 5c. In the
case of the flow around a pipe joint (i.e. constrained flow), 5 diameters of the pipe upstream
would probably be sufficient to fully capture the effect of the joint while as many as 20 pipe
diameters downstream of the joint might be needed to adequately capture the mixing of the
two streams, especially in the case of different temperatures, densities, or fluids themselves
at the joint.

20
In supersonic flow, the length of the domain upstream of the body can be significantly reduced,
if necessary, to as little as 2 characteristic lengths since little or no information can propagate
upstream of a body in such a flow. However, the downstream domain will need to be as large
as, if not larger than, the downstream domain for a subsonic model. The upstream domain
cannot be zero characteristic lengths as this would produce a singularity at the leading edge
of the body and the model would thus be inaccurate or, more likely, unstable. In hypersonic
cases, the downstream domain may need to be as large as 20 or 30 characteristic lengths to
adequately model the flow.

When defining the characteristic length for the sizing of a domain you need to consider the
dimension of the body relevant in that case. In the example of a car moving down the
road, the length of the car will be the most likely characteristic length in the streamwise
direction. In the directions transverse to the stream (i.e. typically vertically and laterally)
the characteristic length would more likely be height or the width of the car since these are
the dimensions that will affect the displacement of the air around the vehicle.

A further consideration when sizing the domain for a model is the motion of any bodies within
the fluid and, related to this, the reference frame used for the simulation. The boundaries
need to be an appropriate distance from the bodies at all times in the simulation and so it
is typically useful to first determine the size of a box which would contain all of the motion
and then add the required distances around this. Although mesh motion is covered further
in subsubsection 5.6.2, it is important to consider here the necessity of mesh motion.

If a body is going to be modelled moving at constant speed, it is an intuitive transformation


to fix the reference frame of the model in the body and move the fluid past it. The benefit
of such a transformation is that rather than modelling a very large domain to capture the
effects of simple motion, a much smaller domain can be be created. Such a model is also
modelled as steady state.

If you want to model relative motion between multiple bodies, it is often worth transforming
the model into the reference frame of one of the bodies as long as its motion is inertial and
then describe the motion of the other bodies in that reference frame. By necessity, such a
model must also be transient. In CFD, transformation into a non-inertial reference frame
produces an inaccurate model because the total energy state of the moving fluid is incorrect
in that reference frame unless it is modified by external functions.

The smallest geometry that can be used in the demonstration problem will be one where the
reference frame is fixed in the slower vehicle. A simple kinematic calculation would show that
the distance required for the trailing vehicle to overtake the leading one is approximately 58
m. When one adds even only 10 vehicle lengths, as the characteristic length in that direction,

21
to the entire domain (5 upstream and downstream respectively), this suggests a minimum
domain length of 94 m.

By comparison, if the reference frame is fixed in the slower vehicle, the length of the box
in which the vehicles will move is 7 characteristic lengths (the length of the faster vehicle
in the initial position; the two vehicle lengths separating the vehicles initially; the length of
the slower vehicle; the two vehicle lengths separating the vehicles at the end of the modelled
motion; and the length of the faster vehicle in the final position) and hence a total domain
length of approximately 61 m, only 65% of the domain length without changing the reference
frame.

The width of the movement box would require only 4.5 m (two vehicle widths and the 0.9
m separation of the vehicles) and then 5 - 10 characteristic lengths, which here would be the
width of the vehicles. A simple calculation suggests a domain width of approximately 23 m.

5.6 Domain layout

A consideration when creating the geometry for a model is the possible necessity of separated
continua. There are several reasons why this may be necessary including: different fluids in
the flow; fluids in different initial states; differences in local meshing behaviour needed; or
zones of mesh motion.

5.6.1 Continua and Blocks

In the first two cases the geometry is divided into the needed number of adjacent geometries
so that when specifying the model the different fluid states can be applied to each. An
example of this is in the modelling of a shock tube where there are two volumes of gas at
different pressures separated by a membrane. It is unnecessary to model the actual membrane
(diaphragm) so most such models will define one block for the high pressure gas and another
for the low pressure gas.

In the third case, as discussed in more detail in section 6, it is often useful to ”pre-optimise”
the mesh for a model by creating regions of concentration of nodes. In order to do so most
systems require the creation of geometric boundaries to define the zones of refinement.

22
5.6.2 Mesh motion

The final common cause for dividing a domain into mesh blocks is mesh motion. When
the boundaries of a mesh move, there is typically remeshing which happens adjacent to the
moving boundary. This process can lead to instability of the model if not properly defined and
generally it is preferred that the type of remeshing is kept as simple as possible. Changes in
cell size near bodies of interest would result in complicated remeshing and so these zones are
normally separated so that the entire complicated block can move with the mesh unchanged
while there is simple mesh deformation adjacent to that block.

As an example of this, in the demonstration problem there will by necessity be a refined mesh
around each of the vehicles. Since the overtaking vehicle will have to move through the domain
it would be most expedient to create a block around it which will contain the refined mesh and
move in a linear fashion and then blocks to either side so that the extent of the remeshing
is limited and the layering remeshing type can be used (see subsubsection 7.4.2 for more detail)

Thus, the final layout of mesh blocks which should work quite well for this model is as shown
in Figure 6.

Slower vehicle block

Faster vehicle Slower vehicle

Shrinking mesh block

Growing mesh block Faster vehicle block

Stationary block

Figure 6: Layout of geometry blocks for demonstration problem

23
5.7 Creation in ANSYS DesignModeler

1. Open ANSYS Workbench

2. Drag a Geometry block from the Component Systems on the left into the workspace and
name it if you wish, as shown in Figure 7. Notice that when it is first placed that there
is a blue question mark icon . This indicates that the information included in the
block is insufficient for the simulation to proceed

Figure 7: ANSYS Workbench with a Geometry component system placed into the Project
Schematic

3. Double-click on the line with the blue question mark in it. This will open ANSYS
DesignModeler, the universal geometry editor for ANSYS Workbench

4. Once ANSYS DesignModeler has loaded, familiarise yourself with the location of the
most important controls:

• Model tree: the block in most ANSYS applications where operations are displayed
and can be selected for: re-ordering; editing; or deletion
• Details pane: the block where the details of the item selected in the model tree
are displayed. Used to edit the parameters of any particular item
• Display area: shows the rendered form of the model described in the model tree.
Also used for the display of other items such as plots

24
View manipulation
Geometry operations
Mouse mode Selector dimensionality
Generator
Model tree New sketch
Display area

Co-ordinate system icon

Details pane

Figure 8: The most commonly used tools and areas of ANSYS DesignModeler

• Mouse mode: allows you to change the mouse operation between single item
select and box select
• Generator: this executes changes made in the model tree. Some operations re-
quire generation before new operations can be added
• New sketch: creates a new sketching plane in the plane selected, which may be
within the base co-ordinate system or a plane within previously-generated geometry
• View manipulation: controls for zooming, rotating, and panning the view of the
model in the display area
• Geometry operations: the most common operations used to create any three-
dimensional geometry. Operations used for creating two-dimensional geometry are
found in the Concept menu
• Selector dimensionality: specifies the dimensionality of the items selected by
the mouse starting, in ascending order: point; line; surface; volume

5. Most geometric operations begin with creating sketches of the section to be extruded,
either linearly or rotationally. Since this model is to be two-dimensional, the geometry
must be constrained to the XY plane as this is required by Fluent. Select the XYPlane
item in the model tree and then press the New Sketch button . A new sketch
item will appear beneath the XYPLane item in the model tree

6. Select the sketch item in the model tree . Notice that a few items appear in the
Details pane which allow you to change the visibility and name of the sketch. Right-click

25
on the new sketch item and notice the options which appear:

• Always Show Sketch: making sketches invisible can be necessary to clarify


the view or to prevent creating unwanted dependencies when creating additional
sketches. Showing a sketch or fixing it as permanently visible allows you to check
the relationship between sketches. These options expand when multiple sketches
are present
• Hide Sketch: useful when needing to hide a sketch for clarity or creation of more
sketches
• Look at: this option changes the view to look orthogonally at the sketch plane,
which is useful when creating a sketch versus drawing in a three-dimensional space
• Show Dependencies: objects which depend upon a sketch, such as extrusions or
cut outs, will be undefined if the base object (the sketch) is deleted and so this is
locked by the existence of those objects. This item allows you to confirm that only
those objects which should depend on the sketch
• Delete: a normal part of developing a model but bear in mind that sketches with
dependent objects cannot be deleted
• Generate: an option which appears on almost all objects. Has almost no effect
on sketches
• Rename: allows you to interactively rename the object in the model tree rather
than in the details pane. Also updates the name shown in dependent objects for
the base object

Select Look At. Note that clicking on an axis in the co-ordinate system icon at the
bottom-right (as shown in Figure 8) will change the view to look down that axis while
clicking the blue ball in that icon will change to an isometric view

7. Notice that in the Model tree there is now a second tab labelled Sketching. Select this
tab

8. There are 5 toolboxes in the Sketching tab which are all various operations for sketching.
Before creating the first sketch, go to the Constraints toolbox

9. Using the black scroll arrow at the bottom right of the Sketching Toolboxes pane, scroll to
the bottom of the Constraints toolbox and enable the Auto-constraint options as shown

26
Constraints toolbox
Auto-constraints options
Toolbox scroll

Modeling tab
Sketching tab

Figure 9: Enabling Auto-constraints

in Figure 9. While this option is not absolutely necessary, it does expedite the creation
of proper models

10. Next open the Draw toolbox

11. Although there are various ways to draw a rectangle, it must be considered that it com-
putationally simpler to draw the base rectangle to represent the faster vehicle such that
the centre of volume (centre of gravity) is at the origin (i.e. (0,0)). Select the Rect-
angle tool and draw a rectangle of arbitrary size that includes the origin as shown in
Figure 10. Although the auto-fillet tool could be used here, leave it disabled for now

Draw toolbox

Rectangle tool (auto-fillet not selected)

Figure 10: First rectangle used in the construction of the faster vehicle body

12. Now go to the Modify toolbox and select the Fillet tool. Enter a value of 0.3 m and then
click the two lines at each of the corners as shown in Figure 11. You may need to zoom
in , pan , or fit the view to fillet all four corners this way

13. Now open the Dimensions toolbox. Although there are options to manually define dimen-
sions such as: angles; horizontal and vertical distances; and radii, the semi-automatic
tool is typically sufficient. Select the semi-automatic tool and place the dimensions.

27
Modify toolbox
Fillet tool (radius defined)

Fillet placed

Figure 11: A filleted corner of the first rectangle by the manual method

In this case there will need to be two horizontal distances (some combination to form
total length and distance of one edge from the origin), two vertical distances (as with
horizontal), and the radii of the fillets (one dimension may cover them all). Place the
dimensions as shown in Figure 12. Note that once suitably constrained, a line will
change to dark blue from turqoise and that dimensions which over-constrain the model
will be red

Figure 12: Dimensions placed on faster vehicle boundary

14. The names allocated to the dimensions may not be the most intuitive so, should you
wish to change them, select the dimension in the display area and then edit the name in
the details pane. Note that the dimension names can contain no spaces and any inserted
will be automatically removed. This can be helped for reading by using underscores( )

28
15. All dimensions associated with the sketch will be shown in the details pane. You can
change the dimensions as needed there or by selecting each and changing the values
individually. To have the vehicle centred on the origin there must be 1.8 to each side
horizontally and 0.9 m vertically. Once dimension values are changed the model auto-
matically adjusts and so it may shrink out of view. In such a case use the fit function
to fit the view, remembering that the dimension lines may now be much larger than the
model itself. The final sketch should appear as shown in Figure 13

Figure 13: Fully dimensioned fisrt vehicle sketch

16. Once the sketch is complete, click on the Modeling tab again. Note that if you select the
sketch in the Modeling tab you can also edit the dimensions there. Note also that there
is a checkbox to the left of each of the dimensions. Selecting this marks the dimensions
as a Model Parameter, meaning that it can be automatically varied once the model is
established. Such functionality will not be covered in this course

17. Since this is to be a two-dimensional model, the geometry must not be created using the
conventional extrusion tools but rather the conceptual tools. Hence, go to the Concept
→Surfaces From Sketches menu item, as shown in Figure 14

18. If it wasn’t selected when you opened the tool, select the faster vehicle sketch either in
the display area or model tree under the Base Objects item of the details for the surface
item which has appeared in the model tree. Notice that the new surface item has a
lightning bolt icon next to it as it still has to be generated. Once you have selected
all of the sketches to be used, click Apply next to the Base Objects item

19. Next specify the thickness of the surface. This number has no meaning in Fluent since
it recognises surface topologies as two-dimensional so it is recommended that you simply
enter 1. Do not simply leave this as 0 otherwise you will not be able to mesh
the model

29
Figure 14: Concept menu items

New surface object

Surface name
Base object(s)
Surface topology type
Surface orientation (normally not used)
Surface thickness

Figure 15: Details for new surface from sketch

20. The final item to specify is the topological type. There are two options for this:

• Add material: this option adds the topology as solid material. If the new volume
intersects any other material volumes their topologies are merged i.e. become one
volume of material. This is analogous to the merging of topologies used with inter-
secting geometries in CAD packages. Typically there is only one material feature
per model
• Add frozen: this option adds the topology as frozen material. If the new volume
intersects any other volumes, material or frozen, it remains independent of these.
This is useful when overlapping continua are needed as part of the development of
a model, either as intermediate geometries or as part of the final geometry

Since this geometry is going to be used to create the ’hole’ in the mesh for the faster
vehicle, add it as a frozen surface

21. Once all settings have been made, click the Generate button to create the surface.
Notice that once it has successfully generated, it will appear slightly transparent as in
Figure 16 because it is a frozen topology

22. Based on this, create a rectangle overlapping the initial one to become the faster vehicle
block. Since you don’t want to have the portion of the mesh adjacent to either of the
vehicles be too small, it is recommended that the width of the block on the side between

30
Figure 16: Completed surface item for the first vehicle

the two vehicles be half of the distance between them i.e. since the separation of the
vehicles is 0.9 m, the width of the block outside of the faster vehicle block should be
0.45 m. The length of the block is at your discretion, but obviously cannot exceed the
length of the domain downstream of the vehicle (5 characteristic lengths). An example
of the generated block is shown in Figure 17. Note that the two topologies have not been
merged and that both have been renamed to make working with them easier

Figure 17: Completed surface item for the faster vehicle block

23. The next sketch to be created will be the block downstream of the faster vehicle, the
growing mesh block. To do this, create another sketch in the XYPlane and then change
to the sketching environment

24. Use the Rectangle by 3 Points tool to create another rectangle. When doing so, start
the rectangle near the top-left corner of the existing surface for the faster vehicle block.

31
Notice, as shown in Figure 18 the P icon that appears next to the cursor. This is an
automatic constraint of that point to coincide with the corner vertex caused by enabling
auto-constraints. If the icon is C then it is some point on the line, which is not what
is required. Thereafter, place the second point of the rectangle on the lower-left point of

Figure 18: First point of new block constrained to existing sketch

the faster vehicle block as shown in Figure 19 Finally, click somewhere to the left of the

Figure 19: Second point of new block constrained to existing sketch

existing parts. Notice in Figure 20 that the three right-most lines of the new sketch are
dark blue (i.e. constrained) but that the left line is turquoise (i.e. unconstrained). Add
the relevant dimension

Figure 20: Final point of new block constrained to existing sketch

25. Since it will be adjacent to the faster vehicle block, ensure that the surface created is
of the frozen type, otherwise the topologies will merge. The generated block should look

32
something like that shown in Figure 21, where the distance downstream of the trailing
edge of the faster vehicle is 5 characteristic lengths

Growing mesh block


Faster vehicle block
Faster vehicle

Figure 21: First three blocks of model

26. Now you can create the additional 4 blocks needed to complete the model (slower vehicle,
slower vehicle block, shrinking mesh block, and stationary block). Once complete, the
blocks should resemble the layout in Figure 22. Note that the sketches were hidden for
purposes of clarity and that there are 7 bodies and 7 parts

Faster vehicle block


Faster vehicle
Shrinking mesh block
Growing mesh block
Faster vehicle block

Faster vehicle
Stationary block

Figure 22: All blocks of model

27. As previously discussed, the vehicles are modelled as ’holes’ in the domain and so an
operation is required to accomplish this. Go to the Create →Boolean menu item

28. In the details pane you will find the options for the boolean, includeing the type selector:

33
Figure 23: Create menu items

Boolean name
Boolean operation

Tool bodies

Figure 24: Details of a new boolean operation

• Unite: merges several topologies. Spatial equivalent of the AND logical operator
• Subtract: subtracts some topologies from others. Spatial equivalent of the NOT
logical operator
• Intersect: retains the portion where two topologies intersect. Spatial equivalent
of the OR logical operator
• Imprint faces: imprints the intersection of bodies on the boundary faces for
possible future operations

Change the operation from the default of Unite to Subtract

29. Once you have selected the Subtract operation you will need to make several settings:

• Target Bodies: these are the topologies from which the tool bodies will be sub-
tracted
• Tool Bodies: these are the topologies to be subtracted from the target bodies. By
default these will be deleted once the operation is complete

34
Target bodies

Target bodies

Target bodies

Figure 25: Details of the subtract boolean operation

• Preserve Tool Bodies?: By default tool bodies in a subtraction operation are


deleted. Change this option to Yes if you wish to retain these

First select the Target Bodies. For the faster vehicle portion of the geometry that will be
the surface called Faster Vehicle Block. Click the surface dimensionality selector option
and then select the Faster Vehicle Block then click Apply on the Tool Bodies option

30. Next you will need to select the appropriate tool bodies. In this case it would be the
surface called Faster Vehicle. Select this and click Apply next to the Tool Body item

31. Finally, since the tool body for the faster vehicle is not going to be needed elsewhere in
the model it can be deleted once done so leave the Preserve Tool Bodies option as No

32. Click Generate . Notice that there are now 6 bodies and 6 parts and that the
surface Faster Vehicle has disappeared

33. Repeat steps 27 to 32 for the slower vehicle after which the model should look as shown
in Figure 26 Alternative approaches such as a single large initial block divided by smaller

Figure 26: Final blocks for model

blocks into the final blocks by boolean operations would have worked equally as well and
it is a matter of preference and experience which approach one uses

35
34. Save the project on the application server. Files saved on the application server
should ONLY be saved in your Z: drive. Files saved elsewhere will be deleted when you
log off

35. Close ANSYS DesignModeler

This is the saved state of the model at the end of the geometry operations.

36
6 Meshing

6.1 Mesh Sizing and Structure

A common mistake by those new to CFD is the use of uniform meshes for all solutions.
While for small domains this method may not be computationally much more expensive,
for large domains or those with complicated flow or physical geometry this can result in
excessive computation time. The reason is that a certain minimum cell size may be required
to properly resolve the flow features of interest or the geometry of the bodies involved which
would result in a very large number of cells being used in the whole domain. One way of
optimizing a mesh is to use a sized mesh i.e. one where there are more cells where needed
and fewer in regions which are fairly uniform. Generally, this will mean a concentration of
cells at the solid surfaces and in the regions of shock waves and other discontinuities.

One concept to bear in mind in this regard is the use of structured and unstructured meshes.
A structured mesh is one which can be simply transformed mathematically into a simple
grid for computation. Thus, while adjacent rows of cells can be of differing height, the
rows are all generally bound by straight edges continuous from one row to the next. In an
unstructured mesh, the orientation of the cell boundaries relative to one another is arbitrary.
This means that unstructured meshes are generally computationally more expensive than
structured meshes. Also, structured meshes tend to produce solutions with higher orders
of accuracy i.e. the value of a variable based on the derivatives of variables calculated by
the solver for a structured mesh is generally more accurate than the same value for an
unstructured mesh. While structured meshes have been known to produce solutions of up
to 8th order accuracy, most unstructured solutions are 1st or 0th order accurate. Advances
in these methods in recent times, however, mean that this is changing and the insistence of
older CFD practitioners that only results from structured meshes are meaningful is becoming
meaningless.

Another consideration when structuring a mesh is that of mesh motion and deformation.
While re-meshing methods are becoming faster and simpler, the motion of meshes near
boundaries is a common cause of instability in such models. This is complicated by such
meshes being unstructured and often the initial refinement of the mesh around features of
interest is lost in such remeshing operations. It is therefore more common to creates blocks
of mesh which are unstructured and move without deforming (i.e. rigid body motion of
the mesh) and then other, structured mesh blocks (which are more simply remeshed using
layering methods, for example) which do not move but do deform.

37
A final consideration in the sizing of meshes is the size difference and alignment of the meshes
between adjacent mesh blocks. When information is translated across a block boundary it is
directly transferred to the node in the adjacent mesh if it overlaps one in the first mesh i.e.
if two nodes lie in the same place then the values of the fluid properties must be the same.
However, more often, the boundary nodes of adjacent meshes do not overlap each other. In
these cases, the value to be assigned to the node in the destination mesh is estimated by
weighted aggregate of the values at the nodes nearest it in the source mesh.

The interpolation functions are normally based on two or three nodes to either side of the
destination node in the source mesh to make the interpolated result as accurate as possible
but there is a limit to the numerical precision of the solver (increased by using a double-
precision solver, for example) and the result is truncated. Depending on the precision of the
solver this can lead to a build-up of truncation errors as the model progresses, which can
even lead to instability. This is more common if the separation between the nodes in the two
meshes (i.e. the cell size) is significantly different between the two meshes i.e. if the cells in
one mesh are significantly larger than those in the adjacent mesh, the interpolated result will
be poor. Generally speaking, the cell sizes between adjacent meshes shouldn’t differ by more
than 300% i.e. the cells in the coarser mesh shouldn’t be more than 4 times the size of the
cells in the finer mesh at the interface.

An example of the reasons for block boundary errors is given in Figure 27. Assume that
there is an exponential gradient of a variable in a field such that the value at the equidistant
positions shown is 1, 2, 4, and 8. The true value at the node in the destination mesh is
approximately 2.83. When interpolating between two nodes, you are limited to a linear
interpolation. Hence, if the estimate was made using only the two outer nodes of the source
mesh (dark blue), the value estimates would be 4.5, and error of 59%. If the estimate was
made using the two nodes closer in (lighter blue) but still with a linear interpolation, the
estimated value would be 3, and error of only 6%. If the scheme being used could make a
higher order polynomial estimate by using all four nodes (i.e. a third-order polynomial) the
estimated value would be 2.81, an error of 0.7%. While the final case would be preferable,
most schemes are limited to linear gradient estimates.

This example describes block boundary errors because high-order gradients in a fine mesh
would be lost in the translation to a coarse mesh while translation in the other direction could
lead to complete mis-representation of the data, even though the finer mesh has the resolution
to describe such gradients. It is for this reason that cell size changes at block boundaries
should be limited to be as low as possible. While this may seem like a justification for uniform
fine mesh scale throughout your domain, this is computationally inhibitively expensive and
typically a waste. A growing trend in modern CFD is the use of overset meshing techniques.
These are methods in which the mesh isn’t explicitly divided into separated blocks but rather

38
Cell boundary
Destination mesh node
Block boundary

1 2 4 8

Source mesh node

Figure 27: Mesh block boundary interpolation

there are additional blocks of mesh associated with moving features. This separate mesh
moves ’over’ the background mesh as the feature moves (hence the term overset mesh). Where
the overset mesh is outside of the computational domain defined by the background mesh,
its nodes are ”switched off” i.e. no computation is done for them. Where the overset mesh
overlaps the background mesh, its nodes are ”switched on” and the nodes of the background
mesh are ”switched off”. In effect this means that a distinct block of mesh of arbitrary shape
can move arbitrarily through the background mesh allowing much more freedom to the range
of motion that can be considered. The only issue with such meshes is that there is an interface
region at the edge of the overset mesh through which information is translated between the
overset and background mesh and so it is important that the cells be similar in size and type
here to minimise truncation errors, as with classical block boundaries.

6.1.1 Minimum mesh cell size

The minimum cell size in a mesh is arguably one of the biggest considerations when sizing the
mesh. This is because small decreases in the minimum cell size can lead to very large increases
in the total number of nodes in the mesh. For this reason it is typically advisable to determine
the minimum size that will meet your needs and use that in the creation of the initial mesh.
Smaller cells can then be included by adaptive refinements methods (subsection 7.6) during
the execution of the simulation.

There are three primary considerations when deciding on the minimum cell size for a mesh:
minimum feature length, geometric resolution, and viscous modelling.

39
6.1.1.1 Minimum feature length

The geometry of a flow field is carried through into the solver by the positions of the nodes
in the mesh. By definition, the edges / faces connecting the nodes of the mesh are straight
/ plane. Thus, if a feature is smaller than the separation of two nodes it will get ”blurred
out” but the geometric truncation of meshing. If the feature must be resolved because it is of
consideration in the model, it will define the minimum cell size in that region. This applies
equally to geometric and flow features.

For example, consider a micro-jet injected into a much larger tank. The diameter of the jet
will define the largest possible minimum size in that region. If the cells were larger than
the jet diameter its geometry would not be accurately represented and a velocity flow rate
definition would result in an incorrect mass flow rate.

If the fluid dynamics around the jet were of interest in the model then you would also need
to consider the velocity profile of the jet. Assuming that it is a fully developed subcritical
flow, the velocity profile across the jet would be essentially parabolic. Thus, a minimum of
3 nodes across the jet would be needed, though typically you would need 10 or more nodes
across the jet diameter to make a reasonably accurate approximation. Thus the minimum
1 th of the jet diameter.
cell size in that region would need to be 10

In the case of a faster vehicle overtaking another, the accurate description of the flow in the
gap between the two vehicles is important to the determination of the transverse loads on each
vehicle during the manoeuvre. Thus, assuming a velocity profile comparable to the developed
flow in a channel, you would need a minimum of 10 cells across the 0.9 m gap. Thus, the
maximum size for the minimum cell size in that gap would be 0.09 m (90 mm).

6.1.1.2 Geometric resolution

Apart from the geometric resolution described above, there is the consideration of the accurate
representation of curvilinear geometry. Since the connectors of mesh nodes are straight, it is
clear that a significant number of nodes are required along any curvilinear feature to describe
the geometry with a reasonable level of accuracy. If you limit the change in arc to 5% of a
full turn, this is a maximum arc length of 18°. However, when representing curved surfaces
it often necessary to use a finer mesh than this as a 5% curve would mean only 6 nodes /
5 edges describing a 90°arc and, depending on the importance of that arc in the flow, the
modelled flow could vary significantly from the actual flow. Typically such surfaces would be
described by cells subtending around 5°of arc.

40
In the case of overtaking vehicles, there are 4 90°curves per vehicle that would need to be
described. The flow around these corners will strongly affect the separation around each
vehicle and the interaction of the separated flows between them. Thus, if you were to opt for
5°arc limit, this would require 18 cells around each arc. To determine the minimum cell size
suggested by geometric resolution, you would hence divide the 90°arc length (471 mm) by 18
for a suggested limit of 26.1 mm. For ease of specification this can be approximated as 25
mm.

6.1.1.3 Viscous modelling

Viscous and turbulent effects in CFD aren’t directly represented since the mechanisms of
turbulence and viscosity aren’t completely understood and such a model would also be com-
putationally expensive. Rather, these effects are modelled i.e. they are included in an overall
fashion by equations which calculate the average effect and impose this on affected regions
of the flow field. These equations are empirical and based on many different experimental
and theoretical results. As such, these models can be ”tuned” but the default values given
in packages like Fluent are adequate initial values for these models.

Due to this formulation of viscosity modelling, the mesh in regions where these effects are
most pertinent (i.e. boundary layers) must be sized to produce the most accurate results.
While some models use so-called sub-grid modelling, the majority require that the basic mesh
at the boundaries conform to geometric limits. The most common of these rules of thumb is
that the first row of cells must be such that 5 ≤ y + ≥ 30. The reason for this is that a cell
height less than y + = 5 will allow for modelling of the laminar sub-boundary layer and direct
calculation of the other parts of the boundary layer while cells larger than y + = 30 will model
the laminar and mixing zone sub-boundary layers while the remainder of the boundary layer
will be directly calculated.

A quick calculation would show that for typical flows in air a cell height for a value of y + = 5
would be of the order of 0.1 mm. Thus, for most air flows, the first layer of cells for a
boundary layer is typically sized for y + = 30, which is approximately 1 mm for most of these
flows.

6.1.2 Maximum mesh cell size

While not as critical as the minimum mesh cell size, the proper specification of the maximum
mesh cell size can be important for limiting the overall mesh size and ensuring good quality
of information reaching the refined areas of the model. If this size is too small then the mesh

41
may be too large for computation in a reasonable amount of time. In constrained flows the
maximum mesh cell size is often not that much larger than the minimum mesh cell size but
in far field condition models, this size is often an order of magnitude (or even two) larger
than the minimum.

In selecting a maximum mesh cell size it is first necessary to consider where these cells are
most likely to occur. In far field models, this will be at the far field boundaries of the model.
Hence, the size of the cells there should be such that flow effects there are not blurred out
by being too large. An upper limit for this size would typically be one which places between
10 and 20 cells along one of these boundaries. Often this size will need to be revised to be
smaller to consider the possibility of flow features smaller than this size.

In the case of the demonstration problem, the longest edge of any of the mesh blocks is
approximately 61 m. This would suggest a cell size of between 30 and 60 cm. It is important
to now consider how this would compare to the expected flow field. Although the effects of
the vehicles are expected to be felt upstream, at the boundary the effect is expected to be of
fairly small gradient. Hence if you were to imagine sampling the flow field 30 cm apart at
this distance it is feasible that there would be negligible difference. Thus a maximum mesh
cell size of 30 cm would seem reasonable.

6.2 Mesh motion vs fluid motion

It is important at this point to discuss the distinction between mesh motion and modelled
fluid motion. Many people new to CFD tend to think that the motion of the mesh implies
movement of the fluid being modelled and that the fluid velocity equals that of the mesh. The
fact is that these two motions are entirely unrelated. Just as you can model a moving fluid
on a stationary mesh, you can model a stationary fluid on a moving mesh. The nodes of the
mesh are simply computational points for imposing the governing equations and boundary
conditions.

Typically there is no reason to move your mesh unless one of the boundaries is moving and so
this means that typically the motion of that boundary will induce motion but the movement
of the nodes of the mesh in the free fluid does not cause fluid motion.Rather, it is the
physical boundary conditions of no slip and continuity at a wall (the fluid must match the
wall’s velocity at its surface and cannot disappear into or emerge from the wall) that induce
the motion of the fluid, like stirring a spoon in a cup of coffee. If you were modelling that
scenario, the spoon would be a ”hole” in the mesh and would probably have a refined mesh
block associated with it which would move through the surrounding mesh but it would be
solid walls of the spoon that would induce fluid motion.

42
6.3 Boundary Types

When defining the mesh the boundary types must also be specified as the node identifiers are
then saved into particular sets to be passed to the solver, Fluent. There are a few common
boundary types used in most models which can be broadly divided into physical and inertial
boundaries, where the former imposes physical conditions to be met while the latter defines
inertial properties of the fluid at that position:

6.3.1 Physical boundary types

• Wall: the most common boundary type and the default imposed by Fluent if no
specification is given. This boundary does not allow flow to cross it and will require
that the no-slip condition be met

• Symmetry: while similar to the wall boundary in that flow cannot cross it, there is no
viscous effect on a symmetry boundary. This can also sometimes be set as a periodic
boundary, meaning that the effects seen at the top may repeat at the bottom, such as
in modelling a gas turbine

• Axis: related to the symmetry boundary in that flow cannot cross it and there is no
viscouse effect, this is required for an axisymmetric model to be run

• Interface: while not strictly a physical boundary, this type is needed to enable data
from one mesh block to be passed into another. Interfaces are defined in (at least) pairs
since each of the mesh blocks must have a boundary across which the information can
be passed

6.3.2 Inertial boundary types

Note that some of these conditions cannot be used in conjunction for reasons of compressib-
ility. These exceptions are identified by Fluent when setting up the simulation

• Pressure Far Field: the boundary type required for free-air models where one is
modelling effectively an infinite atmosphere. This is a non-reflecting boundary type
meaning that pressure variations reaching this boundary can pass out of the flow field.
Fluid properties can be set as quiescent or a velocity imposed along the entire boundary.
Serves as both inlet and outlet boundary type

• Velocity Inlet: the simplest of the constrained inertial inlet boundary conditions,
this allows you to set the velocity of the flow passing through the boundary. Flow

43
is typically defined as normal to the boundary and it is typically terminated by wall
boundary conditions. Specification of velocity by the Velocity Inlet type can preclude
the fully developed flow velocity distribution being modelled initially. Typically used
for subsonic flow. Inlet boundary for the Outflow boundary type

• Outflow: the simplest of the constrained inertial outlet conditions it requires essentially
no specification. Typically used for subsonic flow. Outlet boundary for the Velocity
Inlet boundary type

• Pressure Inlet: a more comprehensive constrained inertial inlet boundary type which
requires the total fluid state (defined by temperature, total pressure, and static pressure)
to be specified. The local velocity is calculated from the continuity equations and
can hence be used to specify both subsonic and supersonic flows. Typically used for
supersonic flows. Inlet boundary for the Pressure Outlet boundary type

• Pressure Outlet: a more comprehensive constrained inertial outlet boundary type


which requires the fluid state (defined by temperature and static pressure) to be spe-
cified. The pressure is defined as a back pressure and hence there can be local reversed
flow if the back pressure exceeds the static pressure at the boundary. Typically used
for supersonic flows. Outlet boundary for the Pressure Inlet boundary type

6.4 Creation in ANSYS Meshing

1. In ANSYS Workbench, drag a Mesh component system into the workspace somewhere
near the Geometry block already there. Notice that there is now a check mark next
to the geometry item as it has been completed and is ready for use. As with when the
geometry component was first added, the geometry item in the Mesh component system
is marked with a blue question mark . In addition, you can see that the mesh item in
the Mesh component is marked with an open blue question mark . The reason for the
difference is that the mesh item is dependent on the geometry item and, since it hasn’t
been defined, nothing can be changed with the mesh item

2. Click and hold on the geometry item in the Geometry component system and drag across
to the geometry item of the Mesh component system, which will be highlighted in red
and give a share identifier, then release the mouse. You will see that there is now a link
between the two component systems and that the geometry item in the Mesh component
system has changed to a check mark while the open question mark for the mesh item
has changed to the refresh symbol .

44
Mesh component system
Component system link

Figure 28: Geometry component system linked to the geometry item of the Mesh component
system

3. Double-click on the mesh item in the Mesh component system to open the meshing
application, ANSYS Meshing. When ANSYS Meshing opens you will notice that the
layout is similar to that of Geometry. Notice that there is currently no mesh specified

4. Select the Mesh item in the Outline pane

5. The first specification to be made in the details pane (Figure 29) will be the type of
mesh:

Figure 29: Details of the mesh specification

45
• Physics Preference: is the specification of the type of solver that will be pro-
cessing this mesh. While Finite Element Analysis (FEA) solvers can work with
meshes with mid-side nodes, CFD solvers cannot and so it is important to select
the CFD option from the dropdown
• Solver Preference: can be left as Fluent as this example deals with the use of
Fluent
• Relevance: specifies the global fineness preferred for the model. Lower (negative)
numbers will produce coarser but faster meshes while higher (positive) numbers will
produce finer but slower meshes. Leave this option at 0

6. The next specification to be made is the global mesh sizing preferences (Figure 30),
which also limit the effect of subsequent local mesh sizing preferences (Only the options
most commonly set will be covered in detail here):

Figure 30: Details of the global mesh sizing specification

• Use Advanced Size Function: Fluent has a number of advanced sizing func-
tions built in which allow you to pre-optimise the mesh without having to explicitly
define mesh refinement operations to do so:
– Curvature: This function ensures that curved geometric elements are accur-
ately represented by placing a minimum number of cells along the curve. This
is specified by defining the maximum angle that can be subtended by the secant
of a cell
– Proximity: This function ensures a minimum number of cells across small
gaps and defines the minimum cell size allowed so that very small gaps aren’t
unnecessarily densely meshed. This is used when there are small gaps which
are of particular interest in the flow field and so the flow must be properly
resolved. A single cell across a gap limits the description to a linear gradient

46
whereas if you were modelling, for example, a journal bearing, proper descrip-
tion of the velocity profile across the gap is needed for accurate determination
of the shear force in the bearing
– Fixed: This is a basic function which allows you to specify that the mesh must
be sized but requires you to define local refinement sizes
Select the Proximity and Curvature options as there are curved features (the corners
of the vehicles) and small gaps (between the vehicles and the block boundaries) that
will need resolution
• Relevance Center: As with the global control, setting the relevance centre to
Fine will produce a basic mesh with smaller average cells than one set to Medium,
or Coarse. This can be left on Coarse as this is an initial mesh
• Smoothing: This reduces the chance of ”ripples” in the mesh. Leave at the default
value of Medium
• Num Cells Across Gap: You will have to identify small gaps that would require
resolution and, having an idea of the expected velocity profile across that gap, define
a minimum number of cells. The default value of 3 cells can describe a cubic (order
3) variation. Since the gap of interest in this model is quite broad set a minimum
value of 10
• Min Size: As discussed in section 6.1.1, the critical definition of the minimum
cell size can greatly influence the overall size of the mesh and the solution time
of the model. The three typical considerations for the minimum cell size of the
model suggest values of 1 mm, 25 mm, and 90 mm. Since the value of 1 mm is
the minimum size for a Y + = 30, it is conservative but economical to consider a
value between 1 and 25 mm, such as 15 mm.
• Max Face Size & Max Size: As discussed in section 6.1.2, the value of the
maximum mesh cell sizes can be specified as 30 cm. Note that if you change one
but not the other there may be an error highlighted in yellow as the Max Face Size
cannot be larger than the Max Size
• Growth Rate: This is the value which determines how much larger than the lower
cells the next row is. For example, if the growth rate is 1.20 and the first row of
cells has a height of 1, then the next row will have a height of 1.2. Making this
value less than 1 will cause the cells to shrink while setting it very large would
cause the cells to grow very fast and could result in poor results. The default value
of 1.20 is suitable for most applications

7. The next option in the details pane is the Inflation section. This is used to create
an initial mesh and then to grow it out from solid surfaces so that the cells there are
optimised for boundary layer modelling. This method has proven to be somewhat fragile

47
for complex geometries but could be used here. Increase the number of layers to 10 and
leave the remainder of the settings at the default values

Figure 31: Details of the global mesh inflation sizing specification

8. The final item of interest in the details pane is the Statistics item. Once you have
completed meshing this will report the size and other parameters of your mesh. Right-
click on the mesh item in the Outline pane and select the Generate option to create the
initial mesh based only on the global settings. If successful, the icon next to the mesh
item should change to a green check mark and the initial mesh should look something
like that shown in Figure 33, comprising fewer than 20 000 nodes

Figure 32: Some operations in the mesh context menu

9. Before proceeding it is worth inspecting the mesh in some detail to identify regions where
additional mesh controls may be needed. Using the zoom tool focus on the section
immediately around the two vehicles. There are several points to note in this initial
mesh:

• There is a high concentration of nodes in the small gaps between the vehicle bound-
aries and the block boundaries inserted by the Proximity advanced meshing function
• There is a concentration of cells at the corners of the vehicles inserted by the
Curvature advanced meshing function

48
Figure 33: Initial mesh based on global mesh options

Figure 34: Details of the initial mesh based on global mesh options

• Although not grouped into a single body in Geometry (the method used to enforce
conformal meshing) the meshes between the three blocks that will move or deform
are nearly conformal at their interfaces
• The meshes at the edges of the proximity-meshed regions are not conformal with
the adjacent mesh blocks (and cannot be)
• The mesh at the leading and trailing edges of the vehicles, and along the outer edge
of the slower vehicle, are quite coarse (estimated cell size of 40 cm along the outer
edge of the slower vehicle) and will likely need refinement
• There is currently no inflation mesh on the vehicles

(Note than you can pan or rotate the view, and then return to the initial zoom
using the fit view tool )

49
10. Based on the inspection of the initial mesh, some refinement of the mesh immediately
surrounding the vehicles is needed. The most commonly used tools for this purpose are
inserted via the Mesh Control menu

• Method: This item is only available for 3D meshes and allows changes of con-
formality between bodies
• Sizing: The most commonly used function, this allows you to explicitly specify
regions in which the mesh must be of a particular size
• Mapped Face Meshing: This method is used when you wish to force a mesh to
be structured i.e. it will resemble a tiled floor. Typically used when the layering
mesh motion method will be used
• Inflation: This methods defines features against which boundary layers are ex-
pected to form and defines inflation meshes to pre-optimise the mesh for solution
thereof

11. To begin, select the Sizing method. Notice that a new sizing item appears in the outline
pane and that the mesh icon changes back to a question mark. The settings for a sizing
method are quite simple:

Figure 35: Detailed settings for the sizing mesh control method

• Scoping Method: This is the method that will be used to assign the control to
features of the geometry. Generally you will use the Geometry Selection option (as
in this case) where you directly select geometry elements but occasionally it may
be useful to use the Named Selection method, where you have previously made a
selection of several geometric features and assigned a name
• Geometry: This block will remain yellow until you have confirmed the geometry
to which mesh control will be applied. Choose the Edge dimensionality selector
and then change the mouse to the Box Selection mode (as shown in Figure 36).
Now draw a box around the edges that comprise the faster vehicle. Then, holding

50
down the Shift key, draw another box around only the edges comprising the slower
vehicle. Now click in the Geometry box and press the Apply button. If you have
done this correctly it should no longer be highlighted in yellow and should indicate
that 16 Edges have been selected (i.e. 8 per vehicle (4 straight edges and 4 corner
radii)). Notice as well that the Sizing element in the Outline pane has been renamed
as an Edge Sizing

Figure 36: Changing the mouse mode for geometry selection

• Suppressed: Leave this option set to No since you want this mesh control to be
applied. Later you may wish to suppress this in favour of other controls
• Type: There are two principal sizing types: Element Size and Sphere of Influence:
– Element Size: most of the time you will use this default option in which
you directly specify the size of the elements that must be placed on the selected
geometric features
– Sphere of Influence: this method can be used to create spherical (or in 2D
models circular) regions of a specified cell size. Typically you must first create
a new co-ordinate system at the centre of the required sphere and then use this
in the definition of the refinement region. Note that this method cannot be
used if Advanced Sizing Functions (such as Curvature) are enabled
For this problem, select the Element Size option
• Element Size: this is the size of the actual elements that you wish to enforce on
the selected geometry. Click where you see the word Default and enter the required
size. In the case of the demonstration problem, we want the cells to match the
proximity and curvature methods cell size which is most likely the minimum global
cell size so set this value to 15 mm (0.015 m)
• Behaviour: This method allows you to set a precedence of the mesh controls
inserted:
– Soft: the default options which allows the local mesh control to be overridden
by global or other harder local mesh controls

51
– Hard: the options which enforces that the specified control is imposed and
overrides other softer controls which may affect the same region of the mesh.
Generally a hard local mesh control will override a global control
Select the Hard option. Note that when you do so some of the control disappear
• Bias: this method allows you to specify the cells such that they change size over the
length of edges only. The default is to have no bias but biases such as larger cells
at one end of a line or even a refinement toward the centre and then coarsening
toward the other end of a line are possible. When specifying such a bias the bias
factor, which is the ratio of the largest cell edge to the smallest cell edge, must be
set. Leave this option at its default of No Bias

Notice that once you have specified the element size for this sizing that yellow rectangles
appear along the edges giving a visual representation of the new edge sizing. The icon for
the Edge Sizing item in the Outline pane will have changed to a check mark indicating
that the specification is complete. The icon for the Mesh item will have changed to a
lightning blot indicating that it must be updated

Figure 37: Preview of edge sizing before mesh is updated

12. Press the Update Button to update the mesh with the new controls. Bear in
mind that it may take a few seconds for this process to be completed, during which there
will be a progress bar displayed indicating the progress per part and overall and allowing
the option to stop meshing if needed

13. Once complete the mesh detail should resemble that in Figure 39 and comprise around
30 000 nodes. As before it is worth inspecting the details of the mesh to be sure that
previous issues identified have been resolved:

• The conformality between the moving and deforming blocks has not been affected

52
Figure 38: Meshing progress indicator

Figure 39: Updated mesh including edge sizing mesh control

• The ratio of cell size at the edge of the proximity refined region and the adjacent
mesh blocks seems to be around 4:1 so it should not pose too much of an issue to
modelling and translation of information across block boundaries
• When the faster vehicle block is closer to the slower vehicle block the mesh sizes
either side of the block boundaries will be almost identical and so this should min-
imise interpolation errors during that critical stage of the simulation

14. The final mesh control to insert will be the inflation layers on each of the vehicles.
Before doing so it would be useful to inspect one of the vehicles so that the effect can be
observed. Use the zoom tool to view the entire faster vehicle in greater detail: Notice
that the cells on the vehicle boundary are clearly visible and fairly square in appearance

15. Select the Inflation method from the Mesh Control menu

16. As with the Sizing method, the first item to be specified will be the geometry to which the
inflation must be applied. In this case, this will be the face on which the mesh must be
affected. Since the default dimensionality for inflation-affected geometries is Volumes
, change the dimensionality selector to Faces . Ensure that the mouse mode is set
to Single Select and then click on the mesh around the vehicle. The selected face will

53
Figure 40: Detailed view of the faster vehicle mesh before the inflation method is applied

go green as shown in Figure 41 Click Apply in the Geometry item of the details pane

Figure 41: The face of the faster vehicle mesh block selected for control by the Inflation
method

to confirm the selection

17. The next item to specify is the Boundary Scoping Method and Boundary. As with the
Sizing method, the Geometry Selection option is most commonly used. Click in the
Boundary item and change the mouse mode to Box Select and the dimensionality is
for edges and then select the edges of the faster vehicle. Click Apply. There should
be 8 edges confirmed as selected

18. The final setting needed for the Inflation method is the maximum number of layers. As
before set this option to 10. Leave the other settings at their default values

54
19. Update the mesh . Once complete, the detailed mesh around the faster vehicle
will now include a very fine layer used for calculating the boundary layer flow and the
number of cells will have climbed closer to 40 000. Note how the small apparent change
in the visible mesh has added a significant number of nodes because of the high cell
density

Figure 42: The updated faster vehicle mesh with the inflation layer included

20. Apply a similar Inflation method to the slower vehicle. Upon completion the mesh
should be around 45 000 nodes

21. Before continuing, it worth checking the quality of the mesh, included as the Mesh
Metric item in the Statistics item of the Mesh details. The most common option for
this is the Aspect Ratio of the cells. Once selected, the minimum, maximum, average,
and standard deviation of the aspect ratios of all the mesh cells will be displayed and a
bar graph of the distribution shown below the mesh. While the ideal is to have all cells
as close to an aspect ratio of 1 (i.e. a square cell) as possible, the use of an inflation
layer will add high aspect ratio cells. High aspect ratio cells are generally a problem if
they occur elsewhere in the mesh because it means that gradients in the longer direction
of the cell may be poorly represented. However, in a boundary layer mesh this isn’t as
much of a problem because the gradients along a boundary layer are generally weak and
the use of inflation cells makes accurately modelling the shear exerted on the body much
easier

22. The final task before finishing is to specify the boundary types of the mesh. This is done
by naming the various geometric features of the mesh as Named Selections. It is not
essential that this be done at this stage but doing so allows for automatic boundary typing
in Fluent if the features are correctly named because Fluent will attempt to interpret the
boundary type from a name if present. Setting the boundary types in Fluent can be

55
done but is cumbersome because there is no graphical means to do so directly and the
automatically generated names for geometric features in Fluent are not immediately
intuitive. Start with the wall boundaries of the faster vehicle:

(a) Set the mouse mode to Box Select and the dimensionality for edges and select
the edges which comprise the faster vehicle
(b) Right-click and select Create Named Selection

Figure 43: Context menu options including Create Named Selection

(c) Specify the name of the named selection. For automatic boundary typing to work
in Fluent the name provided must include, and preferably begin, with the boundary
type required. You can also add extra information to make it clear which boundary
you are naming for ease of reference in Fluent. Since named selections cannot
include spaces, leave these out or replace them with underscores ( ) or hyphens
(-). Enter Wall Faster Vehicle and then click OK
(d) Since this is the first named selection added the Named Selections item will now
appear in the Outline pane

23. Create a similar named selection for the slower vehicle

24. The next edges that can be named are the pressure far field boundary. Since the mesh
is divided into blocks, if you name all of the relevant edges as a named selection they
will get split in Fluent so it is advisable to name them per block:

(a) Set the mouse mode to Point Select and the dimensionality for edges and select
one the edges which comprise the outer boundaries (but not the block interface
boundaries) of the Slower Vehicle block
(b) Holding the Ctrl key, select the other two pressure far field boundaries of the block

56
(c) Right-click and select Create Named Selection. Specify the name of the named
selection. Enter Pressure Far Field Slower Vehicle and then click OK
(d) Repeat this process for the Growing Mesh, Shrinking Mesh, and Stationary blocks

25. The interfaces need to be properly defined now:

(a) Set the mouse mode to Point Select and the dimensionality for edges and
select one the edges which are mesh block interfaces in the Growing Block mesh.
You will notice that the Multiple Selection icon appears in the workspace. This
is because there are multiple edges that can be selected in the same location. You
can change between the options by clicking on of the planes of the icon and select
multiple of the options by holding the Ctrl key while selecting planes in the icon.
However, this is not always as clear as in this case and it is typically advised
to hide blocks with which you are not working while the named selections specific
to that block are defined as including the same edge in multiple named selections
causes errors which prevent the simulation from progressing

Figure 44: Geometry selection with multiple coincident features

(b) Expand the Geometry item in the Outline pane. As you select each of the parts
listed there it will be highlighted in the workspace. You may rename these from the
context menu if you wish to make selecting the correct one easier
(c) Right-click on the part for which you wish to define the interface named selection
and select the Hide All Other Bodies option. Note that there is also the option
to suppress this or other bodies. Suppression completely removes the geometry
definition from the model until unsuppressed while hiding only hides the body and
makes it unavailable for selection but retains its associations. Thus, if the parts
are suppressed the previously-defined named selections associated with them will

57
become suppressed as well (marked with a blue cross ) while if they are hidden
the associated features remain valid

Figure 45: Context menu for geometry control in ANSYS Meshing including the Hide and
Suppress options

(d) Right-click on the edge that you want to define as an interface and select Create
Named Selection. Note that when selecting the edge now that there is no Multiple
Selection icon. When naming interfaces it is useful to name them in such a way
that it is clear which ones must be paired in Fluent (since interface connection
is not automatic). One convention which has been found to be very useful is to
name the interface with the block to which it is attached and then the block/s to
which it must be paired. The two block names are separated by a hyphen rather
than an underscore to make it easier to parse the names into block identities.
This convention creates pairs of names that can be easily picked from a list when
associating interfaces in Fluent. Under this convention, you would enter Inter-
face Growing Mesh-Slower Vehicle and then click OK
(e) Once you have finished naming all of the interfaces for the current mesh block,
right-click on the block in the Geometry item of the Outline pane again an select
the Show All Bodies option
(f ) Repeat this process for all of the remaining mesh interfaces for a total of 12 inter-
face named selections as shown below

26. The final named selections that must be made are the ones which define each of the
blocks. This serves two purposes: to ensure that the blocks are recognised as fluids in
Fluent and also to make them easy to identify in Fluent for settings that will be needed to
define mesh motion. Change the mouse mode to Single Select and the dimensionality

58
Figure 46: All interfaces defined and indicated in the workspace

for faces and select the Slower Vehicle face. As before, create a named selection
calling it Fluid Slower Vehicle

27. Repeat this process for the remaining 4 mesh blocks

28. Save the project

29. Close ANSYS Meshing

This is the saved state of the model at the end of the meshing operations.

59
7 Solver

7.1 Solver Formulation

There are two predominant formulation for the CFD solver known as the Pressure-based and
Density-based solvers. These names refer to the way in which the NS equations are linearised.

7.1.1 Pressure-based solver

This is a method that was originally developed for low-speed, incompressible flows although
it can now be used for other flows as well. The core of the pressure-based solver method
is that the governing equations are solved sequentially, which resulted in the old name for
such solvers, segregated, because of the segregation of the variables. Generally speaking the
momentum variables are each solved sequentially and then a pressure correction based on the
continuity and mass equations is applied. Thereafter other field variables are calculated.

Due to the fact that field variables are only solved one at a time, the memory requirement
of pressure-based method is lower and typically such models have faster solution times. The
drawback of this method is that the segregation of the field variables can result in high-
order dependencies being lost and this is why traditionally these methods are reserved for
incompressible flows.

7.1.2 Density-based solver

These are methods that were originally developed for high-speed, compressible flows though
they can be used for other flows too. The core of the density-based solver methods is that the
governing equations are solved simultaneously. Due to the inherently unsegregated (coupled)
approach, these methods are generally more memory intensive and thus typically have longer
computation times. These models often require several iterations of the solution process to
reach a converged solution. However, the additional accuracy that these models can offer for
high-order coupling means that they are typically required for high flux flows (either high
flow speeds or high rates of change of internal energy).

Since the density-based methods are coupled and variables are solved simultaneously there
are two different methods of linearisation of the solver equations: Implicit and Explicit.

60
7.1.2.1 Explicit Linearisation

In the explicit linearisation method the equation for an unknown variable in any cell is
formulated in terms of known values of that variable only. This means that the variable in
question will appear in the equation of its cell only. A means of visualising this method is that
the values of low variables will be solved from the points of known value, i.e. the boundary
conditions, toward regions of unknown value. It could thus be imagined that during solution
the values imposed at the boundaries of the model ”move into” the remainder of the mesh.
Another way of considering this is that all variables are solved one cell at a time.

7.1.2.2 Implicit Linearisation

In the implicit linearisation method the equations for an unknown variable in any cell are
formulated in terms of both known and unknown values of that variable. This means that
the variable will appear in the equations of multiple cells which must then be solved sim-
ultaneously. Thus, unlike the explicit linearisation, the values of all cell values are solved
simultaneously. This means that all variables are solved simultaneously in all cells at once.

Understanding the difference in linearisation methods it should be clear that the implicit lin-
earisation method requires significantly more computing power than the explicit linearisation
method but that this can lead to overall shorter solution times. Also, since the pressure-based
method solves for each variable sequentially in the entire field it means that the pressure-based
solvers can only have an implicit linearisation.

In the demonstration problem the speeds of the vehicles and fluid flow are clearly in the
subsonic regime and hence a Pressure-based solver will be the most computationally efficient.

7.2 Viscosity in CFD

As alluded to in section 6.1.1.3, the typical Navier-Stokes formulation of CFD packages treats
the fluid as a continuous medium. Thus, viscous effects, which originate at molecular level,
are not directly modelled. To overcome this, most CFD packages use a method known as
viscous modelling. This entails the modelling of the effects on pressure etc. of the viscous
forces without directly modelling the viscous flow structures, or only to a limited degree.
An example of this is the viscous wake behind a flat plate normal to a steady, viscous flow.
Experience (e.g. dragging a teaspoon through a cup of tea) has shown that the wake behind
the plate is a complex system of vortices that grow and decay through mutual interaction
in time and space. However, in a CFD solution the wake behind a flat plate will show the

61
relevant decrease in pressure and other fluid property changes associated with such a wake
though none of the small, individual viscous vortices in the wake will be shown. This is
because the effects of these vortices are expressed in a time-averaged way in the flow field by
the viscosity model without actually resolving any of them.

A drawback to such models is that these are sensitive to the scale of the mesh used to represent
the flow field and can over- or under-estimate the viscous forces exerted on a body. For
example, for the best results most viscosity models require that the cell height immediately
adjacent to a body be approximately equal to y+ = 5. In particular, this sensitivity to mesh
scale means that the drag exerted on a body in a given flow will typically be over-estimated
by between 5% and 8%, though various models produce differing degrees of accuracy. Since
drag is typically of fundamental importance in the design of aerodynamic (or hydrodynamic)
bodies such as aircraft, this is an important factor to bear in mind when validating the results
of a CFD simulation.

7.2.1 Commonly used viscous models in CFD

(The summaries given here are adapted from the ANSYS Fluent Theory Guide available on
any computer with the software installed. More details on the formulation of each can be
found in the same theory guide or other pertinent literature.) Almost all turbulence models
used in CFD are Reynolds-Averaged Navier-Stokes (RANS) models, meaning that the effects
are time-averaged to present an overall view of the behaviour without having to attempt
directly modelling the creation and dissipation of small vortices which is inherently random.
As a result of this, even in transient models, there is time averaging over at least the extent
of a time step to make the model tractable computationally.

7.2.1.1 κ−

The κ −  (”kappa-epsilon” or ”kay-epsilon”) model is considered the workhorse turbulence


model of modern CFD. It is part of a class of models which model the effects of turbulence by
calculating a turbulent length and turbulent time scale, though the manner in which these are
represented varies. In the κ −  model, the transport variables calculated are the turbulence
kinetic energy (κ) and the dissipation rate thereof (). The equations used to calculate these
are based on the assumptions that the flow is fully turbulent and that the effects of molecular
viscosity (such as laminar flow) are negligible meaning that these models can only be used
for fully turbulent flows.

62
Due to identified weaknesses in the standard κ −  model, two common variants have been
developed: the Renormalization Group (RNG) and Realizeable κ −  models. The RNG
model essentially makes allowance for low Reynolds number effects in flows but this requires
appropriate treatment of the near-wall region. Effects covered by these include: effective
viscosity; turbulent Prandtl numbers calculated during simulation (rather than fixed values);
and accommodation of the effects of swirl and rapid fluid strain.

By comparison, the Realizeable κ −  model is basically an alternative formulation of the


standard model which gives a better estimate of the turbulence dissipation rate for certain
flows not well covered by the standard model. The term realizeable specifically refers to
limiting Reynolds stresses to levels consistent with real flows.

7.2.1.2 κ−ω

While similar to the κ −  model, the κ − ω (”kappa-omega” or ”kay-omega”) model is an


empirical model (rather than a mathematical one like κ − ) meaning that it is based on
fitting equations to experimental data. The principal difference between these two models is
that the κ − ω model calculates the specific dissipation rate of turbulence (ω) rather than the
dissipation rate calculated in κ − .

The greater strength of the κ − ω model has been the handling of flows with separation,
typically not as well modelled by the κ −  model. For this reason, the κ − ω model is well-
suited to many industrial flows included pipe flows where the flow from pipes at a junction
may result in separated and recirculating regions. This is a model with significant continuous
development which has improved and continues to improve its accuracy for general flows.

As with the κ −  model, there has been the development of a major sub-model to improve
identified weaknesses in the Shear-Stress Transport (SST) formulation. This model is essen-
tially a combination of the κ −  and κ − ω models which takes advantage of the accurate
near-wall modelling of the κ−ω while adding the insensitivity to the values of k and ω outside
of the boundary layer inherent in the κ− model (and which is a problem of the κ−ω model).
Consequently, the SST κ − ω model has proven to be very popular and accurate for general
industrial flows.

7.2.1.3 Spalart-Allmaras

A one-equation model developed specifically for wall-bounded aerodynamic flows which has
been shown to give good results for boundary layers with adverse pressure gradients. Unlike
classical models which involve the calculation of a turbulence time term and an associated

63
length scale, the Spalart-Allmaras model only models the kinematic eddy viscosity. Although
it is finding some application in turbomachinery application, it is not suitable for use model-
ling general wall-bounded flows (such as industrial models of duct flow) and produces errors
considered large for such cases.

7.2.1.4 LES

In a turbulent flow eddies (vortices) form on various scales with the largest eddies dependant
on geometry and boundary conditions while the smallest eddies are quite independent of this.
The large eddies are more involved in the transport of momentum, mass, and energy while
the smallest eddies are the mechanism of dissipation of turbulent kinetic energy. While one
could theoretically use Direct Navier-Stokes (DNS) to directly resolve all of these features,
the computational requirements of such a simulation for any practical engineering flows are
impossible to meet. Large Eddy Simulation (LES) is method which is part way between
DNS and the RANS methods commonly used in that large eddies are directly resolved in the
simulation while smaller eddies are modelled as in other turbulence schemes. As a result,
LES requires much finer meshes than comparable RANS models and much longer running
times. It is also only applicable to 3D simulations. Despite these heavy requirements, LES
has proved to be useful for better resolving complex turbulent flows where necessary without
having to attempt DNS.

In the current model, the flow is external and of a generally low speed. As a result, it is likely
that the Realizeable κ −  model will be sufficient. While the constants defined for the model
can be adjusted as per details given in the theory pertaining to it, the default values will be
used for this simulation.

7.3 User-Defined Functions (UDFs)

While the capabilities of most CFD solvers are quite extensive, many models in engineering
requires such particular boundary conditions that it would be impossible to build in direct
capability for all of these. Rather, the approach is typically taken that the user can input
boundary conditions of various sorts via external programs, generally called User-Defined
Functions. Once prepared, these functions must be hooked to the model so that it is clearly
defined where each must be applied in the progress of the simulation. A wide variety of UDFs
are freely available on the Internet for various flow conditions.

64
While these may be used for steady state models of very particular scenarios, generally UDFs
are used for time-varying properties in a model. There are two broad categories of properties
which are handled in different ways: fluid property and body motion functions.

7.3.1 Fluid property functions

These functions are typically interpreted functions. This means that the function is parsed
at the start of the model because they are only needed in defining the fluid initially. Once
this behaviour has been defined it can be accessed by the solver at any point necessary. In
Fluent these are written as C++ (.cpp) files.

7.3.1.1 Fluid thermodynamic properties

Often models will entail fluids with experimentally defined properties not accurately described
by built-in functions such as the ideal gas equation. A typical example of this would be
modelling hypersonic flows where the ionisation and chemical reactivity of the gas result
in lower fluid temperatures than predicted by the ideal gas equation. Normally there are
discrete temperatures at which different reactions begin and so properties such as the thermal
conductivity of the gas are defined as piecewise polynomials (i.e. several polynomials with
defined ranges of applicability) describing the thermal conductivity as a function of the gas
temperatures. Other properties which may be described by this sort of function are viscosity
as a function of velocity for non-Newtonian (shear thickening or shear thinning) fluids or
density as a function of pressure for fluids including dissolved gases.

7.3.1.2 Boundary value functions

Many models will entail defining boundary conditions that have been defined by other rela-
tionships. For example, experimental measurements may have been used to develop a velocity
and temperature profile for the inlet flow for a model and these can be described mathem-
atically for inclusion. Another typical case of this is when transforming into the reference
frame of an accelerating body. While this cannot be achieved using the standard boundary
conditions, by defining the change of the Mach number, internal energy, and momentum as
functions of time the model can be made to accelerate the entire fluid without developing
non-physical property gradients which would not exist in the real fluid.

65
7.3.2 Mesh motion

These functions are typically compiled functions. This means that the function is compiled
into a method that will be used by the solver typically at every time step to update the
position of the body to which it has been hooked. One potential problem with mesh motion
defined by UDFs is that it can result in edge boundaries of the model intersecting or crossing
which can cause non-positive cells volumes and result in failure of the model. In Fluent these
are written as C (.c) files.

There are two general types of body motion functions: forced and integrated.

7.3.2.1 Forced motion functions

Forced motion functions are, as the name clearly suggests, ones in which the motion of the
bodies involved is independent of the forces acting upon them. This is usually only the case
when the total forcing power of the system is much higher than the fluid dynamic power
applied. For example, although there is significant pressure developed in the cylinders of an
internal combustion engine, the motion of the pistons at steady state is almost completely
independent of that pressure because of the significant inertia of all of the parts of the drive
train sustaining the motion.

One result of forced motion in CFD is that very high or low pressures and temperatures
may be developed as a result of unrealistic descriptions of the motion. These can cause the
model to fail. In addition, these models are also very prone to boundary intersections or
mesh-boundary overruns which result in model failure due to non-positive cell volumes.

7.3.2.2 Integrated motion functions

Integrated motion functions are those which integrate the forces acting on a body to determine
the nett acceleration experienced and hence define the change in velocity at each time step.
A typical example of a model which would use such a function would the the store separation
from the wing of an aircraft since there is no explicit function which can define the loads
acting on it at all times.

While these models are obviously appealing for the physical completeness of the description
of body motion, they are computationally very expensive and should only be used when
absolutely necessary. As with the forced motion functions, these models can also be prone to
boundary-boundary and mesh-boundary overruns leading to model failure.

66
As the motion of the overtaking vehicle has been described as a constant acceleration to 80
km.h-1 it is expected that a user-defined function will be needed to describe the motion since
it is assumed that the values given include the air resistance. It must be remembered that
the model has been formulated in the frame of reference of the slower vehicle. Hence, the
acceleration of the overtaking vehicle in the simulation will be from relative rest to a speed of
20 km.h-1 at a rate of 15 km.h-1 .s-1 . The UDF used to do this is can be extracted from this
document here

7.4 Mesh Motion Meshing Methods

The range of motion that can be modelled in CFD is generally limited only by the ability
to describe the motion analytically. In addition, many methods exist to integrate the forces
acting on a body and hence calculate its motion. Thus the types of motion available in
CFD are almost limitless and so meshing methods have been developed to deal with various
general forms. Broadly speaking the methods for accommodating mesh deformation can be
divided into smoothing and remeshing methods. The smoothing method is the only method
of its form in ANSYS© Fluent while there are three remeshing methods (Dynamic Layering,
In-cylinder, and Remeshing) where the In-cylinder method is only a highly-specialised form
of the Layering method.

7.4.1 Smoothing method

This method effectively treats the links between nodes in a mesh as springs and determines
the resistance to movement of a node by a method similar to Hooke’s law. This means that it
will spread the local deformation of mesh over a larger area and absorb the movement. The
number of nodes in the mesh and they way that they are connected doesn’t change. Due to
this, the Smoothing method is generally only applicable to small deformations of a mesh and
cannot be used for large, arbitrary motions of boundaries.

7.4.2 Dynamic layering remeshing method

This method is based on regular rows of cells adjacent to a moving boundary which are
split or merged based on the degree of deformation. In short, a cell can get squashed until
it reaches a specified percentage of its nominal size and will be merged with the adjacent,
undeformed cell. Conversely a cell can get stretched until it reaches a specified percentage
of its nominal size and will then be split into two. This method lends itself best to linear

67
motion orthogonal to the mesh rows and isn’t suitable to boundaries which move parallel to
a meshing direction.

Understanding the mechanism it is obviously important that the nominal mesh size be
correctly set adjacent to the moving mesh boundary otherwise the cells may not deform
timeously. When stretching a mesh this causes cells of very high aspect ratio which may
lead to inaccurate results but otherwise the model can continue to run. The biggest problem
with improperly defined nominal cell sizes in when squashing cells. If the nominal cell size
is not correctly set then the nodes on the moving boundary may overrun the next row of
nodes from one time step to the next resulting in non-positive / negative cell volume, where
a positive cell volume is as defined algebraically by the right-hand rule for plane cells, for
example. This condition immediately causes a simulation to terminate.

7.4.3 In-cylinder remeshing method

The In-cylinder method is related to the Dynamic Layering method but is designed to model
only the movement of piston in the cylinders of internal combustion engines. Rather than
using an external UDF to define the movement of the piston mesh boundary, the user spe-
cifies terms such as the crack angle at the start of the simulation, displacement, and engine
frequency and the displacement profile is automatically calculated

7.4.4 Remeshing method

The Remeshing method is the most general method used to update a mesh during a simula-
tion. While the Smoothing method can accommodate fairly large movements, if the boundary
movement is too large it can result in non-positive cell volumes which causes the model to
fail. The Remeshing method identifies cells that are becoming too skew and defines a region
incorporating all of these for local remeshing. Once the new mesh meets the global skewness
limits, the original cells are replaced with the new cells and the flow values updated. In mod-
els with very large displacements of complicated geometry this process can require significant
computational time and so this method should not be lightly used.

The mesh blocks for the demonstration problem were designed so that the mesh associated
with the faster vehicle will move rigidly while the two mesh blocks adjacent will employ the
Dynamic Layering dynamic mesh method.

68
7.5 Mesh Motion Zones

When defining mesh motion the motion and its effects are applied to different zones within
the mesh. There are three commonly used mesh zone types: Stationary; Rigid Body; and
Deforming.

7.5.1 Stationary

This is the implicit mesh motion zone type. This means that if a zone type isn’t allocated,
most zones in the mesh are treated as stationary. However, this can be important when
defining mesh motion adjacent to a zone as it can affect the part of the mesh modified by
the mesh motion methods. For example, when using a Dynamic Layering method, if one of
the ends of the mesh is defined as Stationary then cells will be split or merged there rather
than at the other end.

7.5.2 Rigid Body

This is the zone type used to specify the motion of mesh elements. Often the mesh motion
will involve not just the edges of the mesh block but also the mesh cells themselves and
so separate mesh motion zones using the same conditions must be created for each. Mesh
motion obviously requires at least one Rigid Body zone.

7.5.3 Deforming

This is the mesh motion zone type which allows for deformation of a mesh. This does not
only refer to changing size and shape of a mesh zone. If the cells of a mesh are supposed to
slide along an edge, that edge must be defined as a deforming zone. If this isn’t done then
the nodes on the edge will remain fixed and the cells connected to those nodes will deform
until the aspect ratio becomes too high at which point the model will generally fail.

7.5.4 Division of mesh blocks into zones

It is important to note at this point that, in general, mesh blocks are divided into the edges
and the interior mesh for dynamic mesh motion. Therefore, if you have defined a named
selection for a mesh block, for example Fluid Faster Vehicle, then the edges of that mesh (all
defined as interface or wall boundary types during meshing) will be separate zones to the

69
interior of that mesh, which will be automatically named interior fluid faster vehicle. This
also allows that the interior cells of a mesh can move while the bounding faces / edges do
not.

7.6 Adaptive Mesh Refinement

While efforts can be made in the meshing stage of a model to place refinement in regions of
expected high flow property gradients, in complex flows there will almost always be unexpec-
ted features that arise. Also, pre-optimisation of a mesh only really works for steady state
simulations since the boundaries will move in a transient model and initial refinement may
be removed as a result. In these cases, adaptive mesh refinement is needed.

As the name suggests, adaptive mesh refinement changes the location in which refinement is
made based on the fluid properties at that time. What this means practically is that the solver
identifies regions with gradients of fluid properties (such as: density; velocity; temperature;
and pressure) greater than a user-defined limit and divides the cells in that region into smaller
ones to increase the local resolution. Conversely, the solver can also merge cells in regions
of low property gradients to reduce the total number of cells. Not all solvers are capable of
these adjustments and there are limits to the range of cases in which this can be done but it
is a powerful tool for improving the physical accuracy of a model.

As an example of where this method would be quite useful, consider modelling the flow in
the supersonic inlet of a jet engine. While for simple geometries (with straight cones and
such) you could make some quick hand calculations to identify the the region in which the
oblique shock wave is expected this is almost impossible with the complex, curved geometries
of modern engines. In addition, it is a very time-consuming way of determining the flow
behaviour in side the engine, critical for optimising the performance of the compressor and
hence the engine overall. Adaptive mesh refinement based on gradients of flow properties
that you would expect to change rapidly over features of interest (shock waves) such as
temperature, velocity, density, and pressure can be used to put additional cells where needed.

It is important when considering the use of adaptive refinement methods that suitable flow
properties be considered for determining regions for refinement. For example, if you wish to
identify shock waves in a field you would use the Mach number, but this is actually a function
of the flow velocity and temperature and because of the change in both of these properties
across the shock wave, the change in Mach number is not as large as the changes in each of
these properties separately. Hence it is often more useful to specify velocity and temperature
separately as variable of interest for identifying refinement areas.

70
Although there is some overlap between them, it is common to specify several variables for
adaption of the field to ensure that the desired features are captured. So, when adapting
your mesh to refine it in regions of shock waves, for example, it is typical to use velocity,
pressure, temperature, and density as variables for identifying shock waves in the flow field.
If, on the other hand, you were attempting to identify shear layers as well the use of pressure
would be of no use as shear layers are isobaric (same pressure on each side) while there is a
difference in velocity, temperature, and density.

There are actually several methods commonly used for adaptive refinement broadly divided
into the discriminating property and the threshold mechanism.

When defining the discriminating property for a model you can choose to identify regions
of interest by the value of a property, the gradient of the property, or the curvature of the
property. Essentially these three methods use different derivatives of flow properties (the
value itself, the first derivative, and the second derivative respectively).

By far the derivative methods are more commonly used in adaptively refining engineering
methods because it is regions of change of property that are of most interest in such flows.
Put another way, it is unlikely that you could clearly know beforehand that you want to
refine a model when a fluid property like density reaches a particular value because you often
have only a limited idea of the numerical range of values that will occur throughout the
phenomenon being studied.

Correctly selecting the discriminating property is hence a function of the features you wish
to resolve. While both the gradient and curvature of properties like density are large across a
shock wave (because they are, in reality, step changes), the curvature of pressure in the wake
of a subsonic vehicle will be negligible compared to the gradient of pressure. You must hence
consider the expected flow physics carefully before selecting a property gradient by which to
adapt.

The second part of adaptive mesh refinement is the threshold mechanism. Once you have
selected a discriminating property you will need to set limits above or below which the mesh
will be refined or coarsened. Here again there are three typical possibilities: the direct value;
scaled property values; or normalised property values.

The first option would require you to set a numerical value for a physical property to be used
as the criterion for adaption. For example, if you were adapting by gradients of density you
would need to specify a value of (kg.m-3 ).m-1 above which the mesh would be adapted. Such
values are often difficult to know when setting up a model as mentioned before. Hence, this
method of threshold specification is not very commonly used.

71
By far, the normalised methods of threshold specification (scaled and normalised) are more
commonly used. These methods refer to the discriminating property relative to the entire
field. Hence, in the scaled normalisation threshold specification all values are scaled by the
average value in the domain. So, instead of specifying a density gradient directly by value,
for example, you would specify that all gradient higher than 120% of the mean gradient in
the field must be refined. This allows you to specify a model in which only the most extreme
gradients are considered for refinement.

By contrast, in the normalised threshold specification all values are scaled by the maximum
value in the domain. Hence, if adapting by density gradient you would specify that all
gradients greater than 70% of the maximum be considered for adaption. This is a method
typically simplest for most people to understand and is hence very popular.

Since the gradients in this flow field are not expected to be particularly high, adaptive refine-
ment can be left tout of this model for now. Were you to implement it, it is recommended
that adaptive refinement be specified based on gradients of pressure and velocity changes (since
temperature and density changes are expected to be small).

7.7 Solution Monitoring

Once a model has been set up, you need to have methods of tracking the quality as it
progresses and means of stopping the model once the desired quality has been achieved. There
are two methods commonly used for this: residuals monitoring and flux or force monitors.

7.7.1 Residuals monitoring

As discussed in 2.6.1, residuals are the scaled change in flow variables from one iteration to
the next. In ANSYS© Fluent these are used as the threshold mechanism for terminating
a solution i.e. you would request an initial number of iterations and if these conditions are
met before that number of iterations is executed the solver is stopped from executing. Since
residuals don’t directly report values in the flow field, this does not necessarily mean that
the solution is correct but only that the change in values per iteration is below the specified
limit.

The mechanism of convergence limits for residuals means that you can indirectly limit the
number of iterations that the solution executes so that it doesn’t simply continue refining
the solution beyond your requirements. These are referred to as convergence limits because
the solution is deemed to be convergent when the residuals are at or below the specified

72
levels. There are cases, however, where a solution never reaches the convergence limits or is
not converged when it does so. The NS equations are PDE and hence can behave in under-
damped, critically damped, or over-damped fashion and can be prone to other harmonic
behaviour. When a solution is over-damped (such as when modelling an inflection point in
physical behaviour such as the sonic limit in a converging-diverging nozzle) the residuals will
become very small but the solution won’t actually be converged. In such a case, the residual
limits often need to be made very small to force the solution to be converged.

In the case of under-damped solutions, the convergence may develop harmonic behaviour
in which the values in the flow field oscillate between two stable states but the difference
between them is too great to meet the convergence limits. There is nothing that can be done
to improve such a solution short of changing the boundary conditions.

It is also common for a solution not to reach the convergence limits in each time step of a
transient model. While it is preferred that this is the case, it is quite common for transient
models to develop harmonic behaviour.

In general the default values of convergence limits for most CFD solvers are insufficient for
gas dynamics models, with most convergence limits set at 0.1% (0.001). For gas dynamics
solutions convergence limits of 0.01% (0.0001) are generally recommended, though in the case
of the energy equation it is suggested that the convergence limit be set as 0.0001% (0.000001)
as this equation converges very rapidly.

7.7.2 Flux or force monitors

Since residual monitors do not report the actual values of variables in the flow field, it is
common to enable monitors of forces or fluxes in the model to check the convergence and
accuracy. In cases where the residuals are low and not changing it is informative to examine
the history of a relevant force or flux monitor for actual convergence. For example, in the case
of the overtaking vehicle, monitoring the wind speed would not provide additional information
about the convergence of the model but a monitor of the drag force acting on the overtaking
vehicle would give a sense of the behaviour of the model over the last few time steps and
iterations within each time step.

7.8 Transient Solutions and Time Steps Size

One of the most fundamental specifications of a transient model is the size of the time step. If
you are using an explicit formulation this is determined directly by the value of the Reynolds

73
and Courant numbers. However, in the majority of models it is necessary for you to specify
the time step size yourself. As with mesh sizing, it is recommended to make the time step
size as large as possible because excessive temporal resolution of a model leads to: long run
times; large output data set size; and possibly instability of the model. There are three
principal considerations in determining the maximum time step size for a model: required
temporal resolution; rates of flux; and mesh motion. Once these considerations have been
used to calculate minimum time step length/s, it is common to round these down to the
nearest convenient temporal unit.

7.8.1 Temporal resolution

In any given transient model it may be that you are required to develop a temporal profile of
a phenomenon at a particular frequency. This is typically dictated by interaction with other
physics. Hence, if you have a flow field which is of a kilohertz (maximum time step 1 ms)
frequency behaviour but it is interacting with another feature, for example the temperature
of a heat source such as a laser operating at megahertz frequency (maximum time step size 1
µs), then it may be necessary for your model to have megahertz frequency temporal resolution
to accurately capture the excitation of the fluid by the laser.

7.8.2 Rates of flux

If the flow rates or other fluxes in your model are changing at a high rate it is necessary for
model stability and accuracy to specify a high model frequency to capture this behaviour.
For example, if a flow is accelerating on the order of tens of m.s-2 , the temporal resolution
will need to be of the order of kilohertz (maximum time step 1 ms) to ensure that modelled
temporal velocity profile is sufficiently smooth. If this isn’t done, it could cause apparently
sudden changes in speed that could lead to instability or flow features which don’t exist in
the real flow, such as shock waves. This also applies to the oscillation of features such as
vortex shedding.

7.8.3 Mesh Motion

The specification of the time step size for a model in which there is mesh motion is the most
critical. If the time step size is too large the moving edges may overrun the adjacent mesh
from one time step to the next causing non-positive cell volumes and hence the model will
crash. The simplest way to estimate this is to consider the maximum speed and smallest cell
size in the direction of motion. You determine the time taken for the moving edge to cross

74
the smallest cell at maximum speed, which should be the minimum speed taken to cross any
cell in the model. The maximum time step size should then be about 40% of that speed as
it means that the edge should take 2 - 3 time steps to cross the cell which, if the dynamic
mesh methods have been properly applied, will result in remeshing before non-positive cell
volumes can occur.

In the current model, the fastest speed of any moving edge is 20 km.h-1 , corresponding to the
maximum speed of the overtaking vehicle in the absolute reference frame of 80 km.h-1 . Since
the mesh block surrounding the faster vehicle will be moving as a rigid body, the meshes for
which the minimum cell travel time must be computed (i.e. the meshes through which edges
are moving) are the growing and shrinking mesh blocks. In both mesh blocks the cell height
adjacent to the moving edges is 0.3 m. Thus, the minimum time taken for moving edges to
cross these cells is 0.054 s. Rounding this down to the nearest convenient temporal unit would
suggest a time step size for the model of 50 ms (0.05 s).

7.8.4 Number of time steps

Once the maximum time step size for the model has been determined it is a trivial matter to
calculate the number of time steps required. Simply, you divide the total time to be simulated
by the time step size. Often you will not specify this entire number initially as you would
want to check the stability of your model first and adjust the number of iterations per time
step for the best results.

In the case of the overtaking vehicle, it is required to model the flow from when the faster
vehicle is two vehicle lengths behind the slower vehicle until it is two vehicle lengths ahead, a
total distance of 18 m. Using basic kinematics for accelerating bodies it can be calculated that
the time this will take is 2.94 s. Hence the minimum number of time steps required is 59, or
60 time steps.

7.9 Creation in ANSYS Fluent

1. In ANSYS Workbench, drag a Fluent component system into the workspace somewhere
near the Mesh block already there. Notice that there is now a check mark next to
the mesh item as it has been completed and is ready for use. As with when the mesh
component was first added, the setup item in the Fluent component system is marked
with a blue question mark . In addition, you can see that the solution item in the
Fluent component is marked with an open blue question mark . The reason for the

75
difference is that the solution item is dependent on the setup item and, since it hasn’t
been defined, nothing can be changed with the solution item

2. Click and hold on the mesh item in the Mesh component system and drag across to the
setup item of the Fluent component system, which will be highlighted in red and give a
share identifier, then release the mouse to link the two systems

3. You will see that the mesh item in the Mesh component system has changed to a lightning
bolt while the question mark for the setup item has changed to the refresh symbol
. This is because while linking the systems has shared the mesh with the Fluent
component system, some of the information must be checked for compatibility with the
existing setup of the model (which is empty) and some of the options for Fluent must
be set based on the dimensionality of the mesh, for example. Click the Update Project
button to update this information. Once complete a message will pop
up telling you that Fluent requires more setup information before the model can be
executed. The meshing item will have changed back to a check mark and the setup item
of the Fluent component system will now be a question mark. Note that if the setup had
already been completed that this would cause the model to begin executing without the
necessity of opening Fluent first.

4. Double-click the setup item in the Fluent component system. This will open the Fluent
launch screen where several options must be set:

Figure 47: The Fluent Launcher configuration screen

• Dimension: Since the project was updated, this option has been locked to 2D be-
cause that was the information passed from the Mesh component system by when
launching Fluent independently you would be required to manually select the relev-
ant option for the model you wish to run
• Options: Since this is a 2D model, the only options given are for a Double Preci-
sion solver. This refers to the size of the variables used to store the model valuables.

76
Selecting the Double Precision solver will use double type variables instead of the
standard float type to store the flow values. This is only needed for models where
very high numerical accuracy is required, typically where the physics being mod-
elled has regions near unstable solution points. These models are normally solved
asymptotically and hence require the accuracy. Most models do not and so the
default is not to use this
• Display Options: These are options which older users sometimes prefer to
change. The only one of some use to most current users is the option to em-
bed the graphics window. Unchecking this option means that each graphics window
created will be in its own window rather than embedded in the single Fluent window
which can be helpful when working with multiple displays as it allows you to mon-
itor several model information windows simultaneously. Since you are working on
a terminal system it is typically not necessary
• Processing Options: The options given here refer to whether the model will be
running on a single compute node or parallelised over several. This is because dis-
tributed processing has allowed for significant increases in the size of models which
can be processed in a reasonable amount of time and / or reduced the time required
for simple models.

If you select the Parallel option you will notice that you will be required to specify
the number of processors (and some other options as well). The rules of thumb for
this are that you should have a minimum of 100 000 nodes per compute node and
that the maximum number of processes that can be specified on a single computer
is:
Pmax = nCP U × (ncores − 1) (2)

Where: nCP U is the number of CPU chips in the computer to be used and ncores
is the number of processing cores per chip. The reason that the total is calculated
with one less core per chip is that one core must be kept separated to manage the
overhead of the model such as the data switching between compute blocks and load
balancing of the blocks.

The typical Fluent licence at present allows for a maximum of 4 compute nodes per
licence seat. If you wish to use more compute nodes you will need an additional
High Performance Computing (HPC) licence. More information on parallelisation
of models is covered in section 10.

Since this model is small, you will only use the Serial option

77
• Show More Options: The majority of the options in this part of the launcher
are only for configuration by advanced users, however, there is one option here that
should be noted. On the first pane of the advanced option (called General Options)
is a selector for the Pre/Post Only mode. This is the mode of Fluent that should
be used if you are only going to be post-process results generated previously as it
only caches those tools and not the majority of the solver freeing memory space
for the typically momeory-intensive post-processing activities

Once you have made the appropriate setting click OK to launch Fluent

5. As before, when Fluent first launches it is worth familiarising yourself with the layout
of the most important tools:

Menu Bar

Display Window Selector


Display Window
Workflow Detail Pane

Workflow
Text Interface Window

Figure 48: Layout of the Fluent graphical interface

• Menu Bar: Although obviously expected, it is mentioned specifically here because


there are some settings only available through the classical menu
• Workflow: This list follows the order typically required to set up a model i.e. you
must make sure that you have made the correct settings in at least these items in
order to run a general model
• Workflow Detail Pane: As you select each item in the Workflow, this pane will
show the particular items required for that item. Often you will open additional
dialogues from this pane to put make the very detailed settings
• Display Window and Display Window Selector: Each item that you select
to display will be shown in this common display area (unless you previously de-
selected the option to embed graphics windows). Consequently, if you want to look
at a window previously defined you can change between these by using the Display

78
Window Selector which lists each display window by its window number and a brief
description
• Text Interface Window: This is the pane where the Fluent solver reports output
and which can also be used to make settings via the Text User Interface (TUI)
system. Although explicitly covered in this guide, familiarity with the TUI system
is needed for deploying models on systems like the Centre for High Performance
Computing (CHPC) since most HPC system do not allow the use of advanced
Graphical User Interface (GUI)s. More detail on this can be found in section 10

6. The first action that you should take in general is to check that the mesh that has been
imported is correctly sized and connected. To do so, press the Check button in the Mesh
item in the Workflow Detail Pane for the General item in the Workflow

7. With the mesh as directly imported from Meshing, the mesh check will fail and if you
inspect the output in the TUI window you will note that warnings given are for unas-
signed mesh interfaces. This is because the interfaces haven’t been coupled and so it
is unclear how the solver should treat them. Before the model setup can continue it is
therefore necessary to define these and then check the mesh again

8. Select the Mesh Interfaces item in the Workflow and click the Create/Edit... button:

Figure 49: Mesh interface specification window

• Mesh Interface: This is the field where you will enter the name of the mesh
interface that you want to create. You can also select interfaces that have already
been defined from the list below to edit or confirm the definition or delete the
interface
• Interface Zone 1 and Interface Zone 2: These are the windows where you
will select the interface zones to be associated with one another. While not strictly
necessary it is advised that, if the interface zones are of different size, the smaller
zone(s) be selected under Interface Zone 2. An interface zone cannot be used in
multiple interface definitions so it is important that you keep track of this

79
• Interface Options: There are 4 additional settings that can be made when de-
fining an interface:
– Periodic Boundary Condition: This allows you to define a non-conformal
periodic boundary condition. These can be translationally or rotationally peri-
odic. For example, a 2D model of compressor flows would be considered trans-
lationally periodic (since it is two meshes sliding past each other) while a 3D
model would be considered rotationally periodic
– Periodic Repeat: This is the periodic boundary type applicable to periodic
systems such as the rotors and stators in a compressor. Rather than modelling
all rotors and stators, you define meshes for one of each and then define the
interface so that it effectively repeats the properties from each to simulate
a complete set. The repeat option means that the full model can be simply
displayed through proper definition of the repetition frequency
– Coupled: This is required most commonly when you are modelling fluid-solid
interactions involving heat transfer. If an interface is not defined as coupled,
the interface surfaces are treated as adiabatic and heat transfer between the
fluid and the solid will not be correctly modelled
– Matching: This is a special condition which is used when interfaces may not
align properly that allows Fluent to enforce alignment between the interfaces.
The effect is limited and invalid interfaces will still result if the difference
between the two adjacent zones is too severe
• Period Boundary Condition settings: This is where additional settings de-
fining the periodic behaviour of periodic interfaces would be defined as needed
• Interface management tools: Beside the Create option, you can also delete
incorrectly defined or unnecessary interfaces as needed

Generally interfaces are used for sliding meshes such as in the current model. Since
these are not periodic or thermal conductivity interfaces, none of the options are neces-
sary

9. To define the first interface, select the interface zone Interface Slower Vehicle-Growing Mesh-
Faster Vehicle-Shrinking Mesh under Interface Zone 1

10. Next select Interface Growing Mesh-Slower Vehicle, Interface Faster Vehicle-Slower Vehicle,
and Interface Shrinking Mesh-Slower Vehicle under Interface Zone 2 since these are all
smaller than Interface Slower Vehicle-Growing Mesh-Faster Vehicle-Shrinking Mesh. Note
that you do not need to hold Ctrl or Select to select multiple zones. Rather, any zone
you click will be highlighted and you can de-select it by clicking it again

11. Next enter the name interface top for the interface in the Mesh Interface box (while you
could enter a more comprehensive name, in this case it is simpler to use a shorthand)

80
12. Click Create. You notice that, if properly defined, the interface will appear in the list of
interfaces listed

13. Repeat steps 9 to 12 For the remaining 3 interfaces. Once complete, the list of interfaces
should look like that in Figure 50 and you can close the mesh definition window

Figure 50: Mesh interfaces defined

14. Repeat the mesh check. It should now pass. Notice that in the mesh check some statistics
of the mesh are given such as the domain extents and the minimum and maximum cell
sizes. Ensure that these are as expected. If the domain size is incorrect you will need
to use the Scale tool under the Mesh items of the details pane

15. The next settings to make are the solver selection. As discussed in subsection 7.1, the
solver to use for this model would be a Pressure-based planar 2D solver. Since this is
a model in which the boundary conditions (including the position of wall boundaries)
change with time, the Transient option must be selected. The Velocity Formulation can
be left at the default of the Absolute formulation. Also, since the model is a 2D top-view
model of the vehicle interaction, it would be incorrect to enable the Gravity option. This
should only be used in fields in which gravity is expected to have a significant effect, such
as in liquid flows.

16. Now select the Models item in the Workflow. Most of these options are not used in
typical undergraduate level models and you are recommended to study up on each as
necessary. Two are commonly used: Energy and Viscous. The Energy model is simply
a condition that checks the continuity of the energy equation during simulations. This
is particularly important in compressible flows and so it is automatically enabled when
specifying a compressible gas. Select the Viscous model (currently on the default value
of Laminar) and click Edit

17. In the menu which opens up you will see several options. The first is the Inviscid model
(otherwise known as an Euler solver). This option should be used when it is considered
that viscous effects are negligible in the model at hand. As discussed in subsection 7.2,

81
the appropriate model for this simulation would be the Realizeable κ − . Select κ − 
from the presented list

18. Once you have selected the κ −  option you will notice that the options available all
change:

Figure 51: Specification of the κ −  viscous model

• Model Constants: These are the values used to control the values produced by
the model during the simulation. Generally speaking these should be adjusted as
per the definitions given in the theory guide for the model but the default values
are fairly accurate for most flows and so these values can be retained as given
• k-epsilon Model: This allows you to select the formulation of the κ −  model
that you wish to use. Change this option to Realizeable and notice that some of
the options and constants given change
• Near-Wall Treatment: In some simulations it is necessary to change the near-
wall treatment used by the model to better reflect the particular fashion in which the
fluid interacts with the solid. For most simulations the Standard Wall Functions
are sufficient
• Options: These are advanced options used for particular flow conditions. None
of these will be needed in the current model and the details are available in the
relevant theory
• User-Defined Functions: As described in subsection 7.3, many properties of a
model can be described if necessary by external functions. This dialogue would allow

82
for selection of the correct models that have been added. The current simulation
will not be using UDFs for fluid properties

Once all options have been set, click OK to close the dialogue box

19. Select the Materials item in the Workflow. There is a default list of fluid and solid
materials listed (air and aluminium respectively). Fluent has an extensive database of
materials which can be imported and modified as necessary. Models can contain many
different materials but in this case the only one is air. Select air under the list of fluids
and click Create/Edit...

20. In the presented dialogue, you will notice that you can customise the name of the fluid
that you want to use. You can copy a new fluid into this pane from the Fluent Data-
base... button but that will not be necessary in this model because the only fluid is air.
Each of the relevant fluid properties are adjustable via a text box for fixed values and
a drop-down that allows you to select from among formulation options. Although there
are no compressible effects expected in this model, select the ideal-gas option from the
density specification Once you have changed the density definition you will notice that

Figure 52: Specification of the fluids in the model

the text box for density becomes unavailable and that additional fluid properties are now
listed. These default values can be used but notice that any of these properties could also
be defined by various built-in methods as well as by UDFs Once you have checked that
all of the values are correct, click Change/Create... and close the Materials dialogue.
Notice as well that there is a message in the TUI window indicating that the energy
equation has been automatically enabled since you are using an ideal gas model

21. Check in the Cell Zone Conditions item that the mesh body is recognised as a fluid and
not a solid. This can be prevented (if it has happened) by creating a named selection
for each region in the Meshing operation

83
Figure 53: Specification of the ideal gas fluid

22. Now select the Boundary Conditions item in the Workflow. This is arguably the most
important part of establishing the model. First the Operating Conditions must be set.
Click on the Operating Conditions button:

Figure 54: Setting the operating conditions

• Operating Pressure (pascal): This is the option in which the reference pressure
is set. All pressures entered in the model are in a gauge pressure reference frame
i.e. the difference between the absolute pressure and the specified operating pres-
sure. In gas dynamics it is conventional to work in absolute pressures and so this
value should be set to zero (since all pressures relative to zero are, by definition,
absolute). If this value is not changed and absolutely pressures are entered, the
calculated flow speeds and other properties will be incorrect
• Reference Pressure Location: If you are running a model with no pressure
boundary conditions, this is the cell used to adjust the gauge pressure field for
incompressible fluid models. In a model such as this there will be no effect on its
setting and it can generally be left at (0,0,0)
• Gravity: This is another location in which gravity can be enabled in the model.
If you do so it also opens a dialogue box so that the components of gravitational
acceleration can be specified

84
23. Now the actual boundary conditions can be set. In this particular example, there is
only one setting to be made: the pressure far field boundary condition. Select the pres-
sure far field slower vehicle boundary from the list and click Edit...:

Figure 55: Setting the pressure far field boundary condition

• Gauge Pressure (pascal): This is the static pressure that exists along the entire
pressure far field boundary. Since the operating condition was set to 0 Pa, this
value should be set to 101 325 Pa (1 standard atmosphere) so that the absolute
static pressure on the boundary is 101 325 Pa
• Mach Number: For the pressure far-field boundary condition, the inertia is spe-
cified by the Mach number directly. Since we only know the speed of the vehicles,
this will need to be calculated. Assuming that the air temperature is 300 K (stand-
ard atmosphere), the sound speed, a, for the domain can be calculated by:
p
a= γRT (3)

Which evaluates as 346.76 m.s-1 . Hence the Mach number of the ”wind” resulting
from the transformation into the reference frame fixed in the slower vehicle travel-
ling at 60 km.h-1 (16.67 m.s-1 ) is 0.048064. While it may seem unusual to use so
many decimal places, it is especially necessary at low speeds to use 5 or 6 decimal
places to ensure that the value of the actual speed calculated by Fluent is as close
to the desired value as possible
• X-Component of Flow Direction and Y-Component of Flow Direction:
Rather than requiring a full remeshing every time you want to test a different
wind angle, by changing the components of the wind direction you can use a single
mesh to accomplish the same effect. These values are most simply calculated as
the cosine and sine of the wind angle needed but it does not matter how large or
small the values are as long as they are in the correct proportion. That being said,
it is considered safe practice if the values given are between 0 and 1 since values
outside of this range may be truncated. In this case, the wind will be ”blowing”

85
from right to left to simulate the motion of the vehicles from left to right. Hence
the components of the wind will be -1 and 0 respectively
• Turbulence: You can change details of the turbulence properties of the boundary
via this menu but the default values will be sufficient for this model

24. Set the value of the temperature in the Thermal tab to 300 K (the default). Once the
boundary values for Pressure Far Field Slower Vehicle have been set, click OK

25. Set the same values for the remaining 3 pressure far field boundaries

26. The next item in the Workflow, Mesh Interfaces, has already been handled in steps 8 to
13

27. The next item in the Workflow, Dynamic Mesh, is where the actual mesh motion will
be defined. Before this can be done, the UDF that will be used must be compiled. Open
the Define →User-Defined →Functions →Compiled... menu item

28. The Compiled UDFs menu requires you to include all of the files that must compiled. In
most models this will only be the UDF file itself since the header files used are included
in the Fluent search path:

Figure 56: Compiled UDF menu

• Source Files: These are the files which contain the functions that you want to
hook to you model. As discussed in subsection 4.3, the source files should be placed
in the global folder of the model to be visible to Fluent even though Fluent will tell
you to put it in the same folder as the case and data files (this is a vestige from
when Fluent was a separate company)
• Header Files: As you should have learned in programming, some languages re-
quire additional methods to be imported in header files in order for the programmes
to work. When defining Fluent UDFs, the only header file typically used is ”udf.h”
which is built into Fluent and so you generally won’t need to import any header
files (.h) here
• Build: This is the item which actually builds the UDF so that it can be used during
the execution of the model. The compiled UDF will be placed in a folder called libudf

86
by default in the Fluent subfolder. In order for this to work, a suitable C compiler
must be installed on the computer used for the simulation. If this hasn’t been done,
the build will fail and you won’t be able to include the UDF in your model. It is
especially important if you are using a 64-bit operating system (recommended for
CM computers) that you have a compiler with full 64-bit compilation capability.
Finally, if the model is being run in parallel, the compiled UDF is different to
the compiled form for serial since there are separate functions for the head and
parallel nodes. This generally means that if you change a model from serial to
parallel execution that you will need to re-compile and possibly re-hook the UDF
• Library Name: This is the folder that will be created with the files Fluent needs
to execute the UDF during the simulation. Since this should be located in the global
folder of the model it is advised that you define the explicit location rather than
leaving just the default of ”libudf” (for library - UDF)
• Load: Once the UDF library has been successfully built, you will need to load it
so that the functions you have defined are available for hooking. If you use the
default name of only libudf then the UDF will be built in Fluent subfolder

Under the Source Files item, click the Add button and select the UDF file, Vehicle.c,
that you extracted from the document earlier and moved to the global folder of the model

29. To ensure that the UDF is compiled in the correct place, copy the folder location of
the global folder of your model from the Windows Explorer item and place it at the
beginning of the Library Name so that the correct folder is created. If you are working
on the application server and have used the names recommended to date, the library
location should be ”Z:\Vehicles files\dp0\global\libudf”

30. Click Build. If the build is successful then the output in the TUI window should look
like that in Figure 57. If you receive any messages about nmake being an unknown
executable then there is a problem with the C compiler that you are using and you will
need to correct this before you can proceed. If you receive other error messages then
there may be a problem with your UDF source file

31. If you try to load directly from the Compiled UDF window, it will fail because the Load
function there will still look for the UDF library in the Fluent subfolder. Hence, close
the Compiled UDF window

32. Open the Define →User-Defined →Functions →Manage... menu item Enter the name
of the library that you wish to load (it should be ”Z:\Vehicles files\dp0\global\libudf”)
in the Library Name text box and then click Load. If it is successful you should see that
reported in the TUI window

87
Figure 57: Text User Interface (TUI) output for a successful UDF build

Figure 58: UDF library manager

33. Now that the UDF has been successfully built and loaded into Fluent, you can proceed
with specifying the dynamic mesh zones. Close the UDF library manager and select the
Dynamic Mesh item in the Workflow

34. The first thing required for Dynamic Meshing is that it be enabled in the Details pane
by checking that box

35. As discussed in subsection 7.4, this model will employ the Dynamic Layer method. Un-
check the Smoothing method and check the Layering method

36. Click the Settings button for the Layering method:

• Options: There are two methods that can be used for the Dynamic Layer mesh
motion method: Height Based or Ratio Based. The Ratio Based option allows you
to create cells that may become finer or coarser as the relevant boundary moves but
this is normally only used for motion in one direction only and can cause problems

88
Figure 59: Global settings for the Dynamic Layering mesh motion method

if the direction of motion is reversed. The most common (and hence default)
setting for this is the Height Based option where the cells are split or merged based
on the relationship between their size and the ideal specified when defining the mesh
motion. Keep the default setting
• Split Factor: This is the minimum fraction of the ideal size by which a stretched
cell must exceed the ideal cell height before it will be split i.e. a cell will be split
when the height is h >= (1 + fsplit )hideal . If this value is too small then the
resulting split cell may be very small while if this value is too large then the cells
may stretch to a very high aspect ratio before being split. Keep the default value of
40% (0.4)
• Collapse Factor: As with the Split Factor, the Collapse Factor is the maximum
fraction of the ideal cell size to which a cell can be compressed before it is merged
with the adjacent row of cells i.e. a cell will be collapsed when the height is h <=
fcollapse hideal . If this value is too small then there is the risk that the moving
boundary will overrun the cell in the next time step before collapsing the cell and
cause non-positive cell volumes (and hence crash the simulation). If the value is
too large then the merged cell may be of a very high aspect ratio. Keep the default
value of 20%

Click OK to close the Dynamic Layer settings window

37. To define the Dynamic Mesh zones, click on the Create/Edit... button:

• Zone Names: This is a drop-down which allows you top select the mesh zones
to define as dynamic zones

89
Figure 60: Dynamic Mesh zone definition window

• Type: This is the menu allowing you to select the dynamic mesh zone type you
wish to create. As discussed in subsection 7.5 mesh motion typically requires at
least one Rigid Body zone and typically several Deforming zones. The options
available in each of the configuration panes will change depending on the dynamic
mesh zone type selected
• Motion Attributes: This is the pane in which the UDF to be applied will be
selected and the details of features such as the centre of gravity of the body being
moved are specified
• Geometry Definition: There are only options given here for Deforming dynamic
zone types and the default values are typically suitable for most models
• Meshing Options: This is a critically important tab for each of the three com-
monly used Deforming Mesh zone types since it is here that the mesh properties,
specifically the ideal cell height, are defined for the dynamic zone
• Solver Options: There are only options here for the System Coupling dynamic
zone type which is not covered in this guide

To begin, select the interior fluid faster vehicle zone from the drop-down list to define
this as a rigid body zone

38. In the zone type select Rigid Body as the type to use and then define the options in the
Meshing Attributes pane:

• Motion UDF/Profile: Ensure that the UDF that was built and loaded previously
is selected here. The name given will be the name of the function followed by the
library in which it has been built. Hence, in this case, it would be ”Vehicle :: libudf”
• Center of Gravity Location: Generally speaking, this attribute is not really
important if the motion is purely translational as the motion of the entire body is

90
Figure 61: Rigid Body dynamic zone specification: motion attributes

the same regardless of its position. However, for rotational motion this definition
is critical as rotation of the model is always defined as about the centre of gravity.
For example, if you were using a UDF to rotate a circular mesh about its centre
at (0,1) but kept the default value of (0,0) for the centre of gravity then the mesh
would be swung about its edge and overrun the adjacent boundaries leading to model
failure. For this particular model the default value of (0,0) can be kept
• Center of Gravity Orientation: As with the centre of gravity location, this
attribute only has importance with models where the mesh may be rotating since
the orientation of the moment of inertia of the body in question is likely to affect
the rate of rotation. Since this is a model with only translation you can keep the
default value of 0

39. Skip the Geometry Definition tab (since there are no options here for the Rigid Body
zone type) and select the Meshing Options tab:

Figure 62: Rigid Body dynamic zone specification: meshing options for interior zones

91
• Adjacent Zones: Here there are two adjacent zones identified. Since this mesh
is moving as a rigid body there should be no need for these values to be set at
something other than 0 but it is advised that these be set as the minimum and
maximum cell size values within this region. The use of the inflation layer means
that the cell sizes are very small here but the original minimum and maximum cell
sizes used for this zone can be used here i.e. 0.015 m and 0.3 m
• Deform Adjacent Boundary Layer with Zone: This option ensures that the
inflation layers move rigidly with the rest of the mesh. If it is not selected the
mesh outside of the inflation layer will move and this will eventually result in
non-positive cell volumes. Check this option

Once all of the required options have been defined, click Create to define the dynamic
mesh zone

40. Since this is the only Rigid Body dynamic mesh interior the next step will be defining
the Rigid Body dynamic mesh edges. Select the interface growing mesh-faster vehicle
zone. The Motion Attribute settings for this zone will be the same as for the in-
terior fluid faster vehicle zone so proceed directly to the Meshing Options pane: You will

Figure 63: Rigid Body dynamic zone specification: meshing options for edges

notice that the options entered for the previous zone have been retained but that there is
only one Adjacent Zone here. The Cell Height adjacent to the interface growing mesh-
faster vehicle zone is about 30 cm, therefore change this value to 0.3. If this value was
left at the previous default it would be too small for the adjacent cell zone when cells
are being assessed during Dynamic Layer and so the cells would split very raipidly. You
can also uncheck the Deform Adjacent Boundary Layer with Zone option as there is no
boundary layer defined in that mesh block. Once these values have been changed, click
Create

92
41. Repeat steps 38 to 40 to define the following zones as Rigid Body dynamic mesh zones
(with the adjacent cell size and boundary layer deformation option as shown. It often
helps to have a sketch of all of the dynamic mesh zones on which you can mark the
zones already created and their type for easy visual reference:
Zone Cell Hight Deform Boundary Layer
interface faster vehicle-growing mesh 0.3 No
interface faster vehicle-shrinking mesh 0.3 No
interface shrinking mesh-faster vehicle 0.3 No
wall faster vehicle 0.001 Yes
Once complete the list of defined Rigid Body zones should be as shown in Figure 64

Figure 64: Rigid Body dynamic mesh zones defined

42. Next select interior fluid growing mesh. Change the zone type to Deforming and note
that there are no values necessary for the Motion Attributes tab

43. Change to the Geometry Definition tab. Although the Fluent theory guide suggests
various settings that can be made here, these are no pertinent to a 2D model since all
motion is confined to a single plane. Therefore you can leave this option at the defaults.
If you are building a 3D model, you will need to explore the different values that can be
used here

44. Change to the Meshing Options tab. Notice that the options given are quite different to
those for a Rigid Body zone type:

• Methods: You can specify that the Smoothing and Remeshing dynamic mesh
methods be applied in the vicinity of this particular dynamic zone. Since this
model will be using the Dynamic Layering method, this isn’t necessary but you can
leave these enabled if you wish

93
Figure 65: Deforming dynamic zone specification: motion attributes

Figure 66: Deforming dynamic zone specification: meshing options for mesh interiors

• Smoothing Methods and Remeshing Methods: These items allow you to


select additional options for the local application of the Smoothing and Remeshing
methods
• Zone Parameters: These are the settings which will ensure proper splitting or
merging of the cells during mesh motion using the Dynamic Layering method (along
with the definition on the adjacent rigid body). If you leave these at the default
value of 0 then cells wouldn’t be correctly split because any size would exceed 140%
of 0 and so the mesh may appear to ”unzip”. This is more important for zones

94
like interior fluid shrinking mesh where the cells would never be collapsed because
no cell would be smaller than 20% of 0 and this will always result in non-positive
cell volumes. There are three values that are required: Minimum Length Scale;
Maximum Length Scale; and Maximum Skewness:
– Minimum Length Scale: This is used to define the absolute minimum cell
height that any cell in the domain can have (fcollapse `min ) so that any cell smal-
ler than this is immediately merged. This is especially important for meshes
being affected by the Remeshing dynamic mesh method
– Maximum Length Scale: This is used to define the absolute maximum cell
height that any cell in the domain can have (fsplit `max ) so that any cell larger
than this is immediately split. This is especially important for meshes being
affected by the Remeshing dynamic mesh method
– Maximum Skewness: This is used in the Remeshing dynamic mesh method
to identify cells which may fall within the acceptable size limits but be of de-
graded quality and hence require remeshing. A typical value for this is 0.7
(where a cell that is unskewed has a skewness of 0 and and infinitely skewed
cell has a skewness of 1)

You will need to decide appropriate values for each of these

45. To determine the values of the current mesh zone as a guide for the Zone Parameter
values, click the Cell Zone Info... button. Based on the values shown here it seems that
the minimum and maximum length scales for the mesh can be identically set as 0.3 m
while the limit for the skewness can be set as 0.7, since this would allow for subsequent
deformation of cells during the actual run Close the Cell Zone Info dialogue box

Figure 67: Cell Zone Info dialogue for dynamic meshing

46. Set the values for the Zone Parameters and then click Create to confirm the creation of
the interior fluid growing mesh Deforming mesh zone

47. Repeat steps 42 to 46 to define the following zones as Deforming dynamic mesh zones
(with the adjacent cell sizes and skewness as shown:

95
Zone Cell Min Cell Max Max Skewness
interface growing mesh-slower vehicle 0.3 0.3 0.7
interface growing mesh-stationary 0.3 0.3 0.7
interface faster vehicle-slower vehicle 0.3 0.3 0.7
interface faster vehicle-stationary 0.3 0.3 0.7
interior shrinking mesh 0.3 0.3 0.7
interface shrinking mesh-slower vehicle 0.3 0.3 0.7
interface shrinking mesh-stationary 0.3 0.3 0.7
Once complete the list of defined Deforming zones should be as shown in Figure 68

Figure 68: Deforming dynamic mesh zones defined

48. The final Dynamic Mesh zones to define are the Stationary ones. Select pressure far field growing mesh
and change the dynamic zone type to Stationary. The only setting that needs to be made
here is the adjacent cell size in the Mesh Options tab. Change this to 0.3 m and click
Create to finish the zone definition. Repeat this process for pressure far field shrinking mesh

49. Once all of the dynamic zones have been created, close the dynamic zone dialogue box
and save the project via File →Save Project

50. In order to check the mesh motion settings you will need to complete quite a bit more
of the setup of the model. The next item in the Workflow is Solution Methods. This
item allows you to select specific details of solver settings such as the pressure-velocity
coupling and discretisation schemes. These are changes which only more advance CFD
users can make so these will not be covered here

51. Select the Solution Controls item in the Workflow. If you are using a Density-based
solver this is where you will set the Courant number discussed in 2.6.1. Since this is a

96
Pressure-based solution, the values presented here are, instead, under-relaxation factors
for various parameters. Simply put, the higher an under-relaxation factor is, the more
that the relevant variable may change from one iteration to the next. If a solution seems
to be divergent, you would lower the under-relaxation factor for the relevant variable(s)
to try to bring it back under control. The values given as default have proved to be
optimal for the highest number of test cases and you can leave these as they are

52. As discussed in subsection 7.7, you should set up monitors and reports of the quality
of your model to check the performance as it progresses. These are set in the Monitors
item in the Workflow. To set the convergence limits, highlight the Residuals item in the
Residuals, Statistic and Force Monitors section of the Details pane and click Edit...:

Figure 69: Residuals monitor screen including convergence limits

• Options: You can choose to display the residuals in the TUI window (print) and
/ or plot them to the display window. In general, both are done. You can choose
the number of iterations to display in the plot but typically the default value of 1
000 is sufficient for interpreting the history of a simulation
• Iterations to Store: This is the number of iterations for which the residual data
are saved when saving the state of the simulation. As with the plot, 1 000 iterations
is generally sufficient though you can save more if you wish
• Residual Values: Here you can choose the way in which the residuals are presen-
ted. In general these are normally presented in a scaled fashion so that all residuals
are referred to the initial state of the model (or time step for transient cases) so
that the decrease in change with each iteration can be simply compared. These val-
ues can also be normalised by the maximum value of the residual after a number
of iterations, but this is uncommon as it is not as immediately intuitive as scaled
residuals
• Convergence Criterion: Here you can choose to disable solution convergence
control by residuals by selecting the None option. This means that the solution
will only be limited by the number of iterations that you define. In general this

97
is uncommon practise because it normally requires more direct monitoring of the
solution by the user
• Equations: Here you can select the properties of the flow field that will be mon-
itored during the simulation and set the convergence limits for each if you are using
the Absolute Convergence system. As discussed in subsection 7.7 change most of
these values to 0.0001 except energy which can be set at 0.000001

Once you have set all of the residuals, click OK

53. As discussed in subsection 7.7 it is advisable to also set up a force monitor on the
overtaking vehicle. Under the Surface Monitors item, click Create:

Figure 70: Dialogue for the creation of a surface monitor

• Name: This is the name of the monitor that you sill be creating and the automatic
name for the output file it will create (if the option is selected). This is the name
that will be used to select the plot window as well. Change this to fast drag
• Options: Once again you can choose to print the monitor to the TUI window and
/ or plot it as well as being able to write the output to a simple text file. While
the last is not necessary here, enable plotting of the force monitor. Note that the
window number will automatically change from -1 to the lowest available window
number
• Report Type: There are many different report types available including flux re-
ports (flow rates) and various formulations of averaging. Keep the default value of
Integral as the integrated pressure acting on the vehicle is a monitor of the pressure
component of the drag force
• Field Variable: Here you need to select the general category of field variable
and then a specific form. For example, in this model, to determine the pressure
component of the drag force acting on the faster vehicle we must integrate the static
pressure over its surface. Therefore the general category of the field variable for
this report will be Pressure... while the specific field variable will be Static Pressure

98
• Surfaces: Here you select the actual surface/s over which the monitor variable
must be calculated. If you select multiple, unconnected surfaces Fluent will still
report the total force, for example, acting on all of them. In this case we want
to monitor the pressure component of drag on the faster vehicle so we select
wall faster vehicle. Note that if you wanted to report only the drag acting on
the front of the vehicle you would have had to split the boundary into two named
selection in ANSYS Meshing

Once you have made all of the setting click OK to confirm the creation of the force
monitor

54. The next item in the Workflow is Solution Initialization. This is the part of a simula-
tion where define the initial values of the flow field variables from which the enforcement
of the Navier-Stokes (NS) equations and boundary conditions will be used to calculate
the actual flow values. Essentially this is a guess of the true conditions. As with
any differential system, if the initial estimate is poor, the numerical solution may take
longer to solve or even diverge. In a flow field such as this it is normally best to assume
that the initial flow field is a uniform flow as defined by the far field boundary condition.

The default initialisation method in Fluent is Hybrid Initialization. This method is


not preferred in many gas dynamics equations as it does not give you direct control
over zone initialisation as Standard Initialization does. Change this option to Standard
Initialization:

Figure 71: Details pane for the initialisation of the flow field

• Compute From: This option allows you to calculate the values for initialisation
from the values set for one of the boundary conditions. This is a very common
choice as it allows you to check your boundary values and minimise the risk of
mis-match between the boundary conditions and the values entered. Since we are

99
assuming that the initial flow field is a uniform flow as described by the pressure
far field boundary conditions select pressure far field slower vehicle from the drop-
down list. Notice that when you do that the values in the Initial Values section
automatically change
• Reference Frame: This option allows you to specify if the values given are relat-
ive to the reference frame of moving mesh elements or the absolute reference frame.
If there is no mesh motion then these options are identical but if the values sup-
plied are for the absolute reference frame and there are moving mesh regions, the
absolute values used will be incorrect and the results therefore invalid. Therefore,
select the Absolute option
• Initial Values: These are the values that will be set throughout the flow field
when initialised. If these are calculated from a boundary (as here) then you can
use the values printed there to confirm that your boundary conditions were correctly
set, noting that the values presented may have truncation errors versus the nominal
values specified in the boundary conditions e.g. a temperature of 299.9995 K versus
the nominal value of 300 K
• Patch: This button is not available yet because the field hasn’t been initialised
but allows you to change some of the values in different blocks of the mesh after
initialisation if needed. A common example where this is needed is when modelling
a shock tube where the entire flow field is initialised at the expansion chamber
pressure and temperature and then the mesh block representing the driver is patched
to have the higher value of pressure and possibly temperature

Once all the settings have been made, click Initialize to set the intial values throughout
the flow field. Note that this process may take some time, especially for large meshes

55. Select the next item to set in the Workflow is the Calculation Activities: While there are
other activities that may be defined here (such as adaptive mesh refinement and solution
animations), this item always requires attention because it is where automatic saving
(autosave) of the model is implemented. Besides problems of power supply, the autosave
function is important because it allows you to save your model at various stages through
the execution which also allows you to resume from a stable point with new settings if
the model diverges or to interrogate a particular point in much detail

56. Click Edit.. in the Autosave item of the Details pane:

• Save Data File Every (Time Steps): This sets the frequency of the data save
operation. Depending on the time step size and the level of temporal resolution you
want in your output files you can set this value as high or as low as needed. It is
typical in transient models to save every 10 time steps since this is a large enough
window that the model may diverge in and the preceding saved state be suitable for

100
Figure 72: Details pane for the Calculation Activites Workflow item

Figure 73: Details pane for the Autosave item

re-starting the model from that point without saving an unnecessarily large number
of files. If this value is left as 0 then the autosave function is disabled. (Note that
if the frequency intervale is specified as iterations and not time steps that you have
specified a steady state and not a transient solver)
• Save Associated Case Files: Since it is possible, and typically probable, that
several hundred or thousand points in a solution history will be saved it is possible
to save a significant amount of hard drive space by limiting the number of files
saved. In models where the mesh doesn’t change, either through mesh motion or
adaptive refinement, you can elect to save the data file only when such changes
occur. However, if these changes occur it is necessary to save the case file as well
as the data file because the mesh will have changed and, if you did not, the data
saved would not match the mesh used for processing. Although it is redundant here
because the mesh will have changed each time the solution is saved, change this
option from Only If Modified to Each Time
• Append File Name with: This option allows you to define the identifier used at
the end of the automatic file names. While some users prefer to use the flow time,

101
using the time step number is advisable because it makes automation of external
post-processing via scripted operations simpler

Since the autosave operation can create a very large amount of data there are tools
provided to limit the output but these will not be covered here. Once all settings have
been made, click OK to confirm the autosave

57. The next item in the Calculation Activities window is called Execute Commands. This
is the item where you can define any commands that should be executed throughout
the solution using TUI commands. While there is a menu item (Adapt →Gradient...)
that would allow you to specify dynamic mesh adaption (i.e. mesh adaption that occurs
every few time steps or iterations), you can only define this to be done for one flow
variable. Since most models would require adaption by several variables, it is better
to define the adaption using the commands execution item. Extract this text file of
adaption commands and open it so that you can paste the values into Fluent:

• mark-with-gradients: This function identifies cells suitable for refinement based


on the selected gradient method and variable. The current file specifies the curvature
( curvature) method but it is more appropriate for a flow such as this to use the
gradient method ( space-gradient). The normalised thresholds are set as 0.3 for
coarsening (i.e. cells with gradients below 30% of the maximum are considered for
coarsening) and 0.7 for refinement (i.e. cells with gradients above 70% of the max-
imum are considered for refinement). Details of the other settings can be found in
the theory guide. Note that only cells added by adaptive refinement can be removed
by adaptive coarsening i.e. the original cells in the mesh won’t be coarsened further
• combine-registers: This command combines the lists of cell identifiers (registers)
created by the mark-with-gradients operations preceding it. The set of brackets at
the end of the line terminates the list of registers
• adapt-to-register: This is the command that will actually adapt the mesh based
on the gradients and variables. The number immediately following the command
is the register number produced by the register combination and is one more than
the highest previous register (i.e. there were four registers produced by 4 marking
operation (0 - 3) and so the combined register will be the fifth (4))

58. To define the executable commands click on the Create/Edit... button under the Ex-
ecutable Commands item in the details pane:

• Defined Commands: This specifies the number of commands to be executed. If


you do not change this number you will not be able to define execuatble commands.
Since we will be marking cells for adaption by two variables (subsection 7.6), comb-
ing those registers and then adapting we will need 4 commands

102
Figure 74: Specification of commands to be executed during simulation

• Active: You are required to check commands that must be executed as the default
is that these commands are not automatically included on definition. This also
allows you to de-activate commands which do not behave as expected or are no
longer necessary
• Name: While not essential for the execution of the commands, this makes it easier
to find problematic commands by description of the action especially if many are
named. It is recommended that the 4 commands here be named markpressure,
markvelocity, combine, and adapt respectively
• Every: This defines the frequency of the command execution, whether specified by
time steps or iterations. It is generally advised that you save your model before
adapting the mesh since the changed mesh may make the model unstable. Hence
the frequency of adaption is typically at least the same as the autosave frequency.
Set this value to 10
• When: This allows you to specify whether the command is executed based on
the number of elapsed iterations (default) or time steps. Since we want these
commands to be synchronised with the autosave operations, set this value to time
step
• Command: These are the actual commands that will be executed in the order
listed. Copy the relevant lines, with the described changes, from the provided file.
Once done the dialogue should resemble Figure 75

Figure 75: Commands for adaptive refinement of demonstration problem defined

103
Once you have checked all of the definitions, close the Execute Commands dialogue box
by clicking OK

59. The final commands which may need to be defined are for the export of an animation.
This is necessary at the setup of the model if Fluent is to produce the animation as the
individual frames must be exported at each time step of the model. This item will be
covered under post-processing (section 8)

60. The final step in setting up the simulation is initialising the run. Select the Run Cal-
culation item from the Workflow:

Figure 76: Details for starting the execution of a simulation

• Time Stepping Method: You can choose to use the Adaptive time stepping
method here. This changes the size of the time step depending on the stability of
the model, decreasing it as the model becomes less stable. The problem with such a
method is that results for particular times need to be interpolated. In general it is
simpler to use the Fixed time stepping method, where you specify the value of the
time step
• Options: There are some options here for advanced functions but these will not
be covered in this guide
• Time Step Size: As discussed in subsection 7.8, a suitable time step size for this
model would be 50 ms (0.05 s)
• Number of Time Steps: As discussed in subsection 7.8, the total number of
time steps required for this model is 60. However, to establish the initial flow field
properly leave this value as 0 initially. This means that the model will not step
forward in time while the initial calculation is made. In this way the values used
for calculating the first time step will be more accurate

104
• Max Iterations/Time Step: This is a value that you can only determine
through observation of the model. You can specify a very large number, since
the default value of 20 is generally too low for most models to sufficiently converge
per time step before advancing to the next. Thus, when you take the first time
step it is advised that you set a large number of iterations, say 200, and assess the
convergence from the various monitors setup. You can then adjust the maximum
number of time steps per model to the minimum value for acceptable convergence
per time step. Note that the residuals generally spike when changing from one
time step to the next due to interpolation errors. This jump is larger when mesh
adaption has taken place and so it is generally advised that the model be observed
until at least 1 time step after the first mesh adaption operation to be sure that a
suitable value has been specified

Once you have completed these steps, save the project

61. When you are ready to run the model click Calculate with the time step set to 0. This will
run the model without advancing the time to better resolve the flow field. If the number
of iterations completes without the residuals falling significantly, click Calculate again
and continue to do so until the residuals have settled at a suitably low value. Notice
also that the residual values are printed in the TUI window

Figure 77: Specification of commands to be executed during simulation

62. Once this has done change the number of time steps to 1 and click Calculate again. In
this step you will now determine a reasonable number of iterations per time step for
convergence. Notice the small jump in the residuals at the start of the new time step.
Although the residuals fluctuate somewhat, notice that there is a generally decreasing
trend If the residuals haven’t yet levelled off at the end of the specified number of iter-

105
Figure 78: First attempt at determining the minimum number of iterations per time step for
convergence

ations, change the time step number back to zero to allow the calculation to continue
and make note of the approximate number of iterations in this time step for that to
happen. From the residuals plotted it would seem that time step convergence occurs
after approximately 400 iterations

63. Set the maximum number of iterations per time step to 400 and the time step counter
to 10 so that you can observe the convergence of the model after the first mesh adaption
operation. Note that subsequent time steps may exhibit faster convergence than the first
and that you can possibly reduce the maximum number of iterations per time step after
you have confirmed the suitability following mesh adaption

64. Once you are satisfied that the settings are suitable for the continued run of the model,
change the time step counter to 49 (the remaining time steps of the 60 calculated earlier)
and click Calculate...

65. Since the execution of a model typically takes several hours to several days, it is not
necessary to remain connected to the application server all this time. Return to your
browser and hover your mouse over the Log Off and select the Disconnect option. This
will disconnect you from the server but leave your simulation running. If you choose to
log off then the simulation will be terminated!

This is the saved state of the model just before the start of execution, and with the animation
set up.

106
8 Post-processing in ANSYS Fluent

8.1 Numerical post-processing

One of the primary reasons for running a CFD simulation is that measures of the force acting
on a body are needed. As such, the majority of CFD results reported are either force values
or co-efficients thereof.

Under the Reports item in the Workflow select Forces from the Details pane and click Set
Up...

Figure 79: Setup pane for a force report

• Options: This allows you to determine the type of force report required. Typically you
will need to report forces so keep the default selection of Forces

• Direction Vector: This area changes depending on the type of report required. For a
force report you are required to enter the direction in which the force must be calculated,
effectively the unit vector of the force

• Wall Zones: These are the surfaces on which you wish to calculate the force that
is acting. There will typically be a series of wall items listed here is you have mesh
interfaces due to the mechanism by which these are implemented. Click the deselect all
button and then select only those bodies you require

• Print...: Displays the force report in the TUI window

• Write: Allows you to save the force report to a text file

Note that if you print the force report to the TUI window that it will display the force value
as well as the co-efficient of the force. If these co-efficients are incorrect but the forces aren’t
then you need to change the values of the Reference Values used to calculate the co-efficient
in the Report →Reference Values... menu

107
8.2 Graphical post-processing

Another common requirement of CFD models is the distributions of values around a body
or other feature. This is achieved in post-processing by the creation of line graphs of these
values. Under the Plots item in the Workflow select XY Plot from the Details pane and
click Set Up...

Figure 80: Setup pane for a line graph

• Options: Here you can choose to also write the graph data to a text file, useful for
plotting in another program such as Microsoft Excel

• Plot Direction: This allows you to specify the orientation of the independent (X Axis)
and dependent (Y Axis) as possibly necessary for easier interpretation

• Y Axis Function: This allows you to select the property you wish to plot by first
selecting the general category of the property (e.g. Pressure...) and then selecting the
particular form of the property (e.g. Static Pressure) that you wish to plot

• X Axis Function: This lets you choose whether the plot produced will be defined by
the distance along the direction vector or by the distance along the curve of the surface
in question

• Surfaces: This lets you select the surfaces at which the values will be plotted. In
general these should be line surfaces as the graphs produced are typically 2D

8.3 Advanced graphical post-processing

While force co-efficients and line diagrams are often the principal sort of information preferred
in reports, visualisations of flow fields are more useful for interpreting the physics resulting
in the values presented in those results. The most common sort of plot for this is the contour
plot, in which the flow field (or a section thereof) is coloured by the values of a variable.

Under the Graphics and Animations item in the Workflow select Contours from the Details
pane and click Set Up...

108
Figure 81: Setup pane for a contour plot

• Options - Filled: This options allows you to created flooded contour plots where all
regions are filled by colour. If this option is not selected then only lines of constant
value of each of the levels of the property being plotted will be drawn e.g. if you are
plotting pressure these will be isobars

• Options - Auto Range: This will determine the range for the model by the maximum
and minimum value of the property being plotted. Often you will need to limit this to
a particular range, either to increase the effective resolution of the plot or to ensure a
consistent range for a series of values. Generally you should uncheck this option, which
will allow you to alter the values given under Min and Max

• Options - Clip to Range: This option will leave as transparent those regions of the
domain where the values fall outside of the range defined by Min and Max. If this option
is unchecked then values below Min will all be filled with the colour for Min while values
above Max will be filled with that colour

• Options - Draw Mesh: This option allows you to include representations of the edges
or faces of the geometry of the model. Normally it is unnecessary to enable this option
but it is especially of use when plotting contours on planes taken as sections through 3D
flow fields

• Levels: This is the number of levels into which the range of property values between Min
and Max will be divided. The default value of 20 produces contour plots that generally
show clear bands of values. This can be increased to a maximum of 100, which typically
produces contour plots with almost continuous shading. Increasing this number also
increases the effective resolution of the property values in the plot since each band of
the plot represents a smaller portion of the defined range

109
• Contours of: This allows you to select the property you wish to plot by first selecting
the general category of the property (e.g. Pressure...) and then selecting the particular
form of the property (e.g. Static Pressure) that you wish to plot

• Surfaces: This allows you to specify the surfaces upon which you wish to plot the
contours. The default list is the zones defined in the Meshing operation but you can
create additional surfaces, either by geometric definition or by interpretation of other
fluid properties, via the New Surface menu. Note that with 2D plots that if you want
to display on all surfaces that you may need to deselect all surfaces to get filled plots

• Surface Types: This item allows you to simply select all surfaces of a particular type
upon which to display the contours defined

Once you have completely specified you contour plot, click Display to show it in the Display
Window. Note that this may take some time with very large meshes.

8.4 Setting up animations

While this needs to be done before executing the model, it cannot be accomplished with
understanding of the graphical post-processing methods covered here. Also, you need to
have some sense of the range of the variables you wish to plot in order to set this up as it
cannot be done after the simulation has run.

1. Before executing the simulation but after model initialisation select the Calculation
Activities item in the Workflow

2. Click the Create/Edit... button:

Figure 82: Setup pane for solution animations

110
• Animation Sequences: The number of animation sequences you wish to define.
Note that each uses considerable hard drive space and so these should be set up
conservatively. Set this value to 1
• Active: Due to the storage requirements of each the default is that defined anim-
ations are inactive and you must check each one that you wish to activate. Note
that you can only activate an animation after it is defined
• Name: You can name the animation as you wish. Since this will be an animation
of the velocity field around the vehicles, call this Velocity
• Every: This defines the frequency of the output of animation frames, whether in
time steps or iterations. Since you would want to create a detailed video of the
solution, set this value to 1
• When: Here you can choose between output frequency specified in time steps or
iterations. In most transient models output per time step is used since the number
of iterations may not necessary be synchronised with time steps. Set this value to
Time Step
• Define...: This allows you to specify the memory specification for and type of
animation that will be saved

3. Click the Define... button to specify the animation properties:

Figure 83: Definition pane for solution animations

• Storage Type: Here you can specify how the frames for animation are stored.
While they can all be stored In Memory for small models and numbers of frames,
this option is typically not suitable for most simulations. It is more common for
users to choose either the Metafile or PPM Image option. Metafiles can be edited
outside of Fluent if necessary so leave this default value
• Name: You can change the name of the files to be different to the series name if
you prefer. This name will be suffixed with a frame number as each file is saved
• Window: You need to define the window that you are using since the frames
are created by directly exporting the display window contents. Since the mesh

111
is displayed in window 1 and you have also set up that the residuals and force
monitors are in windows 2 and 3 respectively, change this value to 4 and click Set.
Notice that the contents of the Display Window change when you do so
• Storage Directory: You do not need to define this directory directly since Fluent
will place the output files in the same directory as the case and data files. To
ensure model robustness it is recommended that you specify this anyway by pasting
the case and data file directory into this space
• Display Type: This allows you to choose the actual type of graphics that will be
used to create the video. First you must select the general category, at which point
the configuration window will immediately open. Create a flooded contour plot of
velocity with 100 levels in the range 0 - 100 km.h-1 (0 - 27.7 m.s-1 ) as per 8.3

Once complete click OK to confirm the animation frame definition

4. Check the Active mark for the animation to ensure that it gets saved

5. Click OK to close animation definition pane

112
9 Iterative Model Development

Once you have run a model for the first time there are several checks that you need to do of
its quality aside from the physical results presented. Any of these may suggest changes to
the geometry, mesh, or solver settings used to improve the model. Thus, a model typically
requires several iterations to produce results of the desired quality.

9.1 Mesh Independence

Once a model is completed it is important to test the validity by checking the mesh inde-
pendence. This means that the results obtained do not depend on the type or resolution
of the mesh used. The simplest way to do this is to run successive model with half and
one quarter the cell size of the initial model. When the results of interest aren’t changing
within an acceptable tolerance (typically 1%) the model can be said to be mesh independent.
You can then use the coarsest mesh, or the general meshing process thereof for other related
geometries, that produced the mesh independent result for subsequent models. Similarly you
should also check the dependence of the model on the type of cells used (triangular versus
square, for example) to confirm that the results are independent.

9.2 Solver Independence

In the same way that the result produced should be independent of the mesh, the result should
be independent of the solver used within the limits of the solver. Thus, you cannot use an
inappropriate solver or turbulence model and expect to get similar results to a properly
formulated model but if these different settings are similarly suitable then the variation
between them should be explored. This is especially true of the specification of the turbulence
models used, where you should test several formulations out for the best result.

9.3 Validation & Verification

Validation and verification are the processes whereby the quality of a CFD result are assessed
and confirmed. While the one process, verification, can be considered a cross-check, the other,
validation, is an external confirmation of result quality. Before this it is always important
that you critically assess the quality of your own results in terms of physical feasibility and
reasonable values given the provided boundary conditions. For example, if you are modelling

113
a body travelling at Mach 1.5 and develop a region of Mach 25, there is likely a flaw in your
model.

9.3.1 Verification

This is the process of comparing the results of your model to results produced by another
model, either of your own or as published results. When comparing your results to another
model of your own you would typically need to compare the results produced by two com-
pletely independent solvers (e.g. Fluent and Star-CCM+) and find that the results are similar
within acceptable tolerance (somewhere between 1 and 5 %). Comparison to published res-
ults is typically with published numerical data produced by a third party i.e. simulation data
in the same or another solver to the one you used published for the same scenario.

9.3.2 Validation

This is the process of comparing your results with existing theory or experimental data.
Since these data are not numerical models they are considered to be a better standard for
actual behaviour. There is the caveat that theories may be incomplete and not fully capture
physical behaviour while experimental results may be from poorly-designed experiments (or
have other errors not immediately apparent). As always, balanced critical assessment of your
results in comparison to these data is essential.

114
10 High Performance Computing

A growing trend in Computational Fluid Dynamics (CFD) is the use of High Performance
Computing (HPC) to allow the modelling of systems intractable on desktop computers. A
typical example of this is the computation of the aerodynamics of passenger aircraft or details
of passenger car aerodynamics. If the model is expected to capture additional phenomena
such as acoustic the mesh size and hence memory requirement become too large for even the
most powerful desktop servers.

HPC is the ability of a solver to be deployed on a large server where the model may be
processed by tens, hundreds, or even thousands of parallelised processes. This is not implicit
in the formulation of most solvers and requires special functions such as the division of the
mesh into solution blocks (not necessarily the same as mesh blocks) and the communication of
information between these blocks. It should be apparent that dividing a model into too many
blocks could lead to it actually running slower and possibly having greater errors because
of the time taken to transfer information between blocks. Consequently users should spend
some time developing understanding of appropriate limits for model size and parallelisability.

The final concept of importance when considering the deployment of a model in an HPC
environment is that of scaleability. The developers of parallelised solvers typically undertake
a test in which they compare the time taken for a standard model to solve versus the number of
processes used. Most solvers have a limit at which the improvement in solution time with the
increase of solver processes decreases until there is no tangible benefit to further increasing the
number of solution processes. The linearity of this relationship and the maximum number of
solution processes are both metrics of the scaleability of a solver i.e. how well the performance
improvement scales with the number of solver processes. Most commercial solvers, such as
ANSYS Fluent, have scaleability giving linear improvement in solution time up into the
hundreds of solver processes but it should be borne in mind that this is not universally true.

In South Africa there is a national HPC cluster that has been developed by the Department
of Science and Technology and administered by the Council for Scientific and Industrial
Research (CSIR) called the CHPC. While most of the solvers running on the Centre for
High Performance Computing (CHPC) are non-commercial (because of the cost of licencing),
ANSYS has developed a system in South Africa where holders of chpc licences (such as
Universities) can use Fluent on the CHPC. This use does not cost anything in addition tot
he existing licence costs and is not limited to the number of licences used by the University.
Some of the Masters and PhD, and even fourth year, projects in the School of Mechanical,
Industrial, and Aeronautical Engineering make use of the CHPC due to the much faster
model run times.

115
Glossary

application server Typically a high volume computing server on which applications are
hosted for use by many users. Normally accessed via a browser portal or by remote
access application.

base object In a hierarchical model construction, an object which is required for the gen-
eration of another object, typically referred to as the dependent object, or child object.
Also known as a parent object.

characteristic length The dimension of an object within a flow field which is most pertinent
to generically characterising the behaviour e.g. the chord is used to define the Reynolds
number of flow passing over a wing as this is the dimension aligned with the flow.
Generally the dimension of an object aligned with a flow. The properties of flow fields
without implicit characteristic length are normally expressed per metre.

conformal In multi-block meshing, a mesh such that the nodes in adjacent mesh blocks are
coincident at the block boundary. Favoured for the minimisation of block boundary
interpolation truncation errors.

continuum A field in which properties vary continuously i.e. without discrete local proper-
ties.

convergent In CFD, a convergent solution is one which approaches an analytical or physical


solution with a steady decrease of error.

density Scalar measure of the mass of a substance for a particular volume thereof; inverse
of the specific mass.

dependent object In a hierarchical model construction, an object which is dependent upon


another object for its generation, typically referred to as the base object, or parent
object. Also known as a child object.

finite difference method A mathematical approach to the solution of derivative problems


by approximation of the derivatives by series of finite difference equations such as Taylor
series.

finite element method A mathematical approach to the solution of boundary value prob-
lems for partial differential equations by division of the computational domain into
smaller domains over which variational methods are applied to simplified (typically
lower-order) differential equations.

116
finite volume method A mathematical approach similar to the finite difference and finite
volume methods in which the computational domain is divided into sub-domains (known
as volumes or cells) in which volume integrals are calculated with divergence terms
matched to adjacent cells.

hypersonic Characterising a speed greater than the local speed of sound in which increased
thermodynamic effects (such as ionisation or chemical reactivity) may occur.

inertial Loosely speaking a reference frame that is not accelerating since the expression of
physical laws will depend on the nature of the acceleration.

Knudsen number Ratio of the Mean Free Path length to the characteristic length of a flow
field expressing the degree of continuity of the flow i.e. how closely it approximates a
continuum.

Mach number Ratio of the local transport speed (body or flow) to the local sound speed.

Mean Free Path length The average distance separating atoms / molecules of a sub-
stance.

mesh System of nodes and linkages thereof used in CFD to define the geometry of the system
being studied and as calculation points for the physical behaviour.

pressure Scalar quantity measuring the effect of interaction of objects with the random
motion of the particles with a fluid.

quiescent In fluid mechanics a flow field that is completely at rest.

resolution In CFD, resolution refers to the scale of the mesh versus the scale of the features
it depicts. Generally speaking, features (geometric or physical) smaller than the mesh
resolution at a particular point will not be resolved.

Reynolds number Ratio of the inertial and viscous forces within a fluid in motion (or
through which an object is passing).

Reynolds stress A term used to describe the fluctuating portion of the total stress tensor
in a fluid separated by the averaging process normally used in RANS methods.

specific gas constant Gas constant for a particular gas related to the universal gas constant
by division by the molar mass of the gas.

steady state In reference to the temporal specification of a CFD model, a model in which
time-dependent effects are not directly resolved but rather averaged.

117
subsonic Characterising a speed less than the local speed of sound.

supersonic Characterising a speed greater than the local speed of sound.

temperature Scalar quantity measuring of the total atomic / molecular energy state of a
substance.

time step The length of time by which a transient solution is incrementally advanced from
initial time until completion of the required simulation period.

transient In reference to the temporal specification of a CFD model, a model in which time-
dependent effects are directly resolved by quasi-steady approximation in which the flow
field for each time step is resolved dependent on previous time steps and changes in
boundary conditions.

transonic Characterising a speed less than the local speed of sound but in which local
phenomenon speeds may be greater than sound speed.

viscosity The property of a fluid describing the shear force that would be required to induce
a particular flow.

118

You might also like