0% found this document useful (0 votes)
9 views32 pages

Lecture 9

The document outlines a course on Computational Fluid Dynamics (CFD) presented by Dr. Hesham M. Khalil, covering topics such as conservation laws, turbulence, finite volume methods, and pressure-velocity coupling algorithms. It emphasizes the importance of accurately computing the flow field and introduces the staggered grid method to improve the representation of pressure in momentum equations. The document also discusses iterative solution strategies like the SIMPLE algorithm to resolve non-linearities and pressure-velocity linkage in CFD modeling.

Uploaded by

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

Lecture 9

The document outlines a course on Computational Fluid Dynamics (CFD) presented by Dr. Hesham M. Khalil, covering topics such as conservation laws, turbulence, finite volume methods, and pressure-velocity coupling algorithms. It emphasizes the importance of accurately computing the flow field and introduces the staggered grid method to improve the representation of pressure in momentum equations. The document also discusses iterative solution strategies like the SIMPLE algorithm to resolve non-linearities and pressure-velocity linkage in CFD modeling.

Uploaded by

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

COMPUTATIONAL FLUID DYNAMICS

Presented by
Dr. Hesham M. Khalil
COURSE AGENDA
• Introduction
• Conservation Laws of Fluid Motion
• Turbulence
• Finite Volume Method for Diffusion Problems
• Finite Volume Method for Convection-Diffusion Problems
• Solution Algorithm for Pressure-Velocity Coupling in Steady Flows
• Solution of Discretized Equations
• Finite Volume Method for Unsteady Flow
• Implementation of Boundary Conditions

• Errors and Uncertainty in CFD Modelling


• Design Modeler and Meshing
• Fluent and CFD Post
• Final Project
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

Introduction

• The convection of a scalar variable 𝜙 depends on the magnitude and direction of the local velocity
field.
• To develop our methods in the previous lectures we assumed that the velocity field was somehow
known.
• In general the velocity field is, however, not known and emerges as part of the overall solution
process along with all other flow variables.
• In this lecture we look at the most popular strategies for computing the entire flow field.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

Introduction

• Transport equations for each velocity component – momentum equations – can be derived from the
general transport equation by replacing the variable 𝜙 by 𝑢, 𝑣 and 𝑤 respectively.
• Every velocity component appears in each momentum equation, and the velocity field must also
satisfy the continuity equation.
• This can be clearly shown by considering the equations governing a two-dimensional laminar steady
flow:

𝑑𝑖𝑣 𝜌𝜙𝐮 = 𝑑𝑖𝑣 Γ𝑔𝑟𝑎𝑑𝜙 + 𝑆𝜙


SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

Introduction

• 𝑥-momentum equation

𝜕 𝜕 𝜕 𝜕𝑢 𝜕 𝜕𝑢 𝜕𝑝
𝜌𝑢𝑢 + 𝜌𝑣𝑢 = 𝜇 + 𝜇 − + 𝑆𝑢
𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑥

• 𝑦 -momentum equation
𝜕 𝜕 𝜕 𝜕𝑣 𝜕 𝜕𝑣 𝜕𝑝
𝜌𝑢𝑣 + 𝜌𝑣𝑣 = 𝜇 + 𝜇 − + 𝑆𝑣
𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑦

Continuity equation
𝜕 𝜕
𝜌𝑢 + 𝜌𝑣 = 0
𝜕𝑥 𝜕𝑦
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

Introduction

• The pressure gradient term, forms the main momentum source term in most flows of engineering
importance, and is written separately to facilitate the discussion that follows.
• The solution of the previous equation set presents us with two new problems:
• The convective terms of the momentum equations contain non-linear quantities.
• All three equations are intricately coupled because every velocity component appears in each
momentum equation and in the continuity equation.
• In addition, the most complex issue to resolve is the role played by the pressure.
• It appears in both momentum equations, but there is evidently no (transport or other) equation for
the pressure.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

Introduction

• If the pressure gradient is known, the process of obtaining discretised equations for velocities from

the momentum equations is exactly the same as that for any other scalar, and the schemes explained

in before are applicable.

• In general-purpose flow computations we also wish to calculate the pressure field as part of the

