3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto...

34
Introduction to Computational Fluid Dynamics 424512 E #3 - rz oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku 1/68 Introduction to Computational Fluid Dynamics (iCFD) 424512.0 E, 5 sp 3. Numerical methods for fluid flow (and heat, mass transfer) (lecture 3 of 4) Ron Zevenhoven Åbo Akademi University Process and Systems Engineering Thermal and Flow Engineering Laboratory tel. 3223 ; [email protected] Introduction to Computational Fluid Dynamics 424512 E #3 - rz oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku 2/68 3.1 Discretisation of balance equations Note: many slides are taken (without any or with only little modification) from the material for this course produced by J. Brännbacka (2006, 2005) See also HKTJ07 chapter 6 ÅA course 424508 / 424522 Transport processes Part 6a and 6b http://users.abo.fi/rzevenho/kursRZ.html

Transcript of 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto...

Page 1: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

1/68

Introduction to Computational Fluid Dynamics(iCFD) 424512.0 E, 5 sp

3. Numerical methods for fluid flow (and heat, mass transfer) (lecture 3 of 4)

Ron ZevenhovenÅbo Akademi University

Process and Systems EngineeringThermal and Flow Engineering Laboratory

tel. 3223 ; [email protected]

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

2/68

3.1 Discretisation of balance equations

Note: many slides are taken (without any or with only little modification) from the material for this course produced by J. Brännbacka (2006, 2005)

See also HKTJ07 chapter 6

ÅA course 424508 / 424522 Transport processesPart 6a and 6bhttp://users.abo.fi/rzevenho/kursRZ.html

Page 2: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

3/68

Discretization methods

Finite Difference

Finite Volume

Finite Element

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

4/68

Finite difference

i,j i+1,ji-1,j

Δx

Δy

xxjiji

ji

2,1,1

,

2

,,1,1

,2

2 2

xxjijiji

ji

+

Page 3: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

5/68

Finite differences equations

Differentials differences: ,

with :

Forward differentials:

Backward differentials:

Central differentials:

dy/dx, forward:

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

6/68

Example: stationary heat transfer Stationary heat transfer, 2-D (Laplace eq’n):

with a grid with Δx = Δy, for T0 surrounded by 4 grid points T1, T2, T3, T4:

gives

Page 4: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

7/68

Finite Volume (or Control Volume)

P

Considers finite volumes, ”control volumes” instead of single grid points

Suitable for conservation equations

Can be applied also on unstructured grids

This approach willbe the basis ofthe restof this chapter

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

8/68

Finite Element Method (FEM)

Originally developed for calculating mechanical stresses in solid materials

Development of method has enable solving of nonlinear equations Uses unstructured grid Approximate solution by weighing shape functions; solution method

consist of finding suitable weights

see also B01or Z06

Page 5: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

9/68

Unstructured grid for Finite Element or Finite Volume discretization

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

10/68

3.2a Heat conduction - steady state, 1-D

Page 6: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

11/68

Steady Heat Conduction

Simplified case : No convection term or accumulation term

In one dimension:

0

Sdx

dTk

dx

d

One-dimensional control volume discretization

x

PW E

w e

Δx

(x)w (x)e

E, e = eastW, w = west

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

12/68

Steady Heat Conduction /2

0

e

wwe

dxSdx

dTk

dx

dTk

Integrating the equation over the control volume

Approximating the derivatives by assuming linear variation

0δδ

xSx

TTk

x

TTk

w

WPw

e

PEe

With S = average value for S over Δx

Page 7: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

13/68

Steady Heat Conduction /3Linearized discretization equation

bTaTaTa WWEEPP

ee

E x

ka

δ w

wW x

ka

δ

WEP aaa

xSb

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

14/68

Steady Heat Conduction /4

If the source term depends on T, it can be linearized

PPC TSSS

xSaaa PWEP

Then we get

xSb C

Page 8: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

15/68

Basic rules for the discretization

1. Consistency at control-volume faces for fluxes

2. Positive coefficients ap and anp ensure positive interaction

3. Negative-slope linearization of source term

4. Sum of coefficients aP = anb

Some rules ensuring physical realism and overall balance:

bTaTa PP nbnb

