+ All Categories
Home > Documents > Computational Methods of Heat andMass Transfer

Computational Methods of Heat andMass Transfer

Date post: 01-Nov-2021
Category:
Upload: others
View: 4 times
Download: 1 times
Share this document with a friend
83
Faculty of Mechanical Engineering and Marine Technology Chair of Modelling and Simulation Computational Methods of Heat and Mass Transfer Prof. Dr.-Ing. habil. Nikolai Kornev Rostock 2013
Transcript
Page 1: Computational Methods of Heat andMass Transfer

Faculty of Mechanical Engineering and Marine Technology

Chair of Modelling and Simulation

Computational Methods ofHeat and Mass Transfer

Prof. Dr.-Ing. habil. Nikolai Kornev

Rostock2013

Page 2: Computational Methods of Heat andMass Transfer

2

Page 3: Computational Methods of Heat andMass Transfer

Contents

1 Main equations of the Computational Heat and Mass Trans-fer 111.1 Fluid mechanics equations . . . . . . . . . . . . . . . . . . . . 11

1.1.1 Continuity equation . . . . . . . . . . . . . . . . . . . . 111.1.2 Classification of forces acting in a fluid . . . . . . . . . 12

1.1.2.1 Body forces . . . . . . . . . . . . . . . . . . . 121.1.2.2 Surface forces . . . . . . . . . . . . . . . . . . 131.1.2.3 Properties of surface forces . . . . . . . . . . 13

1.1.3 Navier Stokes Equations . . . . . . . . . . . . . . . . . 151.2 Heat conduction equation . . . . . . . . . . . . . . . . . . . . 18

2 Finite difference method 212.1 One dimensional case . . . . . . . . . . . . . . . . . . . . . . . 212.2 Two dimensional case . . . . . . . . . . . . . . . . . . . . . . . 242.3 Time derivatives. Explicit versus implicit . . . . . . . . . . . . 252.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3 Stability and artificial viscosity of numerical methods 273.1 Artificial viscosity . . . . . . . . . . . . . . . . . . . . . . . . . 273.2 Stability. Courant Friedrich Levy criterion (CFL) . . . . . . . 293.3 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4 Simple explicit time advance scheme for solution of the NavierStokes Equation 334.1 Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.2 Mixed schemes . . . . . . . . . . . . . . . . . . . . . . . . . . 344.3 Staggered grid . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.4 Approximation of − δuni u

nj

δxj. . . . . . . . . . . . . . . . . . . . . 38

4.4.1 Approximation of −∂uxux

∂x− ∂uxuy

∂y= −ux

∂ux

∂x− uy

∂ux

∂y. . 39

4.4.2 Approximation of −∂uxuy

∂x− ∂uyuy

∂y= −ux

∂uy

∂x− uy

∂uy

∂y. . 40

3

Page 4: Computational Methods of Heat andMass Transfer

4.5 Approximation of δδxj

δuni

δxj. . . . . . . . . . . . . . . . . . . . . 41

4.6 Calculation of the r.h.s. for the Poisson equation (4.6) . . . . 41

4.7 Solution of the Poisson equation (4.6) . . . . . . . . . . . . . . 41

4.8 Update the velocity field . . . . . . . . . . . . . . . . . . . . . 41

4.9 Boundary conditions for the velocities . . . . . . . . . . . . . . 42

4.10 Calculation of the vorticity . . . . . . . . . . . . . . . . . . . . 42

5 Splitting schemes for solution of multidimensional problems 43

5.1 Splitting in spatial directions. Alternating direction implicit(ADI) approach . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5.2 Splitting according to physical processes. Fractional step meth-ods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.3 Increase of the accuracy of time derivatives approximation us-ing the Lax-Wendroff scheme . . . . . . . . . . . . . . . . . . 47

6 Finite Volume Method 49

6.1 Transformation of the Navier-Stokes Equations in the FiniteVolume Method . . . . . . . . . . . . . . . . . . . . . . . . . . 49

6.2 Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

6.2.1 Pressure and unsteady terms . . . . . . . . . . . . . . . 50

6.2.2 Convection term of the x-equation . . . . . . . . . . . . 51

6.2.3 Convection term of the y-equation . . . . . . . . . . . . 51

6.2.4 X-equation approximation . . . . . . . . . . . . . . . . 52

6.2.5 Y-equation approximation . . . . . . . . . . . . . . . . 53

6.3 Explicit scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 53

6.4 Implicit scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 54

6.5 Iterative procedure for implicit scheme . . . . . . . . . . . . . 55

6.6 Pressure correction method . . . . . . . . . . . . . . . . . . . 58

6.7 SIMPLE method . . . . . . . . . . . . . . . . . . . . . . . . . 58

6.7.1 Pressure correction equation . . . . . . . . . . . . . . . 59

6.7.2 Summary of the SIMPLE algorithm . . . . . . . . . . . 61

7 Finite Volume Method (continuation) 63

7.1 Explicit scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 63

7.2 Implicit scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 64

7.3 Iterative procedure for implicit scheme . . . . . . . . . . . . . 65

7.4 Pressure correction method . . . . . . . . . . . . . . . . . . . 67

7.5 SIMPLE method . . . . . . . . . . . . . . . . . . . . . . . . . 68

7.5.1 Pressure correction equation . . . . . . . . . . . . . . . 68

7.5.2 Summary of the SIMPLE algorithm . . . . . . . . . . . 70

4

Page 5: Computational Methods of Heat andMass Transfer

8 Overview of pressure correction methods 738.1 SIMPLE algorithm . . . . . . . . . . . . . . . . . . . . . . . . 738.2 PISO algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 74

8.2.1 First iteration . . . . . . . . . . . . . . . . . . . . . . . 748.2.2 Second iteration . . . . . . . . . . . . . . . . . . . . . . 748.2.3 Correction . . . . . . . . . . . . . . . . . . . . . . . . . 748.2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . 75

8.3 SIMPLEC algorithm . . . . . . . . . . . . . . . . . . . . . . . 76

9 Computational grids 799.1 Grid types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799.2 Overset or Chimera grids . . . . . . . . . . . . . . . . . . . . . 809.3 Morphing grids . . . . . . . . . . . . . . . . . . . . . . . . . . 80

5

Page 6: Computational Methods of Heat andMass Transfer

6

Page 7: Computational Methods of Heat andMass Transfer

List of Tables

4.1 Limiters function for TVD schemes . . . . . . . . . . . . 35

6.1 �n�u and ui at different sides. x-equation . . . . . . . . . . 516.2 Velocities at different sides. x-equation . . . . . . . . . . 526.3 Convection flux. x-equation . . . . . . . . . . . . . . . . . 526.4 �n�u and ui at different sides. y-equation . . . . . . . . . . 526.5 Velocities at different sides. y-equation . . . . . . . . . . 526.6 Convection flux. y-equation . . . . . . . . . . . . . . . . . 53

7

Page 8: Computational Methods of Heat andMass Transfer

8

Page 9: Computational Methods of Heat andMass Transfer

List of Figures

1.1 Body and surface forces acting on the liquid element. . . . . . 121.2 Forces acting on the liquid element. . . . . . . . . . . . . . . . 141.3 Stresses acting on the liquid cube with sizes a. . . . . . . . . . 15

2.1 One dimensional case. . . . . . . . . . . . . . . . . . . . . . . 212.2 A sample of non uniform grid around the profile. . . . . . . . . 25

4.1 Sample of the collocated grid. . . . . . . . . . . . . . . . . . . 374.2 Checkerboard pressure solution on the collocated grid. . . . . 374.3 Grid points of staggered grid. . . . . . . . . . . . . . . . . . . 37

6.1 Staggered arrangement of finite volumes. . . . . . . . . . . . . 506.2 SIMPLE algorithm. . . . . . . . . . . . . . . . . . . . . . . . . 596.3 Control volume used for the pressure correction equation. . . . 62

7.1 SIMPLE algorithm. . . . . . . . . . . . . . . . . . . . . . . . . 697.2 Control volume used for the pressure correction equation. . . . 72

9.1 Samples of a) structured grid for an airfoil, b) block structuredgrid for cylinder in channel and c) unstructured grid for an airfoil. 79

9.2 Illustration of structured grid disadvantage. . . . . . . . . . . 80

9

Page 10: Computational Methods of Heat andMass Transfer

10

Page 11: Computational Methods of Heat andMass Transfer

Chapter 1

Main equations of theComputational Heat and MassTransfer

1.1 Fluid mechanics equations

1.1.1 Continuity equation

We consider the case of uniform density distribution ρ = const. The con-tinuity equation has the following physical meaning: The amount of liquidflowing into the volume U with the surface S is equal to the amount of liquidflowing out. Mathematically it can be expressed in form:∫

S

�u�nds = 0 (1.1)

Expressing the scalar product �u�n through components∫S

(ux cos(nx) + uy cos(ny) + uz cos(nz)

)ds = 0.

and using the Gauss theorem we get∫U

(∂ux

∂x+

∂uy

∂y+

∂uz

∂z

)dU = 0

Since the integration volume U is arbitrary, the integral is zero only if

∂ux

∂x+

∂uy

∂y+

∂uz

∂z= 0 (1.2)

11

Page 12: Computational Methods of Heat andMass Transfer

In the tensor form the continuity equation reads:

∂ui

∂xi

= 0 (1.3)

1.1.2 Classification of forces acting in a fluid

The inner forces acting in a fluid are subdivided into the body forces andsurface forces (Fig. 1.1).

Figure 1.1: Body and surface forces acting on the liquid element.

1.1.2.1 Body forces

Let Δ�f be a total body force acting on the volume ΔU . Let us introduce thestrength of the body force as limit of the ratio of the force to the volume:

�F = limΔU→0

Δ�f

ρΔU(1.4)

which has the unit kgms2

m3

kg1m3 = ms−2. Typical body forces are gravitational,

electrostatic or electromagnetic forces. For instance, we have the followingrelations for the gravitational forces:

Δ�f = ρgΔU�k (1.5)

12

Page 13: Computational Methods of Heat andMass Transfer

where Δ�f is the gravitational force acting on a particle with volume ΔU . Thestrength of the gravitational force is equal to the gravitational acceleration:

�F = limΔU→0

(−ρgΔU�k

ρΔU) = −g�k (1.6)

The body forces are acting at each point of fluid in the whole domain.

1.1.2.2 Surface forces

The surface forces are acting at each point at the boundary of the fluidelement. Usually they are shear and normal stresses. The strength of surfaceforces is determined as

�pn = limΔS→0

Δ�Pn

ΔS(1.7)

with the unit kgms2

1m2 = kg

ms2. A substantial feature of the surface force is the

dependence of �pn on the orientation of the surface ΔS.The surface forces are very important because they act on the body fromthe side of liquid and determine the forces �R arising on bodies moving in thefluid:

�R =

∫S

�pndS

�M =

∫S

(�r × �pn)dS

(1.8)

1.1.2.3 Properties of surface forces

Let us consider a liquid element in form of the tetrahedron (Fig. 1.2).Its motion is described by the 2nd law of Newton:

ρΔUd�u

dt= ρΔU �F + �pnΔS − �pxΔSx − �pyΔSy − �pzΔSz (1.9)

Dividing r.h.s and l.h.s. by the surface of inclined face ΔS results in:

ρΔU

ΔS

(d�u

dt− �F

)= �pn − �px

ΔSx

ΔS− �py

ΔSy

ΔS− �pz

ΔSz

ΔS(1.10)

Let us find the limit of (1.10) at ΔS → 0:

13

Page 14: Computational Methods of Heat andMass Transfer

Figure 1.2: Forces acting on the liquid element.

limΔS→0

ΔU

ΔS= 0, lim

ΔS→0

ΔSx

ΔS= cos(nx), (1.11)

limΔS→0

ΔSy

ΔS= cos(ny), lim

ΔS→0

ΔSz

ΔS= cos(nz) (1.12)

Substitution of (1.11) and (1.12) into (1.10) results in the following relationbetween �pn and �px, �py, �pz:

�pn = �px cos(nx) + �py cos(ny) + �pz cos(nz) (1.13)

Let us write the surface forces through components:

�px =�ipxx +�jτxy + �kτxz

�py =�iτyx +�jpyy + �kτyz

�pz =�iτzx +�jτzy + �kpzz

Here τij are shear stress (for instance τ12 = τxy), whereas pii are normalstress (for instance p11 = pxx). From moment equations (see Fig. 1.3) one canobtain the symmetry condition for shear stresses: τzya−τyza = 0 ⇒ τzy = τyzand generally:

14

Page 15: Computational Methods of Heat andMass Transfer

τij = τji (1.14)

Figure 1.3: Stresses acting on the liquid cube with sizes a.

The stress matrix is symmetric and contains 6 unknown elements:⎛⎝ pxx τxy τxz

τxy pyy τyzτxz τyz pzz

⎞⎠ (1.15)

1.1.3 Navier Stokes Equations

Applying the Newton second law to the small fluid element dU with thesurface dS and using the body and surface forces we get:∫

U

d�u

dtρdU =

∫U

�FρdU +

∫S

�pndS (1.16)

The property of the surface force can be rewritten with the Gauss theoremin the following form:

∫S

�pndS =

∫S

(�px cos(nx) + �py cos(ny) + �pz cos(nz)) dS

=

∫U

(∂�px∂x

+∂�py∂y

+∂�pz∂z

)dU

15

Page 16: Computational Methods of Heat andMass Transfer

The second law (1.16) takes the form:

∫U

d�u

dtρdU =

∫U

�FρdU +

∫U

(∂�px∂x

+∂�py∂y

+∂�pz∂z

)dU

∫U

[d�u

dtρ− ρ�F −

(∂�px∂x

+∂�py∂y

+∂�pz∂z

)]dU = 0

Since the volume dU is arbitrary, the l.h.s. in the last formulae is zero onlyif:

d�u

dt= �F +

1

ρ

(∂�px∂x

+∂�py∂y

+∂�pz∂z

)(1.17)

The stresses in (1.17) are not known. They can be found from the generalizedNewton hypothesis⎛

⎝ pxx τxy τxzτxy pyy τyzτxz τyz pzz

⎞⎠ = −

⎛⎝ p 0 0

0 p 00 0 p

⎞⎠+ 2μSij (1.18)

where p is the pressure,

S11 = Sxx =∂ux

∂x; S12 = Sxy =

1

2

(∂ux

∂y+

∂uy

∂x

); S13 = Sxz =

1

2

(∂ux

∂z+

∂uz

∂x

)

S21 = S12, S22 = Syy =∂uy

∂y, S23 = Syz =

1

2

(∂uy

∂z+

∂uz

∂y

)S31 = S13, S32 = S23, S33 = Szz =

∂uz

∂z

The liquids obeying (1.18) are referred to as the Newtonian liquids.

The normal stresses can be expressed through the pressure p:

pxx = −p+ 2μ∂ux

∂x, pyy = −p+ 2μ

∂uy

∂y, pzz = −p+ 2μ

∂uz

∂z

The sum of three normal stresses doesn’t depend on the choice of the coor-dinate system and is equal to the pressure taken with sign minus:

16

Page 17: Computational Methods of Heat andMass Transfer

pxx + pyy + pzz3

= −p (1.19)

The last expression is the definition of the pressure in the viscous flow: Thepressure is the sum of three normal stresses taken with the sign minus. Sub-stitution of the Newton hypothesis (1.18) into (1.17) gives (using the firstequation as a sample):

ρdux

dt= ρFx +

∂x

(− p+ 2μ

∂ux

∂x

)+

∂y

(∂uy

∂x+

∂ux

∂y

))

+∂

∂z

(∂ux

∂z+

∂uz

∂x

))=

= ρFx − ∂p

∂x+ μ

(∂2ux

∂x2+

∂2ux

∂y2+

∂2ux

∂z2

)+

+ μ∂

∂x

(∂ux

∂x+

∂uy

∂y+

∂uz

∂z

)

The last term in the last formula is zero because of the continuity equation.Doing similar transformation with resting two equations in y and z direc-tions, one can obtain the following equation, referred to as the Navier-Stokesequation:

d�u

dt= �F − 1

ρ∇p+ νΔ�u (1.20)

The full or material substantial derivative of the velocity vector d�udt

is theacceleration of the fluid particle. It consists of two parts: local accelerationand convective acceleration:

d�u

dt=

∂�u

∂t︸︷︷︸local acceleration

+ ux∂�u

∂x+ uy

∂�u

∂y+ uz

∂�u

∂z︸ ︷︷ ︸convective acceleration

The local acceleration is due to the change of the velocity in time. Theconvective acceleration is due to particle motion in a nonuniform velocityfield. The Navier-Stokes Equation in tensor form is:

∂ui

∂t+ uj

∂ui

∂xj

= Fi − 1

ρ

∂p

∂xi

+ ν∂

∂xj

(∂

∂xj

ui

)(1.21)

Using the continuity equation (1.3) the convective term can be written in theconservative form:

17

Page 18: Computational Methods of Heat andMass Transfer

uj∂ui

∂xj

=∂

∂xj

(uiuj

)(1.22)

Finally, the Navier Stokes in the tensor form is:

∂ui

∂t+

∂xj

(uiuj) = Fi − 1

ρ

∂p

∂xi

+ ν∂

∂xj

(∂

∂xj

ui

)(1.23)

The Navier Stokes equation together with the continuity equation (1.3) isthe closed system of partial differential equations. Four unknowns velocitycomponents ux, uy, uz and pressure p are found from four equations. Theequation due to presence of the term ∂

∂xj(uiuj) is nonlinear.

The boundary conditions are enforced for velocity components and pressureat the boundary of the computational domain. The no slip condition ux =uy = uz = 0 is enforced at the solid body boundary. The boundary conditionfor the pressure at the body surface can directly be derived from the NavierStokes equation. For instance, if y = 0 corresponds to the wall, the NavierStokes Equation takes the form at the boundary:

∂p

∂x= ρFx + μ

∂2ux

∂y2

∂p

∂y= ρFy + μ

∂2uy

∂y2

∂p

∂z= ρFz + μ

∂2uz

∂y2

Very often the last term in the last formulae is neglected because secondspatial derivatives of the velocity are not known at the wall boundary.Till now, the existence of the solution of Navier Stokes has been not proven bymathematicians. Also, it is not clear whether the solution is smooth or allowssingularity. The Clay Mathematics Institute has called the Navier–Stokesexistence and smoothness problems one of the seven most important openproblems in mathematics and has offered one million dollar prize for itssolution.

1.2 Heat conduction equation

Let q(x, t) be the heat flux vector, U is the volume of fluid or solid body, S isits surface and n is the unit normal vector to S. Flux of the inner energyinto the volume U at any point x ∈ U is

18

Page 19: Computational Methods of Heat andMass Transfer

−q(x, t) · n(x) (1.24)

Integrating (1.24) over the surface S we obtain:

−∫S

q · ndS (1.25)

and using the Gauss theorem∫S

q(x, t) · n(x)dS =

∫U

∇ · q(x, t)dU (1.26)

From the other side the change of the inner energy in the volume U is equalto

∫Uρcp

∂∂tT (x, t)dU , where T is the temperature, cp is the specific heat

capacity and ρ is the density. Equating this change to (1.26) we get:

∫U

ρcp∂

∂tT (x, t)dU = −

∫U

∇ · q(x, t)dU +

∫U

f(x, t)dU (1.27)

Here f is the heat sources within the volume U .Fourier has proposed the following relation between the local heat flux andtemperature difference, known as the Fourier law:

q(x, t) = −λ∇T (x, t) (1.28)

where λ is the heat conduction coefficient.Substitution of the Fourier law (1.28) into the inner energy balance equa-tion (1.27) results in

∫ω

(ρcp

∂tT (x, t)−∇ · (λ∇T (x, t))

)dU =

∫U

f(x, t)dU (1.29)

Since the volume U is arbitrary, (1.29) is reduced to

ρcp∂

∂tT (x, t)−∇ · (λ∇T (x, t)) = f(x, t) (1.30)

The equation (1.30) is the heat conduction equation. The heat conductioncoefficient for anisotropic materials is the tensor

λ =

⎛⎝ λ11 λ12 λ13

λ12 λ22 λ23

λ13 λ23 λ33

⎞⎠ (1.31)

The following boundary conditions are applied for the heat conduction equa-tion (1.30):

19

Page 20: Computational Methods of Heat andMass Transfer

• Neumann condition:

∇T (x, t) · n(x) = F1(x, t), x ∈ S (1.32)

• Dirichlet condition:

T (x, t) = F2(x, t), x ∈ S (1.33)

20

Page 21: Computational Methods of Heat andMass Transfer

Chapter 2

Finite difference method

2.1 One dimensional case

Let us consider the finite difference method for the one dimensional case.Let ϕ(x) is the function defined in the range [0, a] along the x axis. Thesection [0, a] is subdivided in a set of points xi. For the homogeneous distri-bution xi = (i− 1)Δ; i = 1, N , Δ = a/(N − 1) (see Fig. 2.1).

Figure 2.1: One dimensional case.

Let us approximate the derivative ∂ϕ∂x

1. The Taylor series of the function ϕat points xi−1 and xi+1 are:

ϕi−1 = ϕi −Δx

(∂ϕ

∂x

)i

+1

2Δx2

(∂2ϕ

∂x2

)i

− ... (2.1)

1 We use the partial derivative although the function depends only on one variable

21

Page 22: Computational Methods of Heat andMass Transfer

ϕi+1 = ϕi +Δx

(∂ϕ

∂x

)i

+1

2Δx2

(∂2ϕ

∂x2

)i

+ ... (2.2)

Expressing the derivative

(∂ϕ∂x

)i

from (2.1) we get the Backward Difference

Scheme (BDS): (∂ϕ

∂x

)i

=1

Δx

(ϕi − ϕi−1

)+O

(Δx

)(2.3)

Expressing the derivative

(∂ϕ∂x

)i

from (2.2) we get the Forward Difference

Scheme (FDS): (∂ϕ

∂x

)i

=1

Δx

(ϕi+1 − ϕi

)+O

(Δx

)(2.4)

Accuracy of both schemes is of the first order. Subtracting (2.1) from (2.2)we get the Central Difference Scheme (CDS)(

∂ϕ

∂x

)i

=1

2Δx

(ϕi+1 − ϕi−1

)+O

(Δx2

)(2.5)

which is of the second order accuracy.

For the approximation of derivatives ui

(∂ϕ∂x

)i

where ui is the flow velocity

one uses the Upwind Difference Scheme (UDS):

(∂ϕ

∂x

)i

=