solution, so its gradient is not normally known beforehand.


SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

Introduction

• If the flow is compressible the continuity equation may be used as the transport equation for density,
and the energy equation is the transport equation for temperature.
• The pressure may then be obtained from density and temperature by using the equation of state 𝑝 =
𝑝 𝜌, 𝑇 .
• However, if the flow is incompressible the density is constant and hence by definition not linked to
the pressure.
• In this case coupling between pressure and velocity introduces a constraint in the solution of the flow
field: if the correct pressure field is applied in the momentum equations the resulting velocity field
should satisfy continuity.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

Introduction

• Both the problems associated with the non-linearities in the equation set and the pressure–velocity
linkage can be resolved by adopting an iterative solution strategy such as the SIMPLE algorithm of
Patankar and Spalding (1972).
• In this algorithm the convective fluxes 𝐹 through cell faces are evaluated from so-called guessed
velocity components.
• Furthermore, a guessed pressure field is used to solve the momentum equations.
• A pressure correction equation, deduced from the continuity equation, is then solved using the
guessed pressure and velocities to obtain a pressure correction field. Pressure correction is in turn
used to update the velocity and pressure fields.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

Introduction

• To start the iteration process we use initial guesses for the velocity and pressure fields.

• As the algorithm proceeds our aim must be progressively to improve these guessed fields.

• The process is iterated until convergence of the velocity and pressure fields.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The staggered grid

• The finite volume method starts, as always, with the discretisation of the flow domain and of the
relevant transport equations.
• First we need to decide where to store the velocities. It seems logical to define these at the same
locations as the scalar variables such as pressure, temperature etc.
• However, if velocities and pressures are both defined at the nodes of an ordinary control volume a
highly non-uniform pressure field can act like a uniform field in the discretised momentum
equations.
• This can be demonstrated with the following simple two-dimensional situation :
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The staggered grid

• Let us assume that we have somehow obtained a highly irregular ‘checker-board’ pressure field with
values as shown:
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The staggered grid

𝜕𝑝
• If pressures at 𝑒 and 𝑤 are obtained by linear interpolation the pressure gradient term in the 𝑢-
𝜕𝑥

momentum equation is given by

𝑝𝐸 + 𝑝𝑃 𝑝𝑃 + 𝑝𝑊
𝜕𝑝 𝑝𝑒 − 𝑝𝑤 2 − 2 𝑝𝐸 − 𝑝𝑊
= = =
𝜕𝑥 𝛿𝑥 𝛿𝑥 2𝛿𝑥

𝜕𝑝
• Similarly, the pressure gradient 𝜕𝑦 for the momentum equation is evaluated as

𝜕𝑝 𝑝𝑁 − 𝑝𝑆
=
𝜕𝑦 2𝛿𝑦
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The staggered grid

• The pressure at the central node (P) does not appear in these equations.
• Substituting the appropriate values from the ‘checker-board’ pressure field in figure into the previous
equations we find that all the discretised gradients are zero at all the nodal points even though the
pressure field exhibits spatial oscillations in both directions.
• As a result, this pressure field would give the same (zero) momentum source in the discretised
equations as a uniform pressure field.
• This behavior is obviously non-physical.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The staggered grid

• It is clear that, if the velocities are defined at the scalar grid nodes, the influence of pressure is not
properly represented in the discretised momentum equations.
• A remedy for this problem is to use a staggered grid for velocity components (Harlow and Welch,
1965).
• The idea is to evaluate scalar variables, such as pressure, density, temperature etc., at ordinary nodal
points but to calculate velocity components on staggered grids centered around the cell faces.
• The arrangement for a two-dimensional flow calculation is shown in Figure
The staggered grid
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The staggered grid

• The scalar variables, including pressure, are stored at the nodes marked (•).
• The velocities are defined at the (scalar) cell faces in between the nodes and are indicated by arrows.
• Horizontal (→) arrows indicate the locations for 𝑢 -velocities and vertical (↑) ones denote those for
𝑣 -velocity.
• In addition to the 𝐸, 𝑊, 𝑁, 𝑆 notation the figure also introduces a new system of notation based on
a numbering of grid lines and cell faces.
• For the moment we continue to use the original 𝐸, 𝑊, 𝑁, 𝑆 notation; the 𝑢 -velocities are stored at
scalar cell faces 𝑒 and 𝑤 and the 𝑣 -velocities at faces 𝑛 and 𝑠. In a three-dimensional flow the 𝑤 -
component is evaluated at cell faces 𝑡 and 𝑏.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The staggered grid

