You are on page 1of 88

Master’s

Degree in Numerical Simulation


in Engineering with ANSYS
4TH EDITION

Chapter 4: Fundamentals of
Finite Volume Methods for CFD

Module: Fundamentals and Application


of Computational Fluid Dynamics

Benigno J. Lázaro
CHAPTER 4

Fundamentals of Finite Volume


Methods for CFD

Benigno J. Lázaro
Technical University of Madrid, Spain

FUNDAMENTALS AND APPLICATION OF


COMPUTATIONAL FLUID DYNAMICS
MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

All rights reserved. No part of this publication may be reproduced, stored


in a database or retrieval system, or published in any form or in any way
without the prior written permission of the authors.

Copyright  Benigno J. Lázaro, 2016


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

CONTENTS
4 FUNDAMENTALS OF FINITE VOLUME METHODS FOR CFD
4.1. Chapter contents and learning strategy 1
4.2. Numerical integration of the Navier-Stokes equations 3
4.3. Properties of numerical schemes 7
4.4. The unsteady convection-diffusion scalar equation 9
4.5. Discretization of diffusion and convective fluxes 13
4.5.1. Diffusion flux discretization 13
4.5.1.1. Green-Gauss cell based gradient calculation 15
4.5.1.2. Least squared cell gradient calculation 17
4.5.2. Convective flux discretization 18
4.5.2.1. Centered interpolation 19
4.5.2.2. First order upwind interpolation 20
4.5.2.3. Second order upwind interpolation 21
4.5.2.4. Power law interpolation 21
4.5.2.5. QUICK interpolation 22
4.5.2.6. MUSCL interpolation 23
4.5.2.7. Selection of convective discretization scheme 23
4.5.3. Boundary conditions for the convection-diffusion scalar equation 23
4.6. Numerical integration of the steady convection-diffusion equation 24
4.6.1. Jacobi algorithm 27
4.6.2. Gauss-Seidel algorithm 27
4.6.3. SOR algorithm 27
4.6.4. Application to one dimensional case 29
4.7. Temporal discretization of the unsteady convection-diffusion equation 32
4.8. Consistency, stability, and convergence 38
4.9. Numerical integration of the convection-diffusion equation in 3D geometries 44
4.10. Numerical schemes for the Navier-Stokes equations 45
4.11. Discretization of the momentum equation in collocated and non-collocated flow solvers 47
4.12. Pressure based, incompressible flow solver. The SIMPLE scheme 49
4.13. Modified pressure-velocity coupling algorithms for pressure based solvers 56
4.13.1. SIMPLEC 56
4.13.2. PISO 58
4.14. Extension of staggered, pressure based schemes to 3D flows 59
4.15. Collocated, pressure based, incompressible flow solvers 62
4.16. Density based solvers for compressible flow 66
4.17. Inlet/outlet boundary conditions solvers 69
4.17.1. Incompressible flow 70
4.17.2. Compressible flow 71

REFERENCES 80

Contents I
MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

4.1 CHAPTER CONTENTS AND LEARNING STRATEGY

The Navier-Stokes equations introduced in chapter 2 are originally written as conservation laws over
an arbitrary, closed control volume. If the flow variables are smooth, the equations can be transformed
into a set of partial differential equations. In this sense, the original integral formulation is more
general, since it admits the existence of flow solutions with discontinuities. This possibility does in
fact occur in Euler flow, for example when it supports shock waves. The integral form of the equations
is adequate to manage these situations, as it was done when obtaining the jump conditions for the
flow variables across a shock wave. In this chapter will be learn how to perform the discretization of
the Navier-Stokes equations, devising a numerical scheme to integrate them. In this chapter we will
introduce the basic elements of the numerical discretization and solution of the Navier-Stokes
equations. We will use a formulation, called the finite volume method (FVM) based on the integral
form of the equations. The computer program that implements the numerical scheme is called a CFD
solver. The application side of this chapter will focus on introducing the CFD suite ANSYS FLUENT,
which incorporates different solvers that can be used to optimally engage a wide variety of different
flow problems.
Section Title Ranking Comments
4.2 Discretization of the Navier- Required Introduction of strategies to numerically solve
Stokes Equations the Navier-Stokes equations..
4.3 Properties of Numerical Required Characteristics of numerical schemes for
Schemes conservation equations.
4.4 The Unsteady Convection- Required Introduction of scalar equation to be used to
Diffusion Scalar Equation model a generic conservation equation.
4.5 Discretization of Diffusion Required Description of numerical techniques to
and Convective Fluxes discretize the diffusion and convective terms
in the model equation.
4.6 Numerical Integration of the Required Presentation of numerical schemes for the
Steady Convection-Diffusion integration of the steady convection-diffusion
Equation transport equation.
4.7 Temporal Discretization for Required Numerical scheme to discretize the temporal
the Unsteady Convection- term in the model equation.
Diffusion Equation
4.8 Consistency, Stability and Required Detailed description of properties
Convergence characterizing the numerical schemes.
4.9 3D Extension of the Recommended Numerical discretization techniques for
Convection-Diffusion general three-dimensional cases.
Equation
4.10 Numerical Schemes for the Recommended Introduction of numerical schemes for the
Navier-Stokes Equations Navier-Stokes equations.
4.11 Discretization of the Required Basic techniques for the discretization of the
Momentum Equation momentum equation.
4.12 Pressure Based Schemes. Required Introduction to momentum-continuity
The SIMPLE Algorithm coupling schemes for incompressible flow,
pressure based schemes.

Table 4.1 Contents of Theory Chapter 4.

Fundamentals and Application of Computational Fluid Dynamics 1


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

4.13 Modified Algorithms for Recommended Alternative coupling schemes for


Pressure Based Schemes incompressible flow, pressure based schemes
4.14 Staggered Pressure Based Recommended Generalization of pressure based schemes for
Schemes for Arbitrary incompressible 3 D flow problems.
Geometries
4.15 Collocated Pressure Based Recommended Brief description of collocated, pressure based
Schemes schemes for incompressible flows.
4.16 Density Based Schemes Recommended Introduction to density based schemes for
compressible flow
4.17 Inlet/Outlet Boundary Required Numerical implementation of inlet/outlet
Conditions boundary conditions.

Table 4.1 (continued) Contents of Theory Chapter 4.


The contents of this theory chapter are summarized in table 4.1. A brief description of different
strategies that can be adopted to discretize the Navier-Stokes equations will be first presented. It is
followed by a discussion on the properties that can be used to characterize a numerical scheme. The
unsteady convection-diffusion equation will be introduced next. This can be taken as a model
equation to describe the different conservation principles that govern fluid flow. A substantial effort
is dedicated in this chapter to analyze its discretization. This is performed in sections 4.5 to 4.9, where
the basic discretization schemes for the convective, diffusion, and unsteady terms as well as the basic
properties of these schemes are presented. This part of the chapter should be read carefully, since it
contains some of the basic techniques used in the numerical solution of the Navier-Stokes equations.
Sections 4.11 and 4.12 present the basic algorithm used to solve the momentum and continuity
equations for incompressible flow, in which is known as the SIMPLE algorithm. Some of the solvers
included in ANSYS FLUENT are based on variants of this algorithm, and thus these sections are of
interest to get at least a basic knowledge of how the solver works. Sections 4.13 to 4.16 introduce
variants of the SIMPLE algorithm and also another family of solvers, the density based solvers, used
in compressible flow problems. Finally, section 4.17 deals with the numerical implementation of
inlet/outlet boundary conditions. This is also an important subject, since the accuracy of a CFD
computation can strongly depend on how the boundary conditions are set.
The contents of the application chapter appear summarized in table 4.2. It includes three
presentations and six tutorials. The first presentation, AC04.1 Solver Settings, describes the basic
options available within the pressure based solver included in ANSYS FLUENT. It should be read
carefully, since it contains elements that will be systematically used in its use. The presentation
AC04.2 deals with the practical specification of boundary conditions for a given flow problem.
Connecting with the comments introduced above, this presentation is also of significant interest and
should be followed carefully. The third presentation, AC04.3, deals with the basic post-processing
capabilities available within the CFD suite ANSYS FLUENT. The results produced in a CFD
simulation are massive, and its practical use requires summarizing them looking for specific data such
as the force over bodies or the pressure drop between two prescribed control surfaces. All this implies
performing post-processing operations on the CFD results. Presentation AC04.3 will introduce some
of the capabilities included in ANSYS FLUENT to carry out these tasks, which have clear
engineering and technological relevance. The six tutorials included in the application chapter are
intended to put into practice some of the aspects covered in the different presentations. The first two
review the different settings that can be selected in the pressure based solver included in FLUENT.
Tutorial AT04.1b is of particular relevance, as it explores different choices available for a given
aspect of the numerical scheme. Two tutorials have been included linked to presentation AC04.2.

2 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

Tutorial AT4.2a is of significant interest, as it explores the impact of proper boundary condition
setting, whereas AT4.2b deals with an important capability available within ANSYS FLUENT;
namely, the non-conformal mesh interface handling, which allows to simply connect different
computational domains to simulate complex geometry problems, but can be completed later in the
course. Finally, two tutorials have also been included in this chapter linked to the post-processing
presentation. Tutorial AT04.3a is of particular interest, since it presents commonly used post-
processing options.
Section Title Ranking Comments
AC04.1 Solver Settings Required Introduction to solvers and their settings included
in FLUENT.
AT04.1a Vortex Shedding Required CFD simulation of the Karman’s vortex street
behind a circular cylinder.
AT04.1b Solution Methods Required Influence of solver settings on the CFD simulation
of an intake manifold.
AC04.2 Cell Zones and Required Specification of fluid properties and boundary
Boundary Conditions conditions in FLUENT.
AT04.2a Airfoil Required CFD simulation of the flow around an aerodynamic
profile
AT04.2b Mesh Interfaces Recommended Use of non-conformal mesh interface to perform
CFD simulations in complex geometry problems.
AC04.3 Post-processing Required Review of FLUENT post-processing tools included
in ANSYS workbench.
AT04.3a Fire in a Garage Required Post-processing tools applied to a CFD simulation
of a fire in a closed 3D domain.
AT04.3b Rendering Racing Recommended Realistic rendering of results in the numerical
Car simulation of flow around a racing car.

Table 4.2 Contents of Application Chapter 4.

4.2 NUMERICAL INTEGRATION OF THE NAVIER-STOKES EQUATIONS

The discretization of the Navier-Stokes equations can be achieved in a number of ways. The
starting point is the selected formulation of the equations. For the Navier-Stokes equations, three main
formulations have been used [1]:
a) Differential formulation. The Navier-Stokes equations are written as a system of partial
differential equations. The discretization of the equations can proceed in a number of ways.
In finite difference schemes (FDM), the solution is approximated by the values taken at
specific points of a spatial grid. Using these values, the discretization of the equations seeks
to enforce the system of differential equations at the grid points. In spectral methods, the
solution is expressed as a combination of base functions whose coefficients are obtained by
enforcing the original differential equations in a number of grid points.
b) Weak formulation. It is based on applying a variational principle to the Navier-Stokes
equations. The differential equations are multiplied by base functions and integrated over the
whole computational domain. This transformation defines a norm, and the weak formulation
effectively finds an approximate solution by enforcing the differential equations projected on

Fundamentals and Application of Computational Fluid Dynamics 3


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

a set of base functions. The weak formulation is used by discretizations based on the finite
element approach (FEM).
c) Integral formulation. The equations are written in integral form around a generic control
volume. The discretization proceeds by dividing the complete flow domain in a number of
disjoint control volumes and enforcing the integral formulation in each of them. This approach
is the one used by the finite volume method (FVM).
The numerical solution of generic, complex technological flow problems has been mainly based
on the integral formulation approach and more specifically on the FVM implementation. There is a
number of reasons behind this choice, including:
1) Ability to solve complex geometry flows. By using the integral formulation in an arbitrary
control volume, the finite volume method is optimally suited to be implemented in complex
mesh topologies, with no specific mesh organization constraints. This means that numerical
schemes using the finite volume approach can be applied to grids having no organization
pattern. These mesh topologies are called unstructured grids. They can incorporate different
element or control volume types (hexahedron, tetrahedron, prismatic...), which are frequently
used when solving complex geometry flow problems.
2) Automatic enforcement of properties in the Navier-Stokes equations. The finite volume
approach automatically enforces highly desired properties of the Navier-Stokes equations.
Specifically, it allows to naturally enforce conservative properties of the Navier-Stokes
equations linked to interactions taking place at the surfaces of the control volumes.
3) Complex physics implementation. The finite volume method accepts a relatively simple
incorporation of complex physics models, such as turbulent flow, multiphase, or combustion
capabilites.
In the FVM approach, the domain of study is divided in a finite number of disjoint elemental
volumes called cells (figure 4.1). The domain is then composed by a set of cells called the mesh or
grid of cells. In three-dimensional applications, each cell is composed by a volume limited by a cell
surface that is made up of planar elements called faces. In two-dimensional applications the cells
become plane elements and the faces become straight line segments.

,2  ,1 ,2 ,3

,3

,1

Figure 4.1 Spatial discretization in FVM. Left: complete fluid domain. Right: finite volume cell identified by
index in the complete mesh of cells. Cells centers are represented by black dots.
Unknown variables are attached to each cell, forming the mesh data structure. Variables can be
specified at the cell centers, at the center of the faces, or at the vertices of the faces. When all the
unknown variables are specified at given points within the cell, the resulting FVM numerical scheme
is said to be . When different variables are specified at different points of the cell the FVM
numerical scheme is said to be non- . Collocated FVM schemes can either be cell-centered

4 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

schemes, where all the variables are stored at the center of the cell, or cell-vertex schemes, where all
the variables are stored at the vertices of the faces. The choice to select a collocated or a non-
collocated discretization depends on a number of aspects. In CFD, non-collocated schemes are used
where the scalar fluid variables (pressure, density, temperature, etc) are defined at the cell centers and
the velocity vector is defined at the cell faces. This variable storage option offers numerical
advantages, but it is not optimal to handle general, complex geometries. Cell-centered collocated
schemes require incorporating numerical stabilization terms in the discretized equations, but they are
able to handle general, complex geometries. Figure 4.2 shows an example of FVM variable
specification in CFD applications for a non-collocated, two-dimensional incompressible case, and for
a cell centered, two-dimensional compressible case.

Figure 4.2 Example of specification of fluid variables in FVM. Left: non-collocated, incompressible, two-
dimensional scheme, with , velocity defined at the faces whose normal unit vector is respectively aligned
in the , directions. Right: collocated, cell-centered, compressible FVM scheme.
Once that the domain has been partitioned in the mesh of cells, the integral conservation equations
can be written for the volume linked to each cell. Since the unknown variables are defined only at
discrete points within the mesh, a discretized form of the equations is obtained. The discretized
conservation equations are algebraic equations written for the unknown variables defined in each
cell. For the Navier-Stokes equations and collocated, cell centered FVM schemes each cell provides
five algebraic equations: 1 for mass (continuity); 3 for the different momentum components, and 1
for the energy or the total energy. Therefore it is feasible to define, for each cell, 5 fluid variables,
which can be taken as the three components of momentum, the density, and the total energy for a
compressible flow case, or the three components of velocity, the pressure, and the temperature for
incompressible flows. Operating in this way, and assuming that appropriate boundary conditions are
given, the number of unknowns will match the number of algebraic equations.

Figure 4.3 Staggered grids defined in non-collocated FVM schemes. Left: element used when discretizing the
equations to solve the variables defined in the primary cell's centers. Right: staggered element used when
discretizing the equations to solve the variables defined at the primary cell's faces.
In collocated schemes the same control volume will be used to implement the mass, momentum
and energy conservation equations. In non-collocated schemes different control volumes must be

Fundamentals and Application of Computational Fluid Dynamics 5


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

defined for the scalar magnitudes and for the velocity components. This leads to the concept of
staggered grids in non-collocated schemes (figure 4.3).
For CFD problems, the Navier-Stokes equations written in integral form can be expressed as a
transport equation for generic magnitudes , as given by equation (2.92) in chapter 2. Considering
that variable  is defined at the center of the cells, for an element such as in figure 4.1, the
equations become:
  ,  ,  ∙   ,  ∙ . (4.1)

Assuming that the fluxes are continuous, differentiable functions, equation (4.1) is equivalent to a
partial differential equation:
 ∙ ,  ,   ∙ ,  (4.2)

If volume of figure 4.1, limited by surface  , is fixed to the coordinate system, the
discretization of equation (4.1) becomes:
 ∑  ,  ,  ∙  ∑  ,  ∙ . (4.3)

The summation in the approximation to the surface integrals is carried out over the different
elemental faces composing  , and the index denotes face values.
Important aspects of FVM for CFD problems are the selection of variables to describe the fluid
state, and where those variables are stored in the discretized mesh. Regarding the first aspect, there
are two sets of variables that are particularly relevant to solve general CFD problems [2]:
a) Pressure based FVM. In these schemes the selected fluid variables are the pressure, the
velocity components, and the temperature. For general three-dimensional problems described
in Cartesian coordinates the fluid variable set becomes , , , , . These schemes were
originally developed to solve incompressible flow, and this is why the density does not appear
in the variable set. With time, pressure based schemes have evolved and are also able to
manage compressible flow problems, as long as the effects of compressibility are not too
strong.
b) Density based FVM. The selected flow variables in this case are the density, the momentum
per unit volume, and the total energy per unit volume , , , , . This choice is the
preferred one when describing compressible flow, but with some modifications it can also be
effective to solve incompressible, steady flow problems.
Although both choices can be used to solve incompressible and compressible flow situations, we
will focus in pressure based schemes for describing incompressible flows and in density based
schemes for describing compressible flows.
With respect to the location where the variables are stored, as it has been indicated different choices
are possible, giving rise to collocated and non-collocated schemes. Non collocated schemes imply
the use of staggered grids. The main drawback of the staggered grid approach is the difficulty to
handle a general mesh topology where the cells do not follow an ordered pattern. When the cells can
be organized along a well established pattern described by three natural numbers , , the mesh is
said to be structured. When the cells do not follow a well organized pattern and may even include
different element types the resulting mesh is known as unstructured, as the one shown in figure 4.1.
The difficulty of staggered mesh approaches to handle an unstructured grid topology make them
inappropriate to describe general flow problems, but they offer some advantages during the process
of discretizing the equations. Within collocated variable storage, cell centered schemes are preferred

6 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

because they give the highest flexibility to handle complex mesh topology. In FVM applied to CFD
problems, and both for collocated and non-collocated schemes, scalar fluid variables such as the
temperature or the total energy are stored at the cell centers. Therefore, a scalar variable is an optimal
choice to introduce the discretization techniques used in FVM for CFD problems.
Taking into account these considerations, in the first part of this chapter we will concentrate in
discretizing and solving the unsteady convection-diffusion transport equation written for a scalar
magnitude, taking the one-directional problem as model case. As seen in equations (4.1) to (4.3),
unsteady convection-diffusion transport equations play a fundamental role in CFD schemes.
Furthermore, the analysis of the one-dimensional case will naturally allow introducing properties to
characterize the numerical implementation of FVM, including consistency, stability, and
convergence. Some practical examples of the discretization of the scalar transport equation will be
given to illustrate different concepts. The extension to two and three dimensional cases will be also
briefly discussed. Finally the discretization techniques used with the scalar transport equation will be
applied to lay down the basic elements for the numerical integration of the Navier-Stokes equations.

4.3 PROPERTIES OF NUMERICAL SCHEMES

The implementation of the FVM for the unsteady convection-diffusion and, more generally, for the
Navier-Stokes equations is achieved by specifying a numerical scheme where the solution is obtained
in a temporally and spatially discretized grid of points. The quality of the solution is based on the
ability of the numerical scheme to correctly reproduce the underlying set of conservation equations.
The quantitative assessment of this quality is performed by introducing a number of properties that
characterize the numerical scheme. Specifically:
a) Consistency. An approximation included in a numerical scheme is said to be consistent if it
becomes exact as the grid spacing (spatial or temporal) tends to zero. Consider for example a
cell-centered scheme and the evaluation of the scalar value at the faces of the FVM cells. For
the one dimensional case, the scalar field around side , east of cell is shown in figure 4.4.


 ,

 

Figure 4.4 Truncation error for linearly interpolated value at face .


Assuming that the distances ∆ and ∆ between the cell centers , and face are the
same, ∆ ∆ ∆ , a linear interpolation for  gives:
 
 ,
. (4.4)

Expanding the variable  around its exact value at the east face  , if follows:
  ,

∆ . (4.5)

Fundamentals and Application of Computational Fluid Dynamics 7


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

Thus, the truncation error   , of the linear approximation is proportional to ∆ , and