{BDS, if u > 0

FDS, if u < 0(2.6)

The accuracy of BDS, FDS and CDS can be improved using the polynomialrepresentation of the function ϕ(x). For instance, consider the approximation

ϕ(x) = ax2 + bx+ c

within the section [xi−1, xi+1].Without loss of generality we assume xi−1 = 0. The coefficient c can beobtained from the condition:

ϕ(0) = ϕi−1 = c

Other two coefficients a and b are determined from the conditions:

22

Page 23: Computational Methods of Heat andMass Transfer

ϕi = aΔx2 + bΔx+ ϕi−1

ϕi+1 = a4Δx2 + b2Δx+ ϕi−1

a =ϕi+1 − 2ϕi + ϕi−1

2Δx2

b =−ϕi+1 + 4ϕi − 3ϕi−1

2Δx

The first derivative using CDS is then(∂ϕ

∂x

)i

= 2aΔ+ b =ϕi+1 − ϕi−1

2Δx

the second derivative:(∂2ϕ

∂x2

)i

= 2a =ϕi+1 − 2ϕi + ϕi−1

Δx2

If the polynomial of the 3rd order ϕ(x) = ax3 + bx2 + cx + d is applied, weget:

(∂ϕ

∂x

)i

=1

6Δx

(2ϕi+1 + 3ϕi − 6ϕi−1 + ϕi−2

)+O

(Δx3

)(2.7)

for the Backward Difference Scheme,

(∂ϕ

∂x

)i

=1

6Δx

(− ϕi+2 + 6ϕi+1 − 3ϕi − 2ϕi−1

)+O

(Δx3

)(2.8)

for the Forward Difference Scheme and

(∂ϕ

∂x

)i

=1

12Δx

(− ϕi+2 + 8ϕi+1 − 8ϕi−1 + ϕi−2

)+O

(Δx4

)(2.9)

for the Central Difference Scheme. As seen the accuracy order is sufficientlyimproved by consideration of more adjacent points.The second derivatives are:(

∂2ϕ

∂x2

)i

=1

Δx2

(ϕi+1 − 2ϕi + ϕi−1

)+O

(Δx2

)(2.10)

for the polynomial of the second order and

23

Page 24: Computational Methods of Heat andMass Transfer

(∂2ϕ

∂x2

)i

=1

12Δx2

(− ϕi+2 + 16ϕi+1 − 30ϕi + 16ϕi−1 − ϕi−2

)+O

(Δx4

)(2.11)

for the polynomial of the fourth order. The formula (2.10) can also be ob-tained using consequently CDS

(∂2ϕ

∂x2

)i

=1

Δx

(∂ϕ

∂x i+1/2− ∂ϕ

∂x i−1/2

)(2.12)

where i+1/2 and i− 1/2 are intermediate points (see Fig. 2.1). Using againthe CDS for the derivatives at intermediate points:

(∂ϕ

∂x

)i+1/2

=ϕi+1 − ϕi

Δx(2.13)

(∂ϕ

∂x

)i−1/2

=ϕi − ϕi−1

Δx(2.14)

we obtain (2.10).

2.2 Two dimensional case

In the two dimensional case the function ϕ is the function of two variables ϕ =ϕ(x, y). A sample of non-uniform grid is given in Fig. (2.2). In next chapterswe will consider different grids and principles of their generation. In thischapter we consider uniform two dimensional grids (xi, yj) with equal spacingin both x and y directions.

The function ϕ at a point (xi, yj) is ϕij. The CDS approximation of thederivative on x at this point is:

(∂ϕ

∂x

)ij

=ϕi+1j − ϕi−1j

2Δx

whereas on y is:

(∂ϕ

∂y

)ij

=ϕij+1 − ϕij−1

2Δy

24

Page 25: Computational Methods of Heat andMass Transfer

Figure 2.2: A sample of non uniform grid around the profile.

2.3 Time derivatives. Explicit versus implicit

Let the unsteady partial differential equation is written in the form:

∂g

∂t= G(g, t) (2.15)

The solution is known at the time instant n. The task is to find the solutionat n+ 1 time instant. Using forward difference scheme we get:

gn+1 = gn +G(g, t)Δt (2.16)

Taking the r.h.s. of (2.15) from the n− th time slice we obtain:

gn+1 = gn +G(gn, t)Δt (2.17)

The scheme (2.17) is the so called explicit scheme (simple Euler approach).Taking the r.h.s. of (2.15) from the n+ 1− th time slice we obtain:

gn+1 = gn +G(gn+1, t)Δt (2.18)

The scheme (2.18) is the implicit scheme. The r.h.s. side of (2.18) depends onthe solution gn+1. With the other words, the solution at the time slice n+1,gn+1 can not be expressed explicitly through the solutions known the fromprevious time slices 1, 2, .., n for nonlinear dependence G(g, t).Mix between explicit and implicit schemes is called the Crank-Nicolson Scheme:

25

Page 26: Computational Methods of Heat andMass Transfer

gn+1 = gn +1

2(G(gn, t) +G(gn+1, t))Δt

2.4 Exercises

1. Using the CDS find the derivative[∂

∂x

(Γ(x)

∂ϕ

∂x

)]i

= ... (2.19)

2. Using the CDS approximate the mixed derivative

∂2ϕ

∂x∂y ij

=∂

∂x

(∂ϕ

∂y

)ij

(2.20)

3. Write the program on the language C to solve the following partialdifferential equation:

∂ϕ

∂x+ α

∂2ϕ

∂x2= f(x)

with the following boundary conditions:

∂ϕ

∂x(x = 0) = C1

ϕ(x = 0) = C2

Use the central difference scheme.

4. Write the program on the language C to solve the following partialdifferential equation:

α∂ϕ

∂t+

∂2ϕ

∂x2= f(x, t)

with the following boundary conditions:

∂ϕ

∂x(x = 0) = C1

ϕ(x = 0) = C2

and initial condition ϕ(x, 0) = F (x).

Use the explicit method and the central difference scheme for spatialderivatives.

26

Page 27: Computational Methods of Heat andMass Transfer

Chapter 3

Stability and artificial viscosityof numerical methods

3.1 Artificial viscosity

Let us consider the generic linear equation:

∂ξ

∂t+ u

∂ξ

∂x= 0

The numerical upwind scheme (UDS) is:

ξn+1i −ξni

Δt=

⎧⎪⎨⎪⎩−u·ξni −u·ξni−1

Δxu > 0

−u·ξni+1−u·ξniΔx

u < 0

We consider only the case u > 0:

ξn+1i − ξniΔt

= −u · ξni − u · ξni−1

Δxu > 0 (3.1)

Taylor expansions of the function ξ(x, t) in time and space gives

ξn+1i = ξni +

∂ξ

∂t

∣∣∣∣ni

Δt+∂2ξ

∂t2Δt2

2

∣∣∣∣ni

+ ... (3.2)

ξni = ξni−1 +∂ξ

∂x

∣∣∣∣ni−1

Δx+∂2ξ

∂x2

∣∣∣∣ni−1

Δx2

2+ ... (3.3)

27

Page 28: Computational Methods of Heat andMass Transfer

Substitution of (3.2) and (3.3) into (3.1) results in

∂ξ

∂t

∣∣∣∣ni

+∂2ξ

∂t2

∣∣∣∣ni

Δt

2=

= − u

Δx

(+

∂ξ

∂x

∣∣∣∣ni−1

Δx+∂2ξ

∂x2

∣∣∣∣ni−1

Δx2

2

)(3.4)

The derivatives at i− 1− th point can be expressed through these at i− thpoint:

∂ξ

∂x

∣∣∣∣ni−1

=∂ξ

∂x

∣∣∣∣ni

− ∂2ξ

∂x2

∣∣∣∣ni

Δx+∂3ξ

∂x3

∣∣∣∣ni

Δx2

2− ...,

∂2ξ

∂x2

∣∣∣∣ni−1

=∂2ξ

∂x2

∣∣∣∣ni

− ∂3ξ

∂x3

∣∣∣∣ni

Δx− ...

(3.5)

The expressions (3.5) are then used in (3.4)

∂ξ

∂t

∣∣∣∣ni

+∂2ξ

∂t2

∣∣∣∣ni

Δt

2=

= − u

Δx

((∂ξ

∂x

∣∣∣∣ni

− ∂2ξ

∂x2

∣∣∣∣ni

Δx

)Δx+

(∂2ξ

∂x2

∣∣∣∣ni

− ∂3ξ

∂x3

∣∣∣∣ni

Δx

)Δx2

2+ ...

)(3.6)

Finally we have:

∂ξ

∂t

∣∣∣∣ni

+∂2ξ

∂t2

∣∣∣∣ni

Δt

2=

= − u

Δx

{Δx

∂ξ

∂x

∣∣∣∣ni

− ∂2ξ

∂x2

∣∣∣∣ni

Δx2

2+ ...

}(3.7)

Let us consider the left hand side of the equation (3.7).Differentiating ∂ξ

∂t= −u ∂ξ

∂xon time results in

∂2ξ

∂t2= −u

∂x

(∂ξ

∂t

)= +u2 ∂

∂x2(3.8)

28

Page 29: Computational Methods of Heat andMass Transfer

This allows one to find the derivative ∂2ξ∂t2

:

∂2ξ

∂t2

∣∣∣∣ni

= u2 ∂2ξ

∂x2

∣∣∣∣ni

(3.9)

Using the last result the equation (3.7) is rewritten in form:

∂ξ

∂t

∣∣∣∣ni

= − u

Δx·Δx

∂ξ

∂x

∣∣∣∣ni

+∂2ξ

∂x2

∣∣∣∣ni

Δx2

2

u

Δx− u2 ∂2ξ

∂x2

∣∣∣∣ni

Δt

2+ ... (3.10)

Finally we have

∂ξ∂t

= −u ∂ξ∂x

+

(u·Δx2

(1− u·Δt

Δx

)∂2ξ∂x2

)+ ...

Compare now with the original equation:

∂ξ

∂t= −u

∂ξ

∂x

The additional term(u·Δx2

(1− u·Δt

Δx

)∂2ξ∂x2

)

describes the error of numerical approximation of derivatives in the originalequation (3.1). It looks like the term describing the physical diffusion ν ∂2ξ

∂x2 ,where ν is the diffusion coefficient. Therefore, the error term can be in-terpreted as the numerical or artificial diffusion with the diffusion coeffi-cient u·Δx

2(1 − u·Δt

Δx) caused by errors of equation approximation. The pres-

ence of the artificial diffusion is a serious drawback of numerical methods. Itcould be minimised by increase of the resolution Δx → 0.

3.2 Stability. Courant Friedrich Levy crite-

rion (CFL)

Let us consider the partial differential equation:

∂ξ

∂t+ u

∂ξ

∂x= 0 (3.11)

29

Page 30: Computational Methods of Heat andMass Transfer

which is approximated using explicit method and upwind differential schemeat u > 0:

ξn+1i − ξniΔt

= −uξni − ξni−1

Δx(3.12)

It follows from (3.12):

ξn+1i − ξni = −u ·Δt

Δx(ξni − ξni−1)

ξn+1i = ξni (1−

u ·Δt

Δx) +

u ·Δt

Δxξni−1

Let us introduce the Courant Friedrich Levy parameter c = u·ΔtΔx

:

ξn+1i = ξni (1− c) + cξni−1 (3.13)

We consider the zero initial condition. At the time instant n we introducethe perturbation ε at the point i. The development of the perturbation isconsidered below in time and in x direction:

• time instant n:

ξni = ε

• time instant n+ 1:

ξn+1i = ξni (1− c) + c · ξni−1 = ε(1− c)

ξn+1i+1 = ξni+1(1− c) + c · ξni = c · ε

• time instant n+ 2:

ξn+2i = ξn+1

i (1− c) + c · ξn+1i−1 = ε(1− c)2 = ε(1− c)2

ξn+2i+1 = ξn+1

i+1 (1− c) + c · ξn+1i = c · ε(1− c) + c · ε(1− c) = 2c · ε(1− c)

ξn+2i+2 = ξn+1

i+2 (1− c) + c · ξn+1i+1 = c2 · ε

• time instant n+ 3:

ξn+3i = ξn+2

i (1− c) + c · ξn+2i−1 = ε(1− c)3

ξn+3i+1 = ξn+2

i+1 (1− c) + c · ξn+2i = 2c · ε(1− c)2 + c · ε(1− c)2

ξn+3i+2 = ξn+2

i+2 (1− c) + c · ξn+2i+1 = c2 · ε(1− c) + c2(2ε)(1− c)

ξn+3i+3 = ξn+2

i+3 (1− c) + c · ξn+2i+2 = c3 · ε

30

Page 31: Computational Methods of Heat andMass Transfer

• time instant n+N :

(ξn+Ni+N ) = cN · ε

..................

As follows from the last formula,the perturbation decays if

c < 1 (3.14)

The condition (3.14) is the Courant Friedrich Levy criterion of the stabilityof explicit numerical schemes. If the velocity is changed within the compu-tational domain, the maximum velocity umax is taken instead of u in for-mula (3.14). Physically the condition umaxΔt

Δx< 1 means that the maximum

displacement of the fluid particle within the time step [t, t + Δt] does notexceed the cell size Δx. The CFL parameter c can be reduced by decreaseof Δt (not by increase of Δx!).

3.3 Exercise

The field of the velocity component ux is given as ux,ij = exp(−((iΔx −0.5)2 + (jΔy − 0.5)2).Calculate uy,ij from continuity equation (1.3) and the Δt satisfying the CFLcriterion.

31

Page 32: Computational Methods of Heat andMass Transfer

32

Page 33: Computational Methods of Heat andMass Transfer

Chapter 4

Simple explicit time advancescheme for solution of theNavier Stokes Equation

4.1 Theory

The unsteady term of the Navier Stokes Equation

∂ui

∂t= −∂uiuj

∂xj

− 1

ρ

∂p

∂xi

+ ν∂

∂xj

∂ui

∂xj

(4.1)

is written in explicit form:

un+1i = un

i +Δt

[−δun

i unj

δxj

− 1

ρ

δpn

∂xi

+ νδ

δxj

δuni

δxj

](4.2)

where δδxj

is the approximation of the derivative ∂∂xj

. Let us apply the diver-

gence operator δδxi

:

δun+1i

δxi

=δun

i

δxi

+Δtδ

δxi

[−δun

i unj

δxj

− 1

ρ

δpn

∂xi

+ νδ

δxj

δuni

δxj

](4.3)

Let uni is the divergence free field, i.e.

δuni

δxi= 0. The task is to find the

velocity field at the time moment n+ 1 which is also divergence free

δun+1i

δxi

= 0 (4.4)

Substituting (4.4) into (4.3) one obtains:

33

Page 34: Computational Methods of Heat andMass Transfer

δ

δxi

[−δun

i unj

δxj

− 1

ρ

δpn

∂xi

+ νδ

δxj

δuni

δxj

]= 0 (4.5)

Expressing (4.5) with respect to the pressure results in the Poisson equation:

δ2pn

∂x2i

= ρ

[−δ2un

i unj

δxjδxi

+ νδ2

δxiδxj

δuni

δxj

](4.6)

The algorithm for time-advancing is as follows:

i) The solution at time n is known and divergence free.

ii) Calculation of the r.h.s. of (4.6) ρ[− δ2un

i unj

δxjδxi+ ν δ2

δxiδxj

δuni

δxj

]iii) Calculation of the pressure pn from the Poisson equation (4.6)

iv) Calculation of the velocity un+1i . This is divergence free.

v) Go to the step ii).

In the following sections we consider the algorithm in details for the twodimensional case.

4.2 Mixed schemes

The high accuracy of the CDS schemes is their advantage. The disadvantageof CDS schemes is their instability resulting in oscillating solutions. On thecontrary, the upwind difference schemes UDS possess a low accuracy and highstability. The idea to use the combination of CDS and UDS to strengthentheir advantages and diminish their disadvantages. Let us consider a simpletransport equation for the quantity ϕ:

∂ϕ

∂t+ u

∂ϕ

∂x= 0 (4.7)

with u > 0. A simple explicit, forward time, central difference scheme forthis equation may be written as

ϕn+1i = ϕn

i − c([ϕni +

1

2(ϕn

i+1 − ϕni )]− [ϕn

i−1 +1

2(ϕn

i − ϕni−1)]) =

= ϕni − c([ϕn

i − ϕni−1] +

1

2[ϕn

i+1 − ϕni ]−

1

2[ϕn

i − ϕni−1]) (4.8)

34

Page 35: Computational Methods of Heat andMass Transfer

where c = uΔtΔx

is the CFL parameter. The term c[ϕni − ϕn

i−1] is the diffusive