• The scalar control volumes are sometimes referred to as the pressure control volumes because, as we
will see later, the discretised continuity equation is turned into a pressure correction equation, which
is evaluated on scalar control volumes.
• In the staggered grid arrangement, the pressure nodes coincide with the cell faces of the 𝑢 -control
𝜕𝑝
volume. The pressure gradient term 𝜕𝑥 is given by

𝜕𝑝 𝑝𝑃 − 𝑝𝑊
=
𝜕𝑥 𝛿𝑥𝑢

where 𝛿𝑥𝑢 is the width of the 𝑢 -control volume.


SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The staggered grid

𝜕𝑝
• Similarly 𝜕𝑦
for the 𝑣 control volume shown is given by

𝜕𝑝 𝑝𝑃 − 𝑝𝑆
=
𝜕𝑦 𝛿𝑦𝑣

where 𝛿𝑦𝑣 is the width of the 𝑣 -control volume.

• If we consider the ‘checker-board’ pressure field again, substitution of the appropriate nodal pressure

values into previous two equations now yields very significant non-zero pressure gradient terms.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

• As mentioned earlier, if the pressure field is known, the discretisation of velocity equations and the
subsequent solution procedure is the same as that of a scalar equation.
• Since the velocity grid is staggered the new notation based on grid line and cell face numbering will
be used.
• In Figure the solid grid lines are numbered by means of capital letters. In the 𝑥 -direction the
numbering is . . . , 𝐼 − 1, 𝐼, 𝐼 + 1, . . . etc. and in the y direction , , 𝐽 − 1, 𝐽, 𝐽 + 1, , . . . etc.
• The dashed lines that construct the cell faces are denoted by lower case letters . . . , 𝑖 − 1, 𝑖, 𝑖 + 1, . .
. and . . . , 𝑗 − 1, 𝑗, 𝑗 + 1, . . . in the 𝑥 − and 𝑦 -directions respectively.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

• Scalar nodes, located at the intersection of two grid lines, are identified by two capital letters: e.g.
point 𝑃 in figure is denoted by (𝐼, 𝐽).
• The 𝑢 -velocities are stored at the 𝑒 - and 𝑤 -cell faces of a scalar control volume.
• These are located at the intersection of a line defining a cell boundary and a grid line and are,
therefore, defined by a combination of a lower case letter and a capital, e.g. the 𝑤 -face of the cell
around point 𝑃 is identified by (𝑖, 𝐽).
• For the same reasons the storage locations for the 𝑣 -velocities are combinations of a capital and a
lower case letter: e.g. the 𝑠-face is given by (𝐼, 𝑗).
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

• We may use forward or backward staggered velocity grids.


• The uniform grids in figure are backward staggered since the 𝑖 -location for the 𝑢 -velocity 𝑢𝑖,𝐽 is at
1
a distance of − 𝛿𝑥𝑢 from the scalar node (𝐼, 𝐽).
2
1
• Likewise, the 𝑗 -location for the 𝑣 -velocity 𝑣𝐼,𝑗 is − 2 𝛿𝑦𝑣 from node (𝐼, 𝐽).

• Expressed in the new co-ordinate system the discretised 𝑢 -momentum equation for the velocity at
location 𝑖, 𝐽 is given by
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

𝑝𝐼,𝐽 − 𝑝𝐼−1,𝐽
𝑎𝑖,𝐽 𝑢𝑖,𝐽 = ෍ 𝑎𝑛𝑏 𝑢𝑛𝑏 − ҧ 𝑢
Δ𝑉𝑢 + 𝑆Δ𝑉
𝛿𝑥𝑢

where Δ𝑉𝑢 is the volume of the 𝑢 -cell.

• The pressure gradient source term has been discretised by means of a linear interpolation between the
pressure nodes on the 𝑢 -control volume boundaries.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