therefore the linear interpolation is consistent, since its truncation error tends to zero as ∆ →
0. An approximation whose truncation error behaves as ∆ is said to be – . Therefore,
the linear interpolation in a uniform mesh is second order, and 0 is required for the
approximation to be constistent. In principle, the numerical scheme should be constructed
with all the terms having similar order, although other considerations can lead to different
orders in the different terms being approximated.
b) Stability. A numerical scheme is said to be stable if it does not amplify the errors introduced
during the numerical resolution process. In unsteady schemes, the stability property ensures
that the numerical solution will be bounded if the exact solution is also bounded. For steady
schemes based on an iterative procedure, the stability property will ensure that the solution
will not diverge. Typically, the stability of a discretization scheme is characterized by
linearizing it without paying attention to the boundary condition implementation. For
consistent discretizations, the stability characteristics of a numerical scheme depend on the
temporal/spatial mesh sizes. The most common approach for stability analysis is the von
Neumann method which will be described in section 4.8, where stability limits are established
as a function of the temporal and/or spatial mesh sizes.
c) Convergence. This property refers to the condition requiring that a numerical solution to a
system of equations should approach the exact solution of the equations as the spatial and
temporal grid sizes tend to zero. For linear systems, the Lax equivalence theorem [3]
establishes that, for a scheme that satisfies consistency, stability is a necessary and sufficient
condition for convergence. Convergence and stability for non linear systems such as the
Navier-Stokes equations can be very dependent on boundary conditions and in this case the
convergence is typically analyzed by performing grid sensitivity studies, where the solution
in successively refined grids is obtained to check if a grid independent solution can be
achieved. In these cases the rate of convergence for sufficiently small grid sizes is governed
by the largest component of the truncation error.
d) Conservation. A numerical scheme is said to be conservative if it ensures both locally and
globally the underlying conservation laws. For example, for the conservation of mass, this
means that if no mass is added inside the domain, the total mass of fluid entering the domain
should equal the amount that is leaving it. This is equivalent to saying that the continuity
equation is fulfilled at the complete numerical domain level. Numerical schemes using FVM
automatically enforce this property.
e) Boundedness. This property refers to limits that the flow field solution should comply with.
For example, the temperature or density fields should be always positive. The boundedness
of a numerical scheme depends both on the way in which discretizations are implemented and
on the size of the grid. Typically, schemes of order higher than one cannot guarantee this
property. As a result, high order discretizations are prone to generate over and undershoots of
the solution, and the way to control them is by refining the mesh. However, a poor
boundedness behavior may indicate that the numerical scheme has stability and convergence
problems, and therefore they should be avoided.
f) Realizability. This property relates to the physical models included in the numerical schemes,
intended to reproduce in a simple way complex physical phenomena. It occurs, for example,
when resolving turbulent or reacting flows, where simplified physical models of complex
phenomena must be introduced at the equation level. The realizability property is related to
the ability from the model and its numerical implementation to develop a physically realistic

8 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

solution. Specific details of realizability will be discussed in chapter 5, where an introduction


to turbulence modeling is discussed.
g) Transportiveness. It is a property that becomes relevant to the Navier-Stokes equations, where
and convective-diffusive balance plays an important role. The transportiveness can be defined
as the ability of a numerical scheme to incorporate the correct regions of influence in the
convective-diffusive balance. In the steady, one dimensional convection-diffusion equation,
for example, the limit → 0 implies that the solution at a particular point is affected by
perturbations introduced both upstream and downstream from that specific point. This occurs
since the molecular diffusion term is dominant, and it is an isotropic transport mechanism,
acting both in the upstream and in downstream directions. In the opposite case, → ∞, the
solution at one particular point is only affected by perturbations introduced upstream of the
point. The numerical scheme should respect these regions of influence as a function of the
local flow parameters.
h) Accuracy. This is the property of a numerical scheme to produce solutions that are close to
ones of the physical problem that it is simulating. In the numerical simulation of a physical
problem, three different mechanisms generating errors can be listed:
 Modeling errors. Linked to the simplifications in the physical models used to
simulate the flow, such as those due to the turbulence model being used.
 Discretization errors. Defined as the difference between the exact solution of the
differential equations that result after introducing the physical models and the
exact solution of the algebraic equations obtained with the implementation of the
numerical scheme.
 Convergence errors. Defined as the difference between the exact solution of the
algebraic equations that result after discretization, and the approximate solution
given by the iterative algorithm used to resolve them.
Sometimes, different errors may compensate, which can lead to situations where the
numerical solution agrees with the physical one in a coarser grid better than it does in a refined
one. Modeling errors occur not only from the simplification of the physical models, but also
from the simplification of the boundary conditions implemented in a specific problem. The
modeling errors are normally not known in advance, and the only way to characterize them is
by comparing solutions free from discretization and convergence errors with experimental
data. The discretization errors depend on the grid size, and the way to characterize them is by
performing grid sensitivity analysis, where the problem is solved in increasingly refined
meshes till grid independent results are obtained. Finally quantification of convergence errors
is usually performed by computation of residuals, which indicate the relative change of the
solution as the computation advances. A pre-established value of the convergence error can
be fixed and monitoring of the residuals can be used to ensure that an iterative solution has
achieved the given convergence error value.

4.4 THE UNSTEADY CONVECTION-DIFFUSION SCALAR EQUATION

The basic unsteady convection-diffusion transport equation for a scalar  is a simplified version of
the conservation equation expressed in (4.1), where the pressure flux and the volumetric source term
are set equal to zero, ,  0,  0. It results:

Fundamentals and Application of Computational Fluid Dynamics 9


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

 ,  ∙ ,  ∙ , (4.6)

with:

,   , ,    . (4.7)
For continuous convective and diffusion fluxes, expression (4.4) accepts an equivalent, differential
form which is obtained after eliminating the pressure flux and the source terms from equation (4.2):
 ∙  ∙   (4.8)

In (4.7)-(4.8)  represents the molecular transport or diffusion coefficient for , and both the
density and velocity fields , are assumed to be known. When this occurs and when the diffusion
coefficient can be considered constant, the unsteady convection-diffusion transport equation becomes
linear in . Observe that the continuity equation directly follows from equation (4.4) setting  1
and, since 1 0, , 0. Furthermore, selecting  in equation (4.6) results in the internal
energy equation for incompressible flow under negligible contribution from the Rayleigh dissipation
function  .
The most simple domain where equation (4.6) can be applied is that of a variable area, almost one-
directional duct flow whose axis is aligned along the direction (figure 4.5). In this case the velocity
vector is essentially aligned along the axis of the duct:
. (4.9)
The quasi one-directional geometry together with the imposed boundary conditions at the
inlet/outlet planes and at the duct's wall can be specified to generate small transversal non-
uniformities of the flow magnitudes:
∆ , ⁄ ≪ 1, ∆ , ⁄ ≪ 1, ∆ , ⁄ ≪ 1 . (4.10)
where ∆ . , denotes changes of a magnitude found in any direction perpendicular to the duct's axis.

 ∆  ,

   

 ,
 ,

Figure 4.5 Quasi one-directional duct flow. Arbitrary control volume linked to cell . Neighbor cells
situated to the west and east of are respectively denoted by capital letters , . East and west faces of cell
are respectively referred to as  , ,  , .
The convective flux at the solid duct's wall  is zero since there ∙ 0, with representing
the unit vector normal to the duct's wall. We will also assume that the gradient of  normal to the
duct's wall vanishes, so that  ∙ 0 as well. This constraint is needed to support expressions

10 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

(4.10), and will allow writing  only as a function of and ,   , . If  is linked to the internal
energy, the condition  ∙ 0 implies that the duct has adiabatic walls.
We can now apply the integral conservation equation for  to the control volume attached to
element or cell given in figure 4.5. It is limited by a control surface  . It includes the east  ,
and west surfaces  , , defined as duct sections, separated by a distance ∆ , and the
portion of the duct wall surface  , :
  ,  ,  , . (4.11)
As already stated, both the convective and diffusive fluxes of  vanish at the duct's wall. In
addition:
∙ 1, ∙ 1, (4.12)
where , respectively denote the unit vectors normal to surfaces  , ,  , , and exterior to .
Taking into account these expressions and the transversal quasi-uniformity conditions (4.8), equation
(4.6) applied to the control volume of figure 4.4 becomes:
 
     , (4.13)

with . , . denoting values respectively found at surfaces  , ,  , . Observe that, in the limit
∆ → 0 equation (4.13) becomes:
 
  , (4.14)

which is the differential form of the unsteady, one-dimensional convection-diffusion equation.


Equation (4.13) or (4.14) indicates that the determination of  requires specifying the initial scalar
field:
0:  , 0  . (4.15)

Furthermore, equation (4.14) indicates that two boundary conditions in must be prescribed. The
most general form of appropriate boundary conditions for this equation is to write two expressions of
the form , ⁄ 0, , ⁄ 0 at the boundaries of the flow domain. This specification
includes typically found cases such as   (Dirichet boundary condition) and ⁄ ′
(Neumann boundary condition).
The specification of the boundary conditions and of the problem geometry and parameters allow
setting the problem scales and therefore describing it in non-dimensional form. For example, in a
finite domain of length , the specification of Dirichlet boundary conditions at both ends of the
domain is written as:
0:   ; :   . (4.16)

In this case, assuming characteristic values for the area duct, , a constant diffusion coefficient
 , and characteristic density and velocity values respectively given by , , equation (4.14) can
be written in dimensionless form by introducing:
 ⁄ , ⁄ ,  ,     , , ⁄ ,
, ⁄  ⁄ . (4.17)
Equation (4.14) becomes:

Fundamentals and Application of Computational Fluid Dynamics 11


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

 
 
  
, (4.18)

with ⁄ being the Péclet number, which measures the ratio between convective and
diffusion effects linked to the transport of , both calculated using a length scale equal to .
For the simplified case where , , , it results 1 and
equation (4.18) with initial and boundary conditions given by expressions (4.15)-(4.16) becomes:
  
, (4.19)
  

0:  , 0   ;  0:  0;  1:  1, (4.20)
As the selected boundary conditions included in (4.20) do not depend on time, equation (4.19)
admits a steady state solution. For an arbitrary initial state   , the steady state solution is achieved
after an unsteady evolution having characteristic transient time ~ 1, . The steady state
solution is given by:
 
, (4.21)
  

 0:  0;  1:  1, (4.22)
which can be integrated to give:

 , , (4.23)

The steady solution (4.23) has been represented in figure 4.6.

1.0

0.8

0.6

0.4 Pe=-10
Pe=0.01
Pe=10
0.2

0.0
0.0 0.2 0.4 0.6 0.8  1.0

Figure 4.6 Steady state solution to the convection-diffusion equation (4.21) with boundary conditions (4.22)
and different Péclet numbers.
The numerical solution of the scalar, unsteady, convection-diffusion equation (4.13) written for
cell volume introduces a number of aspects that must be addressed, including:
 
a) Discretization of the diffusion flux, i.e., proposing expressions for  ,  .
b) Discretization of the convective flux, i.e., proposing expressions for  ,  .
c) Discretization of the unsteady term, i.e., proposing expressions for  .
d) Implementation of the initial and boundary conditions.

12 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

e) Constructing an integration algorithm to solve the system of algebraic equations resulting after
a) to d) have been completed. Separated integration algorithms will be proposed for the steady
and unsteady forms of the equation.
In the next sections we will discuss ways to deal with items a) to e), using as guide the one-
dimensional convection-diffusion equation but anticipating its extension to general two and three-
dimensional geometries with unstructured grid organization. Previous to that, relevant properties of
the numerical schemes included in the FVM formulation will be introduced.

4.5 DISCRETIZATION OF DIFFUSION AND COVECTIVE FLUXES

Both the convection and diffusion terms that appear in the integral form of the unsteady convection-
diffusion equation appear as surface integrals of diffusion and convective fluxes extended to the
boundary of each one of the finite volumes or cells in which computational domain is divided. The
nature of these fluxes is essentially different. Diffusion fluxes express a molecular transport
mechanism that, due to the isotropic nature of the molecular structure, is acting in all spatial
directions. On the other hand convective fluxes express transport due to the fluid motion, and
therefore has a clear non-isotropic character attached to the movement of the fluid. Resulting from
this different nature, the discretization of diffusion and convective fluxes require different treatment,
and therefore their description will be treated separately.

4.5.1 Diffusion Flux Discretization


Diffusion fluxes with a constant diffusion coefficient macroscopically express an isotropic molecular
transport mechanism. Resulting from their isotropic nature, the discretization of diffusion fluxes is
always carried out using centered interpolation algorithms, since this ensures the proper region of
influence of the underlying isotropic mechanism. For one-dimensional cases, the diffusion flux
appearing in equation (4.5) requires discretizing terms such as ⁄ , ⁄ . For three-
dimensional geometries, the discretization of the diffusion flux integral involves evaluating
magnitudes defined at the cell's faces such as  ∙ , which requires determining the vector
 at the different faces of the surface limiting the cell. Since the scalar  is typically defined at
the cell center, some interpolation scheme is needed to evaluate  .
If the line joining the centers of the cells that share a face is aligned along the normal to the face,
a face centered expression to obtain an estimate of  ∙ can be readily performed. This
situation is illustrated in figure 4.7, where two cells , are sharing face , and the unit vector normal
to the face and exterior to cell is denoted as .


Figure 4.7 Face normal gradient determination for cells with centers aligned in the normal direction to the face
that they share.

Fundamentals and Application of Computational Fluid Dynamics 13


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

The contribution to the diffusion flux integral in cell results:


 
,  ∙   ∙  | |
, (4.24)

Example (4.1) applies expression (4.24) to the one dimensional case.


EXAMPLE 4.1 Based on the discussion leading to expression (4.24), write expressions for the discretized
east and west diffusion fluxes of scalar  in a one-dimensional case around cell shown in the figure below,
assuming a constant diffusion coefficient  . Obtain the discretized diffusion flux integral for cell and
demonstrate that it becomes zero in an arbitrary geometry duct with a uniform scalar field. Simplify the
discretized diffusion integral for a uniform area case , meshed with uniform volume elements of
thickness ∆ .

Solution: In a one dimensional case the line joining the cell centers is aligned along the direction, which
also coincides with the direction of the normal to the faces. Following the discussion leading to expression
(4.24), the discretized diffusion flux vector evaluated at the east and west surfaces of cell becomes:
   
,   |∆ |
, ,   |∆ |
. (a)

The contribution to the discretized diffusion flux surface integral from faces , can then be expressed as:

,  ∙  ,   , ,  ∙  ,   , (b)
with:
 
 , |∆ |
,  , |∆ |
. (c)

The discretized diffusion flux integral at becomes:


∑ ,  ∙  ,   ,  ,   ,  . (d)

Observe that, in a uniform scalar field,    , the diffusion flux integral vanishes. For a uniform
area duct, with uniform cell size ∆ , and constant diffusion coefficient, expression (d) becomes:
∑ ,  ∙   2    , (e)

with:
  ⁄∆ . (f)
The discretization error linked to expression (4.24) can be readily evaluated when the line joining
the two cells is aligned along the direction normal to the face. In that case:
  
  ∆ ∆ ∆ , (4.25)
, , ,

  
  ∆ ∆ ∆ , (4.26)
, , ,

where ⁄ represents the partial derivative along the direction given by vector . Therefore:
    ∆ ∆  ∆ ∆
 ∙ |∆ | |∆ | |∆ |
. (4.27)

14 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

As a result, if the distance from the centers of the two cells to the center of the face are equal and
if the line joining the centers is aligned with the face normal, the calculation of the discretized flux
diffusion integral according to (4.24) becomes second order accurate, with a discretization error that
is proportional to |∆ | .
Obtaining second order accurate expressions for  ∙ in general mesh topologies requires a
more elaborate discretization. Different strategies can be proposed.

4.5.1.1 Green-Gauss cell based gradient calculation


The Green-Gauss cell based algorithm evaluates first the gradient vector at the cell centroids. This is
achieved by applying Gauss's theorem to the cell control volume. Consider element with volume
limited by surface  . The application of Gauss's theorem to this volume gives:

 
∙ , (4.28)

where is the normal exterior to . The discretization of equation (4.28) provides:


 ∑  , (4.29)

where the subscript refers to the different faces of cell . The calculation of  according to
(4.29) requires determining the values of  at the faces of the cell. Different alternatives are possible
for this evaluation. In the Green-Gauss cell algorithm the face value is simply computed as the
average of the values at the two cells that share the face:
   , (4.30)

where represents the cell sharing face with cell , and  ,  denote the values of the scalar 
in the two cells sharing face . For irregular or distorted meshes, approximation (4.30) can lead to
discretization errors that will decrease the order of the discretization. An alternative option is to obtain
the face value as the average of all its nodal values, i.e., the values at the vertices that limit the face.
The nodal values can be obtained from a weighted average extended to all the cell values shared by
the node. The weights can be defined inversely proportional to the cell to node distances. Once that
the gradient vector at the cells has been computed, the evaluation of the gradient vector at the faces
is required. This can be achieved as a weighted average of the gradients at the cells sharing the face:
 ,  ,  . (4.31)
The weights , , , are interpolation coefficients that can be defined as a function of the cell
to face distances:
∆ ∆
, , (4.32)
∆ ∆ ∆ ∆

with ∆ , ∆ expressing the distances from face to, respectively, cells and .
EXAMPLE 4.3 Apply the Green-Gauss cell based algorithm to find the face gradient of scalar  for faces
and in the one-dimensional convection-diffusion case. Assume that the cells have uniform spacing ∆
and uniform transversal area . Introduce the west and east notation defined before around cell , denoting
successive cells to the east as , ... and to the west as , ....., as given in the figure below.

Fundamentals and Application of Computational Fluid Dynamics 15


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

Solution: In order to determine the face gradient at faces , of cell , it is necessary to compute the cell
gradient in cells , , and . In the one-dimensional case the cell gradient vector has only one component,
the component. The cell transversal area is uniform, as well as the cell volume ∙ ∆ . Therefore:
 
 , ∑ ,  ∙
∙∆
  ∆
. (a)

Observe that, since we are computing the component of the gradient, we are making the inner product
between the face normal and the unit vector . The values of the scalar function  at the faces are
|∆ | |∆ |
   |∆ | |∆ |
 |∆ | |∆ |
   . (b)

In expressions (b) the interpolation weights , are given by (4.32) and they are both equal to 1/2. In
the same way, we can write:
   . (c)

Therefore, using equation (a), the gradient at becomes:


 , ∆
  . (d)
The gradient expressions for cells , are obtained applying expression (d) with the appropriate cell
values:
 , ∆
  ,  , ∆
  . (e)
The gradient at the cell faces are obtained by interpolation of the shared cells values:

 ,  ,  , ∆
  ∆
  . (f)

Therefore:

 , ∆
    , (g)

The discretization stencil illustrates the coefficients multiplying the values of the different cells for the
construction of a discretized magnitude. For the gradient of  at face , the stencil times the cell size ∆ is
sketched in the figure below.

1/4 1/4 1/4 1/4

Therefore we can see that the support of the face gradient discretized with the Green-Gauss cell algorithm
is four cells. Applying the same stencil to face , the following result is obtained for the west face gradient:

 , ∆
    , (h)

Note that the face gradient determination introduced in expression (4.24) can be obtained after
applying a Greeen-Gauss face gradient calculation, using a staggered volume constructed around the
face being evaluated.
Figure 4.8 shows the staggered volume used to compute the Green-Gauss face gradient calculation
in a one dimensional case.The application of Gauss's theorem to the dashed, red volume constructed
around face gives:
 ∑ ,  ∆
  , (4.33)

16 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

where the subscript , indicates the faces of the volume constructed around face .

Figure 4.8 Staggered volume used in the Green-Gauss face gradient evaluation.

4.5.1.2 Least-squared cell gradient calculation


An alternative option to the Green-Gauss cell algorithm for evaluating the gradient of a scalar function
at the cell centroid is the least-squared cell gradient calculation procedure. It a based on establishing
a set of difference equations for the values of function  in the cell and in its neighbours (figure 4.9).
The gradient at cell is expressed as a function of the differences between the value of  obtained
in this cell and in its neighbouring ones. The starting point is the system of approximate equations:
 ∙∆   , 1, … . . . (4.34)

Figure 4.9 Least-squared cell gradient evaluation. Sketch of object cell and surrounding cells .
Where ∆ represents the distance between the centroids of cell and , and is the number
of faces of cell . System (4.34) is over specified with respect to  . Therefore some optimization
procedure must be used to get the best estimate for the gradient. Since expression (4.34) is linear in
 ,   , we propose:

 ∑ ∙   , (4.35)

where represent unknown weights that need to be determined by the optimization procedure . A
least square optimization is performed by minimizing:

∑ ∑ , ∙   ∙∆   . (4.36)

The minimization of expression (4.36) will allow obtaining the coefficients , and, using
equation (4.35), determining  . After the determination of the gradient at the cell centers is
completed, the calculation of the face gradients can proceed by using expressions (4.31), (4.32).

Fundamentals and Application of Computational Fluid Dynamics 17


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

4.5.2 Convective Flux Discretization


evaluation of the convective flux requires the determination of the flow variables at the faces of the
cells:

,   . (4.37)

In (4.37), an assessment of both  and must be performed. In non-collocated schemes, the


values of ,  are known at the cell centers, whereas the velocity vector is directly stored at the faces.
In cell centered, collocated schemes, all the variables are stored at the cell centers. As a result, in both
cases a face interpolation is needed for ,  in order to evaluate the convective flux given in expression
(4.37). In addition, for cell centered schemes, the velocity vector also needs to be interpolated at the
faces.
Unlike what happens in the discretization of the diffusion flux, the interpolation of face values in
the evaluation of the convective flux should take into account the anisotropic character of this
transport mechanism. Consider the one-dimensional transport equation (4.12) for scalar . In an
incompressible flow with constant area duct the velocity is constant. For large values of the Péclet
number ≫ 1 , equation (4.12) becomes:
 
0. (4.38)

Equation (4.38) indicates that the scalar  is transported with a constant velocity along the
axis. If the initial distribution of  is given by  , 0  the solution to equation (4.38) becomes:
 ,  , (4.39)
which is a convective wave propagating the initial profile of  with velocity along the direction.
For example, for an initial distribution  given by:
1 0
 , (4.40)
0 0
the solution at any arbitrary time becomes:
1 0
 , , (4.41)
0 0
which describes the convective wave. The solution at times 0, 1, 2 is shown in figure 4.10.

2 2 2

 0  1  2
1 1 1

0 0 0

-1 -1 -1
-4 -2 0 2 4 -4 -2 0 2 4 -4 -2 0 2 4

Figure 4.10 Convective transport of scalar  with constant velocity 1.