1st order upwind contribution. The term c(12[ϕn

i+1−ϕni ]− 1

2[ϕn

i −ϕni−1]) is the

anti-diffusive component. With TVD (total variation diminishing) schemesthe anti-diffusive component is limited in order to avoid instabilities andmaintain boundness 0 < ϕ < 1:

ϕn+1i = ϕn

i − c([ϕni − ϕn

i−1] +1

2[ϕn

i+1 − ϕni ]Ψ

neast −

1

2[ϕn

i − ϕni−1]Ψ

nwest) (4.9)

where Ψ are limiters. Limiters functions for TVD schemes are given in ta-ble 4.1.

Table 4.1: Limiters function for TVD schemes

Scheme Ψ

central 1upwind 0Roe minimod Ψ = max(0,min(r, 1))Roe superbee Ψ = max(0,min(2r, 1),min(r, 2))

Van Leer Ψ = r+mod(r)1+mod(r)

Branley and Jones Ψ = max(0,min(2r, 1))

Here r = (∂ϕ∂x)nwest/(

∂ϕ∂x)neast, (

∂ϕ∂x)neast =

ϕni+1−ϕn

i

xi+1−xi. The mixed upwind and cen-

tral difference scheme are used in Sec. 4.4 for approximation of the convectiveterms with the limiter (4.14).

4.3 Staggered grid

The grids are subdivided into collocated and staggered ones. On collo-cated grids the unknown quantities are stored at centres of cells (points P inFig. 4.1). The equations are also satisfied at cell centres. For the simplicity,we considered the case Δx and Δy are constant in the whole computationaldomain. Use of collocated grids meets the problem of decoupling betweenthe velocity and pressure fields. Let us consider the Poisson equation (4.6)with the r.h.s.

∂Tx

∂x+

∂Ty

∂y=

∂Hx

∂x+

∂Hy

∂y+

∂Dx

∂x+

∂Dy

∂y

where

35

Page 36: Computational Methods of Heat andMass Transfer

Dx = ν∂2ux

∂x2+ ν

∂2ux

∂y2

Dy = ν∂2uy

∂x2+ ν

∂2uy

∂y2

Hx = −∂uxux

∂x−−∂uxuy

∂y

Hy = −∂uxuy

∂x−−∂uyuy

∂y

(4.10)

Application of the central difference scheme to the Poisson equation resultsin

(∂pn

∂x)E − (∂p

n

∂x)W

2Δx

+(∂p

n

∂y)N − (∂p

n

∂y)S

2Δy

=T nx,E − T n

x,W

2Δx

+T ny,N − T n

y,S

2Δy

or

pnEE−pnP2Δx

− pnP−pnWW

2Δx

2Δx

+

pnNN−pnP2Δy

− pnP−pnSS

2Δy

2Δy

=T nx,E − T n

x,W

2Δx

+T ny,N − T n

y,S

2Δy

= QHP

The last equation is expressed in the matrix form:

ApPp

nP +

∑l

Apl p

nl = −QH

P (4.11)

where

l = EE,WW,NN, SS, ApEE = Ap

WW = − 1(2Δx)2

, ApNN = Ap

SS = − 1(2Δy)2

and ApP = −∑

l Apl

This equation (4.11) has involves nodes which are 2Δ apart (see also [1])!It is a discretized Poisson equation on a grid twice as coarse as the basicone but the equations split into four unconnected systems, one with i and jboth even, one with i even and j odd, one with i odd and j even, andone with both odd. Each of these systems gives a different solution. Fora flow with a uniform pressure field, the checkerboard pressure distributionshown in Fig. 4.2 satisfies these equations and could be produced. However,the pressure gradient is not affected and the velocity field may be smooth.

36

Page 37: Computational Methods of Heat andMass Transfer

Figure 4.1: Sample of the collocated grid.

Figure 4.2: Checkerboard pressure solution on the collocated grid.

Figure 4.3: Grid points of staggered grid.

37

Page 38: Computational Methods of Heat andMass Transfer

There is also the possibility that one may not be able to obtain a convergedsteady-state solution.

A possible solution of the problem is the application of the staggered grids(Fig. 4.3). The Poisson equation is satisfied at cell centres designated bycrosses. The ux velocities are stored at points staggered by Δx/2 in x-direction (filled circles). At these points the first Navier- Stokes equationis satisfied:

∂ux

∂t= −∂uxuj

∂xj

− 1

ρ

∂p

∂x+ ν

∂xj

∂ux

∂xj

(4.12)

The uy velocities are stored at points staggered by Δy/2 in y-direction (cir-cles). At these points the second Navier-Stokes equation is satisfied:

∂uy

∂t= −∂uyuj

∂xj

− 1

ρ

∂p

∂y+ ν

∂xj

∂uy

∂xj

(4.13)

The staggered grid is utilized below.

4.4 Approximation of −δuni unj

δxj

The approximation of the convective term is a very critical point. For fasterflows or larger time steps, the discretization shall be closer to an upwindingapproach [2]. Following to [2] we implement a smooth transition betweencentered differencing and upwinding using a parameter γ ∈ [0, 1]. It is definedas

γ = min(1.2 ·Δt ·max(|ux(i, j)|, |uy(i, j)|), 1) (4.14)

The value of gamma is the maximum fraction of a cells which information cantravel in one time step, multiplied by 1.2, and capped by 1. The factor of 1.2is taken from the experience that often times tending a bit more towardsupwinding can be advantageous for accuracy [3].

γ = 0 corresponds to the central difference scheme (CDS) whereas γ = 1results in the upwind difference scheme (UDS).

38

Page 39: Computational Methods of Heat andMass Transfer

4.4.1 Approximation of −∂uxux

∂x − ∂uxuy

∂y = −ux∂ux

∂x − uy∂ux

∂y

• Point (i+ 1/2, j) for x-component of velocity:

ux(i+ 1/2, j) = (ux(i+ 1, j) + ux(i, j))/2.0

If ux(i+ 1/2, j) ≥ 0,

then uxux|i+1/2,j = ux(i+ 1/2, j)(1− γ

2ux(i+ 1, j) +

γ + 1

2ux(i, j))

else uxux|i+1/2,j = ux(i+ 1/2, j)(γ + 1

2ux(i+ 1, j) +

1− γ

2ux(i, j))

• Point (i− 1/2, j) for x-component of velocity:

ux(i− 1/2, j) = (ux(i, j) + ux(i− 1, j))/2.0

If ux(i− 1/2, j) ≥ 0,

then uxux|i−1/2,j = ux(i− 1/2, j)(1− γ

2ux(i, j) +

γ + 1

2ux(i− 1, j))

else uxux|i−1/2,j = ux(i− 1/2, j)(γ + 1

2ux(i, j) +

1− γ

2ux(i− 1, j))

• Point (i+ 1/2, j) for y-component of velocity:

uy(i+ 1/2, j) = (uy(i+ 1, j) + uy(i, j))/2.0

If uy(i+ 1/2, j) ≥ 0,

then uxuy|i+1/2,j = uy(i+ 1/2, j)(γ + 1

2ux(i, j) +

1− γ

2ux(i, j + 1))

else uxuy|i+1/2,j = uy(i+ 1/2, j)(1− γ

2ux(i, j) +

γ + 1

2ux(i, j + 1))

• Point (i+ 1/2, j − 1) for y-component of velocity:

uy(i+ 1/2, j − 1) = (uy(i+ 1, j − 1) + uy(i, j − 1))/2.0

If uy(i+ 1/2, j − 1) ≥ 0,

then uxuy|i+1/2,j−1 = uy(i+ 1/2, j − 1)(γ + 1

2ux(i, j − 1) +

1− γ

2ux(i, j))

else uxuy|i+1/2,j−1 = uy(i+ 1/2, j − 1)(1− γ

2ux(i, j − 1) +

γ + 1

2ux(i, j))

Hx(i, j) = −∂uxux

∂x− ∂uxuy

∂y=

− uxux|i+1/2,j − uxux|i−1/2,j

Δx

− uxuy|i+1/2,j − uxuy|i+1/2,j−1

Δy

39

Page 40: Computational Methods of Heat andMass Transfer

4.4.2 Approximation of −∂uxuy

∂x − ∂uyuy

∂y = −ux∂uy

∂x − uy∂uy

∂y

• Point (i, j + 1/2) for y-component of velocity:

uy(i, j + 1/2) = (uy(i, j) + uy(i, j + 1))/2.0

If uy(i, j + 1/2) ≥ 0,

then uyuy|i,j+1/2 = uy(i, j + 1/2)(1− γ

2uy(i, j + 1) +

γ + 1

2uy(i, j))

else uyuy|i,j+1/2 = uy(i, j + 1/2)(γ + 1

2uy(i, j + 1) +

1− γ

2uy(i, j))

• Point (i, j − 1/2) for y-component of velocity:

uy(i, j − 1/2) = (uy(i, j − 1) + uy(i, j))/2.0

If uy(i, j − 1/2) ≥ 0,

then uyuy|i,j−1/2 = uy(i, j − 1/2)(1− γ

2uy(i, j) +

γ + 1

2uy(i, j − 1))

else uyuy|i,j−1/2 = uy(i, j − 1/2)(γ + 1

2uy(i, j) +

1− γ

2uy(i, j − 1))

• Point (i, j + 1/2) for x-component of velocity:

ux(i, j + 1/2) = (ux(i, j + 1) + ux(i, j))/2.0

If ux(i, j + 1/2) ≥ 0,

then uyux|i,j+1/2 = ux(i, j + 1/2)(γ + 1

2uy(i, j) +

1− γ

2uy(i+ 1, j))

else uyux|i,j+1/2 = ux(i, j + 1/2)(1− γ

2uy(i, j) +

γ + 1

2uy(i+ 1, j))

• Point (i− 1, j + 1/2) for x-component of velocity:

ux(i− 1, j + 1/2) = (ux(i− 1, j + 1) + ux(i− 1, j))/2.0

If ux(i− 1, j + 1/2) ≥ 0,

then uyux|i−1,j+1/2 = ux(i− 1, j + 1/2)(γ + 1

2uy(i− 1, j) +

1− γ

2uy(i, j))

else uyux|i−1,j+1/2 = ux(i− 1, j + 1/2)(1− γ

2uy(i− 1, j) +

γ + 1

2uy(i, j))

Hy(i, j) = −∂uxuy

∂x− ∂uyuy

∂y=

− uyux|i,j+1/2 − uyux|i−1,j+1/2

Δx

− uyuy|i,j+1/2 − uyuy|i,j−1/2

Δy

40

Page 41: Computational Methods of Heat andMass Transfer

4.5 Approximation of δδxj

δuniδxj

The second derivative is calculated using the Central Difference Scheme(CDS):

Dx(i, j) =ux(i+ 1, j)− 2ux(i, j) + ux(i− 1, j)

Δ2x

+ux(i, j + 1)− 2ux(i, j) + ux(i, j − 1)

Δ2y

Dy(i, j) =uy(i+ 1, j)− 2uy(i, j) + uy(i− 1, j)

Δ2x

+uy(i, j + 1)− 2uy(i, j) + uy(i, j − 1)

Δ2y

4.6 Calculation of the r.h.s. for the Poisson

equation (4.6)

The r.h.s. of (4.6) is

−δ2uni u

nj

δxjδxi

+ νδ2

δxiδxj

δuni

δxj

=∂Hx

∂x+

∂Hy

∂y+

∂Dx

∂x+

∂Dy

∂y

The derivatives at the point (i,j) of the pressure storage (designated as X inFig. 4.3) are calculated using CDS

∂Hx

∂x|ij = Hx(i, j)−Hx(i− 1, j)

Δx,∂Dx

∂x|ij = Dx(i, j)−Dx(i− 1, j)

Δx,

∂Hy

∂y|ij = Hy(i, j)−Hy(i, j − 1)

Δy,∂Dy

∂y|ij = Dy(i, j)−Dy(i, j − 1)

Δy

4.7 Solution of the Poisson equation (4.6)

The numerical solution of the Poisson equation is discussed in [1].

4.8 Update the velocity field

The velocity field is updated according to formula

un+1x (i, j) = un

x(i, j) + Δt(Hnx (i, j) +Dn

x(i, j)− (pn(i+ 1, j)− pn(i, j))/Δx)

un+1y (i, j) = un

y (i, j) + Δt(Hny (i, j) +Dn

y (i, j)− (pn(i, j + 1)− pn(i, j))/Δy)

41

Page 42: Computational Methods of Heat andMass Transfer

4.9 Boundary conditions for the velocities

At this stage, the boundary conditions (BC) for the velocity field should betaken into account. The nodes at which the BC are enforced are shown bygrey symbols in Fig. 4.3. Enforcement of the BC is easy, if the ”grey” pointlies exactly at the boundary of the computational domain. If not, two casesshould be considered. If the Neumann condition is enforced ∂u

∂n= C , the

velocity component outside of the boundary u(0) is calculated through theinterior quantity u(1) from

u(1)− u(0)

Δn

= C

If the Dirichlet condition u = C is enforced and the point 0 is outside of thecomputational domain, the value u(0) is calculated from the extrapolationprocedure:

u(0) + u(1)

2= C

4.10 Calculation of the vorticity