• In the new numbering system, the 𝐸, 𝑊, 𝑁, 𝑆 neighbors involved in the summation σ 𝑎𝑛𝑏 𝑢𝑛𝑏 are
(𝑖 − 1, 𝐽), (𝑖 + 1, 𝐽), (𝑖, 𝐽 − 1) and (𝑖, 𝐽 + 1) .
• Their locations and the prevailing velocities are shown in more detail in following figure.
• The values of coefficients 𝑎𝑖,𝐽 and 𝑎𝑛𝑏 may be calculated with any of the differencing methods
(upwind, hybrid, QUICK, TVD) suitable for convection– diffusion problems.
• The coefficients contain combinations of the convective flux per unit mass 𝐹 and the diffusive
conductance 𝐷 at 𝑢 -control volume cell faces.
• Applying the new notation system we give the values of 𝐹 and 𝐷 for each of the faces 𝑒, 𝑤, 𝑛, and 𝑠
of the 𝑢 -control volume:
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations


SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

𝐹𝑖,𝐽 + 𝐹𝑖−1,𝐽 1 𝜌𝐼,𝐽 + 𝜌𝐼−1,𝐽 𝜌𝐼−1,𝐽 + 𝜌𝐼−2,𝐽


𝐹𝑤 = 𝜌𝑢 𝑤 = = 𝑢𝑖,𝐽 + 𝑢𝑖−1,𝐽
2 2 2 2

𝐹𝑖+1,𝐽 + 𝐹𝑖,𝐽 1 𝜌𝐼+1,𝐽 + 𝜌𝐼,𝐽 𝜌𝐼,𝐽 + 𝜌𝐼−1,𝐽


𝐹𝑒 = 𝜌𝑢 𝑒 = = 𝑢𝑖+1,𝐽 + 𝑢𝑖,𝐽
2 2 2 2

𝐹𝐼,𝑗 + 𝐹𝐼−1,𝑗 1 𝜌𝐼,𝐽 + 𝜌𝐼,𝐽−1 𝜌𝐼−1,𝐽 + 𝜌𝐼−1,𝐽−1


𝐹𝑠 = 𝜌𝑣 𝑠 = = 𝑣𝐼,𝑗 + 𝑣𝐼−1,𝑗
2 2 2 2

𝐹𝐼,𝑗+1 + 𝐹𝐼−1,𝑗+1 1 𝜌𝐼,𝐽+1 + 𝜌𝐼,𝐽 𝜌𝐼−1,𝐽+1 + 𝜌𝐼−1,𝐽


𝐹𝑛 = 𝜌𝑣 𝑛 = = 𝑣𝐼,𝑗+1 + 𝑣𝐼−1,𝑗+1
2 2 2 2
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

Γ𝐼−1,𝐽 Γ𝐼−1,𝐽 + Γ𝐼,𝐽 + Γ𝐼−1,𝐽−1 + Γ𝐼,𝐽−1


𝐷𝑤 = 𝐷𝑠 =
𝑥𝑖 − 𝑥𝑖−1 4 𝑦𝐽 − 𝑦𝐽−1

Γ𝐼,𝐽 Γ𝐼−1,𝐽+1 + Γ𝐼,𝐽+1 + Γ𝐼−1,𝐽 + Γ𝐼,𝐽


𝐷𝑒 = 𝐷𝑛 =
𝑥𝑖+1 − 𝑥𝑖 4 𝑦𝐽+1 − 𝑦𝐽

• The above formulae show that where scalar variables or velocity components are not available at a 𝑢 -
control volume cell face, a suitable two- or four-point average is formed over the nearest points where
values are available.
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

Γ𝐼−1,𝐽 Γ𝐼−1,𝐽 + Γ𝐼,𝐽 + Γ𝐼−1,𝐽−1 + Γ𝐼,𝐽−1


𝐷𝑤 = 𝐷𝑠 =
𝑥𝑖 − 𝑥𝑖−1 4 𝑦𝐽 − 𝑦𝐽−1

Γ𝐼,𝐽 Γ𝐼−1,𝐽+1 + Γ𝐼,𝐽+1 + Γ𝐼−1,𝐽 + Γ𝐼,𝐽