The non-isotropic character of the convective flux should be taken into account in its discretization.
For ∙ 0, expression (4.37) indicates that the convective flux propagates the information of
variable  along the direction given by . Referring to figure 4.7, if ∙ 0 the value  is

18 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

being propagated from cell , whereas for ∙ 0 the convective flux propagates the variable
 from cell . This asymmetry should appear in the specification of the convective flux  .
The description of the convective flux discretization will assume a known value of the product ∙
at the face being evaluated. As already indicated, in non-collocated schemes this product is directly
available since this variable is stored at the faces of the cell. For collocated schemes the product ∙
will need to be evaluated using similar interpolation techniques to the ones described in this
section. Therefore, we will just focus in describing the interpolation of the magnitude  at the
faces of the cells.

4.5.2.1 Centered interpolation


The simplest interpolation scheme to obtain the face values is the central interpolation scheme, which
extends the interpolation used in (4.31) for the gradient of a scalar, to the scalar itself:
   , (4.42)

where the interpolation coefficients are again given by expressions (4.32). For close to uniform
meshes, this interpolation is second order accurate. When used to determine the convective flux, it
does not take into account the propagation properties of the convective flux, and supports unphysical,
oscillatory solutions as the next example shows.
EXAMPLE 4.4 Obtain the expression for the discretized convective integral associated to scalar  in a one-
dimensional case using the centered interpolation scheme. Assume equally spaced, constant transversal
area elements of value , in an incompressible fluid having density and steady state flow velocity 0.
Demonstrate that, using a centered interpolation scheme, the convective dominated transport equation of
scalar  admits solutions exhibiting a checkerboard or odd-even pattern.
Solution: For the case of an equally spaced mesh, the interpolation coefficients in (4.42) taken from (4.32)
become 1/2 . Therefore the interpolated scalar values at the faces of each cell are:

   ,    . (a)
The discretized convective flux vector at the east and west faces of cell becomes:

,    , ,    . (b)
The discretized convective integral becomes.
∑ ,  ∙     (c)

which can be written as:


∑ ,  ∙    (d)

with:
 . (e)
Observe that the convective flux at cell only includes contribution of values of  corresponding to the
east and west cells, but not of the element itself.
When the transport equation for  is dominated by convective effects, the convective flux integral has to
vanish in each cell. Therefore:
   0 →   . (f)

Fundamentals and Application of Computational Fluid Dynamics 19


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

Equation (f) is compatible with an unphysical solution of  exhibiting a checkerboard or odd-even pattern,
where odd mesh cells display a value  and even cells display a value  , as the next figure shows.

The appearance of the odd-even mode solution occurs when using a centered interpolation scheme
to approximate convective fluxes. The odd-even pattern can be avoided by introducing small diffusive
terms that will effectively couple the odd and even cell solutions. Alternatively, the odd-even mode
can be avoided by proposing schemes that will take into account the non-isotropic character of the
convective transport. This leads to the upwind interpolation schemes for the convective fluxes.

4.5.2.2 First order upwind interpolation


A simple face interpolation scheme that preserves the convective flux asymmetry is the first order
upwind scheme. Considering that the face normal , is exterior to cell and that face is shared
between cells and as sketched in figure 4.7, the transported magnitude interpolation at the face
becomes:
 ∙ 0
 . (4.43)
 ∙ 0
Observe that the specification of  for ∙ 0 becomes irrelevant since, in that case, the
convective flux vanishes. The discretization error for the upwind flux based on (4.43) becomes first
order, since the difference between the exact and the upwind discretized face value is proportional to
the cell to face distance.
EXAMPLE  4.5 Determine the expression for the east and west first order upwind convective fluxes
associated to scalar  in a one-dimensional case. Assuming constant transversal area elements of value ,
an incompresible fluid with density , and steady state flow with velocity 0, write the total convective
integral for an arbitrary cell .
Solution: In this case the velocity at the faces is and the convective flux becomes:
 0  0
,  ,  . (a)
 0  0
For incompressible flow with constant velocity 0 the east and west convective fluxes become:

,   ,   . (b)
The total convective integral becomes in this case:
∑ ,  ∙      , (c)

where, in this case, the convective coefficient  is given by:


 . (d)
Note that now the convective integral receives contributions form the values of  in contiguous cells and
thus the even-odd mode is excluded.

20 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

For a general case with either positive or negative face velocities, equations (a) lead to:
∑ ,  ∙       (e)

with:
 0, ;  0, 0, ;  0, . (f)

4.5.2.3 Second order upwind interpolation


It is possible to define upwind based, face interpolations schemes having higher than first order
accuracy. This can be achieved, for example, introducing the cell gradient of the variable being
upwind interpolated:
   ∙∆ , ∙ 0
 , (4.44)
   ∙∆ , ∙ 0
where the notation refers again to figure 4.7, and the cell gradient terms can be determined according
to the Green-Gauss or least squared cell based algorithms previously presented. In expression (4.44)
the variable  represents a scalar called the gradient limiter that limits the second order correction
to the first order upwind interpolation when the flow is changing abruptly. In flow regions where the
scalar field is smooth  is set to 1 and a second order upwind scheme is obtained. In flow regions
where the scalar filed is suffering significant changes  is set to zero and the first order upwind
discretization is recovered. Typically    ∙∆  ∙∆ .

4.5.2.4 Power law interpolation


For the incompressible flow case, the convective flux is linear in the transported scalar . In those
cases, additional higher order schemes can be easily specified. The power law scheme is based on the
solution of the steady, incompressible one-dimensional convection-diffusion transport equation
previously discussed (equation (4.21)). The scalar face value  is defined as a function of a face
Pléclet number:
∙ |∆ |  . (4.45)
The transported scalar  at face is defined as:
    ∆ ⁄|∆ | 1 1 . (4.46)

The asymptotic behavior of this expression becomes:


 ≫1
∆ ∆
 |∆ |
 |∆ |
 ≪1. (4.47)
 ≫1
Therefore, for weak convective to diffusion transport ratios ≪ 1 the face value becomes
the linearly interpolated value between cells and , and a second order, centered interpolation
scheme is recovered. When the absolute value of the face Pléclet number is large and positive, the
convective transport is dominant and it carries information from cell to . Therefore the scalar  at
the face is given the value that it takes at cell . Likewise, when the absolute value of the face Plécet
number is large but the face Pléclet is negative the face is assigned the value of the scalar in cell ,
which becomes in this case the upstream cell.

Fundamentals and Application of Computational Fluid Dynamics 21


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

4.5.2.5 QUICK interpolation


A higher order, upwind face interpolation scheme can be defined for cases where the grid is made up
of hexahedral cells and the flow is mainly aligned along a specific grid direction. For these flow
problems and grid topologies, upstream and downstream faces can be clearly defined. Considering
all the cells in contact with cell , the upstream and downstream cells of become:
∶ ∙ ; ∶ ∙ . (4.48)
Therefore the upstream cell is defined as the cell of all those sharing some face with cell that
will maximize the value of the products ∙ . When the flow is aligned with one of the grid
directions, the absolute value of the convective products ∙ will be much larger for the
upstream and downstream cells than for the rest. The largest contribution to the convective integral
will result from the faces in contact with the upstream and downstream cells. A higher order scheme
to take into account these convective dominant contributions is the QUICK interpolation (Quadratic
Upstream Interpolation for Convective Kinematics) [4]. Following the notation introduced in
Example 4.3, the upstream cells of element will be denoted as , etc (figure 4.11).

Figure 4.11 Cells involved in the upwind interpolation at faces of cell according to the QUICK interpolation
scheme and , 0.

To determine the convective fluxes for cell , the face values of the transported scalar  should be
evaluated at faces , . Assume that is the upstream cell of and is the downstream one,
identified according to expressions (4.48). The QUICK interpolation scheme to obtain  involves
approximating  by means of a parabola passing through the two cells sharing face (i.e. and ),
and the upstream cell . To determine the value at face , the parabola will pass through the two
cells sharing the face (i.e. and ) and the next upstream cell .
Assuming uniform cell dimensions in the upstream-downstream direction, the QUICK
interpolation scheme for face is graphically sketched in figure 4.12. The interpolated values at faces
and become:
    ;     . (4.49)


Figure 4.12 Convective flux determination with QUICK interpolation scheme. Interpolated value at face
shared by cells and .

22 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

The generalization of expressions (4.48) for cases of non-uniform grid spacing is straightforward.
The QUICK interpolation scheme has a third order truncation error.

4.5.2.6 MUSCL interpolation


An additional high order upwind, face interpolation scheme that does not require a structured mesh
organization is the MUSCL (Monotone Upstream-Centered Scheme for Conservation Laws)
interpolation scheme [5]. In this approach the scalar face value is constructed as a blend of the
centered and second order upwind interpolations:
   1  , (4.50)

where  is the second order upwind interpolation introduced in (4.44), with  1. In this
case the limiter character is assigned to the variable which can be defined in a number of ways that
depend on the local properties of the flow in faces , . With appropriately defined limiters, this blend
of two second order interpolations allows giving the convective discretization scheme certain
desirable properties, such as ensuring that no overshoots and undershoots are generated during the
solution convergence process.

4.5.2.7 Selection of convective interpolation scheme


From the discretization error point of view higher order upwind schemes are superior to the first order
upwind discretization of expression (4.41). However, the stability behavior and robustness of lower
order schemes for the convective flux calculation is also superior to those of higher order schemes
and sometimes a converged solution with the higher order scheme maybe difficult if not impossible
to be achieved. As normally the initial condition for a numerical simulation is characterized by large
non-compliance of the discretized conservation equation, a good practice to ensure convergence is to
begin the simulation with a first order upwind scheme and, once that some convergence in the solution
have been achieved, switch on the higher order discretization to minimize discretization errors and
improve the accuracy of the solution.

4.5.3 Boundary Conditions for the Convection-Diffusion Scalar Equation


The numerical integration of the convection-diffusion transport equation for scalar  requires the
evaluation of the diffusion and convective fluxes at the faces of the finite volume cells. As far as a
face is shared by two cells, the evaluation of these fluxes can proceed in the manner discussed in
sections 4.5.1 and 4.5.2. These faces are interior domain faces. The faces limiting the computational
domain are only shared by one cell, and therefore the procedure to set the convective and diffusive
fluxes at these faces must be modified. The boundary conditions established on  are also
implemented through the boundary faces. The implementation of the boundary conditions provides
the alternative path to determine the convective and diffusion fluxes on the boundary faces.
Establishing a Dirichlet boundary condition on the face value  ∗ allows the direct evaluation of
the convective flux. In this case the evaluation of the diffusion flux can proceed by estimating the
scalar gradient at the face using the face and cell values. Likewise, imposing a Neumann boundary
condition allows the direct evaluation of the diffusive flux. The convective flux evaluation in this
case requires the specification of the  scalar at the boundary face,  . This evaluation can be
constructed from the cell value,  , and from the boundary condition specified face gradient value,
∗ ∗
 ∙  , so that    ∆ ∙ .

Fundamentals and Application of Computational Fluid Dynamics 23


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

4.6 NUMERICAL INTEGRATION OF THE STEADY CONVECTION-DIFUSSION


EQUATION

For steady state problems, the solution of the convection-diffusion equation implies the balance
between the convective and diffusion integrals, with the possibility of additional source terms. The
integral formulation for a cell provides:

,  ∙ ,  ∙  . (4.51)

The FVM implementation of equation (4.51) for cell becomes:


∑ ,  ∙ ∑ ,  ∙  , (4.52)

where the subscript denotes the different faces of cell . The discretization of the diffusion and
convective fluxes can be achieved with the schemes presented in sections 4.5.1 and 4.5.2, to be
completed with the implementation of appropriate boundary conditions. The interpolation of the
different terms appearing in equation (4.52) results in an algebraic equation of the type:
 ∑  , (4.53)
where refers to the neighbor cells of . The term includes the discretization of the volumetric
source terms, although for boundary cells it can also incorporate the implementation of the boundary
conditions.
Assuming that the density and velocity fields are know from the solution of the flow field, that the
diffusion coefficient is known and does not depend on the scalar field , and that the source term
is at most linear in , equation (4.53) corresponds to a system of linear equations in the variables  ,
where represents a generic cell within the FVM discretization.
Consider for example a one-dimensional duct of length and constant area with no source terms.
Assuming an incompressible fluid of density , the continuity equation provides a flow field with
constant velocity . Let us consider also that Dirichlet boundary conditions are applied at the
extremes of the duct:
0:  0; :  1 , (4.54)
The analytical solution of this problem is given by equation (4.21):
∙ ⁄
 ⁄ , , (4.55)

where ⁄ is the Péclet number.


Let us consider now the case with an evenly spaced mesh having 10 elements. In that case:

∆ 0.1 , (4.56)

The mesh is shown in figure 4.13. The domain boundary 0, corresponds to the west face of
cell 1, whereas the domain boundary at 1 corresponds to the east face of cell 10. Therefore cells
2 to 9 are interior cells, whereas cells 1 and 10 are boundary cells.

1 2 3 4 5 6 7 8 9 10

Figure 4.13 Cell numbering used in the discretization of the one-dimensional duct geometry.

24 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

For interior cell , equation (4.52) becomes:

,  ,  ,  ,  , (4.57)

where the convective and diffusive flux scalars are defined as ,  ,  ∙ , ,  ,  ∙ .


The simplest description of the fluxes included in equation (4.57) involves using the centered face
gradient evaluation, equation (4.33), for the diffusion fluxes, and the first order upwind evaluation of
the face scalar, equation (4.43), for the convective fluxes. In that case equation (4.57) becomes:
 
  ∆
  ∆
  , (4.58)

which can be arranged as:


  

 2

 ∆
 0. (4.59)

introducing again the convective and diffusion coefficients:


 ,   ⁄∆ . (4.60)
Equation (4.59) becomes:
    2    0. (4.61)
The diffusion and convective fluxes for boundary cells 1 and 10 need to be modified. The diffusive
flux for cell 1 becomes:
   
,   ∆
   ; ,   ∆ ⁄
2   , (4.62)

where  represents the scalar boundary value at 0. The convective flux becomes:

,    ; ,    . (4.63)

Therefore equation (4.57) for cell 1 is written as:


 3     2  . (4.64)
where  denotes the boundary value of  at 0. In the a similar way, the conservation equation
for cell 10 becomes:
    3  2  , (4.65)
where  represents the prescribed, known boundary value of  at . Equations (4.61), (4.64)
and (4.65) make up the following set of linear equations:
 3     2  (4.66)
    2    0 2, … ,9 , (4.67)
    3  2  , (4.68)
with  ,  given in expressions (4.60). Comparing equations (4.66)-(4.68) with (4.53), the
coefficients , , can be identified. It is a linear system of equations that can be arranged as:
0 0 0 
0 0 
… ⋮ ⋮ , (4.69)

Fundamentals and Application of Computational Fluid Dynamics 25


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

where the contribution of the boundary values  ,  to equations (4.66) and (4.68) have been written
as part of the source term column matrix . Written in compact form, the system (4.69) becomes:
̿∙ (4.70)
The squared matrix of coefficients multiplying the unknown scalar field  , … ,  is
tridiagonal. In a more general case, it has a number of properties. Specifically:
a) Sparsity. Most of the off-diagonal components of ̿ are zero. The number of non-zero, non-
diagonal components depends on the cell connectivity and on the order of the scheme. The
higher the order, the largest the support from neighbor cells and the more full the matrix
becomes.
b) Symmetry. If properly organized, is symmetric. This characteristic is connected to the
conservation properties of the FVM discretization.
c) Diagonal dominance. Depending on the discretization scheme used for the convective and
diffusive fluxes, the matrix of coefficients may verify | | ∑ , indicating the
̿
condition for to be diagonally dominant.
A number of methods are available to solve linear systems where the coefficient matrix ̿ exhibits
the properties described above. Specifically, there are methods providing the direct solution of the
linear system (4.70), including Gaussian elimination, or LU decomposition algorithms [6]. In spite of
providing the exact solution of the system, the direct resolution of (4.70) is not sought in FVM due
to the large dimension of the matrices involved and to the fact that an exact solution of the system is
not needed, since discretization errors will always limit the solution accuracy. For these reasons, the
solution of (4.70) is pursued using an iterative method.
The general scheme to iteratively solve (4.70) includes proposing an initial guess  of the solution
scalar field and defining an iterative algorithm where successive solution approximations are
obtained:
 ̿, ,  . (4.71)
Expression in (4.71) is defined so that the exact solution  verifies:
 ̿, ,  , (4.72)
A convergence parameter can be defined as a residual:
̿ , (4.73)
which is related to the solution error   by the following relation:
̿ , (4.74)
The basic iterative scheme decomposes the matrix ̿ into two matrices and :
̿ , (4.75)
∙ ∙ , (4.76)
such that solving (4.76) should be inexpensive. The error   verifies:
∙ ∙ → ∙ (4.77)

26 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

The iterative algorithm converges when lim 0 which, in turn, requires that the spectral radius

of the matrix is smaller than 1, i.e., | | 1, with  being the –
eigenvalue of matrix . For this to occur the matrix should be "small" with respect to ̿. In fact,
in the limit → 0, → ̿ the direct method is recovered and the exact solution would be obtained in
one iteration. Therefore the decomposition (4.75) should be selected so that equation (4.76) is simple
to resolve and at the same time the coefficients of are small with respect to those of .
Following these arguments, different algorithms can be proposed. The three most commonly used
are discussed next.

4.6.1 Jabobi Algorithm


The Jacobi algorithm implements the most simple option to ensure (4.75):
̿ , ̿ ̿ (4.78)
Expression (4.71) becomes:
 ∑  . (4.79)

The Jacobi algorithm is known to converge if the matrix ̿ is diagonally dominant, i.e., if | |
∑ . The discretized convection-diffusion equation using the first order upwind scheme for the
convective fluxes and the face gradient centered discretization for the diffusion fluxes results in a
diagonally dominant matrix, so that the Jacobi algorithm should converge when applied to this
problem.

4.6.2 Gauss-Seidel Algorithm


The Gauss-Seidel algorithm selects to be closer to ̿ by adding the elements placed below the
diagonal. These elements multiply components of  which have been already updated in the new
iteration, and therefore they are already available. Thus:
̿ , ̿ ̿ (4.80)
The iterative algorithm takes the form:
 ∑  ∑  . (4.81)

Observe that we are taking into account the updated, available values of  to compute the off-
diagonal terms of (4.70). In a general, unstructured mesh case, equation (4.81) will use, for each
update  , the values of  which are already available.

4.6.3 SOR algorithm


The SOR (Successive Over-Relaxation) algorithm updates the value of  as a blending between the
Gauss-Seidel updated value and the previous iteration value. The iterative algorithm takes the form:
 ∑  ∑  1  , (4.82)

where is called the over-relaxation parameter. For 1 equation (4.82) reproduces the Gauss-
Seidel algorithm. Setting 1 is equivalent to the Gauss-Seidel algorithm with a reduced
convergence rate. The best choice is to set 1 with 0.5. The optimum value of the
relaxation parameter is problem dependent, and should be selected as the one providing the fastest
residual decrease.

Fundamentals and Application of Computational Fluid Dynamics 27


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

EXAMPLE 4.6 Consider the following linear system of equations:

3 1 0  0
̿ , ̿ 1 2 1 ,   0 ,
0 1 3  2
whose exact solution is:
 1⁄6 ,  1⁄2 ,  5⁄6 ,
Starting as initial guess:
   0,
obtain an approximate solution of the above system using 10 iterations of the Jacobi method. For each
iteration define a residual as:

  ,
with ̿ ,  , . Plot the evolution of the residual as a function of the iteration index .
Solution: Equation (4.79) gives in this case the following iterative scheme:
  /3,    /2,   2 /3 . (a)
After 10 iterations, it results:
 0.1646,  0.4979,  0.8313 . (b)
The absolute error in the 3 components of  is very similar and close to 0.002, which translates into a 1.2%
largest relative error for  .
To compute the residual, observe that for the initial guess:

  2 . (c)

so that the residual at iteration becomes:

 . (d)

The evolution of the residual with the Jacobi iteration count is shown in the next figure.

1.E+02

1.E+00

1.E-02

1.E-04

1.E-06

1.E-08

1.E-10
0 5 10 15

PROBLEM 4.1 Repeat example 4.6 using the iterative algorithms of Gauss-Seidel and SOR with 1.1.
Compare the evolution of residuals for the three methods.

28 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

4.6.4 Application to One-dimensional Case


The iterative algorithms described in sections 4.6.1 to 4.6.3 can be applied to solve the steady,
discretized convection-diffusion equation. Considering the one-dimensional case in the interval 0
1, with a uniform mesh of 10 elements so that ∆ ⁄ 0.1, using the first order upwind
and the face centered schemes to respectively discretize the convection and diffusion fluxes, results
in equations (4.66) to (4.68).
Assuming that we set 1, 1, 1, it results  1⁄ and expressions (4.60) give:
 1,  10⁄ . (4.83)
. The convergence of the iterative algorithm can be monitored using the residual defined in
Example 4.6:
  (4.84)

In expression (4.84) we are using, as usual, the Einstein notation where an implicit summation is
taking place in the repeated index . Therefore, for 2, … ,9, equation (4.84) gives 
, 1  1 , , 1  1.