The calculation of vorticity ωz =∂ux

∂y− ∂uy

∂xis performed as follows:

ux(i− 1/2, j + 1/2) =1

4(ux(i, j) + ux(i, j + 1) + ux(i− 1, j) + ux(i− 1, j + 1)),

ux(i− 1/2, j − 1/2) =1

4(ux(i, j) + ux(i− 1, j) + ux(i, j − 1) + ux(i− 1, j − 1)),

uy(i+ 1/2, j − 1/2) =1

4(uy(i, j) + uy(i+ 1, j) + uy(i, j − 1) + uy(i+ 1, j − 1)),

uy(i− 1/2, j − 1/2) =1

4(uy(i, j) + uy(i− 1, j) + uy(i, j − 1) + uy(i− 1, j − 1)),

ωz(i, j) =ux(i− 1/2, j + 1/2)− ux(i− 1/2, j − 1/2)

Δy

− uy(i+ 1/2, j − 1/2)− uy(i− 1/2, j − 1/2)

Δx

42

Page 43: Computational Methods of Heat andMass Transfer

Chapter 5

Splitting schemes for solutionof multidimensional problems

5.1 Splitting in spatial directions. Alternat-

ing direction implicit (ADI) approach

Let us consider the two dimensional unsteady heat conduction equation:

∂φ

∂t= λ

(∂2φ

∂x2+

∂2φ

∂y2

)(5.1)

We use implicit scheme proposed by Crank and Nicolson and CDS for spatialderivatives:

φn+1 − φn

Δt=

λ

2

[(∂2φn

∂x2+

∂2φn

∂y2

)+

(∂2φn+1

∂x2+

∂2φn+1

∂y2

)](5.2)

(∂2φn

∂x2

)i,j

=φni+1,j − 2φn

i,j + φni−1,j

(Δx)2(5.3)

(∂2φn

∂y2

)i,j

=φni,j+1 − 2φn

i,j + φni,j−1

(Δy)2(5.4)

In what follows we use the designations for derivative approximations:

δ2

δx2φn =

φni+1,j − 2φn

i,j + φni−1,j

(Δx)2(5.5)

δ2

δy2φn =

φni,j+1 − 2φn

i,j + φni,j−1

(Δy)2(5.6)

43

Page 44: Computational Methods of Heat andMass Transfer

Using these designations we get from the original heat conduction equation:

(1− λΔt

2

δ2

δx2

)(1− λΔt

2

δ2

δy2

)φn+1 =

(1 +

λΔt

2

δ2

δx2

)(1 +

λΔt

2

δ2

δy2

)φn+

+(λΔt)2

4

δ2

δx2

[δ2

δy2

(φn+1 − φn

)](5.7)

The last term is neglected since (φn+1 − φn)(Δt)2 ∼ ∂φ∂t(Δt)3.

Numerical solution is performed in two following steps:

• Step 1: Solution of one dimensional problem in x-direction:

(1− λΔt

2

δ2

δx2

)φ∗ =

(1 +

λΔt

2

δ2

δy2

)φn (5.8)

The numerical solution of (5.8) φ∗ is then substituted as the guesssolution for the next step:

• Step 2: Solution of one dimensional problem in y-direction

(1− λΔt

2

δ2

δy2

)φn+1 =

(1 +

λΔt

2

δ2

δx2

)φ∗ (5.9)

It can be shown that the resulting method is of the second order of accuracyand unconditionally stable.

5.2 Splitting according to physical processes.

Fractional step methods

Within the fractional step method the original equation is split accordingto physical processes. Splitting according to physical processes is used forunsteady problems. The general idea is illustrated for the transport equation:

∂u

∂t= Cu+Du+ P (5.10)

Here

C is the convection operator,

D is the diffusion operator,

44

Page 45: Computational Methods of Heat andMass Transfer

P is the pressure source operator.

Simple explicit Euler method can be written as

un+1 = un + (Cu+Du+ P )Δt (5.11)

The overall numerical solution is considered as the consequence of numericalsolutions of the following partial problems:

u∗ = un + (Cun)Δt (*) Convection step

u∗∗ = u∗ + (Du∗)Δt (**) Diffusion step

un+1 = u∗∗ + (P )Δt (***) Pressure step

(5.12)

solving sequentially. The sense of this splitting is that the numerical solutionof partial problems (*)-(***) is simpler and more stable than that of thewhole problem. The disadvantage of this procedure is that it is applicable toonly unsteady problem formulation. Another disadvantage is the low orderof accuracy with respect to time derivative approximation. The order of timederivative approximations can be derived using the sample with two physicalprocesses described by operators L1 and L2:

∂u

∂t= L1(u) + L2(u) (5.13)

The splitting of (5.10) results in two steps procedure:

∂u∗

∂t= L1(u

∗), u∗|t=tn = un

∂un+1

∂t= L2(u

n+1), un+1|t=tn = u∗(5.14)

where

u∗ = un +ΔtL1(un) +O(Δt2),

un+1 = u∗ +ΔtL2(u∗) +O(Δt2) =

= un +ΔtL1(un) + ΔtL2(u

n +ΔtL1(un)) +O(Δt2) =

= un +Δt(L1(un) + L2(u

n)) +O(Δt2).

(5.15)

The accuracy of the final solution un+1 is of the first order in time.Very often the diffusion step is treated implicitly. This is done to diminishthe time step restriction for the diffusion process. Otherwise, the stability

45

Page 46: Computational Methods of Heat andMass Transfer

requires Δt to be proportional to the spacial discretization squared, if a pureexplicit scheme is applied. The semi implicit scheme for the two dimensionalNavier Stokes equation reads:

• Convection step is treated explicitly:

u∗x − un

x

Δt= −δun

xunx

δx− δun

xuny

δy(5.16)

u∗y − un

y

Δt= −δun

yunx

δx− δun

yuny

δy(5.17)

• The solutions u∗x,y are used then for the diffusion process which is

treated implicitly:

u∗∗x − u∗

x

Δt= ν

(δ2u∗∗

x

δx2+

δ2u∗∗x

δy2

)(5.18)

u∗∗y − u∗

y

Δt= ν

(δ2u∗∗

y

δx2+

δ2u∗∗y

δy2

)(5.19)

• The solutions u∗∗x,y are used then for the next process which is treated

explicitly:

un+1x − u∗∗

x

Δt= −δpn+1

δx(5.20)

un+1y − u∗∗

y

Δt= −δpn+1

δy(5.21)

where the pressure pn+1 should be pre computed from the continuityequation demanding the velocity at n+ 1 time slice is divergency free:

δun+1x

δx+

δun+1y

δy= 0 (5.22)

Applying the operator∇ to the equations (5.20) and (5.21) we get the Poissonequation for the pressure:

δ2pn+1

δx2+

δ2pn+1

δy2=

1

Δt

(δu∗∗

x

δx+

δu∗∗y

δy

)(5.23)

46

Page 47: Computational Methods of Heat andMass Transfer

5.3 Increase of the accuracy of time deriva-

tives approximation using the Lax-Wendroff

scheme

Let us consider the general transport equation:

∂u

∂t+

∂F (u)

∂x= 0 (5.24)

We introduce the following designations:

A =∂F

∂u

utt = −Fxt = −Ftx, Ft = Fuut = −FuFx ≡ −AFx (5.25)

Substitution of these results into the time Taylor series gives the Lax-Wendroffscheme which is of the second order in time:

u(t+ τ) = u(t) + τut(t) +τ 2

2utt(t) +O(τ 3)

= u(t)− τFx(t) +τ 2

2(A(t)Fx(t))x +O(τ 3)

(5.26)

A difficulty arising in the LW approach is the computation of the operator A.One can easy derive that the Lax Wendroff scheme results in the solution ofthe equation:

un+1 − un

τ+

∂F n

∂x=

τ

2

∂x

(An∂F

n

∂x

)

47

Page 48: Computational Methods of Heat andMass Transfer

48

Page 49: Computational Methods of Heat andMass Transfer

Chapter 6

Finite Volume Method

6.1 Transformation of the Navier-Stokes Equa-

tions in the Finite Volume Method

The Navier Stokes equation

∂ui

∂t+

∂(uiuj)

∂xj

= Fi − 1

ρ

∂p

∂xi

+ ν∂

∂xj

(∂

∂xj

ui

)(6.1)

is fulfilled within each mesh element (finite volume U) in the integral sense.For that it is integrated over the volume U :

∫U

[∂ui

∂t+

∂(uiuj)

∂xj

]dU =

∫U

[Fi − 1

ρ

∂p

∂xi

+ ν∂

∂xj

(∂

∂xj

ui

)]dU (6.2)

Application of the Gauss theorem results in

∂t

∫U

uidU +

∫S

ui�u�ndS =

∫U

FidU − 1

ρ

∫S

p�ei�ndS + ν

∫S

gradui�ndS (6.3)

The same procedure applied to the continuity equation gives

∫S

�u�ndS = 0 (6.4)

49

Page 50: Computational Methods of Heat andMass Transfer

Figure 6.1: Staggered arrangement of finite volumes.

6.2 Sample

Let us consider the two dimensional transport equation without the diffusionterm ⎧⎪⎪⎨

⎪⎪⎩∂ui

∂t+

∂uiuj

∂xj

= − ∂p

∂xi

∂uj

∂xj

= 0

(6.5)

In the integral form this equation reads

∂t

∫U

uidU +

∫S

ui�u�ndS = −∫S

p�ei�ndS (6.6)

We use the staggered grid (Fig. 6.1). The pressure is stored at the volumecenters. The ux velocity is stored at the centers of vertical faces, whereasthe velocity uy component at centers of horizontal faces. The x- equationis satisfied for volumes displaced in x-direction, whereas the y-equation forthese displaced in y-direction.Below we consider approximations of different terms:

6.2.1 Pressure and unsteady terms

Source (pressure) term for x-equation:

50

Page 51: Computational Methods of Heat andMass Transfer

Qp1 = −

∫S

p�e1�ndS ≈ −(peSe − pwSw

)= −

(pi+1j − pij

)Δ (6.7)

Unsteady term for x-equation:

∂t

∫U

uxdU = Δ2un+1xij − un

xij

Δt(6.8)

Pressure term for y-equation:

Qp2 = −

∫S

p�e2�ndS ≈ −(pnSn − psSs

)= −

(pij+1 − pij

)Δ (6.9)

Unsteady term for y-equation:

∂t

∫U

uydU = Δ2un+1yij − un

yij

Δt(6.10)

6.2.2 Convection term of the x-equation

The integrand in convection term ui�u�n is represented in the table 6.1.

Table 6.1: �n�u and ui at different sides. x-equation

side �n�u ui

east uxe uxe

west −uxw uxw

north uyn uxn

south −uys uxs

The necessary velocities are approximated as shown in the table 6.2.Herewith the convection term has the form presented in the table 6.3.

6.2.3 Convection term of the y-equation

The integrand in convection term ui�u�n is represented in the table 6.4.The necessary velocities are approximated as shown in the table 6.5.Herewith the convection term has the form presented in the table 6.6.

51

Page 52: Computational Methods of Heat andMass Transfer

Table 6.2: Velocities at different sides. x-equation

velocity approximationuxe uxe =

12(uxij + uxi+1j)

uxw uxw = 12(uxij + uxi−1j)

uxn uxn = 12(uxij + uxij+1)

uxs uxs =12(uxij + uxij−1)

uyn uyn = 12(uyij + uyi+1j)

uys uys =12(uyij−1 + uyi+1j−1)

Table 6.3: Convection flux. x-equation

side fluxeast Δ

4(uxij + uxi+1j)

2

west −Δ4(uxij + uxi−1j)

2

north Δ4(uxij + uxij+1)(uyij + uyi+1j)

south −Δ4(uxij + uxij−1)(uyi+1j−1 + uyij−1)

Table 6.4: �n�u and ui at different sides. y-equation

side �n�u ui

east uxe uye

west −uxw uyw

north uyn uyn

south −uys uys

Table 6.5: Velocities at different sides. y-equation

velocity approximationuxe uxe =

12(uxij + uxij+1)

uxw uxw = 12(uxi−1j + uxi−1j+1)

uyn uyn = 12(uyij + uyij+1)

uys uys =12(uyij + uyij−1)

uye uye =12(uyij + uyi+1j)

uyw uyw = 12(uyij + uyi−1j)

6.2.4 X-equation approximation

Δ2un+1xij − un

xij

Δt+

52

Page 53: Computational Methods of Heat andMass Transfer

Table 6.6: Convection flux. y-equation

side fluxeast Δ

4(uxij + uxij+1)(uyij + uyi+1j)

west −Δ4(uxi−1j + uxi−1j+1)(uyij + uyi−1j)

north Δ4(uyij + uyij+1)

2

south −Δ4(uyij + uyij−1)

2

Δ

4(uxij + uxi+1j)

2 − Δ

4(uxij + uxi−1j)

2+

Δ

4(uxij + uxij+1)(uyij + uyi+1j)− Δ

4(uxij + uxij−1)(uyij−1 + uyi+1j−1)

+

(pi+1j − pij

)Δ = 0

6.2.5 Y-equation approximation

Δ2un+1yij − un