General form of discretization equation

nb = neighbour

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

16/68

Interface conductivity interpolation

e

ee x

xf

δ

δ

(x)e+(x)e-

P Ee

(x)e

E

e

P

e

e k

f

k

f

k

11Recommended interpolation of ke :

with ƒ = ½ gives harmonic mean ke = 2kPkE/(kP+kE)

Linearisation of thermal conductivity k at point e: ke = ƒe∙kP + (1-ƒe)∙kE

with interpolation factor ƒe

Page 9: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

17/68

Non-linearityFor nonlinear equations(e.g. heat condictivity dependent on T) :

Iterative solution:

1.Start with an initial guess of T at all grid points.2.Calculate the values of the coefficients ai in the discretizationequation from the guessed T’s.3.Solve the nominally linear set of equations to get new values of T.4.Use these T’s as a better guesses, and return to step 2. Terminate iteration loop when no significant changes in the values of T occur.

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

18/68

Source term linearization

PP TTdT

dSSS

dT

dSTSS PC

dT

dSSP

gives the coefficients

Linearization of S

Page 10: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

19/68

Source term linearization /2

HKTJ07Chapter 6

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

20/68

Source term linearization /3

2423 TTS

TdT

dS82

22 4382423 PPPPPC TTTTTS

Example :

PP TS 82

What if T´P < 0.25 ?

2423 PPC TTS

0PS

Note: a situation whereSp > 0 violates the Second Law of Thermodynamics

Page 11: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

21/68

Boundary conditions Grid point positions at boundary? Boundary conditions

– Given boundary temperature– Given boundary heat flux– Heat flux given by boundary temperature

B I W P E

“Half” control volume

Normalcontrol volume

i

x

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

22/68

Given boundary heat flux

B I W P E

“Half” control volume

Normalcontrol volume

i

x

xTSSx

TTkq BPC

i

IBiB

Gives bTaTa IIBB

ii

I x

ka

δ BC qSb where, for constant qB :

xSaa PIB

qi

Page 12: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

23/68

Given boundary heat flux /2

bTaTa IIBB

ii

I x

ka

δ

For qB dependent on TB, e.g : BsbB TTkq

sbC TkSb

bpIB kxSaa

B I W P E

“Half” control volume

Normalcontrol volume

i

x

kb =heat transfer coefficientat B

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

24/68

3.2b Heat conduction – non-steady state, 1-D

Page 13: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

25/68

Unsteady 1-dimensional heat conduction

x

Tk

xt

Tc

tt

t

e

w

tt

t

e

wdtdx

x

Tk

xdtdx

t

Tc

Integrating over control volume and time

dt

x

TTk

x

TTkTTxc

tt

tw

WPw

e

PEePP

δδ0,1,

gives

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

26/68

Unsteady heat conduction How do temperatures vary between t and t+Δt?

Approach:

tTfTfdtT PP

tt

t P

0,1, 1

Gives, when denoting TP = TP,1 and with weighing factor ƒ

0,0,

0,0,

11

11

PWEP

WWWEEEPP

Tafafa

TfTfaTfTfaTa

ee

E x

ka

δ

w

wW x

ka

δ

t

xcaP

0,

0,PWEP aafafa

Page 14: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

27/68

Explicit scheme

0,0,0,0, PWEPWWEEPP TaaaTaTaTa

e

eE x

ka

δ w

wW x

ka

δ

f = 0 gives :

t

xca P

0,

0,PP aa

For

WE aa

xct

we get negative dependence

between TP,0 and TP !

TP not related to unknown TE or TW.

Choose Δt < ρ∙cp∙(Δx)2/k = (Δx)2/a i.e. Fo(Δ) < ½

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

28/68

Fully implicit schemeSetting f = 1 and including source term gives :

bTaTaTa WWEEPP

ee

E x

ka

δ

w

wW x

ka

δ

t

xcaP

0,

0,0, pPC TaxSb

xSaaaa PPWEP 0,

Alternative:Crank – Nicolsonscheme: f = ½

Page 15: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

29/68

3.2c Heat conduction – non-steady state, 2-D

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

30/68

2-D heat conduction

Sy

Tk

yx