The results of solving the system (4.66)-(4.68) using the Gauss-Seidel iterative algorithm for
Dirichlet boundary conditions  0 1,  1 0 and 0.1, 1, and 25 are shown in figure 4.14.
In all the cases, 50 iterations of the Gauss-Seidel algorithm were performed. For the low Péclet
number case 0.1 , the transport of  is dominated by diffusion effects, and the solution
approaches a linear profile between the boundary values imposed at 0, 1. For the
intermediate Péclet number case 1.0 convection and diffusion effects are of the same order
and the solution exhibits some curvature along the direction. Finally, in the large Péclet number
case 25 the convective transport is the dominant effect over most of the domain, setting the
values of  to the one fixed at the left boundary,  0 1. The boundary condition imposed at 1,
1 0 must be enforced, and the diffusion term must become active near 1 to do so. This can
only occur if a thin layer of characteristic non-dimensional thickness ~ 1⁄ is formed around
1, where the solution quickly swings from 1 to 0. Note that for 25 the boundary layer thickness
becomes 10 , as the exact solution in figure 4.14 shows.
The scalar field obtained after 50 iterations can be considered the converged solution of the
iterative process, since the scaled residual at this stage is smaller than 10 for all the cases. The error
of the discretized problem can be defined as the maximum in the absolute value of the differences
between the exact and the discretized solutions.
After 50 iterations, the error is 10 3 for the cases 0.1, 1.0. However, it becomes 10 1
in the result obtained for 25. In this case the equation is dominated by the convective flux,
whose error with the selected upwind discretization is first order in  . On the other hand, the
diffusion flux interpolation is second order, and thus the low and intermediate Péclet number cases
exhibit a much smaller error. In fact, in the limit → 0 the solution of the scalar  becomes linear
with , and in this limit the second order interpolated diffusion fluxes become exact, so the error
should vanish as the Péclet number approaches zero.
In the large Péclet number limit, the first order upwind discretization will determine the error of
the discretized solution. An alternative to improve the discretization error of the convective fluxes is
to use the central interpolation scheme presented in section 4.5.2.1.

Fundamentals and Application of Computational Fluid Dynamics 29


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

1.5
exact
 n=1
1.E+02
n=5
1.E+00
1.0 n=50
1.E-02

1.E-04
0.5 0.1
1.E-06

1.E-08
0.0
1.E-10

1.E-12
-0.5
0 20 40 60
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

1.5
exact
 n=1
1.E+02
n=5
1.E+00
1.0 n=50
1.E-02

1.E-04
0.5 1.0
1.E-06

1.E-08
0.0
1.E-10

1.E-12
-0.5
0 20 40 60
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

1.5


1.E+02

1.E+00
1.0
1.E-02

1.E-04
0.5 25
1.E-06
exact
n=1 1.E-08
0.0 n=5
n=50 1.E-10

1.E-12
-0.5
0 20 40 60
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

Figure 4.14 Gauss-Seidel iterative resolution of the steady convection-diffusion equation with first order
upwind discretization of the convective fluxes and face centered discretization of the diffusion fluxes. Left:
solution after 1, 5, and 50 iterations. Right: residual evolution as a function of the iteration number. Graphs
from top to bottom give results for 0.1, 1, and 25.
Introducing the centered convective flux interpolation developed in Example 4.4, the conservation
equations for the 10 cell computational domain of the one dimensional example becomes:
 ⁄2 3   ⁄2    2  (4.85)
 ⁄2   2   ⁄2   0 2, … ,9 (4.86)

 ⁄2    ⁄2 3   2  , (4.87)
with again  ,  given in expressions (4.83). The solution of system (4.85) to (4.87) after 50 iterations
of the Gauss-Seidel algorithm is shown in figure 4.15.

30 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

1.5

 exact
n=1
1.E+02

n=5 1.E+00
1.0
n=50
1.E-02

1.E-04
0.5 0.1
1.E-06

1.E-08
0.0
1.E-10

1.E-12
-0.5
0 20 40 60
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

1.5

 exact
n=1
1.E+02

n=5 1.E+00
1.0
n=50
1.E-02

1.E-04
0.5 1.0
1.E-06

1.E-08
0.0
1.E-10

1.E-12
-0.5
0 20 40 60
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

1.5


1.E+02

1.E+00
1.0
1.E-02
exact
n=1 1.E-04
0.5 n=5 25
n=50 1.E-06

1.E-08
0.0
1.E-10

1.E-12
-0.5
0 20 40 60
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

Figure 4.15 Gauss-Seidel iterative resolution of the steady convection-diffusion equation with face centered
interpolation of the convective and diffusion fluxes. Left: solution after 1, 5, and 50 iterations. Right: residual
evolution as a function of the iteration number. 0.1, 1, and 25.
For 0.1, 1.0 the results are very similar to those obtained with the first order upwind scheme.
However, the 1 already indicates the onset of convergence problems since the residual stabilizes
in 10 3 levels. For 25 the residual is 1 and the error is also of the same order. In fact,
for slightly larger Péclet numbers the solution diverges.
This behavior is linked to system (4.85)-(4.87) losing its diagonal dominance property for large
enough Péclet numbers. Since  ⁄ , we can write:
2 1 , 2
| | ∑ ,
4 , 2

Fundamentals and Application of Computational Fluid Dynamics 31


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

0, 2
| | ∑ , 2, … , 1 , (4.88)
2 1 ⁄2 , 2
2 , 6
| | ∑ .
4 , 6
Therefore, for 2 the diagonal dominance of the interior cell equations is first lost. For 6
the diagonal dominance of the equation for node is also lost. On the other hand, system (4.66) to
(4.68), obtained using the first order upwind interpolation of the convective fluxes, gives:
2 1 ⁄2 1,
| | ∑ , (4.89)
0 2, … , 1
which means that it is diagonally dominant for all Péclet numbers. Thus, compared to the convective
centered interpolation, the first order upwind scheme gives lower accuracy but ensures the stability
of the discretization.

4.7 TEMPORAL DISCRETIZATION OF THE UNSTEADY CONVECTION-DIFFUSION


EQUATION

In the unsteady convection-diffusion equation the solution depends on space and time, and the spatial
discretization of laminar and convective fluxes must be complemented with the discretization of the
temporal term. Assuming an incompressible fluid of constant density , the unsteady FVM
convection-diffusion equation (4.4) written for cell becomes:
 ∑ ,  ∙ ∑ ,  ∙  . (4.90)

After discretizing the convective and diffusion integrals, and the volumetric source term, equation
(4.90) becomes:
 ,  ,  , (4.91)

where refers again to neighbor cells to , and represents an algebraic expression that results
from the discretization of the source terms and of the convective and diffusion fluxes. The function
can have also a explicit dependence on time as, for example, if the source terms or some boundary
conditions depend on time. The discretization of equation (4.91) involves defining a temporal
discretization scheme for the temporal derivative. We will consider advancing the temporal solution
at discrete time increments ∆ . In this respect, denoting  as the value of the scalar in cell at
temporal iteration , such that ∆ , first and second order schemes can be proposed.
Specifically:
a) First order temporal discretization. The temporal derivative in (4.91) is replaced by its first
order temporal discretization:


  ,  ,  . (4.92)

b) Second order temporal discretization. The temporal derivative in (4.91) is replaced by a


second order accurate discretization, given after passing a parabola through the discrete points
, , , , , , and evaluating the temporal derivative at . It
results:
3 4   ,  . (4.93)

32 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

Besides the order of the temporal discretization, the time instant where  ,  is to be
evaluated must be also specified. In a most general case we can write:
 ,  ,  ,  ; ,  ,  . (4.94)

When expression (4.94) does not depend on  ,  the temporal discretization scheme is
said to be explicit, since the solution  can be directly advanced to instant if it is known at
instant . On the other hand, when expression (4.94) depends on  ,  an implicit temporal
discretization scheme is obtained.
The simplest temporal discretization is defined using an explicit, first order scheme:


  ,  ,  , (4.95)

which defines the forward Euler method. The solution of equation (4.95) does not involve any
iterative process and can therefore achieved in a very fast way. It naturally requires a uniform time
step ∆ for all the cells in the computational domain, which becomes its global time step. The mayor
drawback of explicit schemes such as (4.95) is that there are restrictions in the maximum time step
size ∆ that can be used to ensure the stability of the scheme. This limitation is usually quantified as
a function of a non-dimensional parameter known as the Courant number :
∆ ⁄∆ , (4.96)
where are characteristic propagation velocities of the flow information during the temporal
interval ∆ . For example, in the simple, one dimensional convection-diffusion transport equation a
characteristic velocity is , which is associated to the convective term. A characteristic velocity

linked to the diffusion terms is given by  ⁄ ∆ . The stability limitations are expressed as
the Courant-Friedrich-Lewy (CFL) condition, which limits the Courant number to a maximum value:
, (4.97)
A more detailed analysis of the stability limits in unsteady schemes is given in section 4.8.
An alternative explicit temporal discretization to the forward Euler method is the Runge-Kutta
scheme, which involves a multiple, explicit evaluation of (4.92):


  , 2 , 2 , , , (4.98)

with:
, ,  ,  , (4.99a)

,

,  ∆
, ,  ∆
, , (4.99b)

,

,  ∆
, ,  ∆
, , (4.99c)
∆ ∆
, ∆ ,  , ,  , , (4.99d)

which effectively becomes a fourth order temporal scheme, where the temporal discretization error
is proportional to ∆ .
The simplest implicit temporal scheme is the first order, backward Euler algorithm:


  ,  ,  . (4.100)

Fundamentals and Application of Computational Fluid Dynamics 33


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

At each time step, the solution of (4.100) must be obtained using an iterative algorithm as the ones
described in sections 4.6.1 to 4.6.3. In this case the only difference appears in the contribution of the
left hand side of the equation. An obvious advantage of the implicit temporal discretization is that it
is unconditionally stable with respect to the time step size, and therefore no restriction such as the
one given in (4.97) must be ensured. However, scheme (4.100) remains first order accurate, and to
keep the accuracy of the temporal integration the step size should be bounded by the characteristic
time of the unsteady process.
The backward Euler, implicit scheme can be used to solve the unsteady convection-diffusion
equation in the simple, one-dimensional geometry presented in section 4.6.4. We will assume that the
initial condition is given by:
0,  , 0 0. (4.101)
and that for times 0 the boundary conditions given before are applied at the boundary of the
computational domain:
0:  0, 1,  1, 0 . (4.102)
As the boundary conditions are independent of time we expect the solution to reach a steady state
that should coincide with the solution found in section 4.6.4. The flow evolution once again depends
on the Péclet number ⁄ .
If a first order upwind interpolation is used to discretize the convective fluxes and a face centered
interpolation is used to discretize the diffusion fluxes, the implicit, backward Euler temporal
discretization provides the following set of algebraic equations:
  3     2   (4.103)

     2      2, … ,9 (4.104)

     3  2    , (4.105)
with:
 ∆ ⁄∆ ,  ,    ⁄∆ . (4.106)
Observe that the system (4.103) to (4.105) is similar to the original steady state system of equations
(4.66) to (4.68), and that the only difference is the inclusion of terms on the right and on the left hand
side proportional to  , that implement the first order temporal discretization. The right hand side
terms are known from the previous time step, and therefore they act as source terms for the system of
equations (4.103)-(4.105). Furthermore, on the left hand side of the system of equations only the
diagonal terms receive a contribution proportional to  . As a result, if the original system was
diagonally dominant, the unsteady implicit Euler scheme is also diagonally dominant.
For boundary conditions not changing in time, the characteristic time to achieve the steady state
solution from an arbitrary initial state depends only on the Péclet number.
In the limit ≪ 1, the fluid response is dominated by the diffusion term. Therefore the different
terms in equation (4.12) become:
 
  , (4.107)
∆ ∆ ∆
~ ~ ~ ,

34 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

The convective term with respect to the diffusion one is of order ≪ 1. During the transient
period, the unsteady term must be of the order of the most important term in the differential equation.
Therefore:
∆ ∆
~ → ~  . (4.108)

Thus, if we want to describe the unsteady process we should select ∆ ≪  ∙ ⁄ .


For the case where ≫ 1, the convective term dominates the steady state fluid response.
Following a similar argument to the one given above, the characteristic transient time becomes:
∆ ∆
~ → ~ ⁄ . (4.109)

which is the residence time of the flow in the length of the computational domain. Again, in order
to capture the unsteady process we must select ∆ ≪ ⁄ . We can combine both criteria and establish,
for a general case, the condition that ∆ should satisfy in order to capture the transient response:
∆ ≪ ⁄ 1, . (4.110)
Let us consider the case solved in section 4.6.4 with  10, and , , take all unity values, so
that 0.1. Condition (4.110) then becomes:
∆ ≪ 0.1 . (4.111)
We can select for example ∆ 0.005. With this choice, the characteristic flow time to achieve the
steady state solution will be of the order of 20 temporal iterations, and we should be able to describe
the unsteady evolution. The discretization coefficients in (4.106) become:
 20,  1,  100. (4.112)
The solution of the linear system (4.103) to (4.105) can be accomplished using any of the iterative
methods presented in section 4.6. We can select, for example, the Gauss-Seidel algorithm. At each
new time level, the convergence can be checked with the appropriate definition of the residual,
according to expression (4.84). The evolution of the unsteady calculation for 0.1 is presented in
figure 4.16.
1.5

 t=0.00025
t=0.005
1.E+02

t=0.01
1.0 1.E+01
t=0.02
t=0.04 1.E+00
t>>1
0.5 1.E-01

1.E-02

0.0 1.E-03

1.E-04
0 50 100 150 200 250
-0.5
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ⁄
1.0
Figure 4.16 Solution of the unsteady convection-diffusion equation for 0.1 using an implicit, backward
Euler temporal scheme, first order upwind and face centered interpolations for the convective and diffusion
surface integrals, and a Gauss-Seidel procedure for convergence at each time step. Left graph: evolution of the
scalar field  , . Right: residual as a function of the Gauss-Seidel iteration number.

Fundamentals and Application of Computational Fluid Dynamics 35


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

In the results of figure 4.16, 10 Gauss-Seidel iterations are performed to advance each time step.
With this choice, the residual is seen to drop one order of magnitude in each time step, which is
aligned with the expected accuracy of the first order temporal scheme accuracy. The exact solution
exhibits a discontinuity at 0, 0, since there the scalar value goes from 0 to 1 around 0.
In the numerical solution, the scalar profile progressively adopts the steady state solution. Observe
that for this low Peclet number, the steady state solution is achieved in times of the order of
~ ⁄ .
For the integration of a high Péclet number case, ≫ 1, the condition (4.110) becomes ∆ ≪
⁄ . The numerical solution of the case 25 with ∆ 0.02 appears in figure 4.17. Note that in
this case the characteristic transient time becomes ~ ⁄ , i.e, of the order of the flow residence
time.
1.5

 1.E+02
1.E+00
1.0
1.E-02

1.E-04

0.5 1.E-06
1.E-08
t=0.2
1.E-10
t=0.4
0.0 1.E-12
t=0.6
t=1.0 1.E-14
t>>1 0 50 100 150 200 250
-0.5
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ⁄
1.0
Figure 4.17 Solution of the unsteady convection-diffusion equation for 25 using an implicit, backward
Euler temporal scheme, first order upwind and face centered interpolations for the convective and diffusion
surface integrals, and a Gauss-Seidel procedure for convergence at each time step. Left graph: evolution of the
scalar field  , . Right: residual as a function of the Gauss-Seidel iteration number.
The high Péclet number case unveils the significant errors linked to the first order upwind
discretization in unsteady calculations. In the high Péclet number case, the temporal evolution of the
scalar field  , at a particular location should display a front advancing with the convective
velocity 1 where the scalar  undergoes a jump from the value set by the boundary at 0
 1 to the one imposed by the intial condition, i.e.,  0. Therefore, in the limit → ∞, the
solution takes the form:
1, 0 ⁄ 1
 , , (4.113)
0, 1 ⁄ ⁄
for times ⁄ 1. For times ⁄ 1 the solution becomes  1 within the interval 0 ⁄ 1,
and  0 at ⁄ 1, so that the asymptotic solution for → ∞ exhibits a discontinuity at ⁄ 1.
The evolution of the scalar field in the temporal interval 0 ⁄ 1 resembles the convective wave
shown in figure 4.10.
For large but finite Péclet numbers the solution approaches the front given in (4.113). However
the weak diffusion effects establish a finite thickness to the transition layer separating the  1 and
 0 regions. In the interval 0 ⁄ 1 the thickness of the transition layer increases with time
as:

36 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

⁄ ~  ⁄ ~ /
⁄ . (4.114)

Therefore, for ⁄ ~1, the thickness of the transition layer should be ⁄ 10 . The results
shown in figure 4.17 exhibit a much thicker transition layer, with ⁄ ~1 in the early stages of the
transient period. These results follow from the highly diffusive character of the first order upwind
discretization. Note that the first order upwind ( ) convective flux for cell , , , can be
written as:

,      2  . (4.115)

The first parenthesis on the right hand side of (4.115) is the second order, centered convective flux.
The second parenthesis behaves as a negative diffusive flux with an equivalent diffusion coefficient
given by:
 ∆
→  , (4.116)

which is proportional to the mesh size. This numerical diffusivity defines an effective numerical
Péclet number which is determined by the mesh size:

2 , (4.117)

As a result, the effective Péclet number of the computation becomes:



∗ → ⁄
. (4.118)

For the 10 cell mesh, the numerical Péclet becomes 2 ∆ ⁄ 20, and the effective
Péclet of the computation for the case 25 becomes ∗ 11. It follows that to correctly describe
an unsteady flow with a given Péclet number , it should be:

⁄ ≪ 1 ↔ ≪ . (4.119)

For example, if we want to accurately simulate the case 25 we should generate a mesh with
a spacing ∆ ⁄ ~ 1⁄100, at least in the region where large gradients are created. For the unsteady
calculation this occurs around the center of the advancing front. For the steady calculation the mesh
clustering should take place around the 1 region, which is the one exhibiting a boundary layer
structure.
The diffusive character of the first order upwind discretization can be clearly observed in figure
4.18, which shows the temporal evolution of  at 0.45, close to the mid-span of the computational
domain, for the example with 25. The solution has been compared to the one obtained with the
temporal evolution of a 0 to 1 discontinuity that advances along the axis with velocity 1 while
being diffused with a diffusion coefficient proportional to .
It becomes obvious that the first order upwind discretization is smearing out the advancing front.
For the position being analyzed the thickness of the passing front almost doubles as a result of the
numerical diffusivity created by the upwind discretization. As a result, the accurate simulation of
unsteady high Péclet number flows requires the use of higher order discretizations for the convective
fluxes, involving the determination of the scalar gradient at the cell centers. In those cases, the mesh
quality becomes critical, since the high order upwind discretization error and stability characteristics
are very sensitive to mesh distortion effects.

Fundamentals and Application of Computational Fluid Dynamics 37


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

1.2

1.0

0.8

0.6

0.4
numerical
0.2 exact

0.0
0.0 0.5 1.0 1.5 ⁄ 2.0

Figure 4.18 Solution of the unsteady convection-diffusion equation for 25 using the implicit, backward
Euler temporal discretization method, a first order upwind discretization of the convective fluxes and centered
discretization of the diffusive fluxes, with ∆ ⁄ 0.1. Temporal evolution of scalar  at ⁄ 0.45.

4.8 CONSISTENCY, STABILITY, AND CONVERGENCE

Using simple examples whose exact, analytical solution can be obtained, we have seen in the previous
sections that the numerical solution of the discretized convection-diffusion transport equation, either
in its steady or unsteady version, exhibits deviations with respect to the exact one. In some cases, a
bounded numerical solution is not even possible to be achieved. The ability of a numerical scheme to
model a given conservation equation can be described by a number of properties. In this respect, the
concepts of consistency, stability, and convergence are of particular relevance. The steps involved in
the determination of a solution from a numerical scheme are shown in figure 4.19, next to the process
that characterizes the exact solution determination.
Modeled conservation equation
Exact conservation equation
Discretized conservation equation

Conservation physics
Iterative solution scheme

Exact solution
Numerical solution
Figure 4.19 Exact and numerical solution determination process.
The initial element in the numerical solution process involves the modelization of the exact
conservation equation. If the underlying physics is complex, a simplified numerical solution can be
chosen. In those cases, modeling of the complex physics terms is required. This situation occurs, for
example, in the computation of turbulent flow. The exact Navier-Stokes equations are replaced by a
simplified version involving some spatial/temporal filtering process. The filtering operation generates
some additional terms in the conservation equations, which express the contribution of the physical
phenomena that is not being resolved by the simplified model. These terms must be modeled in order
to obtain a closed system of equations. The modelling process is not properly connected to the

38 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

numerical properties of the discretized scheme, although it can often set the overall accuracy of the
numerical solution. For the case of turbulent flow, the modeling process will be analyzed in chapter
5.
The first step in the definition of the numerical scheme itself is the conversion of the differential
conservation equation into a discretized equation. This involves discretizing the spatial and temporal
independent variables to describe the numerical solution in a finite mesh of grid points. For the simple
one-dimensional case this could be specified as a couple of natural numbers , denoting the
discrete spatial coordinates and the temporal instants where the discretized solution will be
obtained. In the cell centered FVM, the spatial coordinates correspond to the centroids of the
finite volume cells. The discretization can be characterized by the mesh size in the spatial
∆ , | 1 | and in temporal ∆ , | 1 | variables. The quality of
the discretization process is characterized by its , which refers to the property of the
discretized equations to asymptotically reproduce the modeled conservation equation as the temporal
and spatial mesh size tends to zero (figure 4.20).

∆ ,∆ → 0
Discretized conservation equation Modeled conservation equation
Figure 4.20 Consistency of the discretized equations.
The standard test to check for consistency includes writing the discretized conservation equation
as the modeled conservation equation plus a discretization error. The numerical scheme is consistent
when the discretization error tends to zero as the mesh size is made to tend to zero.
EXAMPLE 4.7 The incompressible, one-dimensional, unsteady convective transport equation for scalar 
and constant area flow can be written as:
 