yij

Δt+

Δ

4(uxij + uxij+1)(uyij + uyi+1j)− Δ

4(uxi−1j + uxi−1j+1)(uyij + uyi−1j)+

Δ

4(uyij + uyij+1)

2 − Δ

4(uyij + uyij−1)

2+

+

(pij+1 − pij

)Δ = 0

6.3 Explicit scheme

The next task is to specify the upper index in X and Y equations. If theindex is n we get fully explicit scheme which is similar to that derived abovefor finite difference method

Δ2un+1xij − un

xij

Δt+

Δ

4(un

xij + unxi+1j)

2 − Δ

4(un

xij + unxi−1j)

2+

Δ

4(un

xij + unxij+1)(u

nyij + un

yi+1j)−Δ

4(un

xij + unxij−1)(u

nyij−1 + un

yi+1j−1)

53

Page 54: Computational Methods of Heat andMass Transfer

+

(pni+1j − pnij

)Δ = 0 (6.11)

Δ2un+1yij − un

yij

Δt+

Δ

4(un

yij + unyi+1j)(u

nxij + un

xij+1)−Δ

4(un

yij + unyi−1j)(u

nxi−1j + un

xi−1j+1)+

Δ

4(un

yij + unyij+1)

2 − Δ

4(un

yij + unyij−1)

2+

+

(pnij+1 − pnij

)Δ = 0 (6.12)

The Poisson equation for pressure is derived in the same manner as abovefor finite difference method. For that the equations (7.1) is differentiatedon x, whereas the equation (7.2) is differentiated on y. Then both results aresummed under assumptions that both un+1

ij and unij are divergence free:

δun+1xij

δx+

δun+1yij

δy= 0,

δunxij

δx+

δunyij

δy= 0

This equation is coupled with equations (7.1) and (7.2). The explicit schemehas advantage that the solution at the time instant n + 1 is explicitly ex-pressed through the solution at time instant n. The solution of linear alge-braic equations which is the most laborious numerical procedure is necessaryonly for the solution of the Poisson equation. The momentum equations (7.1)and (7.2) are solved explicitly. Velocities un+1

xij and un+1yij are computed then

from simple algebraic formula (7.1) and (7.2). The big disadvantage of theexplicit method is the limitation forced by the Courant Friedrich Levy crite-rion. The time step Δt should be very small to secure the numerical stability.This disadvantage can be overcome within the implicit schemes.

6.4 Implicit scheme

If the index is n+ 1 we get implicit scheme

Δ2un+1xij − un

xij

Δt+

Δ

4(un+1

xij + un+1xi+1j)

2 − Δ

4(un+1

xij + un+1xi−1j)

2+

54

Page 55: Computational Methods of Heat andMass Transfer

Δ

4(un+1

xij + un+1xij+1)(u

n+1yij + un+1

yi+1j)−Δ

4(un+1

xij + un+1xij−1)(u

n+1yij−1 + un+1

yi+1j−1)

+

(pn+1i+1j − pn+1

ij

)Δ = 0 (6.13)

Δ2un+1yij − un

yij

Δt+

Δ

4(un+1

yij + un+1yi+1j)(u

n+1xij + un+1

xij+1)−Δ

4(un+1

yij + un+1yi−1j)(u

n+1xi−1j + un+1

xi−1j+1)+

Δ

4(un+1

yij + un+1yij+1)

2 − Δ

4(un+1

yij + un+1yij−1)

2+

+

(pn+1ij+1 − pn+1

ij

)Δ = 0 (6.14)

The Poisson equation for pressure is derived in the same manner as abovefor finite difference method. For that the equations (7.3) is differentiatedon x, whereas the equation (7.4) is differentiated on y. Then both results aresummed under assumptions that both un+1

ij and unij are divergence free:

δun+1xij

δx+

δun+1yij

δy= 0,

δunxij

δx+

δunyij

δy= 0

The resulting Poisson equation can not be solved because both the r.h.s.(velocities) and the l.h.s (pressure) depend on n + 1. The term on r.h.s.cannot be computed until the computation of velocity field at time n + 1 iscompleted and vice versa. Other problem is that the equations (7.3) and (7.4)are non linear.

6.5 Iterative procedure for implicit scheme

To solve the nonlinear system and the whole system of equations we use theiterative procedure. Let m be an iteration number. The nonlinear term isrepresented in form:

∂uiuj

∂xj

=∂u

(m)i u

(m−1)j

∂xj

(6.15)

The velocity uj is taken from the previous iteration (m−1). The system (7.1)and (7.2) is rewritten in the form

55

Page 56: Computational Methods of Heat andMass Transfer

Δ2u(m)xij − un

xij

Δt+

Δ

4(u

(m)xij + u

(m)xi+1j)(u

(m−1)xij + u

(m−1)xi+1j )−

Δ

4(u

(m)xij + u

(m)xi−1j)(u

(m−1)xij + u

(m−1)xi−1j )+

Δ

4(u

(m)xij + u

(m)xij+1)(u

(m−1)yij + u

(m−1)yi+1j )−

Δ

4(u

(m)xij + u

(m)xij−1)(u

(m−1)yij−1 + u

(m−1)yi+1j−1)

+

(p(m)i+1j − p

(m)ij

)Δ = 0

Δ2u(m)yij − un

yij

Δt+

Δ

4(u

(m)yij + u

(m)yi+1j)(u

(m−1)xij + u

(m−1)xij+1 )−

Δ

4(u

(m)yij + u

(m)yi−1j)(u

(m−1)xi−1j + u

(m−1)xi−1j+1)+

Δ

4(u

(m)yij + u

(m)yij+1)(u

(m−1)yij + u

(m−1)yij+1 )−

Δ

4(u

(m)yij + u

(m)yij−1)(u

(m−1)yij + u

(m−1)yij−1 )+

+

(p(m)ij+1 − p

(m)ij

)Δ = 0

or

qxi−1ju(m)xi−1j + qxiju

(m)xij + qxi+1ju

(m)xi+1j + qxij−1u

(m)xij−1 + qxij+1u

(m)xij+1+ (6.16)

+

(p(m)i+1j − p

(m)ij

)Δ = rxij

qyi−1ju(m)yi−1j + qyiju

(m)yij + qyi+1ju

(m)yi+1j + qyij−1u

(m)yij−1 + qyij+1u

(m)yij+1+ (6.17)

+

(p(m)ij+1 − p

(m)ij

)Δ = ryij

where

56

Page 57: Computational Methods of Heat andMass Transfer

qxij = Δ2/Δt+Δ

4[(u

(m−1)xij + u

(m−1)xi+1j )− (u

(m−1)xij + u

(m−1)xi−1j )+

+ (u(m−1)yij + u

(m−1)yi+1j )− (u

(m−1)yij−1 + u

(m−1)yi+1j−1)]

qxi+1j =Δ

4(u

(m−1)xij + u

(m−1)xi+1j ), qxi−1j = −Δ

4(u

(m−1)xi−1j + u

(m−1)xij ),

qxij+1 =Δ

4(u

(m−1)yij + u

(m−1)yi+1j ), qxij−1 = −Δ

4(u

(m−1)yij−1 + u

(m−1)yi+1j−1)

qyij =Δ2

Δt+

Δ

4

[(u(m−1)yij + u

(m−1)yij+1

)− (u(m−1)yij + u

(m−1)yij−1

)+

+(u(m−1)xij + u

(m−1)xij+1

)− (u(m−1)xi−1j + u

(m−1)xi−1j+1

)]qyi−1j = −Δ

4

(u(m−1)xi−1j + u

(m−1)xi−1j+1

), qyi+1j =

Δ

4

(u(m−1)xij + u

(m−1)xij+1

)qyij−1 = −Δ

4

(u(m−1)yij + u

(m−1)yij−1

), qyij+1 =

Δ

4

(u(m−1)yij + u

(m−1)yij+1

)rxij = Δ2

unxij

Δt, ryij = Δ2

unyij

Δt

Dividing the equations (7.6) by qxij and (7.7) by qyij we obtain

axi−1ju(m)xi−1j + u

(m)xij + axi+1ju

(m)xi+1j + axij−1u

(m)xij−1 + axij+1u

(m)xij+1+ (6.18)

+

(p(m)i+1j − p

(m)ij

)Δ/qxij = Rxij

ayi−1ju(m)yi−1j + u

(m)yij + ayi+1ju

(m)yi+1j + ayij−1u

(m)yij−1 + ayij+1u

(m)yij+1+ (6.19)

+

(p(m)ij+1 − p

(m)ij

)Δ/qyij = Ryij

where ax,ykl = qx,ykl/qx,yij and Rx,ykl = rx,ykl/qx,yij. In what follows we usethe operator form of equations (7.8) and (7.9):

u = Au+Bp+ C (6.20)

57

Page 58: Computational Methods of Heat andMass Transfer

6.6 Pressure correction method

The velocity field satisfying the equation (7.10) is the solution of the lin-earized Navier Stokes equation. It doesn’t fulfill the continuity equation.The iterative solution satisfying the whole system of equations is computedusing the pressure correction method.

The iterative scheme consists of following steps. First, the intermediate so-lution is calculated with pressure taken from the previous iteration:

u∗ = Au∗ +Bp(m−1) + C (6.21)

The velocity and pressure corrections

u(m) = u∗ + u′, p(m) = p(m−1) + p′ (6.22)

are computed within next steps. Substitution of (7.12) into (7.10) gives

(u∗ + u′) = A(u∗ + u′) + B(p(m−1) + p′) + C (6.23)

Since u∗ satisfies the equation (7.11) the equation for the velocity correctionreads

u′ = Au′ +Bp′ (6.24)

The velocity at the iteration (m) is

u(m) = u∗ + Au′ +Bp′ (6.25)

It should satisfy the continuity equation

∇u(m+1) = 0 (6.26)

what results in

∇u∗ = −∇Bp′ −∇Au′ (6.27)

6.7 SIMPLE method

A very popular pressure correction method is the SIMPLE method. The mainassumption of this method is neglect of the term ∇Au′ in (7.17) and (7.14):

∇Bp′ = −∇u∗ (6.28)

58

Page 59: Computational Methods of Heat andMass Transfer

Figure 6.2: SIMPLE algorithm.

The equation (7.18) is the Poisson equation for the pressure correction p′.

The solution algorithm is summarized in Fig. 7.1. Let the solution is knownat time slice n, the solution at the next time instant n+ 1 is seeking. In thefirst iteration all quantities are taken from the previous time instant

u(m=1)x,yij = un

x,yij, p(m=1)ij = pnij

At each time instant the inner loop iterations are performed until residualsare getting smaller than some threshold

max|u(m)x,yij − u

(m−1)x,yij | < εu, max|pm(m)

ij − p(m−1)ij | < εp

As soon as the inner loop iterations are converged the solution at time in-stant n+1 is equaling to the solution from the last iteration and the next timeinstant is computed. The structure of the inner loop is shown in Fig. 7.1.

6.7.1 Pressure correction equation

Let us consider the pressure correction equation (7.18) in details.This equa-tion is solved for the control volume shown in Fig. 7.2. The divergencyoperator ∇f = ∂fx

∂x+ ∂fy

∂yis represented within Finite Volume Method as

follows

59

Page 60: Computational Methods of Heat andMass Transfer

∫U

∇fdU =

∫U

(∂fx∂x

+∂fy∂y

)dU =

∫S

fndS = (fxe − fxw + fyn − fys)Δ (6.29)

Therefore, the right hand side of the equation (7.18) takes the form

∫U

∇u∗dU =

∫S

u∗ndS = (u∗xij − u∗

xi−1j + u∗yij − u∗

yij−1)Δ (6.30)

As follows from (7.8) and (7.9) the operator Bp′ has the following values atfaces of the control volume

(Bp′)xij =(p′i+1j − p′ij

)Δ/qxij, (Bp′)xi−1j =

(p′ij − p′i−1j

)Δ/qxi−1j

(Bp′)yij =(p′ij+1 − p′ij

)Δ/qyij, (Bp′)yij−1 =

(p′ij − p′ij−1

)Δ/qyij−1. (6.31)

Substitution of (7.20) and (7.21) into (7.18) results in

(p′i+1j − p′ij

)/qxij −

(p′ij − p′i−1j

)/qxi−1j +

(p′ij+1 − p′ij

)/qyij

−(p′ij − p′ij−1

)/qyij−1 = −(u∗

xij − u∗xi−1j + u∗

yij − u∗yij−1) (6.32)

or

βi+1jp′i+1j + βijp

′ij + βi−1jp

′i−1j + βij+1p

′ij+1 + βij−1p

′ij−1 = cij (6.33)

where

cij = −(u∗xij − u∗

xi−1j + u∗yij − u∗

yij−1), βij = −(

1

qxij+

1

qxi−1j

+1

qyij+

1

qyij−1

),

βi+1j =1

qxij, βi−1j =

1

qxi−1j

, βij+1 =1

qyij, βij−1 =

1

qyij−1

.

60

Page 61: Computational Methods of Heat andMass Transfer

6.7.2 Summary of the SIMPLE algorithm

We introduce one dimensional numbering instead of two dimensional oneaccording to the rule