Tk

xt

Tc

tt

t

n

s

e

w

n

s

e

w

tt

tdtdydxS

y

Tk

yx

Tk

xdydxdt

t

Tc

Δx

ΔyP

N

S

W E

s

n

ew

(x)w

x

y

E, e = eastW, w = westN, n = northS, s = south

Page 16: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

31/68

2-D discretization equation

bTaTaTaTaTa SSNNWWEEPP

e

eE x

yka

δ

w

wW x

yka

δ

n

nN x

xka

δ

s

sS x

xka

δ

t

yxcaP

0,

0,0, pPC TayxSb

yxSaaaaaa PPSNWEP 0,

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

32/68

Solution approach Iteration : guess initial values of T Iterate until discretization equation (almost) satisfied for

all grid points

PP a

bTaT

nbnb

Under-relaxation (α<1) or over-relaxation(α>1): (T’p = previous value)

PP

PP Ta

bTaTT nbnb

Page 17: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

33/68

3.3a Heat conduction + convection -1-D

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

34/68

Convection and diffusion steady-state

xxu

x

Γ

x

PW E

w e

Δx

(x)w (x)e

we

we dx

d

dx

duu

problem:Values forΦe, Φw ?

Note:Continuity, thenρ = constant

*)

Momentum transfer:Φ = u, Γ = μHeat transfer:Φ = cpT, Γ = λMass transfer:Φ = c, Γ = D

Page 18: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

35/68

Central-difference convection scheme

2EP

e

2WP

w

w

WPw

e

PEeWPwEPe xx

uuδδ2

1

2

1

Introducing two variables

xDuF

δ,

Strenght of convection (flow)

Diffusion conductance

number Péclet

PeD

F

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

36/68

Central-difference discretization equations

WWEEPP aaa

2e

eE

FDa

2w

wW

FDa

weWEw

we

eP FFaaF

DF

Da 22

Continuity : Fe = Fw

Page 19: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

37/68

Example: Central-difference scheme

Peclet number :

uL

Pe

D

FPexL δ

F D Pe W E P

0 1 0 0.9 0.5 0.7

1 1 1 0.9 0.5 0.8

2 1 2 0.9 0.5 0.9

3 1 3 0.9 0.5 1.0

4 1 4 0.9 0.5 1.1

-1 1 -1 0.9 0.5 0.6

-2 1 -2 0.9 0.5 0.5

-3 1 -3 0.9 0.5 0.4

-4 1 -4 0.9 0.5 0.3

Setting W = 0.9 , E = 0.5, D = 1 and varying F :

Unrealistic resultswhen ||F|| > 2D

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

38/68

Upwind convection scheme Idea: set the value of the convected equal to the

upstream value

0if,

0if,

eE

eP

e

F

F

0if,

0if,

wP

wW

w

F

F

0,max0,max wPwWw FF

0,max0,max eEePe FF

Denoted using the max – function :

Page 20: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

39/68

Upwind discretization equation

WWEEPP aaa

0,max eeE FDa 0,max wwW FDa

weWEwweeP FFaaFDFDa 0,max0,max

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

40/68

Example: Upwind scheme

Setting W = 0.9 , E = 0.5, D = 1 and varying F :

F D Pe W E P

0 1 0 0.9 0.5 0.70

1 1 1 0.9 0.5 0.77

2 1 2 0.9 0.5 0.80

3 1 3 0.9 0.5 0.82

4 1 4 0.9 0.5 0.83

-1 1 -1 0.9 0.5 0.63

-2 1 -2 0.9 0.5 0.60

-3 1 -3 0.9 0.5 0.58

-4 1 -4 0.9 0.5 0.57

Page 21: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

41/68

Analytical solution

Analytical solution of between grid points P and E :

1

e

ee

P

P

Pex

xx

PEP e

e

ee

P

Pex

xx

PE x

Pe

e

e

dx

de

e

P

δ1

δ

e

ee D

FPe

**)

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

42/68

Analytical solution

Pee = 0Pure diffusion

Pee << 0 down-stream isimportant

Pee >> 0 up-stream isimportant

||Pee|| >> 1Diffusion absent

Page 22: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

43/68