0,
with being constant. Assuming that uniform grids of sizes ∆ , ∆ are respectively used in the spatial and
temporal discretizations, that the convective fluxes are discretized using a central scheme, and that the
unsteady term is discretized using an explicit forward Euler method, determine if the discretized problem
is consistent and evaluate the discretization error.
Solution: The discretized equation becomes:
   
0. (a)
∆ ∆

To evaluate the discretization error, we can write  , , using a Taylor series expansion around
 . It results:
 
  ∆ ∆ ∆ . (b)

  
  ∆ ∆ ∆ ∆ . (c)

  
  ∆ ∆ ∆ ∆ . (d)

Introducing (b), (c), and (d) into (a), it results:


       
∆ ∆ ∆ ,∆ . (e)
∆ ∆

Since the discretized equation tends to the exact one as ∆ , ∆ → 0, the discretization is consistent. The
discretization error becomes first order in ∆ and second order in ∆ .

Fundamentals and Application of Computational Fluid Dynamics 39


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

The third step in the numerical solution process of figure 4.19 involves setting up an iterative
algorithm to reach the discretized solution. The quality of the iterative algorithm used to reach the
solution of the discretized equations is given by its properties. Stability refers to the ability
of the iterative algorithm to maintain bounded the error found between the solution of the discretized
equation and the exact solution of the discretized equation. At iteration step we can define the error
of the iterative algorithm at cell , , as the difference between the computed solution and the exact
solution of the discretized equation:
  , (4.120)

where  denotes the exact solution of the discretized equation. The iterative algorithm can represent
either a time marching scheme or the iterative scheme designed to solve a steady state problem. The
algorithm is said to be stable if, for every cell of the computational domain, we can write:
lim | | , (4.121)

with independent of . A more general stability criterion can be established by stating that any
component of the initial condition should not be amplified without bound. For a linear iterative
scheme we can write:
 ̿ , (4.122)
and therefore:
 ̿  , (4.123)
so that the stability criterion on a bounded value of  implies:
̿ , (4.124)

where ‖ ‖ denotes the norm of the matrix.


A final property of the numerical solution obtained from the discretization scheme and the iterative
algorithm is . The numerical method converges if the error between the numerical
and the exact solution of the approximate conservation equation at any point and time tends to zero
as both the temporal and spatial steps of the discretization tend to zero. If  represents the exact
solution of the discretized, modeled conservation equation at ∆ , ∆ , the error between the
numerical and the exact solutions is given by:
̃   , (4.125)
The convergence condition then becomes:
lim | ̃ | 0, (4.126)
∆ ,∆ →

which in terms of the linear iterative scheme (4.122) implies:


lim ̿   0, (4.127)
∆ ,∆ →

The properties of consistency, stability, and convergence are closely related to each other. The
relation can be precisely given in the equivalence theorem due to Lax [3], which states that in a well-
posed initial value problem, discretized with a consistent scheme, stability is the necessary and
sufficient condition for convergence. In other words, if the selected discretization scheme is
consistent, the stability and convergence properties are equivalent. Therefore the analysis of a

40 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

numerical method can be accomplished by ensuring first its consistency, determining the order of the
temporal and spatial discretization error, and then describing its stability properties.
We have already seen how to study the discretization's consistency. The analysis of the stability
properties is more complex. In fact, its theory is only well established for linear schemes developing
in spatial unbounded domains, or in bounded domains with periodic boundary conditions. In non-
linear iterative algorithms, a necessary condition for stability is the stability of the linearized problem.
An additional complication in the stability analysis occurs for finite spatial domains with non-periodic
boundary conditions.
The analysis of linear stability in unbounded or bounded but periodic domains was developed by
Von Neumann in the 1940's. We will see the basis of the stability analysis method by applying it to
the one dimensional equation.
The starting point of the stability analysis realizes that, for the linear equation case, the error
between the exact solution  and the actual computed solution  to a given differential equation, as
defined in expression (4.120), satisfies the same equation as the computed solution. For finite domains
with periodic boundary conditions the error feeds from two possible sources: errors in the
specification of the initial data, and round-off errors. For a one-dimensional bounded domain
spanning the interval and having periodic boundary conditions, the error can be
decomposed into a spatial Fourier series with wavenumbers in the range ⁄ ⁄∆ ,
corresponding to wavelengths in the range 2∆  2 . The smallest wavelength corresponds to
the mesh resolution, while the largest one is fixed by the periodicity of the solution. If the interval
0 is divided in cells, the discretized solution at time step can be represented as a finite
Fourier series. As the error verifies the same equation as the discretized solution, it can also be
expressed in the same way. Thus we can write, for the error at cell and time step :
∑ ⁄ ∑ , (4.128)

where √ 1 represents the imaginary unit. In expression (4.128) represents the amplitude of
the harmonic with wavenumber ⁄ . The second equality in (4.128) expresses the error in a
more compact way by defining the phase of harmonic as ⁄ . Noticing that the error also
verifies the discretized equation, the Von Neumann stability method obtains an equation for the
evolution of the error harmonic . Let us consider for example the simple case of the incompressible,
one dimensional, constant area unsteady convection equation. In differential form it can be written
as:
 
0. (4.129)

Assuming a FVM formulation with constant grid size ∆ , and that we use an explicit Euler forward
temporal discretization, coupled to a face centered discretization of the convective term, the
discretized version of equation (4.129) becomes:
   
0. (4.130)
∆ ∆

The error also verifies the discretized equation. Therefore we can write:

0. (4.131)
∆ ∆

Since , , substitution of expression (4.128) into (4.131)


gives:

Fundamentals and Application of Computational Fluid Dynamics 41


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

0. (4.132)
∆ ∆

Introducing the parameter ∆ ⁄∆ , and the amplification factor for harmonic , ,


expression (4.132 ) becomes:
1 . (4.133)
The stability condition requires the modulus of the amplification factor for all harmonics to be
smaller or equal to 1, 1. For the case under study we get:

1 , (4.134)
which implies that the stability condition is never satisfied. We conclude then that the unsteady
convection transport equation, with a forward Euler temporal scheme and a centered convective
discretization, is always unconditionally unstable.
A similar analysis can be carried out for the forward Euler temporal scheme and first order upwind
convective discretization. Assuming 0, the discretized equation becomes:
   
0, (4.135)
∆ ∆

which leads to:


1 0. (4.136)
The amplification factor becomes:
1 . (4.137)

2.0
sigma=0.5
 sigma=0.9
stability limit

1.0

0.0

-1.0

-2.0
-2.0 -1.0 0.0 1.0  2.0
Figure 4.21 Stability diagram for the linear unsteady convection equation with forward Euler scheme and first
order, upwind discretization. Complex amplification for 0.5, 0.9. The stability limit lies inside the red,
dashed circle.
Expression (4.137) represents, in the complex plane   linked to the complex amplification
factor , a circle of radius centered at  1 . The complex amplification factor is shown in

figure 4.21. The stability limit is given by the condition 1, whith ∗ denoting the
complex conjugate of the complex amplification factor. In the complex plane   the stability

42 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

condition is given by the circle or unit radius centered at the origin. For 1 expression (4.137)
gives 1. As a result we can conclude that the unsteady convection equation with forward Euler
and first order upwind discretizations is conditionally stable provided that the parameter verifies:
0 1. (4.138)
As already stated, the parameter ∆ ⁄∆ is called the Courant number, and the stability
condition (4.138) is known as the Courant-Friedrichs-Lewy or CFL condition. Therefore, the stability
condition for the forward Euler and first order upwind discretization scheme becomes that the Courant
number must be smaller than 1. This limits the temporal step that can be used with a given spatial
discretization.
There is a physical interpretation of this stability result. It is connected to the propagation of
information supported by the temporal and convective terms in the original conservation equation,
which creates regions of influence around a given point , , which depends on the flow field
found at previous times within a certain spatial region. Since the linear unsteady convection equation
represents a wave that propagates along the positive direction with constant speed the region of
influence for point , and times ∆ becomes the interval ∆
, as it is shown in figure 4.22.




Figure 4.22 Region of dependence for point , in the linear, unsteady convection equation with positive
convection velocity 0. The solution at and times ∆ depends on the scalar field
developing in the region ∆ , which is shown as a grey zone in the figure.
The stability condition result 1 means that the interval spanned by the grid points used to
evaluate the convective flux at time ∆ includes the region of dependence for the
newly calculated point, since for positive convection velocity, the convective flux evaluation in the
first order upwind discretization involves mesh points and , separated by a distance ∆ . Thus,
if ∆ ∆ the region of dependence is included in the interval used to evaluate the convective flux.
Therefore the CFL stability condition on the Courant number states that the domain of the dependence
of the discretized equation should contain the domain of dependence of the exact modelled
conservation equation.
For non-linear cases the Von Neumann analysis can be applied after linearizing the conservation
equation around a given point and instant. In practice, non-linear and non-periodic boundary
conditions effects result in a reduction in the effective CFL condition, so that the maximum Courant
number is somewhat lower than the one given by the linear stability analysis. Sometimes the Courant
number can be given referred to its maximum value set by the CFL condition.
We can finally perform the stability analysis on the implicit, backward Euler scheme with face
centered discretization of the convective flux:

Fundamentals and Application of Computational Fluid Dynamics 43


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

   
0. (4.139)
∆ ∆

In this case, the equation for the amplitude of harmonic becomes:


0, (4.140)
which provides an amplification factor given by:
. (4.141)

whose modulus is:


. (4.142)

Equation (4.142) indicates that the implicit backward Euler scheme with face centered
discretization of the convective flux is unconditionally stable.
PROBLEM 4.2 Perform a Von Neumann stability analysis to the discretized unsteady convection-diffusion
equation using an implicit backward Euler scheme, a first order upwind discretization of the convective
flux, and a face centered discretization of the diffusion fluxes.

4.9 NUMERICAL INTEGRATION OF THE CONVECTION-DIFFUSION EQUATION IN


3D GEOMETRIES

The discretization techniques presented for the unsteady, one-dimensional convection diffusion
equation can be extended to general two or three-dimensional geometry cases. Consider a three
dimensional FVM element of volume , limited by surface  . This surface will be composed by
a number of plane surface elements or faces denoted as  with 1, … . Each face will be
characterized by an individual data structure that will contain properties such as the coordinates of
the points which define the edges of the face, the area and the components of the normal unit vector,
as well as pointers to the two cells that share the face.
The FVM implementation of the convection-diffusion transport equation for scalar  and cell
becomes:
 ∑ ,  ∙  ∑ ,  ∙ . (4.143)

Both for the steady and unsteady cases, the spatial and temporal discretization of equation (4.143)
will result in an algebraic equation similar to (4.74), obtained for the one dimensional case:
 ∑   ∑  . (4.144)

where the coeffients , represent the coefficients of matrix in equation (4.76) whereas ,
are related to matrix . The determination of the coefficients that appear in (4.144) is done as a
pre-processing task. For each cell , the information necessary to construct the coefficients in
equation (4.144) requires the information of the cell connectivity, i.e., information of the cells that
participate in the fluxes of equation (4.143). The connectivity information can be given in a number
of ways. The data structure defined for the faces can include the connectivity information.
Let us consider for example a cuadrilateral face as the one represented in figure 4.23. The face
could be identified by a global mesh face index, indicating its position within the total number of
faces composing the mesh. The basic face data structure will indicate the number of vertices and,
for each of them, their coordinates. For a cuadrilateral face, we can denote them as , 1, … 4.

44 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

The face data structure is completed with the global indices of the cells and sharing the cell. The
normal face area vector that appears in the calculation of the convective and diffusive fluxes can
be expressed as:
3 1 4 2 . (4.145)

3

2

1
Figure 4.23 Cell connectivity and unit normal vector for face shared by cells and .
The direction of the normal vector, either exterior to cell or can be determined by computing
the product ∙ , with the face center defined as ∑ . If the scalar
product is positive vector is directed exterior to cell .
The above described face data structure can also incorporate information of the boundary
conditions. For example if the face is a boundary face, the index of the shared cell which is on the
exterior of the computational domain could be identified by a negative entire number. The negative
sign will specify that the face is a boundary face. The absolute number of the index could provide a
pointer to the description of the type of boundary condition that it incorporates.
The cell data structure will contain also information as the type of element (triangle or cuadrilateral
in two dimensional geometries; tetrahedron or hexahedron in three dimensional geometries) and the
coordinates of the vertex defining it , 1, … , where denotes the number of vertices
contained in the element. From this information, data needed to set up equation (4.143) can be
obtained. For example, for a tetrahedron cell, the volume becomes:
2 1 ∙ 3 1 4 1 . (4.146)

Finally, in Cartesian coordinates, the three-dimensional convective and diffusion flux vectors
become:

,   ,  ,  , (4.147)

,   ⁄ ,  ⁄ ,  ⁄ . (4.148)

4.10 NUMERICAL SOLVER SCHEMES FOR THE NAVIER-STOKES EQUATIONS

The FVM solution of the unsteady scalar convection-diffusion equation is the building block to solve
the equations that govern fluid flow. The Navier-Stokes equations exhibit specific characteristics that
require further work to solve them. These particularities have different nature when addressing either
incompressible or compressible flows. As a result, numerical techniques for solving incompressible
and compressible flows have evolved following different paths.
A majority of flows where compressibility effects are relevant occur at high Reynolds numbers.
In those cases, molecular transport effects are often restricted to thin layers developing around the

Fundamentals and Application of Computational Fluid Dynamics 45


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

surfaces of solid bodies and to the wakes behind these bodies. By contrast, most of the flow can be
described by the Euler equations. The compressible Euler equations conform a hyperbolic system
which supports the transport of information in the , space. For a specific spatial direction given
by a unit vector and characterized by spatial coordinate , the compressible Euler equations define
trajectories in the plane , called characteristic lines where specific fluid properties are kept
invariant. The fluid properties propagate as waves along these trajectories. The velocity of
propagation depends on the flow properties, but it is a combination of the flow velocity projected
along direction and a thermodynamic property called the sound speed, which for gases is related to
the molecular agitation velocity. When the fluid state departs little from a reference, uniform
condition, the sound speed can be taken as constant and the resulting waves propagate at almost
constant velocity. In this case, the Euler equations can be linearized, and the propagation capability
manifest itself as a set of linear waves. This situation occurs, for example, in acoustic propagation of
small velocity and pressure perturbations. When the fluid state exhibits a significant departure from
the reference, uniform condition the propagation velocity depends on the local state of the fluid, and
non-linear waves are generated. Under appropriate circumstances, the dependence of the wave
propagation speed on the local fluid state leads to the formation of steep wave fronts which eventually
evolve in thin regions where the fluid properties exhibit order one changes. In the limit of the Euler
equations, discontinuities in the flow field appear. The discontinuities supported by the Euler
equations result from the non-linear evolution of its wave propagation capability. The wave
propagation supported by the Euler equations suggests the use of time marching numerical schemes
where the flow field is advanced in time towards the solution. If the problem admits a steady state
solution, the time marching scheme should progress until the steady state solution is achieved. This
strategy for solving the compressible flow equations is used in the density based numerical schemes,
where density, momentum and total energy are used as variables to describe the fluid state. These
schemes work best when the different velocities involved in the wave propagation process are of the
same order, i.e., when the characteristic flow velocity and the characteristic sound speed are similar.
The ratio between these two velocities is the characteristic flow Mach number . Thus, density
based, time marching numerical schemes will work best in flows where 1 .
In most flows where ≪ 1 the pressure differences found in the fluid are very small compared
with the characteristic pressure level. As a result, compressibility effects due to pressure changes are
weak. If, in addition, the temperature differences are small with respect to the characteristic
temperature level, the equation of continuity reduces to the incompressible fluid case. Accepting the
incompressible hypothesis, the Euler equations now become a hyperbolic-elliptic system of
equations, since the temporal term drops from the continuity equation. The elliptic character
introduces stiffness in the equations, since perturbations introduced in a point of the fluid
instantaneously affect to the whole flow domain. In addition, the density becomes constant, and
cannot be taken as one of the variables to describe the fluid state. Instead, pressure, velocity, and
temperature are used in this case. This description gives rise to pressure based numerical schemes.
In this case, the numerical solution of the flow equations cannot be handled with a pure time-marching
scheme. Instead, some iterative solving strategy is needed to ensure that the elliptic continuity
equation is always satisfied. If the problem is steady, the iterative procedure can be designed just to
guarantee that the converged solution will satisfy the continuity equation. If the problem is unsteady,
it is required that some inner iterative scheme is devised to ensure that continuity is enforced at each
time step of the computation.
From the discussion above, it is clear that the numerical approach to solve density based,
compressible flow problems cannot be the same as the one used to deal with pressure based schemes
for incompressible flow problems. Certain modifications can be introduced in density based solvers
so that they can be also applied to steady, low Mach number flows. Likewise, pressure based

46 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

numerical schemes are also able to handle compressible flows not having too strong compressibility
effects. In the rest of this chapter we will describe the pressure based schemes in the context of solving
incompressible flow cases. We will also briefly introduce density based schemes used in compressible
flow solvers.

4.11 DISCRETIZATION OF THE MOMENTUM EQUATION IN COLLOCATED AND


NON-COLLOCATED FLOW SOLVERS

After having analyzed the numerical resolution of the linear, unsteady convection-diffusion equation,
we will discuss the difficulties that will have to be faced when solving the Navier-Stokes equations.
To simplify the analysis, we will focus our attention to the case of steady, one-dimensional,
incompressible flow in a variable area duct. For a control volume centered around cell , the
continuity and momentum equations take the form:
, 0, (4.149)

, , , (4.150)

where the pressure gradient term has been transformed to a volume integral using Gauss's theorem
and , , , respectively represent the components of the convective fluxes for the continuity
and -momentum equations. Likewise, , denotes the component of the diffusion flux in the
-momentum equation:

, , , , , , (4.151)

Consider now the application of equations (4.149), (4.150) to the control volume of cell in figure
4.24, which uses a collocated variable storage option, where both pressure and fluid velocity are
stored in the center of the cell. The mass and -momentum conservation equations become:
0, (4.152)

, (4.153)

Figure 4.24 Control volume for cell used in the discretization of the one-dimensional flow equations with
collocated flow variables defined at the center of each cell.
Inspecting the discretized -momentum equation, we observe that it shares elements with the
convection-diffusion equation analyzed previously, where  . There are, however, two mayor
differences. First, the element multiplying in the convective term is proportional to itself, so that
the convective flux introduces non-linearity in the discretized equation. Second, a new term appears
which incorporates the effect of the pressure gradient in the flow. It is acting as a source term in the
momentum equation, but its strength is unknown, since the pressure field is part of the solution we
are seeking. Except for very specific cases, the pressure gradient term is key to maintain the flow,
since is the only term in the momentum equation not exhibiting a velocity dependence. Therefore, for
a fluid initially at rest with no moving solid surfaces, the pressure gradient is the only term that can

Fundamentals and Application of Computational Fluid Dynamics 47


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

impart motion to the fluid. As a result, except for very specific flow cases, the pressure gradient is of
the order of the largest fluid response term and there is a strong coupling between the pressure and
the velocity fields. For incompressible flows the coupling is even stronger. This can be seen by taking
the divergence of the differential, incompressible momentum equation:
∆ ∙ , (4.154)
where ∆ . denotes the Laplacian operator. According to equation (4.154), the Laplacian of the
pressure is driven by the velocity field, thus highlighting the strong link between the two dependent
variables. Equation (4.154) makes use and can replace the continuity equation to formulate, together
with the momentum equation, a system of two partial differential equations in and . The previous
discussion hints that the pressure field is key in the flow resolving process, and that is strongly linked
to the velocity field in incompressible flow.
Let us now try to apply the convection-diffusion equation solving techniques to solve equation
(4.153), using the collocated variable storage scheme proposed in figure 4.24, where both , are
defined at the center of the FV cell elements. The scalar  in this case is represented by the velocity
. Assume that the Reynolds number is large enough so that we can neglect the viscous diffusion
flux in (4.153). In addition, let us suppose that the convective fluxes are upwind interpolated, and that
a face centered interpolation is used for the pressure field. In that case, equation (4.153) becomes:

, (4.155)

or:
. (4.156)

Equation (4.,156) shows the structure of the steady convection-diffusion equation with a source
term that is proportional to the pressure difference . A problem with this numerical scheme
can be immediately identified, since a chessboard pressure field, with two different pressure levels in
odd and even cells, can be added to equation (4.156) without having any impact in the velocity
solution. As a result, unphysical solutions with pressure oscillations can appear if a collocated scheme
is used together with a centered pressure interpolation.
A way to avoid this problem is to use a non-collocated, staggered storage strategy for pressure and
velocity, as shown in figure 4.25.

Figure 4.25 Control volume around cell for the discretization of the one-dimensional flow equations with
mesh staggered definition of flow variables.
In the staggered mesh option, the pressure is still defined at the center of the control volumes, but
the velocity is defined at the faces separating consecutive cells. With this choice the control volume
to establish the momentum equation must be modified, as it is shown in figure 4.26.

Figure 4.26 Control volume used to establish the momentum equation in the non-collocated storage option.
The staggered control volume for is shown in grey.

48 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

In this case, using the same convective upwind and pressure centered interpolations as before, the
momentum equation for the staggered control volume centered around face becomes:
, (4.157)
which can again be written in the proper form to iterate with respect to unknown variable :
. (4.158)
Expression (4.158) does not support an arbitrary added chessboard pressure field solution, since
the pressure term appears as the difference between the pressure level of two consecutive cells. We
conclude then that the use of a staggered definition for the pressure and velocity fields can
automatically avoid the appearance of unwanted oscillations in the flow solution. For this reason, the
non-collocated approach is the primary choice to formulate pressure based schemes. We will thus
initially follow this approach to discretize the incompressible flow equations.