α = (i− 1)Ny + j

Let the solution at the time instant n be known. The task is to find thesolution at the time n + 1. At each time instant the guess solution is takenfrom the previous time instant:

u(1)x,yα = un

x,yα, p(1)α = pnα

The solution is found within the next substeps:

i) Calculation of the auxiliary velocity u∗x,yα from two independent sys-

tems of linear algebraic equations:

axα−Nyu∗xα−Ny

+ u∗xα + axα+Nyu

∗xα+Ny

+ axα−1u∗xα−1 + axα+1u

∗xα+1+

+

(p(m−1)α+Ny

− p(m−1)α

)Δ/qxα = Rxα

ayα−Nyu∗yα−Ny

+ u∗yα + ayα+Nyu

∗yα+Ny

+ ayα−1u∗yα−1 + ayα+1u

∗yα+1+

+

(p(m−1)α+1 − p(m−1)

α

)Δ/qyα = Ryα

ii) Calculation of the pressure correction p′α from the system of linearalgebraic equations:

βα+Nyp′α+Ny

+ βαp′α + βα−Nyp

′α−Ny

+ βα+1p′α+1 + βα−1p

′α−1 = cα

iii) Calculation of the velocity correction u′x,yα:

u′xα = −

(p′α+Ny

− p′α

)Δ/qxα

u′yα = −

(p′α+1 − p′α

)Δ/qyα

iv) Correction of the velocity and pressure:

u(m)x,yα = u∗

x,yα + u′x,yα, p(m)

α = p(m−1)α + p′α

61

Page 62: Computational Methods of Heat andMass Transfer

Figure 6.3: Control volume used for the pressure correction equation.

v) Check the difference between two iterations:

max|u(m)x,yα − u(m−1)

x,yα | < εu, max|p(m)α − p(m−1)

α | < εp

If these conditions are not fulfilled then

u(m−1)x,yα = u(m)

x,yα, p(m−1)α = p(m)

α

and go to the step i). Otherwise the calculation at the time momentn+ 1 is completed

un+1x,yα = u(m)

x,yα, pn+1α = p(m)

α

and one proceeds to the next time instant n+ 2.

62

Page 63: Computational Methods of Heat andMass Transfer

Chapter 7

Finite Volume Method(continuation)

7.1 Explicit scheme

The next step is to specify the upper index in X and Y equations. If theindex is n we get fully explicit scheme which is similar to that derived abovefor finite difference method

Δ2un+1xij − un

xij

Δt+

Δ

4(un

xij + unxi+1j)

2 − Δ

4(un

xij + unxi−1j)

2+

Δ

4(un

xij + unxij+1)(u

nyij + un

yi+1j)−Δ

4(un

xij + unxij−1)(u

nyij−1 + un

yi+1j−1)

+

(pni+1j − pnij

)Δ = 0 (7.1)

Δ2un+1yij − un

yij

Δt+

Δ

4(un

yij + unyi+1j)(u

nxij + un

xij+1)−Δ

4(un

yij + unyi−1j)(u

nxi−1j + un

xi−1j+1)+

Δ

4(un

yij + unyij+1)

2 − Δ

4(un

yij + unyij−1)

2+

+

(pnij+1 − pnij

)Δ = 0 (7.2)

63

Page 64: Computational Methods of Heat andMass Transfer

The Poisson equation for pressure is derived in the same manner as abovefor finite difference method. For that the equations (7.1) is differentiatedon x, whereas the equation (7.2) is differentiated on y. Then both results aresummed under assumptions that both un+1

ij and unij are divergence free:

δun+1xij

δx+

δun+1yij

δy= 0,

δunxij

δx+

δunyij

δy= 0

This equation is coupled with equations (7.1) and (7.2). The explicit schemehas advantage that the solution at the time instant n + 1 is explicitly ex-pressed through the solution at time instant n. The solution of linear alge-braic equations which is the most laborious numerical procedure is necessaryonly for the solution of the Poisson equation. The momentum equations (7.1)and (7.2) are solved explicitly. Velocities un+1

xij and un+1yij are computed then

from simple algebraic formula (7.1) and (7.2). The big disadvantage of theexplicit method is the limitation forced by the Courant Friedrich Levy crite-rion. The time step Δt should be very small to secure the numerical stability.This disadvantage can be overcome within the implicit schemes.

7.2 Implicit scheme

If the index is n+ 1 we get implicit scheme

Δ2un+1xij − un

xij

Δt+

Δ

4(un+1

xij + un+1xi+1j)

2 − Δ

4(un+1

xij + un+1xi−1j)

2+

Δ

4(un+1

xij + un+1xij+1)(u

n+1yij + un+1

yi+1j)−Δ

4(un+1

xij + un+1xij−1)(u

n+1yij−1 + un+1

yi+1j−1)

+

(pn+1i+1j − pn+1

ij

)Δ = 0 (7.3)

Δ2un+1yij − un

yij

Δt+

Δ

4(un+1

yij + un+1yi+1j)(u

n+1xij + un+1

xij+1)−Δ

4(un+1

yij + un+1yi−1j)(u

n+1xi−1j + un+1

xi−1j+1)+

Δ

4(un+1

yij + un+1yij+1)

2 − Δ

4(un+1

yij + un+1yij−1)

2+

+

(pn+1ij+1 − pn+1

ij

)Δ = 0 (7.4)

64

Page 65: Computational Methods of Heat andMass Transfer

The Poisson equation for pressure is derived in the same manner as abovefor finite difference method. For that the equations (7.3) is differentiatedon x, whereas the equation (7.4) is differentiated on y. Then both results aresummed under assumptions that both un+1

ij and unij are divergence free:

δun+1xij

δx+

δun+1yij

δy= 0,

δunxij

δx+

δunyij

δy= 0

The resulting Poisson equation can be solved because both the r.h.s. (veloc-ities) and the l.h.s (pressure) depend on n+1. The term on r.h.s. cannot becomputed until the computation of velocity field at time n+ 1 is completedand vice versa. Other problem is that the equations (7.3) and (7.4) are nonlinear.

7.3 Iterative procedure for implicit scheme

To solve the nonlinear system and the whole system of equations we use theiterative procedure. Let m be an iteration number. The nonlinear term isrepresented in form:

∂uiuj

∂xj

=∂u

(m)i u

(m−1)j

∂xj

(7.5)

The velocity uj is taken from the previous iteration (m−1). The system (7.1)and (7.2) is rewritten in the form

Δ2u(m)xij − un

xij

Δt+

Δ

4(u

(m)xij + u

(m)xi+1j)(u

(m−1)xij + u

(m−1)xi+1j )−

Δ

4(u

(m)xij + u

(m)xi−1j)(u

(m−1)xij + u

(m−1)xi−1j )+

Δ

4(u

(m)xij + u

(m)xij+1)(u

(m−1)yij + u

(m−1)yi+1j )−

Δ

4(u

(m)xij + u

(m)xij−1)(u

(m−1)yij−1 + u

(m−1)yi+1j−1)

+

(p(m)i+1j − p

(m)ij

)Δ = 0

Δ2u(m)yij − un

yij

Δt+

Δ

4(u

(m)yij + u

(m)yi+1j)(u

(m−1)xij + u

(m−1)xij+1 )−

Δ

4(u

(m)yij + u

(m)yi−1j)(u

(m−1)xi−1j + u

(m−1)xi−1j+1)+

Δ

4(u

(m)yij + u

(m)yij+1)(u

(m−1)yij + u

(m−1)yij+1 )−

Δ

4(u

(m)yij + u

(m)yij−1)(u

(m−1)yij + u

(m−1)yij−1 )+

65

Page 66: Computational Methods of Heat andMass Transfer

+

(p(m)ij+1 − p

(m)ij

)Δ = 0

or

qxi−1ju(m)xi−1j + qxiju

(m)xij + qxi+1ju

(m)xi+1j + qxij−1u

(m)xij−1 + qxij+1u

(m)xij+1+ (7.6)

+

(p(m)i+1j − p

(m)ij

)Δ = rxij

qyi−1ju(m)yi−1j + qyiju

(m)yij + qyi+1ju

(m)yi+1j + qyij−1u

(m)yij−1 + qyij+1u

(m)yij+1+ (7.7)

+

(p(m)ij+1 − p

(m)ij

)Δ = ryij

where

qxij = Δ2/Δt+Δ

4[(u

(m−1)xij + u

(m−1)xi+1j )− (u

(m−1)xij + u

(m−1)xi−1j )+

+ (u(m−1)yij + u

(m−1)yi+1j )− (u

(m−1)yij−1 + u

(m−1)yi+1j−1)]

qxi+1j =Δ

4(u

(m−1)xij + u

(m−1)xi+1j ), qxi−1j = −Δ

4(u

(m−1)xi−1j + u

(m−1)xij ),

qxij+1 =Δ

4(u

(m−1)yij + u

(m−1)yi+1j ), qxij−1 = −Δ

4(u

(m−1)yij−1 + u

(m−1)yi+1j−1)

qyij =Δ2

Δt+

Δ

4

[(u(m−1)yij + u

(m−1)yij+1

)− (u(m−1)yij + u

(m−1)yij−1

)+

+(u(m−1)xij + u

(m−1)xij+1

)− (u(m−1)xi−1j + u

(m−1)xi−1j+1

)]qyi−1j = −Δ

4

(u(m−1)xi−1j + u

(m−1)xi−1j+1

), qyi+1j =

Δ

4

(u(m−1)xij + u

(m−1)xij+1

)qyij−1 = −Δ

4

(u(m−1)yij + u

(m−1)yij−1

), qyij+1 =

Δ

4

(u(m−1)yij + u

(m−1)yij+1

)rxij = Δ2

unxij

Δt, ryij = Δ2

unyij

Δt

Dividing the equations (7.6) by qxij and (7.7) by qyij we obtain

axi−1ju(m)xi−1j + u

(m)xij + axi+1ju

(m)xi+1j + axij−1u

(m)xij−1 + axij+1u

(m)xij+1+ (7.8)

66

Page 67: Computational Methods of Heat andMass Transfer

+

(p(m)i+1j − p

(m)ij

)Δ/qxij = Rxij

ayi−1ju(m)yi−1j + u

(m)yij + ayi+1ju

(m)yi+1j + ayij−1u

(m)yij−1 + ayij+1u

(m)yij+1+ (7.9)

+

(p(m)ij+1 − p

(m)ij

)Δ/qyij = Ryij

where ax,ykl = qx,ykl/qx,yij and Rx,ykl = rx,ykl/qx,yij. In what follows we usethe operator form of equations (7.8) and (7.9):

u = Au+Bp+ C (7.10)

7.4 Pressure correction method

The velocity field satisfying the equation (7.10) is the solution of the lin-earized Navier Stokes equation. It doesn’t fulfill the continuity equation.The iterative solution satisfying the whole system of equations is computedusing the pressure correction method.

The iterative scheme consists of following steps. First, the intermediate so-lution is calculated with pressure taken from the previous iteration:

u∗ = Au∗ +Bp(m−1) + C (7.11)

The velocity and pressure corrections

u(m) = u∗ + u′, p(m) = p(m−1) + p′ (7.12)

are computed within next steps. Substitution of (7.12) into (7.10) gives

(u∗ + u′) = A(u∗ + u′) + B(p(m−1) + p′) + C (7.13)

Since u∗ satisfies the equation (7.11) the equation for the velocity correctionreads

u′ = Au′ +Bp′ (7.14)

The velocity at the iteration (m) is

u(m) = u∗ + Au′ +Bp′ (7.15)

67

Page 68: Computational Methods of Heat andMass Transfer

It should satisfy the continuity equation

∇u(m+1) = 0 (7.16)

what results in

∇u∗ = −∇Bp′ −∇Au′ (7.17)

7.5 SIMPLE method

A very popular pressure correction method is the SIMPLE method. The mainassumption of this method is neglect of the term ∇Au′ in (7.17) and (7.14):

∇Bp′ = −∇u∗ (7.18)

The equation (7.18) is the Poisson equation for the pressure correction p′.

The solution algorithm is summarized in Fig. 7.1. Let the solution is knownat time slice n, the solution at the next time instant n+ 1 is seeking. In thefirst iteration all quantities are taken from the previous time instant

u(m=1)x,yij = un

x,yij, p(m=1)ij = pnij

At each time instant the inner loop iterations are performed until residualsare getting smaller than some threshold

max|u(m)x,yij − u

(m−1)x,yij | < εu, max|pm(m)

ij − p(m−1)ij | < εp

As soon as the inner loop iterations are converged the solution at time in-stant n+1 is equaling to the solution from the last iteration and the next timeinstant is computed. The structure of the inner loop is shown in Fig. 7.1.

7.5.1 Pressure correction equation

Let us consider the pressure correction equation (7.18) in details.This equa-tion is solved for the control volume shown in Fig. 7.2. The divergencyoperator ∇f = ∂fx

∂x+ ∂fy

∂yis represented within Finite Volume Method as

follows

∫U

∇fdU =

∫U

(∂fx∂x

+∂fy∂y

)dU =

∫S

fndS = (fxe − fxw + fyn − fys)Δ (7.19)

Therefore, the right hand side of the equation (7.18) takes the form