𝐷𝑒 = 𝐷𝑛 =
𝑥𝑖+1 − 𝑥𝑖 4 𝑦𝐽+1 − 𝑦𝐽

• By analogy the 𝑣 -momentum equation becomes

𝑎𝐼,𝑗 𝑣𝐼,𝑗 = ෍ 𝑎𝑛𝑏 𝑣𝑛𝑏 + 𝑝𝐼,𝐽−1 − 𝑝𝐼,𝐽 𝐴𝐼,𝑗 + 𝑏𝐼,𝑗


SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

• The neighbors involved in the

summation σ 𝑎𝑛𝑏 𝑢𝑛𝑏 and prevailing

velocities are as shown in figure


SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

• Coefficients 𝑎𝐼,𝑗 and 𝑎𝑛𝑏 again contain combinations of the convective flux per unit mass 𝐹 and the

diffusive conductance 𝐷 at 𝑣 -control volume cell faces.

• Their values are obtained by the same averaging procedure adopted for the 𝑢 -control volume and are

given below:
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

𝐹𝑖,𝐽 + 𝐹𝑖,𝐽−1 1 𝜌𝐼,𝐽 + 𝜌𝐼−1,𝐽 𝜌𝐼−1,𝐽−1 + 𝜌𝐼,𝐽−1


𝐹𝑤 = 𝜌𝑢 𝑤 = = 𝑢𝑖,𝐽 + 𝑢𝑖,𝐽−1
2 2 2 2

𝐹𝑖+1,𝐽 + 𝐹𝑖+1,𝐽−1 1 𝜌𝐼+1,𝐽 + 𝜌𝐼,𝐽 𝜌𝐼,𝐽−1 + 𝜌𝐼+1,𝐽−1


𝐹𝑒 = 𝜌𝑢 𝑒 = = 𝑢𝑖+1,𝐽 + 𝑢𝑖+1,𝐽−1
2 2 2 2

𝐹𝐼,𝑗−1 + 𝐹𝐼,𝑗 1 𝜌𝐼,𝐽−1 + 𝜌𝐼,𝐽−2 𝜌𝐼,𝐽 + 𝜌𝐼,𝐽−1


𝐹𝑠 = 𝜌𝑣 𝑠 = = 𝑣𝐼,𝑗−1 + 𝑣𝐼,𝑗
2 2 2 2

𝐹𝐼,𝑗 + 𝐹𝐼,𝑗+1 1 𝜌𝐼,𝐽 + 𝜌𝐼,𝐽−1 𝜌𝐼,𝐽+1 + 𝜌𝐼,𝐽


𝐹𝑛 = 𝜌𝑣 𝑛 = = 𝑣𝐼,𝑗 + 𝑣𝐼,𝑗+1
2 2 2 2
SOLUTION ALGORITHMS FOR PRESSURE-VELOCITY COUPLING IN STEADY FLOWS

The momentum equations

Γ𝐼,𝐽−1 Γ𝐼−1,𝐽−1 + Γ𝐼,𝐽−1 + Γ𝐼−1,𝐽 + Γ𝐼,𝐽


𝐷𝑠 = 𝐷𝑤 =
𝑦𝑗 − 𝑦𝑗−1 4 𝑥𝐼 − 𝑥𝐼−1

Γ𝐼,𝐽 Γ𝐼,𝐽−1 + Γ𝐼+1,𝐽−1 + Γ𝐼,𝐽 + Γ𝐼+1,𝐽


𝐷𝑛 = 𝐷𝑒 =
𝑦𝑗+1 − 𝑦𝑗 4 𝑥𝐼+1 − 𝑥𝐼

• Again at each iteration level the values of 𝐹 are computed using the 𝑢 - and 𝑣 - velocity components
resulting from the previous iteration.
• Given a pressure field 𝑝, discretised momentum equations of the previous form can be written for each
𝑢 - and 𝑣 -control volume and then solved to obtain the velocity fields.
• If the pressure field is correct, the resulting velocity field will satisfy continuity. As the pressure field is
unknown, we need a method for calculating pressure.

You might also like