4.12 PRESURE BASED, INCOMPRESSIBLE FLOW SOLVER. THE SIMPLE SCHEME

The SIMPLE (Semi Implicit Method for Pressure-Linked Equations) algorithm was developed in the
early 1970's [7] as an effective way to simultaneously solve the incompressible momentum and
continuity equations using a non-collocated storage of the pressure and velocity fields. We will
illustrate the algorithm for the variable area, one-dimensional, incompressible steady flow case.
Following the previous discussion, the pressure will be stored at the center of the finite volume
cells, whereas the velocity will be stored at the faces separating consecutive cells. A generic cell
will be identified by index . The west and east faces limiting this cell will be respectively referred to
as and 1 , as shown in figure 4.27.

1 1 1

Figure 4.27 Staggered control volumes used in the non-collocated discretization of the continuity equation
(left) and of the -momentum equation (right).
The continuity equation is enforced using control volumes centered around the nodes where the
pressures are defined. For cell shown at the left of figure 4.27, it results:
0, (4.159)
Assuming that is an interior face, the -momentum equation for the staggered cell centered
around becomes (see right sketch in figure 4.27):
. (4.160)

Observe that with the staggered mesh choice, there is no need to interpolate the pressure in
expression 4.160. On the other hand, we have to decide the interpolation scheme used for the
convective and diffusion fluxes, according to the options seen in section 4.5. Using a first order
upwind interpolation for the convective fluxes and a face centered interpolation for the diffusion
fluxes, assuming that the velocity field is always positive, it follows:

∆ ∆
, (4.161)

Fundamentals and Application of Computational Fluid Dynamics 49


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

where ∆ represents the dimension of cell in the direction. Rearranging equation (4.161):

∆ ∆ ∆ ∆
, (4.162)

which exhibits the following structure:


∑ , (4.163)
where denotes faces neighbour to . Expression (4.163) is similar to the one obtained when
resolving the discretized convection-diffusion equation, with an added term due to the pressure
differences, which is in fact acting like a source term. Observe also that in the discretized momentum
equation for the staggered cell centered at face the coefficients , depend on the velocity
itself, giving the discretized momentum equation its non-linear character. Thus, for :

, (4.164)
∆ ∆

The SIMPLE algorithm proceeds in an iterative way to simultaneously verify (4.163) and (4.159),
by using a predictor-corrector iterative strategy. Let us assume that after iterations the pressure at
cell is and the velocity at face is denoted as . The algorithm defines a predictor-corrector
scheme to obtain the next pressure and velocity variables at iteration level 1 , which should
eventually converge to the discretized flow solution.
The predictor step is specified by defining guessed pressure and velocity fields ∗ , ∗ , solution of
the linearized momentum equation (4.163). The guess pressure is the pressure field obtained at the
previous iteration. In addition the previous iteration velocity field is used to evaluate the ,
coefficients that appear in (4.163). Thus:

. (4.165a)
∗ ∗ ∗ ∗
∑ . (4.165b)
where is the coefficient defined in equation (4.164), setting , and similarly for .
The solution for the system of equations (4.165a) - (4.165b) can be achieved using some iterative
procedure, such as the Jacobi, Gauss-Seidel, or SOR methods introduced in section 4.6.
The guessed velocity field so obtained, ∗ , does not verify the continuity equation. In order to do
that, a corrector step is devised by introducing perturbations to the guessed pressure and velocity
fields:

, (4.166)

, (4.167)
such that the corrected field also verifies the linearized momentum equation:
∑ . (4.168)
Substracting (4.165b) from (4.168) gives a relationship between the velocity and pressure
corrections:
∑ . (4.169)
When the system has converged, both the velocity and pressure corrections should vanish. Based
on this observation, equation (4.169) is modified to obtain a simple relationship between the velocity
and pressure corrections:

50 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

, (4.170)
or:
, (4.171)

and the corrected velocity becomes, according to equation (4.166):



. (4.172)

The pressure perturbation is selected so that the corrected velocity field verifies the continuity
equation (4.159):

∗ ∗
0 , (4.173)

which can be rearranged to give:


∗ ∗
, (4.174)

which again exhibits a similar structure to (4.165b) and can again be solved using the iterative
procedures of section 4.6 to obtain the pressure correction field . In this case the source term for
∗ ∗
the equation system (4.174) is , which is the error in the continuity

equation of the guess velocity field . This means that after the guess velocity field verifies the
continuity equation, the source term in (4.174) vanishes and the solution to this system of equations
will give 0.
Once that the pressure correction is obtained from (4.174), the velocity corrections follow from
expression (4.171). The pressure at iteration 1 is defined as:

1 , (4.175)
where expression (4.165a) has been used and is an under-relaxation parameter for the pressure
field, such that 0 1 . In the same way, the velocity field at iteration 1 is defined as:

1 , (4.176)
with being a velocity under-relaxation parameter, also ranging between 0 and 1. The purpose of
the under-relaxation parameters is double: on one side, they limit the pressure flow field correction
when the initial guess is far away from the converged solution, which can initially create large values
of the correction. In addition, they smooth out the simplification introduced from expression (4.169)
to (4.170), which can impose on the pressure correction an excessive load when enforcing the
continuity equation (4.173). Typically, the optimum relaxation values depend on the Reynolds
number, on the interpolation used in for the convective and viscous fluxes, and on the mesh
parameters. For the SIMPLE algorithm with first order upwind convective and face centered viscous
interpolations 0.3, 0.7 can be taken as indicative values.
Once that the new pressure and velocities have been updated using (4.175), (4.176), the rest of
scalar fields  such as temperature or turbulent magnitudes are solved, using the convection-diffusion
equation solving techniques previously introduced in this chapter.
Observe that, with definition (4.176), the velocity field at iteration 1 satisfies the discretized
continuity equation. However, in general it does not satisfies the momentum equation for two reasons.
In first place the initial guess ∗ satisfies the momentum equation with coefficients evaluated using

Fundamentals and Application of Computational Fluid Dynamics 51


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

the velocity field from the previous iteration. In addition, the velocity corrections neither verify
the momentum equation as a result of the simplification introduced from (4.169) to (4.170). However,
when the correction fields tend to zero, both the continuity and momentum equations are
simultaneously satisfied.
In order to complete the scheme, we have to see how it needs to be modified at the cells and faces
that implement the boundary conditions. For the one dimensional case, the differential continuity and
momentum equation can be obtained by taking the limit in expressions (4.152) and (4.153), when the
thickness of the control volume tends to zero. It follows:
0, (4.177)

, (4.178)

Equation (4.177) implies that the product is a flow invariant, i.e., it remains constant for every
. As a result, the continuity equation fixes the velocity distribution in the duct, once that a value at
a given station is given. According to (4.177) if the velocity is positive, the value should be fixed
at the inlet plane. Then, in spite that equation (4.178) is second order in , the velocity field is already
fixed by continuity and therefore no additional condition can be specified. With respect to pressure,
equation (4.178) states that only pressure differences appear in the incompressible case. This means
that if is the pressure field solution of an incompressible flow problem, with
being an arbitrary reference level is also a solution. Up to that reference constant level, the pressure
distribution can be directly obtained from (4.178), once that the velocity distribution is fixed by
(4.177). If the absolute values of the pressure are required, then (4.178) indicates that we have to
specify the pressure value at some station . Therefore the specification of the velocity at some
location and of the pressure at other, not necessarily coincident, location completely determines the
velocity and pressure distribution of the one dimensional set (4.177)-(4.178). From the mathematical
point of view, alternative specifications are possible, although some can become ill-behaved. This is
the case for specifying the pressure level at two different stations. Equations (4.177) and (4.178)
indicate that the distribution of pressure differences is completely specified once that the velocity
field is given. In the limit of large Reynolds numbers for example, with negligible viscous effects, if
the two points selected to give the pressure boundary condition have the same area they should have
the same pressure level, and the problem definition is not completed, since in fact only one pressure
level is given and the velocity distribution becomes undefined. Therefore if two pressure levels are
specified at two different stations the areas in these two stations must be different. If the duct has
constant area, specifying the pressure level at two locations becomes an ill condition for → ∞.
When solving the numerical problem, the specification of the velocity and/or pressure must be
done at the boundary cells so that the discretized equations in the adjacent cells can be solved.
According to the discussion above, possible combinations include:
a) Specifying the velocity at the inlet and outlet boundaries, in a compatible way with the inlet
specification. In this case, the pressure solution can be found up to a reference level, which
can be given as an independent parameter in the computation in the form of the absolute
pressure level found at a particular location of the flow.
b) Specifying the velocity at the inlet boundary and the pressure at the outlet boundary. In this
way the absolute pressure distribution is fixed.
c) Specifying the total pressure at the inlet boundary and the pressure at the outlet
boundary.

52 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

Let us see the treatment of the inlet cell, identified with 1, for the case in which we specify at
the inlet the flow velocity (figure 4.28). In this case the first cell incorporates a velocity inlet boundary
condition, and the value of the velocity at the west face of cell 1 is given by the boundary condition,
. As a result, no momentum equation needs to be resolved in this face during the predictor
step.

1 2

1 2
Figure 4.28 Implementation of velocity inlet boundary condition.
When solving the pressure correction for cell 1, the continuity equation (4.173) becomes:


0, (4.179)

which results in the following equation for :



. (4.180)

The implementation of the velocity outlet boundary condition follows a similar path (figure 4.29).

1
Figure 4.29 Implementation of velocity outlet boundary condition.
In this case, assuming that the boundary cell is identified with the index , the momentum
equation at face 1 needs not to be solved, since . The equation for the pressure
correction at cell is obtained after establishing the continuity equation at cell :


0, (4.181)

which, after rearranging, provides an equation for the pressure correction at cell :

, (4.182)

The way to implement pressure boundary conditions follows a similar approach. For example,
consider fixing a pressure outlet condition, where the pressure is fixed at the outlet cell . In this case
, with being the specified outlet pressure. Thus, at each iteration, the predictor value
of the pressure at cell becomes:

. (4.183)

with this value the predictor and correction values of the velocity at face can be obtained
applying equations (4.165b) and (4.171). The correction value of the velocity at the outlet face
1 is given by enforcing the continuity equation in cell :
∗ ∗
, (4.184)

Fundamentals and Application of Computational Fluid Dynamics 53


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

When fixing the inlet total pressure, an indirect method can be used during the iterative process
that will convert the inlet total pressure into a velocity inlet condition. This will allow a simple
resolution of the flow field. If the inlet total pressure level is , , the inlet velocity can be adjusted
during the iterations as :

, , (4.185)

After implementing the boundary conditions, an algebraic system of equations is obtained which
must be solved using an iterative method. The convergence of the iterative scheme can be quantified
by defining appropriate residual expressions. For the convergence of the continuity equation, a
suitable residual at iteration and cell can be based on the mass imbalance:
. (4.186)
Therefore, the continuity scaled residual al iteration becomes:

. (4.187)

Likewise, the residual at iteration for the momentum equation can be defined as:

. (4.188)

We can apply the one-dimensional incompressible, pressure scheme based on the SIMPLE
algorithm to solve the variable area duct equations (4.177)-(4.178). Let us consider a duct of length
described by a linear area variation:
1 . (4.189)

with 1, and subject to an inlet flow of incompressible fluid having a velocity , with density
and viscosity respectively given by , . Integration of equations (4.177)-(4.178) provides the
distribution of velocity and pressure along the duct:

1 , (4.190)

1 ⁄ 1 1 , (4.191)

where ⁄ is a characteristic Reynolds number of the flow and is a reference pressure


level found at .
The case 1 ⁄ , 1 ⁄ , 1 , 1 with 0.5 represents a converging
channel where the outlet velocity becomes 2 . Appropriate inlet and outlet velocity boundary
conditions for this case are:
0 , 1 2 , (4.192)
At large Reynolds numbers, the pressure field (4.191) approaches the ideal solution, where the
total pressure is constant along the flow. For the case 10 , corresponding to
10 ⁄ ∙ , the solution obtained with relaxation parameters 0.2, 0.7 for a
computational domain that includes 10 cells is given in figure 4.30.

54 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

A pressure reference of 1 is set at 0.65. This is accomplished by adding, after


completing every iteration, a constant pressure field to the solution so that the reference pressure
is always recovered at .
The selected relaxation parameters result in complete convergence achieved in about 200
iterations. For this specific Reynolds number, optimized relaxation parameters can be selected so that
convergence can be achieved in 150 iterations, but the set of parameters 0.2, 0.7 gives
adequate convergence for any Reynolds number.

2.0 2.0
U exact
U numerical
1.E+03
1.8 P exact 1.6
P numerical
1.E+00

1.6 1.2 1.E-03

1.E-06
1.4 0.8
1.E-09

1.2 0.4 continuity


1.E-12 momentum

1.E-15
1.0 0.0
0 50 100 150 200 250
0.0 0.2 0.4 0.6 0.8 1.0

Figure 4.30 Incompressible pressure based scheme with SIMPLE algorithm applied to one-dimensional
converging duct flow, 10 . Computational domain divided in 10 equally spaced cells. Left: pressure and
velocity field. Right: residual convergence.
For the one-dimensional case, the error in the velocity solution is negligible, since the algorithm
ensures the continuity in each cell and the velocity inlet boundary condition sets the appropriate mass
flow rate.
2.0
numerical, N=4
numerical, N=10
1.6
exact

1.2

0.8

0.4

0.0
0.0 0.2 0.4 0.6 0.8 1.0

Figure 4.31 Comparison of pressure field results for two different mesh sizes in the converging duct problem
of figure 4.30.
The pressure solution exhibits errors relative to the inlet dynamic pressure that are 10 . Figure
4.31 compares the pressure solution for 10 and 4. As the cell size practically doubles
between the two cases, the relative error in pressure is also multiplied by the same factor, indicating

Fundamentals and Application of Computational Fluid Dynamics 55


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

an error dependence that is first order with respect to the mesh size. This is due to the first order
discretization error attached to the convective upwind interpolation.
For ≪ 1 the pressure evolution is determined by viscous effects. The solution obtained for
0.1, 10 ⁄ ∙ , 10 is shown in figure 4.32. In this case, the error in pressure must be
referred to the characteristic change in pressure, which is of the order of ⁄ , resulting 10
since it is now governed by the error in the discretization of the viscous flux, which is second order
accurate for the face centered interpolation used here.

2.0 6.0
U exact
U numerical 1.E+03
1.8 P exact 4.0
P numerical continuity
1.E+00 momentum

1.6 2.0 1.E-03

1.E-06
1.4 0.0
1.E-09

1.E-12
1.2 -2.0
1.E-15
0 50 100 150 200 250
1.0 -4.0
0.0 0.2 0.4 0.6 0.8 1.0

Figure 4.32 Incompressible pressure based scheme with SIMPLE algorithm applied to one-dimensional
converging duct flow, 10 . Computational domain divided in 10 equally spaced cells. Left: pressure and
velocity field. Right: residual convergence.

4.13 MODIFIED PRESSURE-VELOCITY COUPLING SCHEMES FOR PRESSURE BASED


SOLVERS

Since its introduction, a number of variants in the SIMPLE algorithm have been developed. They
target to improve the predictor-corrector strategy in which it is based. The objectives are to increase
the scheme accuracy and/or to improve its convergence rate. The simplification introduced by
SIMPLE in equation (4.22) is very effective to establish the velocity corrections, but, on the other
hand, it can be no so effective to correct the pressure field and ensure a rapid momentum equation
convergence. A number of modified algorithms have been proposed to improve these deficiencies.
We will briefly describe here two of them: SIMPLEC and PISO.

4.13.1 SIMPLEC
In the SIMPLEC (SIMPLE-Consistent) algorithm [8] the relationship between the velocity and
pressure corrections (4.170) is modified in an effort to bring it closer to the complete expression
(4.169):
, (4.193)

which implies that is being replaced by .in equation (4.169). Therefore we are making
the approximation and, in addition, we are introducing the momentum under-relaxation

56 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

parameter . In this way it is possible to avoid the zero in the denominator of (4.193) that would
result in a uniform area, constant velocity flow, where ∑ . Calling:
∑ , (4.194)
allows the modification of equation (4.174), which becomes:

∗ ∗
, (4.195)

The modified equations for the pressure correction in boundary cells 1, are now:

. (4.196)


, (4.197)

1.E+03

momentum, SIMPLE
1.E+00 momentum SIMPLEC

1.E-03

1.E-06

1.E-09

1.E-12

1.E-15
0 50 100 150

Figure 4.33 Evolution of the momentum residual for the 4 cell one-dimensional duct problem, 10 .
Comparison of SIMPLE and SIMPLEC algorithms.
Observe that the source terms that depend on the guess velocity field ∗ and that appear in
equations (4.195)-(4.197) are exactly the same as in the SIMPLE algorithm, and that the only change
are the new coefficients . Since in this case we are incorporating some contribution from the
neighbor velocity corrections in the momentum equation of the corrector step, (4.169), the pressure
update does not need to be under-relaxed, i.e., 1, which means:
, (4.198)
After solving for , the velocity correction is obtained from equation (4.193), and the updated
velocity field is given by equation (4.176). The SIMPLEC algorithm can improve in some cases the
convergence rate of the pressure based scheme with respect to the SIMPLE implementation. Figure
4.33 shows the evolution of the momentum residual for the 4 cell, one-dimensional duct described in
the previous section. The SIMPLEC algorithm is seen to converge to a given residual level with a

Fundamentals and Application of Computational Fluid Dynamics 57


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

20% iteration count saving. In general terms, the convergence improvement depends on the specific
flow and boundary condition details.

4.13.2 PISO
The PISO (Pressure Implicit with Splitting of Operators) pressure-velocity coupling algorithm [9] is
also a SIMPLE based procedure for solving the pressure based flow equations which was originally
developed for the non-iterative, time marching computation of unsteady flows. It has been adapted to
include the computation of steady flow following a standard iterative process. The PISO algorithm
involves one predictor and two corrector steps. The predictor and first corrector steps follow the
SIMPLE strategy. We will denote ∗∗ , ∗∗ as the velocity and pressure obtained after the SIMPLE
predictor-corrector step:
∗∗ ∗
, (4.199)
∗∗ ∗
, (4.200)

where the predictor , ∗ and corrector , fields are obtained following the SIMPLE
procedure. The first corrected pressure and velocity fields verify:
∗∗ ∗ ∗∗ ∗∗
∑ . (4.201)

As a result, the set ∗∗ , ∗∗ does not verify the linearized momentum equation. In PISO, a second
correction is proposed for the pressure and velocity fields, such that second corrected magnitudes are
denoted as ∗∗∗ , ∗∗∗ . This set is constructed to approximately verify the momentum equation,
following expression (4.201):
∗∗∗ ∗∗ ∗∗∗ ∗∗∗
∑ , (4.202)
Substracting equations (4.202) and (4.201) an equation for the second corrected velocity results:
∗∗∗ ∗∗ ∑ ∗∗ ∗
, (4.203)

where the second pressure corrections are defined as:


∗∗∗ ∗∗
, (4.204)
An equation for the second pressure corrections is obtained by ensuring that the second corrected
velocity field satisfies the continuity equation:
∗∗∗ ∗∗∗
. (4.205)
∗∗
Since the first corrected velocity field satisfies the continuity equation, expressions (4.203)
and (4.205) provide an equation for :

, (4.206)

where the source term is given by:


∗∗ ∗ ∗∗ ∗
∑ ∑ , (4.207)

in the previous expression we are taking into account that the first corrected velocity field ∗∗ satisfies
the continuity equation. After solving (4.207) for the second pressure corrections, equation (4.203)

58 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

can be used to determine the second corrected velocity field. The updated flow field is finally obtained
introducing appropriate under-relaxation parameters:
∗∗∗
1 , (4.208)
∗∗∗
1 , (4.209)
Compared to the SIMPLE and SIMPLEC procedures, the PISO algorithm involves two corrector
levels, and therefore requires more memory storage space. However, it can accelerate the
convergence rate with respect to the previous schemes. When used in unsteady computations, the
double correction step usually ensures adequate convergence even if a non-iterative procedure is used
at each temporal iteration. In general, if there is not strong coupling with other scalar equations such
as turbulent magnitudes, PISO shows robust convergence behavior and also less overall
computational effort when compared with SIMPLE and SIMPLEC. When there is a strong coupling
between other scalars and the pressure-velocity field, the advantage of PISO might be lost. In this
strongly coupled scenarios, both SIMPLE and SIMPLEC usually give robust convergence behavior.

4.14 EXTENSION OF STAGGERED, PRESSURE BASED SOLVERS TO 3D FLOWS

The pressure based numerical schemes presented in the previous sections can be extended to include
two or three dimensional geometries. If the mesh can be arranged with faces parallel to the planes of
a Cartesian coordinate system, the extension of the staggered, pressure based schemes does not pose
additional difficulties.

Figure 4.34 Mesh definition of variables for staggered, pressure based schemes in two-dimensional Cartesian
mesh geometry.
Consider for example a two dimensional geometry with a mesh formed by rectangular cells (figure
4.34). The pressure and other scalars (temperature, turbulent magnitudes, density in case of a
compressible flow) are stored at the center of the primary cells. The velocity components of the
velocity field are stored at the mesh faces whose normal is aligned along the direction (faces ,
in figure 4.34). Likewise, velocity components are stored at the mesh faces whose normal is aligned
along the direction (faces , in figure 4.34). Primary cells such as the one highlighted in figure
4.34 are used to enforce the continuity equation. For cell and steady state flow, it follows:
0, (4.210)

Fundamentals and Application of Computational Fluid Dynamics 59


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