68

Page 69: Computational Methods of Heat andMass Transfer

Figure 7.1: SIMPLE algorithm.

∫U

∇u∗dU =

∫S

u∗ndS = (u∗xij − u∗

xi−1j + u∗yij − u∗

yij−1)Δ (7.20)

As follows from (7.8) and (7.9) the operator Bp′ has the following values atfaces of the control volume

(Bp′)xij =(p′i+1j − p′ij

)Δ/qxij, (Bp′)xi−1j =

(p′ij − p′i−1j

)Δ/qxi−1j

(Bp′)yij =(p′ij+1 − p′ij

)Δ/qyij, (Bp′)yij−1 =

(p′ij − p′ij−1

)Δ/qyij−1. (7.21)

Substitution of (7.20) and (7.21) into (7.18) results in

(p′i+1j − p′ij

)/qxij −

(p′ij − p′i−1j

)/qxi−1j +

(p′ij+1 − p′ij

)/qyij

−(p′ij − p′ij−1

)/qyij−1 = −(u∗

xij − u∗xi−1j + u∗

yij − u∗yij−1) (7.22)

69

Page 70: Computational Methods of Heat andMass Transfer

or

βi+1jp′i+1j + βijp

′ij + βi−1jp

′i−1j + βij+1p

′ij+1 + βij−1p

′ij−1 = cij (7.23)

where

cij = −(u∗xij − u∗

xi−1j + u∗yij − u∗

yij−1), βij = −(

1

qxij+

1

qxi−1j

+1

qyij+

1

qyij−1

),

βi+1j =1

qxij, βi−1j =

1

qxi−1j

, βij+1 =1

qyij, βij−1 =

1

qyij−1

.

7.5.2 Summary of the SIMPLE algorithm

We introduce one dimensional numbering instead of two dimensional oneaccording to the rule

α = (i− 1)Ny + j

Let the solution at the time instant n be known. The task is to find thesolution at the time n + 1. At each time instant the guess solution is takenfrom the previous time instant:

u(1)x,yα = un

x,yα, p(1)α = pnα

The solution is found within the next substeps:

i) Calculation of the auxiliary velocity u∗x,yα from two independent sys-

tems of linear algebraic equations:

axα−Nyu∗xα−Ny

+ u∗xα + axα+Nyu

∗xα+Ny

+ axα−1u∗xα−1 + axα+1u

∗xα+1+

+

(p(m−1)α+Ny

− p(m−1)α

)Δ/qxα = Rxα

ayα−Nyu∗yα−Ny

+ u∗yα + ayα+Nyu

∗yα+Ny

+ ayα−1u∗yα−1 + ayα+1u

∗yα+1+

+

(p(m−1)α+1 − p(m−1)

α

)Δ/qyα = Ryα

ii) Calculation of the pressure correction p′α from the system of linearalgebraic equations:

βα+Nyp′α+Ny

+ βαp′α + βα−Nyp

′α−Ny

+ βα+1p′α+1 + βα−1p

′α−1 = cα

70

Page 71: Computational Methods of Heat andMass Transfer

iii) Calculation of the velocity correction u′x,yα:

u′xα = −

(p′α+Ny

− p′α

)Δ/qxα

u′yα = −

(p′α+1 − p′α

)Δ/qyα

iv) Correction of the velocity and pressure:

u(m)x,yα = u∗

x,yα + u′x,yα, p(m)

α = p(m−1)α + p′α

v) Check the difference between two iterations:

max|u(m)x,yα − u(m−1)

x,yα | < εu, max|p(m)α − p(m−1)

α | < εp

If these conditions are not fulfilled then

u(m−1)x,yα = u(m)

x,yα, p(m−1)α = p(m)

α

and go to the step i). Otherwise the calculation at the time momentn+ 1 is completed

un+1x,yα = u(m)

x,yα, pn+1α = p(m)

α

and one proceeds to the next time instant n+ 2.

71

Page 72: Computational Methods of Heat andMass Transfer

Figure 7.2: Control volume used for the pressure correction equation.

72

Page 73: Computational Methods of Heat andMass Transfer

Chapter 8

Overview of pressure correctionmethods

8.1 SIMPLE algorithm

The linearized Navier Stokes equation written in operator form is

u = Au+Bp+ C (8.1)

Within the SIMPLE algorithm the solution is seeking at each time step inform of the loop:

• Calculation of the auxiliary velocity

u∗ = Au∗ +Bp(m−1) + C (8.2)

• Calculation of the pressure correction

∇Bp′ = −∇u∗ (8.3)

• Calculation of the velocity correction

u′ = Bp′ (8.4)

• Correction

u(m) = u∗ + u′, p(m) = p(m−1) + p′ (8.5)

73

Page 74: Computational Methods of Heat andMass Transfer

8.2 PISO algorithm

In the SIMPLE algorithm we neglected the term ∇Au′ (see 7.15). In PISOalgorithm this term is taken into account. Actually the term ∇Au′ can notbe calculated before the velocity correction is computed. Therefore, the termis taken into account in an iterative way.

8.2.1 First iteration

The term Au′ is neglected, i.e. Au′ = 0. The pressure correction is foundfrom the Poisson equation

∇Bp′ = −∇u∗ (8.6)

The velocity correction is then

u′ = Bp′ (8.7)

8.2.2 Second iteration

The pressure correction within the second iteration is found from the Poissonequation

∇Bp′′ = −∇Au′ (8.8)

The velocity correction within the second iteration is then

u′′ = Au′ +Bp′′ (8.9)

8.2.3 Correction

Corrected velocities and pressure are

u(m) = u∗ + u′ + u′′, p(m) = p(m−1) + p′ + p′′ (8.10)

Using formula derived above

∇Bp′ = −∇u∗, u′ = Bp′, u′′ = Au′ +Bp′′,∇Bp′′ = −∇Au′

it is easy to prove that the velocity u(m) satisfies the continuity equation.Now we prove the equation u(m) = Au(m) +Bp(m) + C:

u∗ + u′ + u′′ = A(u∗ + u′ + u′′) + B(p(m−1) + p′ + p′′) + C (8.11)

74

Page 75: Computational Methods of Heat andMass Transfer

Since

u∗ = Au∗ +Bp(m−1) + C, u′ = Bp′, u′′ = Au′ +Bp′′

the equation (8.11) is not satisfied. The residual is Au′′. The residual can bereduced within next iterations. However, usually, PISO algorithm uses onlytwo iterations.

8.2.4 Summary

The PISO algorithm can be summarized as follows:

• Calculation of the auxiliary velocity

u∗ = Au∗ +Bp(m−1) + C (8.12)

• Calculation of the pressure correction p′:

∇Bp′ = −∇u∗ (8.13)

• Calculation of the velocity correction u′

u′ = Bp′ (8.14)

• Calculation of the pressure correction p′′:

∇Bp′′ = −∇Au′ (8.15)

• Calculation of the velocity correction u′′

u′′ = Au′ +Bp′′ (8.16)

• Correction

u(m) = u∗ + u′ + u′′, p(m) = p(m−1) + p′ + p′′ (8.17)

Both algorithms PISO and SIMPLE are widely used in CFD codes.

75

Page 76: Computational Methods of Heat andMass Transfer

8.3 SIMPLEC algorithm

Another way to hold the term ∇Au′ (see 7.15) is implemented in the SIM-PLEC algorithm. The velocity correction at α − th control volume u′

α canbe calculated using the interpolation over N adjacent control volumes:

N∑β=1

Aβu′β ≈ u′

α

N∑β=1

Aβ (8.18)

where β is the number of adjacent control volumes around the control volumewith the number α.

u′α ≈

∑Nβ=1 Aβu

′β∑N

β=1 Aβ

(8.19)

The equation for the velocity correction is

u′ = Au′ +Bp′ (8.20)

or

u′α =

N∑β=1

Aβu′β +Bp′ (8.21)

Substitution of (8.19) into (8.21) yields

u′α = u′

α

N∑β=1

Aβ +Bp′ (8.22)

and

u′α =

Bp′

1−∑Nβ=1 Aβ

(8.23)

The pressure correction equation

∇Bp′ = −∇u∗ −∇Au′

takes the form

∇Bp′ = −∇u∗ −∇ABp′

1−∑Nβ=1 Aβ

or

76

Page 77: Computational Methods of Heat andMass Transfer

∇(B + A

B

1−∑Nβ=1 Aβ

)p′ = −∇u∗ (8.24)

The computational steps are the same as these in SIMPLE algorithm withonly difference that the equation (8.24) is solved instead of (8.3).

77

Page 78: Computational Methods of Heat andMass Transfer

78

Page 79: Computational Methods of Heat andMass Transfer

Chapter 9

Computational grids

9.1 Grid types

The computational grids are subdivided into:

• structured grids (see Fig. 9.1a),

• block structured grids (see Fig. 9.1b),

• unstructured grids (see Fig. 9.1c).

Disadvantage of the structured grid is shown in Fig. 9.2. Refinement of thegrid close to the wall results in the refinement in areas where this refinement isnot necessary. This disadvantage can be overcome by use of block-structured(Fig. 9.1b) and unstructured grid (Fig. 9.1c).

Figure 9.1: Samples of a) structured grid for an airfoil, b) block structuredgrid for cylinder in channel and c) unstructured grid for an airfoil.

The quality of the grid has a strong impact on the accuracy of numericalprediction. The change of the cell topology within the computational domain

79

Page 80: Computational Methods of Heat andMass Transfer

Figure 9.2: Illustration of structured grid disadvantage.

should be smooth especially at the border between different grid blocks. Thegrid resolution should be high especially in areas of boundary layers and closeto the free surface. For this sake the special refinement is used in these areas.To increase the accuracy of the computations in boundary layers one usesspecial grid boundary layers close to walls.

9.2 Overset or Chimera grids

For complicated objects one uses overset or Chimera grids. The idea ofchimera or overset grids is to generate the grids separately around each geo-metrical entity in the computational domain. After that the grids are com-bined together in such a way that they overlap each other where they meet.The crucial operation is an accurate transfer of quantities between the dif-ferent grids at the overlapping region. The most important advantage of theoverset or Chimera grid is the possibility to generate high quality structuredparticular grids separately for different body elements completely indepen-dent of each other, without having to take care of the interface betweengrids.

9.3 Morphing grids

Very efficient way of CFD body simulation is the use of moving or morphinggrids [4]. The idea is the computational grid is moved in accordance with thedisplacement of the body by using an analytical weighted regridding whichis a type of extrapolation of rigid transformation. The possible problem ofmorphing grid is poor quality caused by its motion. Consequently if themesh surrounding the body is allowed to deform the elements around thebody deform. This can quickly lead to poor quality elements if care is nottaken. An alternative method is to replicate the motion of the body with thefluid domain split into an inner and outer region. The outer domain remainsfixed in space while the inner domain containing the body moves laterally toreplicate the motion. The mesh in the inner sub domain remains locked in

80

Page 81: Computational Methods of Heat andMass Transfer

position relative to the lateral motion of the body. This prevents deformationof the detailed mesh around the body. The outer mesh is deformed due tothe motion of the inner region.

If moving grids are used the Navier Stokes should be transformed to take thevelocity of grid faces �Ug into account,

∂�u

∂t+

{(�u− �Ug

)∇}�u = �f − 1

ρ∇p+ νΔ�u (9.1)

Thomas and Lombard have shown that the function �Ug can not be arbi-trary rather than they have to be found from the Geometric ConservationLaw

∂t

∫U

dU −∫S

�Ug�ndS = 0 (9.2)

Where U and S are respectively volume and surface of cells. The equa-tion (9.2) is derived from the condition that the computation of the controlvolumes or of the grid velocities must be performed in a such a way thatthe resulting numerical scheme preserves the state of the uniform flow, in-dependently of the deformation of the grid. The equation (9.2) is satisfiedautomatically if the control volumes don’t change their shape. The Geomet-ric conservation law (9.2) should solve coupled with other fluid flow equationsusing the same discretizations schemes.

More detailed information about grid generation can be found in [1], [5]and [6].

81

Page 82: Computational Methods of Heat andMass Transfer

82

Page 83: Computational Methods of Heat andMass Transfer

Bibliography

[1] Ferziger J. and Peric M. Computational Methods for Fluid Dynamics.Springer, 2002.

[2] Seibold B. A compact and fast matlab code solving the incompressiblenavier-stokes equations on rectangular domains. Applied Mathematics,Massachusetts Institute of Technology, www-math.mit.edu/ seibold, 2008.

[3] Dornseifer T. Griebel M. and Neunhoeffer T. Numerical simulation influid dynamics: A practical introduction. Society for Industrial and Ap-plied Mathematics, Philadelphia, PA, USA, 1998.

[4] Phillips A.B. Turnock S.R. and Furlong M. Urans simulations of staticdrift and dynamic manouveres of the KVLCC2 tanker. pages F63–F68.Proceedings of the SIMMAN workshop, 2008.

[5] Liseikin V. Grid Generation Methods. Springer, 2010. 390p.

[6] Warsi Z.U.A Thompson I.F. and Mastin C.W. Numerical grid generation.Foundations and applications, 1997.

83


Recommended