Analytical solution: Exponential scheme

WWEEPP aaa

1exp

e

eE Pe

Fa

1exp

exp

w

wwW Pe

PeFa

weWEP FFaaa

Inserting**) into *)

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

44/68

Other schemes Power-law : Approximation of the exponential

scheme for faster computation

Second-order upwind : Uses the upwind value of and its gradient over the upwind cell to calculate the face value of .

QUICK : weighed average of second-order upwindand central-difference scheme – see next page

Page 23: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

The QUICK scheme

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

45/68

QuadraticUpstreamInterpolation ofConvectiveKinematics

HKTJ07, p. 140

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

Comparison implicit / explicit schemes

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

46/68

S10, p. 119

Page 24: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

47/68

Generalized formulation

WWEEPP aaa

0,max eeeE FPeADa 0,max wwwW FPeADa

weWEP FFaaa

Scheme Equation for A(|Pe|)

Central difference

Upwind 1

Power-law

Exponential (exact)

Pe5.01

1exp Pe

Pe

51.01,0max Pe

Central differencescan give unrealisticresults for ||Pe||>2

Refine grid!

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

48/68

3.3b Heat conduction + convection -2-D

Page 25: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

49/68

Discretization equation for 2-D

Syyxxy

vx

ut

ΓΓ

Δx

ΔyP

N

S

W E

s

n

ew

(x)

w

x

y

yx J and Jfluxes total with Sy

J

x

J

t

Φρ yx

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

50/68

Discretization equation for 2-Dbaaaaa SSNNWWEEPP

0,max eeeE FPeADa

0,max wwwW FPeADa

0,max nnnN FPeADa

0,max sssS FPeADa

t

yxa P

P

0,

0,

0,0, PPC ayxSb

yxSaaaaaa PPSNWEP 0,

yuF ee e

ee x

yD

δ

e

ee D

FPe etc.

Page 26: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

51/68

The outflow boundary

At outflow boundary †, neither the value of nor theflux is known!

Solution: treat boundary as a one-way coordinate byassuming large Peclet number (upwind + zerodiffusion) → † uses ‡ and no information aboutboundary value needed!

u †‡

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

52/68

3.4 Calculation of the flow field

Page 27: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

53/68

Calculation of flow field

x

p

x

u

xx

uu

x

PW E

w e

Δx

(x)w (x)e

ewwe

we ppdx

du

dx

duuuuu

Steady-state,no source term

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

54/68

Representation of the pressure gradient

222EWEPPW

ew

pppppppp

p = 100 300 300100 100

Example: consider the pressure field:

This pressure field would not cause any fluid flow!

Pressure field is actually calculated from a coarser grid with size 2Δ

Page 28: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

55/68

Representation of the Continuity equation

222EWEPPW

ew

uuuuuuuu

u = 10 -3 -310 10

Example: consider the velocity field:

Nonetheless, the discretized continuity equation is satisfied!

0dx

duOne-dimensional, constant density

Flow field is actually calculated from a coarser grid with size 2Δ

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

56/68

Solution (for structured grids): Staggered gridCalculate the velocities at the cell faces → Four different grids, pressure (+ other variavbles), u-velocity, v-velocity, w-velocity

P Ee

x

Page 29: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

57/68

Staggered grid

P

N

n

x

HKTJ07

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

58/68

Collocation, Unstructured grids Collocation of velocities and pressure

by pressure-velocitycouplingRhie, C. M. & Chow, W. L. (1983).

Numerical study of the turbulent flow past an airfoil withtrailing edge separation, AIAA Journal 21: 1525–1532.

In unstructered grids: interpolate face valuesby using momentum-weighed averaging

Page 30: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

Colocated and staggered grids (2-D)

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

59/68

S10

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

60/68

The momentum equations (2-D)

eEPee Appbuaua nbnb

Problem: unknown pressure field.

Using guessed pressure field p´

eEPee Appbuaua nbnb

nNPnn Appbvava nbnb

yAe For 2D : xAn

Page 31: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

61/68

Pressure and velocity corrections

ppp

Assume that the correct pressure and velocities are given by

uuu vvv then

eEPee Appuaua nbnb