where no interpolation is needed for the velocities at the faces. The momentum equation for is
written after constructing a staggered cell around mesh face . For steady state flow it becomes:
∆ ∆ ∆y , , ∆ , , ∆ . (4.211)

The momentum equation for follows in a similar way:



∆ ∆x , , ∆ , , ∆ (4.212)

where , represents the viscous shear stress. The subscript refers to the intersection corner
between mesh faces and , i.e., the north-east corner of cell . A similar convection is used with
subscripts , . The main contribution to the viscous stresses is proportional to the rate of strain
tensor, , 2 , which in turn is constructed from the gradients of the velocity components. The
value of these gradients at the cell centers can be directly computed using the Green-Gauss or least
squared cell gradient algorithms introduced in section 4.5. The gradients at the cell corners can then
be computed from an average of the gradients in the cells sharing the corner. Equations (4.211),
(4.212) also require defining interpolation schemes for the convective fluxes. For example, if 0
and a first order upwind interpolation scheme is defined for the convective fluxes, . Following
this approach, it is possible to establish momentum equations for each of the velocities defined in the
staggered mesh. Using a SIMPLE based velocity-pressure coupling scheme, the linearized
momentum equations can iteratively be solved to determine the predictor velocity field, ∗ , ∗ . The
definition of a corrector step leads to the continuity equation (4.210) becoming an expression for the
pressure corrections. After iteratively solving it, the velocity corrections can be directly determined
and the flow calculation can proceed to the next step. The extension to 3D geometries with cells
formed by hexahedra whose faces are parallel to the planes defined by a Cartesian coordinate system
is straightforward (figure 4.35). In this case two additional faces and velocities (referred to as bottom
and top ) are defined at each cell, with scalars such as pressure or temperature still defined at
the cell centers.

Figure 4.35 Mesh definition of variables for staggered, pressure based schemes in three-dimensional Cartesian
mesh geometry.
The application of cells elements whose faces are parallel to the Cartesian system planes in
complex geometry flows can be achieved using the Chimera grid approach [10]. However, in complex

60 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

geometries the most common meshing strategy involves defining structured, body fitted or
unstructured grid topologies.
The application of pressure based schemes with staggered storage to curvilinear, body fitted mesh
topologies requires using velocity components that are aligned, at each element, with the mesh lines
(figure 4.36). For body fitted mesh topologies, the definition of the velocity vector at the cell faces
follows the approach developed for finite difference schemes, and can be achieved in two ways.

Figure 4.36 Variable definition for pressure based schemes with staggered variable storage and body fitted
mesh topology.
The first option involves defining the local curvilinear coordinates ,  at each face selecting the
direction that connects the cell centers sharing the face  and the direction(s) defining the tangent
plane to the face  . The velocity components defined in this way  ,  are called covariant
velocity components. The second option involves defining the velocity components in the normal
direction to the face  , and in the plane perpendicular to the line connecting the centers of the cells
that share the face  . In this case, the velocity components  ,  are called contravariant
components. With these definitions, both covariant and contravariant formulations are suitable for
pressure based schemes with staggered variable storage. At each face, only the velocity component
perpendicular to the face (contravariant formulation) or the one defined along the lines joining the
centers of the cells sharing the face (covariant formulation) are used. SIMPLE based pressure-velocity
coupling algorithms can be adapted to the curvilinear variable organization. There are two main
drawbacks with this approach:
a) Formulating the momentum equations using curvilinear velocity components requires
including non-linear terms that involve the curvature of the curvilinear system, and which
appear as additional source terms in the momentum equations. Calculating these terms adds
complexity and can compromise the stability of the numerical scheme.
b) Cartesian velocities are required to compute terms that appear in the equations, including key
turbulent production terms in turbulent flows or the simple evaluation of viscous fluxes.
Typically, the Cartesian velocity components must be reconstructed after each iteration to
compute these terms, creating additional complexity and in some cases further compromising
the stability and robustness of the scheme.
The application of pressure based schemes with non-collocated variable storage to unstructured
mesh topologies is even more problematic, since the generalization of the momentum equation in
such cases is very complex. The remedy to avoid the difficulties attached to the formulation of
pressure based collocated solvers in non-Cartesian mesh topologies is the use of collocated schemes.

Fundamentals and Application of Computational Fluid Dynamics 61


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

4.15 COLLOCATED, PRESSURE BASED, INCOMPRESSIBLE FLOW SOLVERS

In collocated schemes all the variables are defined at the same mesh locations. For cell centered
formulations, the locations are the centers of the cells. This choice is optimal to define solution
algorithms that can be applied to complex geometry meshes, being either body fitted meshes, or
unstructured grids with even different element types. The disadvantage of selecting a collocated
scheme is that it will support the onset of chessboard modes, leading to instabilities that must be
prevented. We can have a close look to this problem by analyzing a collocated scheme in an
incompressible, one-dimensional, constant area case and a SIMPLE-like strategy (figure 4.37).

Figure 4.37 Collocated, pressure based schemes. Control volume used to establish the continuity and
momentum equations. Variable storage is shown above the flow domain, indicating that both pressure and
velocity are stored at the center of the cells.
Assuming negligible viscous effects, the momentum equation applied to cell gives:

. (4.213)
In equation (4.213) we need to interpolate the convective flux, as well as the pressure at faces , .
Regarding the convective interpolation, using for example a first order upwind approximation, and
assuming that the velocities are positive, equation (4.213) becomes:
. (4.214)
In general, the discretization of the convective and viscous fluxes in the momentum equation for
cell will give:
∑ . (4.215)
If we use a linear interpolation for the pressure field:
⁄2 , ⁄2 , (4.216)
equation (4.215) becomes:
∑ , (4.217)

which supports a chessboard mode, in the sense that a pressure field with uniform but different
pressure levels at the odd and even cells can be added to equation (4.217) without altering it. Equation
(4.217) can be written as:
, (4.218)

where:
∑ (4.219)

acts as an average velocity of the cells that are neighbor to . Similar equations will result after
discretizing the momentum equation in cells , :

62 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

, . (4.220)

Equations (4.218), (4.220) can then be taken as basis to construct a predictor step for the velocity
field. The continuity equation for cell establishes the balance between the mass convective fluxes
at faces , for which an interpolation of the velocities is needed. For example, if we use a centered
interpolation:

, (4.221)

, (4.222)

Observe again that, regarding the face velocities, an arbitrary pressure field for which
and appears as a uniform pressure field. This means that also in this case a chessboard
pressure pattern can be added to equations (4.221)-(4.222) without altering them. The same happens
if instead of using a centered interpolation the face velocities are based in an upwind interpolation for
the velocities , . The continuity equation for cell is written as:
0. (4.223)
This mass convective balance provides an equation for the pressure field:

, (4.224)

that clearly also supports a solution where the pressure field in odd and even cells differs by an
arbitrary difference level. This will lead to the growth of chessboard flow instabilities when trying to
apply SIMPLE based iterative procedures for the collocated, pressure based scheme.
The origin of the problem can be seen by inspecting equation (4.221), giving the interpolated face
velocity. It depends on pressure differences that do not involve adjacent cells, but alternate cells (
and ). The chessboard mode can be destroyed if we make the face velocities to depend on
pressure differences between adjacent cells. This can be achieved if, instead of (4.221), we use for
the definition of the face velocity the following expression [11]:

, (4.225)

with:
, (4.226)

The face velocity is then constructed from the linear interpolation of the velocities at the adjacent
cells, ⁄2, plus a correction that is proportional to the adjacent cells pressure difference and,
with negative contribution, to the pressure differences in the alternate cells closest to the face.
, (4.227)

The correction term can be rearranged in a slightly different way by defining at each cell velocities
used for the continuity equation. Thus, for cell we can define east and west velocities:

, 2 , , 2 , (4.228)

The velocity at a face is then constructed from the interpolated value of the two cells sharing the
face. For example, for face in figure 4.37:

Fundamentals and Application of Computational Fluid Dynamics 63


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

, , 2 2 , (4.229)

which reproduces the face velocity defined in (4.225). The last two terms in expression (4.229)
represent the perturbations introduced to define the face velocities linked to each cell. We can relate
them to the Laplacian of the pressure field:

∆ . (4.230)

Therefore:
∆ ∆
, , , . (4.231)

The face velocity becomes:



, , , (4.232)

and similarly for . The face velocities can be finally written as:
∆ ∆
, . (4.233)

As a result, the face velocities incorporate a correction that is proportional to the third derivative
of the pressure. Establishing the continuity equation leads to:
∆ ∆
. (4.234)

The right hand side of the equation (4.234) is related to the 4th derivative of the pressure:

. (4.235)

Therefore the continuity equation constructed with the modified face velocities is equivalent to
linearly interpolating the face velocities from the shared cells and adding a dissipation term that is
proportional to the 4th derivative of the pressure, with the dissipation coefficient being proportional
to ∆ , and therefore vanishing when ∆ → 0. Introducing the corrector step in the cell pressure and
velocities, expression (4.235) provides an equation to obtain the pressure correction field, as was done
in the staggered scheme. Without the addition of the dissipation term, the equation will support
chessboard instability and the pressure field would diverge. The 4th order dissipation term is very
efficient to suppress odd-even or chessboard instability modes, so that it helps stabilizing the
computation of the pressure correction field. The face velocities defined in (4.233) include the linearly
interpolated velocity field between the face shared cells, which provides second order accuracy. The
correction term introduces an additional third order discretization error. Therefore, the interpolation
used to construct the face velocities defined in (4.233) is second order accurate. The definition of
modified face velocities by adding the pressure difference terms is known as momentum interpolation
for the continuity equation [11].
As a result of the above, the continuity equation is satisfied by the face defined velocities, but not
by the ones linked to the cell, which only satisfy the momentum equations. This is a departure from
staggered pressure schemes, where only one set of velocities are defined, satisfying both momentum
and continuity.
The practical implementation of the collocated pressure scheme based on the SIMPLE algorithm
follows an iterative procedure. For the one dimensional case the starting point for each iteration is the
discretized cell velocity and pressure field, which for cell we denote as , . As in the staggered

64 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

approach, a predictor step for the pressure and cell velocities is defined, with the cell velocities
verifying the discretized momentum equation. For the one-dimensional case it results:

. (4.236a)
∗ ∗
∗ ∑ ∗
. (4.236b)

where in this case the momentum equation only involves the cell defined velocities. After this set of
equations is converged using the iterative methods introduced in section 4.6, the hat velocity for each
cell can be computed:
∗ ∗
∑ ∗ ∗
. (4.237)

Next, the predictor step face velocities are constructed. For faces sharing cell they become:
∗ ∗ ∗ ∗ ∗ ∗
, (4.238)

As it happens in the staggered scheme, these face velocities do not satisfy the continuity equation.
Therefore, a corrector step is introduced:

. (4.239)

. (4.240)
The relationship between the face velocity and pressure corrections is obtained from equations
(4.238). For the correction at face it becomes:

. (4.241)

Similarly to what is done in the staggered scheme, the previous expression is simplified to contain
a simple linear relationship between face velocities and cell pressure corrections:

. (4.242)

In order to speed up convergence, also cell velocity corrections are defined:


. (4.243)

Next, continuity is enforced in the corrected face velocity field:


∗ ∗ ∗
, (4.244)
which becomes an equation to find the pressure corrections:

, (4.245)
with:

, , (4.246)

Equation (4.245) is solved using the iterative methods of section 4.6. Notice that this equation is
driven by the source term ∗ which is the continuity unbalance of the predictor step face velocities.
Therefore when the face velocities obtained in the predictor step, equations (4.238), satisfy continuity

Fundamentals and Application of Computational Fluid Dynamics 65


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

the solution of the pressure correction equations (4.245) will give 0 for all cells. In turn this will
produce, following equations (4.242), (4.243) zero corrections in the face and cell velocities. After
solving equation (4.245), the cell velocity and pressure are updated following the standard under-
relaxation procedure:

1 , (4.247)

1 , (4.248)

4.16 DENSITY BASED, COMPRESSIBLE FLOW SOLVERS

Density based schemes were initially developed to solve the compressible flow equations. They can
be very effective to resolve flows whose characteristic velocity is comparable to the characteristic
sound speed, i.e., in flows whose characteristic Mach number is order unity. For low speed flows
≪ 1 , density based solvers become ineffective compared to pressure based schemes, except in
steady state problems, where some manipulation of the Navier-Stokes equations can be performed to
increase their efficiency. In general, density based schemes have been used to solve compressible
flow with 1 . As it was the case with pressure based methods, collocated schemes are also
preferred in density based solvers for handling complex geometries. The instability problems that
were found in collocated pressure based schemes are exacerbated in compressible flow, since the
compressible Euler equations admit the existence of surfaces where the flow variables are
discontinuous. In particular, in the limit of the Euler equations shock waves appear as surfaces where
pressure, density, and relative fluid velocity normal to the shock undergo jumps across the surface.
Such discontinuities introduce added complexity to prevent the instability of the numerical scheme.
We will assume that the compressible fluid can be described as a perfect gas. The integral
formulation of the Navier-Stokes equations set for a perfect gas has been presented in chapter 2. The
equations of continuity, momentum, and total energy written for a closed control volume limited
by surface  and fixed to the reference system are:

∙ 0, (4.249)

∙ ̿′ ∙ , (4.250)

∙ ̿′ ∙ ∙ ∙ ∙ , (4.251)

We will assume Cartesian coordinates to describe the velocity vector, . The


variable introduced in the total energy equation is the total entalphy, and allows to condense in one
single term the convective transport of total energy and the work per unit time performed by the
pressure:
⁄ ∙ , (4.252)

The set (4.249) to (4.252) is completed with the equation of state and with the definition of the
viscous stress tensor:
, (4.253)

̿ 2 ̿ ∙ ̿, (4.254)

66 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

As it was the case with pressure based schemes, the most critical elements from the discretization
point of view are the convective terms. We will then concentrate in describing density based schemes
where both the body forces and real fluid effects are negligible. For gas flow, the body forces per unit
mass, such as the acceleration of gravity, are usually much smaller than the convective acceleration.
Viscous terms are important in regions of large velocity gradients, such as in the boundary layers that
develop over the surfaces of solid bodies in contact with the fluid. For flow regions where both body
forces and viscous effects can be neglected, equations (4.249) to (4.251) simplify to the Euler
equations:

∙ 0, (4.255)

∙ 0, (4.256)

∙ 0, (4.257)

Considering the one-dimensional, variable area duct, with an element of thickness ∆ , the Euler
flow equations (4.255)-(4.257) take the form:
∆ 0, (4.258)

∆ ∆ , (4.259)

∆ 0, (4.260)

Using a collocated, cell centered data storage organization, cell is characterized by the state
vector of variables , , . The convective fluxes can then be evaluated introducing a
linear interpolation. For example, for the convective flux in the continuity equation:
, (4.261)

For constant area duct elements, the discretized continuity equation becomes:
∆ 0, (4.262)

so that the temporal evolution of variables at cell depends on the evolution of variables in cells
1 , 1 . The same occurs when discretizing the momentum and total energy equations. As a
result, an arbitrary flow with uniform levels in the odd and in the even cells can be added without
altering the discretized equations. This again means that the central discretization of the convective
fluxes supports odd-even, chessboard instability modes. The collocated character also promotes the
appearance of odd-even modes in the pressure field. In addition, the compressible Euler equations
support the existence of discontinuities, which can further compromise the stability of density based
schemes. There are two possible strategies to remedy this situation, which in fact are equivalent. The
first one implies using a central interpolation scheme for the convective flux and pressure term in the
momentum equation and adding some numerical dissipation terms that will ensure the proper stability
behavior both when capturing shock waves and to avoid odd-even modes. The second strategy implies
using an upwind discretization of the convective terms with same accuracy as the central
interpolation. The second approach involves the specification of flux or gradient limiters for cases in
which the flow field exhibits large gradients [12-13]. As already stated, it is possible to show the
equivalence between both approaches [14]. As a result, we will briefly describe here a density based
scheme based on linear face interpolation with added dissipation terms. Coupled to an explicit, multi-

Fundamentals and Application of Computational Fluid Dynamics 67


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

stage Runge-Kutta time integration it forms the basis of the Jameson-Schmidt-Turkel [15] density
based scheme, widely used to solve transonic and supersonic flow.
For cell , the one-dimensional Euler equations can be written as:
∆ , / / , / / 0, (4.263)

∆ , / / , / / ∆ , (4.264)

∆ , / / , / / 0, (4.265)

where the subscripts 1/2 , 1/2 respectively refer to the west and east faces of cell . The
fluxes appearing in equations (4.263)-(4.265) are given by:
; ; . (4.266)
The face flux is defined in terms of a linear interpolation between the fluxes found at the cells
sharing the faces plus a numerical dissipation flux. Thus, for variable :

, ⁄ , , , ⁄ . (4.267)

The dissipation flux is constructed from two dissipation terms:


, ⁄ , ⁄ , ⁄ . (4.268)
The term  is known as second order or shock capturing dissipation flux, and it is intended to
stabilize the density based scheme in regions with large gradients of flow variables, as it happens
across shock waves. It takes the form:

, ⁄ ⁄  ⁄   ,  ⁄ | | , . (4.269)

with ⁄ being the sound speed at cell and ⁄ representing a non-dimensional second
order face dissipation coefficient.
The term  is known as fourth order or odd-even dissipation flux, and it prevents the appearance
of chessboard instabilities due to the linear interpolation of the Euler fluxes. For face 1⁄2 it
becomes:

, ⁄ ⁄  ⁄  3 3  , (4.270)

with ⁄ representing a non-dimensional fourth order face dissipation coefficient. The face
dissipation coefficients are made to depend on how smooth is the pressure field. Specifically, the
second order dissipation coefficient is switched on when the pressure field exhibits large gradients:
| |
⁄  , , , ,  | |
. (4.271)

The reference value of the second order dissipation coefficient is usually taken as 1⁄2.
Observe that the coefficients  satisfy 0  1, being close to zero in the smooth flow regions, and
close to unity in the flow regions where the pressure exhibits changes of the order of its characteristic
value, i.e., in shock waves. Therefore the coefficient ⁄ is mostly close to zero except in the cells
where a shock wave is placed.
The fourth order dissipation coefficient takes the form:

68 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

⁄ 0, ⁄ , (4.272)

with 1⁄32. In the smooth flow regions, where the second order dissipation coefficient is much
smaller than , the fourth order dissipation coefficient approximately becomes . In flow regions
exhibiting large pressure gradients, as in shock waves, the fourth order dissipation coefficient takes a
zero value, since in these regions the fourth order dissipation can contribute to amplify shock driven
instabilities.
The time marching procedure for equations (4.263)-(4.265) is based on a fourth order, explicit
Runge-Kutta scheme [15]. For a generic variable , belonging to the flow state vector , , ,
the time marching scheme becomes:
  ,

  , / / , / / ,

  , / / , / / , (4.273)


  , / / , / / ,


  , / / , / / ,

A fourth order time accurate scheme can be obtained by setting:


1⁄4 ; 1⁄3 ; 1 ⁄2 , (4.274)
The linear stability characteristics of the fourth order Runge-Kutta and central difference
convective scheme imply that stability is ensured for numbers satisfying 2√2.

4.17 INLET/OUTLET BOUNDARY CONDITIONS

The numerical solution of flows always involves a finite fluid domain. Within it, solid surfaces are
often found. As a result, the flow domain can be limited by different solid surfaces and, in most cases,
by fluid surfaces set to limit the extension of the computational domain. The boundary conditions in
solid surfaces can be precisely defined. For example, in real flows, the local thermodynamic
equilibrium at a point of the solid surface implies that the fluid velocity and temperature must be
equal to those of the solid surface. Furthermore, the energy equation requires the continuity of the
heat flux normal to the solid surface. On the other hand, the specification of boundary conditions at
the limits of the computational domain occupied by fluid, the inlet and outlet flow boundaries, must
be analyzed with care, since these boundaries are artificial ones constructed to ensure a numerically
affordable problem.
When the numerical simulation tries to model an unbounded domain where uniform flow interacts
with some element perturbing it, the specification of boundary conditions is simplified, since the
computational boundary can be placed far away from the elements producing the perturbation flow.
In such cases, far field boundary conditions are a good approximation at boundaries that are located
far from the elements generating the flow perturbation. The far field boundary conditions can simply
specify a far field flow. This scenario occurs in external flow problems such as the flow around
aircrafts or cars. Typically, the perturbation flow decays at large distances from the source, and thus
the approximation of an unperturbed flow as a far field boundary condition can be adequate. When

Fundamentals and Application of Computational Fluid Dynamics 69


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

high accuracy is required, a simple, uniform far field boundary condition can introduce errors in the
computation that cannot be neglected. For example, for unbounded, subsonic flow around an obstacle,
the perturbation flow produced by the obstacle typically decays as the inverse of the squared distance
to the obstacle. However, for cases where the flow generates a force over the obstacle that is
perpendicular to the far field flow direction, the perturbation flow only decays with the inverse of the
distance to the obstacle. In those conditions, if high accuracy is required in the computed flow, and
the computational domain is not set sufficiently far away from the obstacle, a modified boundary
condition might be necessary, which includes some specification of the perturbation flow.
For cases where the inlet/outlet surfaces are located close to the region where the perturbations
occur the specification of appropriate inlet/outlet boundary conditions becomes particularly relevant.
In those cases, it is convenient the analyze separately the inlet/outlet boundary condition problem
setting for incompressible and compressible flows.

4.17.1 Incompressible flow