Drop the influence of the neighbours (simplification) and derive the correction equations for u and v :

EPe

eee pp

a

Auu

NPn

nnn pp

a

Avv

(2-D)

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

62/68

Pressure correction equation

0

y

v

x

u

t

Continuity equation:

00,

xvvyuu

t

yxsnwe

PP

Integrated over control volume and time step

Inserting velocity correction equations and solving for p

(2-D)

Page 32: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

63/68

Pressure correction equation /2

bpapapapapa SSNNWWEEPP

ya

Aa

e

eeE y

a

Aa

w

wwW

xa

Aa

n

nnN x

a

Aa

s

ssS

SNWEP aaaaa

xvvyuut

yxb snwe

PP

0,

(2-D)

And similar – with a few more terms – for 3-D

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

64/68

The SIMPLE algorithm

1. Guess pressure field2. Solve momentum equations using guessed pressure field3. Solve pressure correction equation4. Calculate new pressure field using the calculated pressure

correction5. Calculate new velocities using the velocity correction

equations (giving velocities satisfying the continuity equation)6. Solve all other equations influencing the flow field7. If equations not converged, return to 2.

See P80

Semi-ImplicitMethod for Pressure-LinkedEquations

Page 33: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

65/68

3.5 Using CFD software(see also demo-lecture )

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

66/68

CFD and turbulent flow simulation For a turbulent flow with heat transfer the

SIMPLE procedure can be used to solve for variables– velocity (u,v,w), – pressure (p), – turbulence variables like turbulent kinetic energy

(k) and its dissipation(ε), and temperaturevariance (θ2)

More advanced schemes after / based on SIMPLE are for example SIMPLER, QUICK,.........

Page 34: 3. Numerical methods for fluid flowusers.abo.fi/rzevenho/iCFD19-RZ3.pdfIntroductionto ComputationalFluid Dynamics 424512 E #3 -rz oktober 2019 ÅboAkademiUniv-Chemical Engineering

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

67/68

Using CFD software Purpose of simulation?

Selecting calculation domain Grid generation Define boundary conditions Select equations to be solved Adjusting solver parameters Judging convergence Studying the results

See also S10 chapter 12

The first questionshould be: what is more important:- The result is good(too good to be true ?)or-The result looks good (toogood to be wrong ?)

Verification againstexperimental data if possible

It all comes down to: howmuch respect do you havefor the user of the CFD calculation result

At least don’t fool yourself!

But in the end: all modelsare wrong, so let’s use a niceone!

Introduction to Computational Fluid Dynamics 424512 E #3 - rz

oktober 2019 Åbo Akademi Univ - Chemical Engineering Thermal and Flow Engineering - Piispankatu 8, 20500 Turku

68/68

Sources / further reading #3 BSL60: R.B. Bird, W.E. Stewart, E.N. Lightfoot ”Transport phenomena” Wiley (1960)

B01: J. Blazek ”Computational fluid mechanics: principles and applications” Elsevier (2001)

B06: J. Brännbacka ”Introduction to CFD” course material Åbo Akademi University (version 2006)

HKTJ07: K. Hanjalić, S. Kenjereš, M.J. Tummers, H.J.J. Jonker “Analysis and modelling of physical transport phenomena” VSSD, Delft, the Netherlands (2007, 2012) Chapter 6ÅA library 13 hardcopies (ASA): https://abo.finna.fi/Record/alma.896997

H85: C.J. Hoogendoorn ”Fysische Transportverschijnselen II”, TU Delft / D.U.M., the Netherlands2nd. ed. (1985) (in Dutch)

P80: S.V. Patankar ”Numerical heat transfer and fluid flow” Hemisphere publishing Corp. (1980)

S10: O. Zikanov ” Essentional Computational fluid dynamics” Wiley & Sons (2010) Chapter 7 ÅA library: https://ebookcentral.proquest.com/lib/abo-ebooks/detail.action?docID=819001

WWW69: J.R. Welty, C.E. Wicks, R.E. Wilson ”Fundamentals of momentum, heat and mass transfer”, Wiley, New York (1969)

Z06: W.B.J. Zimmerman ”Multiphysics modelling with finite element methods” World Scientific Publ. , Singapore (2006)