The implementation of appropriate inlet/outlet boundary conditions for incompressible flows is a
particularly delicate problem. The reason is that the continuity equation introduces an elliptic
character to the system of the Navier-Stokes equations. What this physically means is that a flow
perturbation introduced at one specific location will impact the flow field everywhere. In particular,
if the perturbation is introduced at the boundary of a finite flow domain, the whole flow field,
including the rest of the points located at the flow domain boundary, will sense it. The implication is
that in principle it is not possible to study the specification of boundary conditions as a local problem,
restricted to analysing a flow region close to the boundary. The solution of the conservation equations
applied to a boundary cell requires knowledge of some flow variables at the faces which limit the
computational domain. Specifically, when solving the continuity and momentum equation, the
pressure and convective fluxes require knowing the pressure and normal velocity to the face
∙ , with denoting the normal unit vector, exterior to the flow domain.
For one-dimensional flow we have already explored some relevant inlet/outlet boundary
conditions, with different combinations being possible. For example we can fix the inlet velocity.
Continuity then automatically fixes the outlet velocity level, and the pressure distribution is fixed up
to a certain reference level. Therefore, to also fix the pressure level we can give the velocity at the
inlet and the static pressure level at the outlet. This static pressure level can be replaced by specifying
the pressure level at a given station along the duct. Alternatively it is possible to fix the total pressure
at the inlet and the static pressure at the outlet surface, which are often values that can be related to
the physical parameters set in a given flow problem. Giving the pressure level both at the inlet and
outlet boundaries can result in an ill-posed condition, since when the inlet and outlet flow areas are
equal and the flow is ideal the inlet and outlet pressure should be equal, and the flow velocity
distribution admits infinite solutions.
Based on these arguments, the inlet/outlet boundary conditions for incompressible flow classify
the different regions of the computational domain boundary according to inlet or outlet flow
boundaries.
In a boundary region classified as inlet boundary two different boundary conditions can be clearly
identified:
a) Velocity inlet. This condition will set the value of the velocity normal to the face, . The
continuity equation provides an expression to find the pressure at the boundary cell. This
equation can directly input the mass flux contribution from the boundary face through the
value of . Furthermore, assuming that the face and cell velocity share the same velocity

70 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

direction, the contribution to the cell momentum equation from the convective flux at the
boundary face can also be evaluated. These considerations will allow advancing the cell
velocity and pressure levels in the most general, collocated pressure based scheme.
b) Pressure inlet. This condition is in fact very similar to the previous one. It will set a link
between the boundary cell pressure and the velocity magnitude at the boundary face, ,
by establishing , where is the total pressure boundary condition value.
This will allow obtaining the face velocity magnitude, 2 ⁄ . Furthermore,
assuming again that the flow direction at the boundary face is equal to the one found at the
boundary cell, the normal face velocity can be determined, ∙ . Once that
the face normal velocity is computed, case a) is recovered, and the equations of continuity and
momentum for the boundary cell allow advancing , .
For boundary regions labelled as outlet boundaries, two types boundary conditions can also be
well specified:
a) Pressure outlet. This boundary condition will set the pressure level at the boundary face, .
Using an upwind interpolation for the boundary convective fluxes, the momentum equation
for the boundary cell can be written in terms of the cell pressure, of the boundary face pressure,
of the boundary cell velocity, and of the pressure and velocity of interior cells adjacent to the
boundary cell. The continuity equation for the boundary cell will then provide an equation for
the cell pressure , whose iterative solution will allow obtaining also the boundary cell
velocity .
b) Outflow. This condition will imply a fully developed flow at the outlet boundary cells, so that
the magnitudes at the boundary face can be extrapolated from the ones given at the boundary
cell. Thus and . This approximation will allow establishing the momentum
and continuity equations for the boundary cell, and thus advancing the solution for , .

4.17.2 Compressible flow


In compressible flow the Euler equations are a set of hyperbolic differential equations that support
the propagation of information in space and time. As a result, the imposed inlet/outlet boundary
conditions must be compatible with the propagation properties of the Euler equations. The Euler
equations are often appropriate to describe most of the flow in inlet/outlet boundaries, so their study
should be relevant to properly set the inlet/outlet boundary conditions for compressible flows. We
will first focus in the study of one-dimensional, compressible duct flow [16]. We will consider the
propagation of information along a direction that will aligned along the the normal exterior to the
flow domain. The velocity projected along this direction will be denoted as ∙ . The
differential Euler equations follow from setting the appropriate limits to expressions (4.258)-(4.260):
0, (4.275)

, (4.276)

0, (4.277)

where represents the spatial coordinate along the direction . The system (4.275)-(4.277) can be
transformed into a set of equations using the variables , , :

Fundamentals and Application of Computational Fluid Dynamics 71


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

, (4.278)

0, (4.279)

,, (4.280)

whith 2 ⁄ representing the square of the sound speed. We would like to transform the system
(4.278) to (4.280) into an equivalent one where the wave propagation character of the Euler equations
is revealed, as was already introduced for constant area flow in chapter 3. This requires defining
appropriate combinations of the original variables , , to construct alternative variables
whose equations take the form:
, (4.281)

which represents a wave transporting in time variable with velocity along the direction, and
undergoing during its transport a temporal change given by the source term . One such
combination can be easily obtained if we multiply (4.278) times the square of the sound speed ,
and subtract it from (4.280):
0. (4.282)

Defining the variable as the differential expression:


. (4.283)
equation (4.281) becomes:
0. (4.284)

which represents a wave propagating in time the variable along the direction with a velocity
equal to the local, projected flow velocity . In the same way, dividing equation (4.280) by and
adding or subtracting it from (4.279), it follows:
. (4.285)

. (4.286)

These equations allow defining two additional variables, , :


. (4.287)

. (4.288)

that verify the following differential equations:


. (4.289)

. (4.290)

The equation for variable represents a wave transporting it in time with speed along
the direction. As it is transported, it suffers changes at a temporal rate given by the source term that
appears at the right hand side of equation (4.289). Similarly, variable is transported in time along

72 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

direction with a wave speed of , while undergoing a temporal change at a rate given by
the right hand side of equation (4.290). Equations (4.284) and (4.289)-(4.290) are a generalization of
the equations obtained in chapter 3, section 3.3.3, for compressible, constant area one-dimensional
duct flow, where the direction of the axis, , is now replaced by the exterior normal direction .
The variables , , are known as characteristic variables of direction , and the lines in the
, along which they propagate are known as the characteristic lines , , linked to
direction . The equations of these characteristic lines become:
: ; : ; : . (4.291)

Equation (4.283) informs that is a purely thermodynamic variable. As seen in chapter 2, the
differential in (4.283) defines the entropy , which, for ideal gases, is proportional to ⁄ and thus
. Variables , are a combination of the local flow velocity and a thermodynamic
property whose differential is given by ⁄ . The variables , are known as the Riemann
invariants linked to direction , , . As indicated in chapter 3, for a perfect gas in
a constant entropy flow, the Riemann invariants can be integrated to give:
. (4.292)

. (4.293)

Figure 4.38 Finite length, one-dimensional duct with inlet and outlet surfaces.
Let us now analyze the inlet/outlet boundary conditions to be imposed in a finite length duct (figure
4.38). Recall that, for each boundary, we denote as the normal to the flow domain, exterior to it.
Thus, for the duct shown in figure 4.38, the boundary labelled INLET will have , whereas the
one labelled OUTLET will have . A boundary surface will be an inlet boundary when ∙
0. Similarly a boundary surface will be labelled as outlet boundary when ∙ 0.

Figure 4.39 Characteristic line propagation at subsonic inlet.

Fundamentals and Application of Computational Fluid Dynamics 73


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

We will assume that in the almost one-directional flow of figure 4.38 , 0, so that the
flow is from left to right. As a result, at the left end of the duct 0 ∙ 0 and thus is an
inlet boundary. On the other hand at the surface we have ∙ 0 , which corresponds
to an outlet boundary.
We will first study the boundary conditions to be imposed at the inlet boundary, 0. At arbitrary
time we can draw the characteristic lines linked to and passing through this inlet station. Let us
assume that the inlet flow is subsonic, | | . In this case the propagation of the characteristic lines
is shown in figure 4.39.
Since 0, 0 , we have the characteristic lines , propagating in direction ,
and therefore they travel in time towards the inside of the duct. On the other hand, since 0
the characteristic line propagates with positive velocity and therefore in the same direction as .
Thus, the information that it conveys is travelling in time from the interior towards the exterior of the
flow domain. This implies that of the three variables , , that describe the flow at the inlet station,
we must fix two of them in such a way as to be able to construct the invariants , since,
according to the propagation properties of the Euler equations, these two invariants propagate from
the exterior of the computational domain to the interior of it. On the other hand, we cannot specify
the invariant since its value at the inlet is being propagated from the interior towards the exterior
of the duct. Therefore, in a subsonic inlet we have to provide, at each instant, 2 boundary conditions.
There is certain freedom to specify the 2 variables to be imposed, except that it cannot lead to impose
the Riemann invariant , linked to the characteristic which is propagating its information from
the interior to the exterior of the flow domain.
EXAMPLE 4.8 Consider a subsonic inlet in one-dimensional duct flow. A boundary condition specification
is proposed fixing the temporal evolution of the inlet pressure and of the inlet density .
Determine if this specification is compatible with the propagation properties of the Euler equations.
Solution: At a subsonic inlet the invariants , propagate from the inlet towards the duct, whereas
invariant propagates from the interior to the exterior of the fluid domain. As a result, 2 boundary
conditions must be specified at the subsonic inlet. As the pressure and density are given, it must be checked
that this is compatible with the propagation properties of the Euler equations. For the flow at the inlet station
0 we can write:
0, , 0, , 0, 0 , , . (a)
where , 0 , denotes the Riemann invariant propagated from the interior of the flow domain towards
the inlet plane. Furthermore:
0, ⁄ . (b)
And thus:
0, , ⁄ . (c)

As a result, we can define, at any instant , the complete flow state at the inlet 0, , 0, , 0,
0, . Therefore, giving the pressure and density in a subsonic inlet is compatible with the propagation
properties of the Euler equations.

PROBLEM 4.2 Consider a subsonic inlet in one-dimensional duct flow. A boundary condition specification
is proposed by fixing the temporal evolution of the inlet velocity and of the inlet temperature
. Determine if this specification is compatible with the propagation properties of the Euler
equations.

74 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

According to the previous discussion, different combinations are possible to specify the boundary
conditions at a subsonic inlet. For one dimensional flow, we must exactly specify two variables which
must not fix the value of the Riemann invariant propagating from the interior to the exterior of the
duct. A particular combination appears if we specify as boundary conditions the invariants , .
For the case when the inlet entropy is uniform, this means that we give, at the inlet plane, the temporal
evolution of:
⁄ , . (4.294)

If we fix these two variables, we are fixing the invariants , at each instant, whereas the third
invariant is obtained from the flow condition developing at the interior of the duct. As a result,
the invariants , propagating towards the inside of the duct do not propagate back any
information linked to . Thus, the information of does not reflect back into the flow domain
from the imposed boundary conditions. Because of this property, setting expressions (4.146) as
boundary conditions is known as a non-reflective inlet boundary condition specification. It would be
the most appropriate boundary condition specification in a domain in which we artificially establish
a boundary to limit the computational domain. In addition, the non-reflective boundary condition
specification improves the numerical convergence in steady flow problems since it avoids wave
reflections in the computational domain that will decrease the solution convergence rate.
The propagation of characteristic lines at a supersonic inlet is schematically shown in figure 4.40.
In this case the three characteristic lines have negative propagation velocities, in opposite direction
to . As a result all of them propagate in time from the exterior of the domain towards its interior.
Therefore, in a supersonic inlet the complete flow field must be specified as boundary condition:
0, ; 0, ; 0, . (4.295)

Figure 4.40 Characteristic line propagation at supersonic inlet.


The propagation diagram for the subsonic outlet is given in figure 4.41. This will be flow found
at in the sketch of figure 4.38., with ∙ 0. For a subsonic outlet we will have 0
. As a result, the characteristic lines and are propagating in time in the same direction
as , i.e., from the interior of the flow domain towards its exterior. On the other hand, the
characteristic line is propagating with velocity 0, in direction contrary to , and
therefore from the exterior of the flow domain towards its interior. This means that in a subsonic
outlet flow, only one variable can be specified, and it must not set the values of the Riemann invariants
and .

Fundamentals and Application of Computational Fluid Dynamics 75


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

Figure 4.41 Characteristic line propagation at subsonic outlet.


Assuming that the entropy at the outlet region is uniform, we can fix any variable except the
combination ⁄ or , since these variables are the Riemann invariants that
are propagated from the interior of the domain towards its boundary. Possible combinations include
for example the exit velocity or the exit pressure. If we fix as outlet boundary condition the variable
combination:

, , (4.296)

the information related to the invariants , which are propagating in time from the interior will
not return back to the flow domain by the imposed outlet boundary condition. The specification
(4.148) is known as a non-reflective subsonic outlet boundary condition. As it occurred at the inlet
flow specification, the non-reflective outlet boundary condition will result in improved convergence
rate for steady state flow problems.

Figure 4.42 Characteristic line propagation at supersonic outlet.


Finally, the characteristic line propagation at a supersonic outlet is schematically shown in figure
4.42. In this case, the three characteristic lines exhibit positive propagation velocities, which means
that the three characteristic variables are propagated from the interior of the domain towards the
outlet. As a result, all the flow variables at a supersonic outlet are fixed by the interior flow, and no
boundary condition can be specified at a supersonic outlet.
Summarizing the specification of inlet/outlet boundary conditions in one-directional compressible
flow we can conclude that the number of variables to be imposed must coincide with the number of
characteristics propagating in time towards the interior of the flow domain, and that the selected

76 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

boundary condition specification should not fix any variable related to any characteristic propagating
in time towards the exterior of the flow domain.
It is possible to extend the previous analysis to a general, three-dimensional flow configuration. In
that case the propagation supported by the Euler equations must be studied at each point of the
boundary [16]. For each face of the boundary we can construct a local coordinate system represented
by the exterior normal and two unit vectors, and , tangent to the face (figure 4.43).

Figure 4.43 Euler propagation along the direction normal to an inlet/outlet surface.
The resolution of the convective and pressure integrals involved in the compressible Euler
equations require specifying the thermodynamic state (for example pressure and temperature
(or speed of sound ), and the velocity normal to the face ∙ .
A similar analysis to that performed before can be developed to describe the propagation of
information along the direction. In the general three dimensional case, 5 characteristic lines are
found. Characteristics , , and propagate with speed ∙ . The Riemann variables
associated to these three characteristics are the entropy and the components of vorticity in the tangent
plane to the boundary face. The remaining two characteristics , are similar to the ,
characteristics found in the one-dimensional case. The propagation speeds for , are,
respectively, and . In a uniform inlet/outlet entropy flow of calorically perfect gas
the Riemann invariants associated to these characteristics are and
.

Assuming a collocated scheme, and regarding the information needed to solve the flow, it is only
necessary to pay attention to the propagation of characteristics , , and , since these will allow
defining two thermodynamic variables and the normal velocity at the boundary face.
As it happened in the one-dimensional case, the number of boundary conditions to be imposed at
a boundary face is given by the number of characteristics propagating to the interior of the flow
domain, i.e., in the direction opposite to . Since we are selecting the vector always pointing towards
the exterior of the flow domain, this implies that the number of boundary conditions to be fixed is
equal to the number of negative propagating speeds in the characteristics.
For example, for a subsonic outlet, we have 0 ∙ . Therefore the characteristic waves
linked to and have positive propagation speeds, whereas exhibits a negative propagation
speed. Therefore only one variable can be fixed as boundary condition at a subsonic outlet, and it
cannot be the entropy or the invariant . Thus, fixing the pressure value at a

Fundamentals and Application of Computational Fluid Dynamics 77


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

subsonic outlet is a boundary condition specification compatible with the propagation properties of
the Euler equations. The non-reflective outlet boundary condition specification occurs when fixing
the variable .

The information linked to the characteristic propagating towards the interior of the flow domain
can be taken from the specification of a far-field condition, given by a far-field flow:
| | → ∞: → , → , → , (4.297)

where , , are known, specified values. Let us call , the first and second Riemann
invariants calculated with the flow properties found at the boundary cell :

⁄ , 2 ⁄ 1 . (4.298)
The boundary condition compatible with the propagation of information for a subsonic outlet can
be written as:
1 1
2 2 , (4.299)
3 3 ∞

with 2 ⁄ 1 . Using expressions (4.298), the system (4.299) allows defining the
boundary face flow properties as a function of their boundary face and far field values. Specifically:
∞ ⁄2 ∞ ⁄ 1
∞ ⁄2 1 ∞ ⁄4 , (4.300)
2 ⁄ 1

If the face with outlet flow is supersonic ∙ all the characteristic have positive propagation
velocity, which means that the flow variables at the boundary face must be set from their cell values:

, (4.301)

For a subsonic inlet we will have ∙ 0. In that case the characteristics and
have negative propagation speed, which means that they must be fixed through boundary conditions
set from the exterior flow. On the other hand the characteristic has positive propagation speed,
indicating that is propagating from the interior to the exterior of the computational domain and
therefore the associated Riemann invariant must be fixed by the interior flow. If we follow an
approach similar to the one proposed in the subsonic outlet, expressions (4.299) we have this time:
1 1 ∞
2 2 , (4.302)
3 3 ∞

which now leads to:


∞ ⁄2 ∞ ⁄ 1
∞ ⁄2 1 ∞ ⁄4 . (4.303)
2 ⁄ 1
⁄ ∞

78 Chapter 4: Fundamentals of Finite Volume Methods for CFD


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

Observe, that the expressions giving , in (4.303) are identical to those of the subsonic outlet,
expressions (4.300). Only the entropy level, and therefore the pressure at the inlet boundary face
changes, incorporating this time the far-field information.
Finally, for a supersonic inlet we will have ∙ . In this case all the characteristics will
have negative propagation velocities, which means that all the flow variables at the inlet face must be
established through the boundary conditions. For the case of a far field specification this means:

∞ . (4.304)

The boundary condition specification summarized in expressions (4.300), (4.301), (4.303) and
(4.304) is compatible with the propagation of information supported by the Euler equations. This
specification is known in ANSYS FLUENT as pressure far-field boundary condition specification.
Alternative boundary conditions specifications are possible. For example, for a subsonic outlet,
the pressure level can be specified, , whereas the face normal velocity and the sound speed
can be propagated from the boundary cell’s values. This specification is known as pressure outlet.
Likewise, for a subsonic inlet, an alternative boundary condition specification can be placed. In the
pressure inlet boundary condition specification the Riemann invariants , are replaced by the
total pressure and temperature , , and the flow direction.

Fundamentals and Application of Computational Fluid Dynamics 79


MASTER IN NUMERICAL SIMULATION IN ENGINEERING WITH ANSYS 

REFERENCES

[1] C. Hirsch. Numerical Computation of Internal and External Flows. John Wiley & sons, 1990.
[2] J.. H. Ferziger and M. Peric. Computational Methods for Fluid Mechanics. Springer, 1996.
[3] R.D. Ritchmyer and K.W. Morton. Difference Methods for Initial Value Problems. Wiley
Interscience, 1967.
[4] B. P. Leonard. A stable and accurate convection modelling procedure based on quadratic
upstream interpolation. Comput. Meth. Appl. Mech. Enging. 19, 59-98, 1979.
[5] B. Van Leer. Toward the ultimate conservative difference scheme. A second order sequel to
Godunov's method. Journal Comp. Physics 32, 101-136, 1979.
[6] G. H. Golub and Ch. Van Loan. Matrix Computations. John Hopkins University Press, 2012.
[7] S. V.. Patankar and D. B. Spalding. A calculation procedure for heat, mass, and momentum
transfer in three-dimensional parabolic flows. Int. J. Heat Mass Transfer 15, 1787-1793, 1972.
[8] J. P. Van Doormal and G.D. Raithby. Enhancements of the SIMPLE method for predicting
incompressible fluid flows. Numer. Heat Transfer 7, 147-163, 1984.
[9] R. I. Issa. Solution of the implicitly discretized fluid fow equations by operator-splitting. J.
Comput. Phys. 62, 40-65, 1986.
[10] J. L. Steger, F. C. Dougherty, and J. A. Benek. A Chimera grid scheme. Advances in Grid
Generation, K. N. Ghia and U. Ghia, eds., ASME FED-Vol. 5, 1983.
[11] C.M. Rhie and W.L. Chow. A numerical study of the turbulent flow past an isolated airfoil with
trailing edge separation. AIAA Journal 21,1525–1532, 1983.
[12] J. L. Steger and R.F. Warming. Flux vector splitting of the inviscid gas-dynamics equations with
application to finite difference methods. J. Comput. Phys. 40, 263-293, 1981.
[13] B. Van Leer. Flux vector splitting for the Euler equations. Proc. 8th International Conference on
Numerical Methods in Fluid Dynamics. Springer Verlag, 1982.
[14] A. Jameson. Artificial dissipation, upwind biasing, limiters and their effect on accuracy and
multigrid convergence in transonic and hypersonic flows. 11th AIAA CFD Conference, 1993.
[15] A. Jameson, A. Schmidt and E. Turkel. Numerical simulation of the Euler equations by finite
volume methods using Runge-Kutta time stepping schemes. AIAA Paper 81-1259. AIAA 5th
Computational Fluid Dynamics Conference, 1981.
[16] C. Hirsch. Numerical Computation of Internal and External Flows. John Wiley & Sons, 1990.

 
 
 
 
 

80 Chapter 4: Fundamentals of Finite Volume Methods for CFD


 
 
 
 
 
   
 
 
 
 
 
 
 
 
 
 
 
 

www.ansys.com/mastersdegree 

All rights reserved. No part of this publication may be reproduced, stored in a


database or retrieval system, or published in any form or in any way without
the prior written permission of the authors.

Copyright  Benigno J. Lázaro, 2016

You might also like