fluid mechanics – applications and numerical methodskrzyte/students/numerical_methods.pdf · k....

281
K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics – Applications and Numerical Methods Krzysztof Tesch Fluid Mechanics Department Gda´ nsk University of Technology

Upload: vuonghanh

Post on 09-Apr-2018

262 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1

Fluid Mechanics – Applications and

Numerical Methods

Krzysztof Tesch

Fluid Mechanics DepartmentGdansk University of Technology

Page 2: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Contents

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 2

Description of fluid at different scales

Turbulence modelling

Finite difference method

Finite element method

Finite volume method

Monte Carlo method

Lattice Boltzmann method

Other methods

References

Page 3: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Description of fluid at different

scales

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 3

Page 4: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Descriptions

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 4

Fluid motion may be described by three types ofmathematical models according to the observed scales:

Microscopic description (molecular mechanics anddynamics)

Mesoscopic description (kinetic theory, DPD) Macroscopic description (classical fluid mechanics)

Page 5: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Microscopic description

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 5

Molecular mechanics takes advantage of classicalmechanics equations to model molecular systemswhereas molecular dynamics simulates movements ofatoms in the context of N-body simulation. Themotion of molecules is determined by solving theNewtons’s equation of motion

md2ri

dt2= Gi +

N∑

j=1 6=i

fij. (1)

The force exerted on a molecule consists of theexternal force such as gravity Gi and theintermolecular force fij = −∇V usually described bymans of the Lennard-Jones potential

Page 6: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Microscopic description

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 6

V = 4ǫ

[

(

σ

‖r‖

)12

−(

σ

‖r‖

)6]

. (2)

In the above equations ‖r‖ is the distance betweenparticles, ǫ – the depth of the potential well thatcharacterises the interaction strength and σ – thefinite distance describing the interaction range.Further, the ensemble average makes it possible toobtain a macroscopic quantity from the correspondingmicroscopic variable. The disadvantage of moleculardynamics method is that the total number ofmolecules even in small volume is too large –proportional to 1023.

Page 7: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Molecular dynamics pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 7

t← 0;Calculate initial molecule position r;while not the end of calculations do

fij ← −∇V ;a← m−1fij;r← r+ v∆t+ 1

2a∆t2;

t← t+∆t;

Page 8: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Molecular dynamics - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 8

Page 9: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesoscopic description

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 9

The key concept is the probability distributionfunction f (N) in the phase space. The phase space isconstituted of 3N spatial coordinates q1, . . . ,qN and3N momenta p1, . . . ,pN . The probability distributionfunction f (N) allows to express the probability to finda particle within the infinitesimal phase space

(q1,q1 + dq)× . . .× (qN ,qN + dq)×(p1,p1 + dp)× . . .× (pN ,pN + dp). (3)

The total number of molecules within the infinitesimalphase space is then

f (N) (q1, . . . ,qN ,p1, . . . ,pN ) dqN dpN . (4)

Page 10: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesoscopic description

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 10

The time evolution of the probability distributionfunction f (N) follows the Liouville equation

df (N)

dt=∂f (N)

∂t+

N∑

i=1

(

∂f (N)

∂pi· dpidt

+∂f (N)

∂qi· dqidt

)

= 0.

This means that the distribution function is constantalong any trajectory in phase space.The reduced probability distribution function isdefined as

Fs (q1, . . . ,qs,p1, . . . ,ps) =∫

R3(N−s)

R3(N−s)

f (N) (q1, . . . ,qN ,p1, . . . ,pN ) dqN−s dpN−s.

Page 11: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesoscopic description

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 11

The above function is called the s-particle probabilitydistribution function. A chain of evolution equationsfor Fs for 1 ≤ s ≤ N is derived and called BBGKYhierarchy. This means that the sth equation for thes-particle distributions contains s+ 1 distribution.That hierarchy may be truncated. Truncating it at thefirst order results in Boltzmann equation

∂f

∂t+ v · ∇f = Ω(f) (5)

for the probability distribution function

f(r,v, t) = mNF1(q1,p1, t) (6)

for binary collisions with uncorrelated velocities beforethat collision.

Page 12: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesoscopic description – DPD

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 12

The DPD (Dissipative Particle Dynamics) methodsimulate only a reduced number of degrees of freedom(coarse-grained models). The motion of particles isdetermined by solving the Newtons’s equation ofmotion

md2ri

dt2= Gi +

N∑

j=1 6=i

(

fCij + fDij + fRij)

where the interaction forces are the sum of

fCij conservative or repulsion forces fDij dissipative forces fRij random force

Page 13: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – conservation

equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 13

Conservation of mass

dt+ ρ∇ ·U = 0 (7)

Conservation of linear momentum

ρdU

dt= ρf +∇ · σ (8)

Decomposition of stress tensor σ = −ptδ+ τ.Another form of conservation of linear momentum

ρdU

dt= ρf −∇pt +∇ · τ (9)

Page 14: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – energy equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 14

Energy Equation

Kinetic ρdekdt

= ρf ·U+∇ · (σ ·U)−∇ · qTotal ρdec

dt= ∂pt

∂t+∇ · (τ ·U)−∇ · q

Mechanical ρdemdt

= ∇ · (σ ·U)− σ : DInternal ρde

dt= σ : D−∇ · q

Enthalpy ρdhdt

= τ : D−∇ · q+ dptdt

Page 15: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – general transport

equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 15

∂(ρf)

∂t+∇ · (ρUf) = Sf −∇ · k (10)

Left hand side represents transient and convectioneffects. It expresses rate of changeρdf

dt≡ ∂(ρf)

∂t+∇ · (ρUf). Right hand side represents

sources (positive and negative) and fluxes (transportdue to other mechanism than convection).

mass conservation equationf := 1, Sf := 0, k := 0

linear momentum conservation equationf ← U, Sf ← ρf , k← −σenergy conservation equationf := ek, Sf := ρf ·U, k := q− σ ·U

Page 16: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – laws of

thermodynamics

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 16

Second law of thermodynamics

ρds

dt≥ −∇ · q

T. (11)

Entropy balance

ρds

dt=φ

T−∇ · q

T. (12)

First law of thermodynamics

ρde

dt= τ : D− pt∇ ·U−∇ · q. (13)

Page 17: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – constitutive

equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 17

Mechanical (rheological) constitutive equations Equations of state Fluxes

Page 18: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – mechanical

constitutive equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 18

Newtonian fluids τ = 2µD Non-Newtonian fluids

Generalised Newtonian fluids τ = 2µ(γ)D Differential type fluid τ = f(A1,A2, . . .)

Ai+1 =dAi

dt+Ai·

∂U

∂r+∇U·Ai, i = 1, 2, . . .

Integral type fluids

τ =t∫

−∞

f(t− τ) (δ−Ct(τ)) dτ

Rate type fluids τ = f(

τ,D, D)

τ+ λ1τ = 2µ(

D+ λ2D)

Page 19: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Generalised Newtonian fluids

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 19

τ1n = τ

1n

0+ (kγ)

1m

µ1n =(

τ0|γ|

)1n

+ k1m |γ| 1m− 1n

Szulman

τ = τ0 + kγn + µ∞γ

µ = τ0|γ| + k|γ|n−1 + µ∞

Generalised Herschel

τ1n = τ

1n

0+ (kγ)

1n

µ1n =(

τ0|γ|

)1n

+ k1n

Generalised Casson

m := n

τ = τ0 + kγn

µ = τ0|γ| + k|γ|n−1

Herschel-Bulkley

n := 1,

m := 1n

µ∞ := 0

τ = τ0 + k√γ + µ∞γ

µ = τ0|γ| +k√|γ|+ µ∞

Luo-Kuang

n := 12

√τ =√τ0 +√kγ

√µ =√

τ0|γ| +

√k

Casson

n := 2

τ = τ0 + kγµ = τ0|γ| + k

Bingham

n := 1

τ = kγn

µ = k|γ|n−1

Ostwald-de Waele

n := 1 τ0 := 0

τ = kγµ = k

Newton

τ0 := 0 n := 1

τ0 := 0

k := 0,

µ∞ := k,

τ0 := 0

Page 20: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – equations of state

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 20

Fundamental equation of state e = f(s, ρ−1)

de

dt= T

ds

dt+ptρ2

dt(14)

Thermal equation of state pt = f(T, ρ−1)

pt = ρRT (15)

Caloric equation of state e = f(T, ρ−1)

de = cv dT +

(

T∂pt∂T− pt

)

dρ−1 (16)

Page 21: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – fluxes

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 21

General form w = −T · ∇ϕ due to assumptionw = f(∇ϕ). More precisely w depends only on ϕ and∇ϕ. Fourier’s law

q = −λ · ∇T (17) Fick’s law

ji = −ρDij · ∇gi (18) Darcy’s law

U = −µ−1K · ∇p (19)

In the case of isotropy T = α δ andw = −α δ · ∇ϕ = −α∇ϕ.

Page 22: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – applications 1

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 22

General form of the Navier-Stokes equation forNewtonian fluids

ρdU

dt= ρf −∇p+∇ ·

(

2µDD)

(20)

incompressible flow creeping flow inviscid flow Boussinesq approximation Oseen approximation filtration one-dimensional flows heat transfer

Page 23: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – applications 2

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 23

– Incompressible flow (ρ = const)

ρdU

dt= ρf −∇p+∇ · (2µD) (21)

µ = const

ρdU

dt= ρf −∇p+ µ∇2U (22)

– creeping flow

ρ∂U

∂t= ρf −∇p+∇ · (2µD) (23)

2D creeping flow

∇4ψ = 0 (24)

Page 24: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – applications 3

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 24

– inviscid flow (µ = 0)

ρdU

dt= ρf −∇p (25)

potential flows (∇×U = 0)

∇2ϕ = ∇2ψ = 0 (26)

– Boussinesq approximation– Oseen approximation U · ∇U ≈ U∞ · ∇U

ρ∂U

∂t+ ρU∞ · ∇U = ρf −∇p+∇ ·

(

2µDD)

(27)

Page 25: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – applications 4

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 25

– filtration

ρdU

dt= ρf −∇p+ µ∇2U− R1U (28)

– one-dimensional flows

∇2U = a (29)

Page 26: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – applications 5

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 26

– heat transfer The ‘fluid’ Fourier equation describesthe temperature field in the fluid.

cv

(

∂(ρT )

∂t+∇ · (ρTU)

)

= φµ +∇ · (λ∇T ) . (30)

For solids where U = 0 the above equation simplifiesto the ‘solid’ Fourier-Kirchhoff equation

c∂(ρT )

∂t= ∇ · (λ∇T ) + SE (31)

where internal energy sources are given by SE .

Page 27: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Comments

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 27

Generally, the ‘fluid’ equation should be solvedtogether with ‘solid’ equation. This is called conjugateheat transfer. Not having to know the heat transfercoefficient is an advantage of this approach. Thedisadvantage is the necessity of increasing the totalnumber of mesh elements due to the additional solidvolume.It is not always possible because of storagelimitations. Then either the temperature or heat fluxmust be specified at the wall. Alternatives, throughboundary conditions, are discussed further such asspecified temperature, specified heat flux, specifiedtemperature and heat flux, adiabatic or specified heattransfer coefficient.

Page 28: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – dimensionless form

of equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 28

Mass conservation equation

∇+ ·U+ = 0 (32)Linear momentum conservation equation

ρ+(

Sh∂U+

∂t++U+ · ∇+U+

)

=

=ρ+f+

Fr− Eu∇+p+ +

µ+

Re∇2+U+ (33)

Fourier-Kirchhoff (internal energy)

ρ+c+v

(

Sh∂T+

∂t++U+ · ∇+T+

)

=

=Ec

Reφ+µ +

λ+

PrRe∇2+T+ (34)

Page 29: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – dimensionless

numbers

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 29

Sh := LUt0

= tcht0

= LfU

=Ut0U2

L

Fr := U2

f0L=

ρ0U2

L

ρ0f0

Re := LUρ0µ0

= LUν0

=ρ0U

2

Lµ0U

L2

Eu := p0ρ0U2 =

p0L

ρ0U2

L

Ec := U2

cv0T0Pr := cv0µ0

λ0= ν0

λ0cv0ρ0

Sc := µ0ρ0D0

= ν0D0

Da := K0

L2

De := λ0t0

Wi := λ0γ0

Page 30: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – compatibility

conditions

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 30

General transport equation

∂(ρf)

∂t+∇ · (ρUf) = Sf −∇ · k. (35)

From Reynolds’ transport theorem arises generalcompatibility condition n · [ρUf + k] = 0.

– Mass conservation: f := 1, Sf := 0, k := 0. C.C.takes form n · [ρU] = 0 or n · [U] ≡ [Un] = 0.– Linear momentum: f ← U, Sf ← ρf , k← −σ andC.C. n · [ρUU− σ] = 0 or n · [σ] = [σn] = 0.– Energy conservation: f := ek, Sf := ρf ·U,k := q− σ ·U and C.C. n · [ρUek − σ ·U+ q] = 0or n · [q] or [λ∂T

∂n] = 0.

Page 31: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – boundary

conditions 1

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 31

Compatibility conditions are insufficient! Furtherconditions are needed:

adhesion l ·U = Ul = 0 thermal equilibrium on surfaces [T ] = 0

Boundary condition related to heat transfer (arisefrom C.C.)

Dirichlet: T = f1(x, y, z, t) Neumann: qn := n · q or qn = f2(x, y, z, t) mixed: αT − λ∂T

∂n= f3(P, t)

Page 32: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Macroscopic description – boundary

conditions 2

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 32

Other surfaces than walls

inlet: n− 1 conditions where n stands for thenumber of equations

outlet: Generally, σn = n · σ plus T distribution.Usually p distribution due to σn ≈ −pn plus∂T∂n

= 0

symmetry: ∂ϕ∂n

= 0 for all scalar variables ϕ periodicity (translation and rotation):

ϕ(P1) = ϕ(P2) where P1 and P2 arecorresponding points on periodic surfaces

Page 33: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mathematical classification

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 33

The Navier-Stokes equations are second ordernonlinear partial differential equations. In general,they cannot be classified. However they possesproperties of quasi-linear, semi-linear and linear secondorder partial differential equations. Sometimes theycan be simplified to those and can be divided into:

hyperbolic, parabolic, elliptic.

Page 34: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Semi-linear second order PDEs

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 34

For two independent variables x, y:

A(x, y)∂2U

∂x2+B(x, y)

∂2U

∂x∂y+ C(x, y)

∂2U

∂y2+

F

(

x, y, U,∂U

∂x,∂U

∂y

)

= 0 (36)

for all (x, y) over a domain Ω the above equation is:

hyperbolic if B2 − 4AC > 0, parabolic if B2 − 4AC = 0, elliptic if B2 − 4AC < 0.

Page 35: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Important elliptic second order PDEs

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 35

Laplace equation

∂2U

∂x2+∂2U

∂y2= 0. (37)

Poisson equation

∂2U

∂x2+∂2U

∂y2= f(x, y). (38)

Helmholtz equation

∂2U

∂x2+∂2U

∂y2+ k2U = 0. (39)

Page 36: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Important parabolic second order PDEs

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 36

Heat equation

∂U

∂t− α∂

2U

∂x2= 0, (40)

∂U

∂t− α∂

2U

∂x2= f(x, t). (41)

Page 37: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Important hyperbolic second order PDEs

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 37

Wave equation

∂2U

∂t2− a2∂

2U

∂x2= 0. (42)

Telegraph equations

∂2U

∂x2− a∂

2U

∂t2− b∂U

∂t− c U = 0. (43)

Page 38: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Important mixed type second order PDEs

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 38

Euler-Tricomi equation

∂2U

∂x2− x∂

2U

∂y2= 0. (44)

It is of hyperbolic type for x > 0, parabolic atx = 0 and elliptic for x < 0.

Generalised Euler-Tricomi equation

∂2U

∂x2− f(x)∂

2U

∂y2= 0. (45)

Page 39: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Important mixed type second order PDEs

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 39

Potential gas flow

(1−Ma2∞)∂2ϕ′

∂x2+∂2ϕ′

∂y2= 0. (46)

It is of hyperbolic type for Ma2∞ > 1, parabolic atMa2∞ = 1 and elliptic for Ma2∞ < 1.The velocity potential for the x axis dominatedflow is

ϕ(x, y) = U∞x+ ϕ′(x, y). (47)

Velocity components are then given as

Ux(x, y) =∂ϕ

∂x= U∞ + U ′x(x, y), (48a)

Uy(x, y) =∂ϕ

∂y= U ′y(x, y). (48b)

Page 40: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Turbulence modelling

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 40

Page 41: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Turbulence features

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 41

Irregularity Unsteadiness 3-D in terms of space and vortex structures Diffusivity Dissipation Energy cascade Need for constant energy supply

Page 42: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Kolmogorov scales 1

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 42

Kolmogorov scales are the smallest vorticity scaleswhere nearly the whole dissipation takes place. Thereare three scales, for velocity UK = (νε)1/4, length

LK = (ν3ε−1)1/4

and time tK = (νε−1)1/2

.The Reynolds number for these scales

ReK =UKLKν

=(νε)1/4 (ν3ε−1)

1/4

ν= 1. (49)

It means that at this level the inertial forces are of thesame order as the viscous forces.The dissipation intensity of the kinetic energy offluctuation can also be estimated in terms of a lengthscale for large scale motion (vorticity) as

Page 43: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Kolmogorov scales 2

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 43

ε ∼ U2

t=U2

L/U =U3

L . (50)

It means that the energy U2 of the large scales isdissipated proportionally to time L/U . Substitutingthe dissipation in equation for Lk with that for ε wehave

LK =

(

ν3LU3

)1/4

. (51)

Introducing a Reynolds number for large scalesReL = UL

νit is possible to find a relation for the ratio

of length scales by means of this Reynolds number inthe form of

LLK∼( U3

ν3L

)1/4

L =

(ULν

)3/4

= Re3/4L . (52)

Page 44: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Turbulence glossary

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 44

DNS – Direct Numerical Simulation LES – Large Eddy Simulation RANS – Raynolds Averaged Navier-Stokes URANS – Unsteady Raynolds Averaged

Navier-Stokes DES – Detached Eddy Simulation SST – Shear Stress Transport RNG – ReNormalisation Group EARSM – Explicit Algebraic Reynolds Stress

Models RST – Reynolds Stress Transport

Page 45: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Turbulence modelling

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 45

DNS LES RANS

Models based on the Boussinesq hypothesis(0-eq, 1-eq, 2-eq models)

Models which do not take advantage of theBoussinesq hypothesis

RST models EARSM

Page 46: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Decompositions and averages

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 46

Decomposition f(r, t) = f(r) + f ′(r, t)

Realisations f(r) := limN→∞

1N

N∑

i=1

fi(r, t)

Time fτ (r) := limτ→∞

τ∫

0

f(r, t) dt

Time ft(r, t) :=1∆t

t+∆t∫

t

f(r, t) dt

Spatial fV (r, t) :=1|V |

∫∫∫

Vf(r, t) dV

Page 47: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Comments

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 47

In practice it is usually enough to know what theaverage velocity is (not the fluctuation). The velocityvector field is be decomposed into average andfluctuation components U = U+U′. The time ofaveraging ∆t should be chosen to be greater than thefluctuation range and smaller than the function that isgoing to be averaged. The averaging process of theNavier-Stokes equation introduces a number of newunknown functions.

Page 48: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

RANS 1

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 48

Averaged mass conservation equation

∇ · U = 0 (53)

Averaged Navier-Stokes equation

ρ∂U

∂t+ ρ∇·

(

UU)

= ρf −∇p+µ∇2U−ρ∇·U′U′ (54)

Reynolds stress tensor R := −ρU′U′ and thetotal stress tensor σ := −pδ+ 2µD+R makes itpossible to obtain the averaged momentumequation

ρdU

dt= ρf +∇ · σ (55)

Page 49: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

RANS 2

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 49

Averaged Fourier-Kirchhoff equation

cv

(

∂(ρT )

∂t+∇ ·

(

ρT U)

)

=

= 2µD2 +∇ · (λ∇T )− cv∇ ·(

ρT ′U′)

+ ρε.(56)

The averaging process of the Navier-Stokes equationintroduces six unknown (because of the symmetry)components of the Reynolds stress tensor. Theaveraged Fourier-Kirchhoff equations gives a furtherthree of the vector T ′U′.

Page 50: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Comments

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 50

It is important to realise that the closure of system ofthe mass conservation and Navier-Stokes equationshas been lost. Further modelling is required.Formulating additional relationships for unknownfunctions to achieve closure of equations is calledturbulence modelling. Any additional closure equationmust fulfil a few basic criteria such as coordinateinvariance. This is fulfilled by proper tensorformulation of the exact and modelled equations.Another criterion is called realisability meaning that asolution must be physical.Practically, however, it is difficult to achieve all theserequirements. This is because some parts of the exacttransport equations are modelled or even dropped.

Page 51: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Closure

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 51

There are two main approaches to achieve closure.The models may be divided between those whichassume the eddy viscosity hypothesis and those whichdo not

Models not assuming the eddy viscosity hypothesis

Reynolds stress transport equation Algebraic stress tensor models

Boussinesq hypothesis assumed

Page 52: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Reynolds stress transport equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 52

∂R

∂t+∇ ·

(

UR)

= −∇U · (RT +R)+

+∇ ·((

Ck2ε−1 + ν)

∇R)

−Π+2

3ρεδ (57)

The left hand side represents unsteadiness andconvection. On the right hand side the two first termsrepresent production. The two terms under divergenceare responsible for diffusion.The right hand side fourth term is the secondunknown tensor Π need to be modelled. The lastright hand side term 2

3ρεδ is the so called dissipation

tensor for isotropic turbulence.

Page 53: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Algebraic stress tensor models

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 53

Without using the eddy viscosity hypothesis twotransport equations for k and a second variable areformulated. Instead of the linear Boussinesqhypothesis – algebraic, non-linear relationships areformulated between the stress anisotropy tensor a andthe average flow properties. The tensor a is related tothe Reynolds stress tensor by:

a :=R

k− 2

3δ. (58)

Typically, relationships depend on average strain rateand spin tensors

a = f(D, Ω). (59)

Page 54: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Boussinesq hypothesis

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 54

The turbulence stresses is related to the mean flowRxy = µt

∂Ux

∂y. This linear relationship is

R = a0δ+ 2µtD. (60)

The trace of this relations allows to find a constant−2ρk = 3a0 which gives

R = −2

3ρkδ+ 2µtD. (61)

The Reynolds equation becomes

∂(ρU)

∂t+∇·

(

ρUU)

= ρf −∇pe+∇·(

2µeD)

(62)

where µe := µt + µ, pe := p+ 23ρk.

Page 55: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Eddy viscosity and diffusivity hypothesis

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 55

The eddy diffusivity hypothesis is introduced by directanalogy with the eddy viscosity hypothesis. It reducesthe number of unknown functions in theFourier-Kirchhoff equation −cvρT ′U′ = λt∇T .The Fourier-Kirchhoff equation then becomes

cv

(

∂(ρT )

∂t+∇ ·

(

ρT U)

)

= 2µD2+∇·(

λe∇T)

+ρε,

(63)where λt can be estimated by means of the turbulentPrandtl number λt =

µtcvPrt

. Effective conductivity isintroduced by means of the definitionλe := λt + λ = µtcv

Prt+ λ.

Page 56: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Trace of RST equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 56

Calculating the trace of the Reynolds stress transportequation

∂R

∂t+∇ ·

(

UR)

= −∇U · (RT +R)+

+∇ ·((

Ck2ε−1 + ν)

∇R)

−Π+2

3ρεδ (64)

results in kinetic energy k transport equation which isused in the preceding one- and two-equationturbulence models trR = −2ρk for µt = Cµρk

2ε−1.The traces of Π by definition trΠ = 0 and thetransport equation for k takes the following form

∂(ρk)

∂t+∇·(ρkU) = ∇U : R+∇·

((

µtσ−1k + µ

)

∇k)

−ρε(65)

Page 57: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Zero-equation model

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 57

Zero k and ε are assumed. It allows the Boussinesqequation to be reduced to R = 2µtD.Eddy viscosity µt is modelled by means of thePrandtl-Kolmogorov hypothesis. This hypothesiscomes directly from dimensionless analysis µt = cρUL.The velocity scale U is often approximated by meansof the maximal velocity |U|max and length scale L bythe volume of the flow domain |V | by U ∼ |U|max,L ∼ 3

|V |.The Boussinesq hypothesis takes the following form

R = Cρ 3√

|V ||U|maxD (66)

No new unknown functions! However, zero-equationmodels are not as accurate but they are robust (firstapproximation for more complex models).

Page 58: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

One-equation model

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 58

One transport equation for k is introduced

∂(ρk)

∂t+∇·(ρkU) = ∇U : R+∇·

((

µtσ−1k + µ

)

∇k)

−ρε

where ‘production’ ∇U : R = 2µtD2. According to

Prandl-Kolmogorov hypothesis U =√k and ε ∼ U3

Lso

ε = k3/2L−1. Finally, the k transport equation arrives

ρdk

dt= 2µtD

2 +∇ ·((

µtσ−1k + µ

)

∇k)

− ρk3/2L−1

(67)where eddy viscosity is estimated as µt = ρ

√kL by

means of another Prandtl hypothesis.

Page 59: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Two-equation k-ε model

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 59

Two additional equations have to be formulated. Thefirst, for the kinetic energy k, comes from theReynolds stress transport equation

ρdk

dt= 2µtD

2 +∇ ·((

µtσk

+ µ

)

∇k)

− ρε

and that for the dissipation ε is analogous to it

ρdε

dt= Cε1

ε

k2µtD

2 +∇ ·((

µtσε

+ µ

)

∇ε)

−Cε2ρε2

k.

(68)Both of them are transport equations for a scalarfunction. The eddy viscosity depends on both k and εand is postulated, as previously, to have the formµt = Cµρ

k2

ε.

Page 60: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Comments

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 60

The five constants in equations are empirical, that is,should be deduced from experiment for a specificgeometry. This ‘standard’ set is given by

σk = 1, σε = 1.3,

Cµ = 0.09, Cε1 = 1.44, Cε2 = 1.92. (69)

Page 61: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Two-equation k-ω model

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 61

The turbulent frequency ω is proportional to the ratioof dissipation and kinetic energy ω ∼ ε

kand using the

constant Cµ, they are then related by ε = Cµkω. Theeddy viscosity takes the form µt = ρ k

ω. The two

transport equations take the following form

ρdk

dt= 2µtD

2+∇·((

µtσk1

+ µ

)

∇k)

−Cµρkω (70)

ρdω

dt= α1

ω

k2µtD

2 +∇ ·((

µtσω1

+ µ

)

∇ω)

− β1ρω2

(71)This ‘standard’ set is constant is σk1 = 2, σω1 = 2,Cµ = 0.09, α1 =

59, β1 =

340.

Page 62: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Two equations SST model

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 62

The shear stress model combines the k−ω model nearthe wall with the k − ε far from it. Firstly, the k − εmodel has to be transformed to the k − ω formulationby means of relation ε = Cµkω. This results in

∂(ρk)

∂t+∇·

(

ρkU)

= 2µtD2+∇·

((

µtσk2

+ µ

)

∇k)

−Cµρkω,

∂(ρω)

∂t+∇ ·

(

ρωU)

= α2ω

k2µtD

2 +∇ ·((

µtσω2

+ µ

)

∇ω)

+

−β2ρω2 + 2ρ

ωσω2∇k · ∇ω.

Additional cross-diffusion terms now appear. The‘standard’ set of constants is different from that forthe original k − ε σk2 = 1, σω2 = 0.856, Cµ = 0.09,α2 = 0.44, β2 = 0.0828.

Page 63: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Two equations SST model

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 63

Secondly, the equations for the k − ω model aremultiplied by a blending function F1 and thetransformed k − ε equations by (1− F1). Theequations then are added. This results in

∂(ρk)

∂t+∇·

(

ρkU)

= 2µtD2+∇·

((

µtσk3

+ µ

)

∇k)

−Cµρkω,

∂(ρω)

∂t+∇ ·

(

ρωU)

= α3ω

k2µtD

2 +∇ ·((

µtσω3

+ µ

)

∇ω)

+

−β3ρω2 + (1− F1)2

ωρσω3∇k · ∇ω.

Constants marked with the subscript ‘3’, namely σk3,σω3, α3, β3 are linear combinations of constants fromthe component models C3 = F1C1 + (1− F1)C2.

Page 64: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Additional passive transport equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 64

The additional variable transport equation may beadded to the closed system after averaging, as

∂(ρf)

∂t+∇·

(

ρfU)

= −∇·(

ρf ′U′)

−∇·k+Sf . (72)The first term of the right hand side can be modelledby means of the eddy diffusivity hypothesis and theturbulent diffusivity coefficient Γ , −ρf ′U′ = Γ∇fand the additional transport equation takes the form

∂(ρf)

∂t+∇ ·

(

ρfU)

= ∇ ·((

µtSct

+ ρD

)

∇f)

+ Sf

(73)where the turbulent diffusivity coefficient Γ may berepresented as a function of the eddy viscosity and theturbulent Schmidt number Γ := µt

Sctwhere Sc := µ

ρD.

Page 65: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Turbulent boundary layer

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 65

1 2 5 10 20 50 100 2000

5

10

15

20

25

y+

U+

1 2 5 10 20 50 100 200

0

5

10

15

20

25

Friction velocity Uτ :=√

τ0ρ

Characteristic length l := νUτ

dimensionless distance y+ := yl

dimensionless velocity U+ := Ux

y+ < 11 laminar sub-layer

5 < y+ < 30 bufferregion

11 < y+ < 250 turbu-lent sublayer (log-lawlayer)

y+ < 250 inner turbu-lent boundary layer

y+ > 250 outer turbu-lent boundary layer

Page 66: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Filtration of N-S equations 1

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 66

Filtration of the N-S equations is associated with LESmethod. Small scales are removed by means offiltering

f(r, t) =

∫∫∫

R3

+∞∫

−∞

f(r ′′, t′′)G(r− r ′′, t− t′′) dt′′ dV ′′

where G is a filter. Typically it is a product

G(r− r ′′, t− t′′) := Gt(t− t′′)3∏

i=1

Gvi(xi−x′′i ). (74)

For Gt(t− t′′) := τ−1H(t′′) andGvi(xi − x′′i ) := δ(xi − x′′i ) we have time average

fτ (r) := limτ→∞

τ∫

0

f(r, t) dt.

Page 67: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Filtration of N-S equations 2

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 67

Filtration of the N-S equations results in

ρ∂U

∂t+ρ∇·

(

UU)

= ρf−∇p+∇·(

2µD− ρ (L+C+R))

(75)where Leonard’s decomposition

L := UU− UU, C := UU′ +U′U, R := U′U′

(76)represents the cross stress tensor C (interactionsbetween large and small scales), Reynolds subgridtensor R (interactions among subgrid scales) andLeonard tensor L (interactions among the largescales).For L = 0 and C = 0 we have Reynolds equations.

Page 68: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Finite difference method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 68

Page 69: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

The method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 69

The finite difference method (introduced by Euler inXVIII century) replaces the region by a finite mesh ofpoints at which the dependent variable isapproximated.

All partial derivativesat each mesh pointare approximated fromneighbouring valuesby means of Taylor’stheorem. Thismeans that derivativesat each pointare approximated bydifference quotients.

Page 70: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Taylor’s theorem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 70

Assuming that f has continuous derivatives overcertain interval the Taylor expansion is used

f(x0 +∆x) =m−1∑

n=0

dnf(x0)

n!+

dmf(c)

m!. (77)

where x := x0 +∆x, c = x0 + θ∆x and θ ∈]0; 1[.The above equation may also be written as

f(x0 +∆x) = f(x0) + f ′(x0)∆x+1

2f ′′(x0)∆x

2

+1

6f ′′′(x0)∆x

3 + . . . +1

m!f (m)(c)∆xm. (78)

Page 71: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Taylor’s theorem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 71

Instead of f (m) at unknown point c it is rewritten interms of another unknown quantity of order ∆xm

f(x0 +∆x) = f(x0) + f ′(x0)∆x+ f ′′(x0)∆x2

2

+ . . . + f (m−1)(x0)∆xm−1

(m− 1)!+O(∆xm) (79)

Discarding (truncating) O(∆xm) one gets anapproximation to f . The error in this approximation isO(∆xm). Roughly speaking it says that knowing thevalue of f and the values of its derivatives at x0 it ispossible to write down the equation for its value atthe point x0 +∆x.

Page 72: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

First order finite difference

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 72

Taking under consideration the Taylor expansion up tothe first derivative

f(x0 +∆x) = f(x0) + f ′(x0)∆x+O(∆x2) (80)

then neglecting O(∆x) and rearranging gives the firstorder finite difference approximation to f ′(x0)

f ′(x0) ≈f(x0 +∆x)− f(x0)

∆x. (81)

This approximation is called a forward approximation.Replacing ∆x by −∆x in Taylor expansion one getsbackward approximation

f ′(x0) ≈f(x0)− f(x0 −∆x)

∆x. (82)

Page 73: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Second order finite difference

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 73

Taking under consideration the Taylor expansion up tothe second derivative

f(x0+∆x) = f(x0)+f′(x0)∆x+f

′′(x0)∆x2

2+O(∆x3)

(83)then neglecting O(∆x2). Doing the same for −∆xand combining the two above we have

f ′(x0) ≈f(x0 +∆x)− f(x0 −∆x)

2∆x(84)

after neglecting O(∆x2). This is so called the secondorder central difference approximation to f ′(x0).

Page 74: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Second order finite difference

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 74

Higher order approximation to derivatives is alsopossible. This can be done by taking more terms inthe Taylor expansion. Doing so up to the third we get

f(x0 +∆x) = f(x0) + f ′(x0)∆x+1

2f ′′(x0)∆x

2

+1

6f ′′′(x0)∆x

3 +O(∆x4). (85)

Replacing ∆x for −∆x and combing the results thendropping O(∆x4) gives the second order symmetricdifference approximation to f ′′

f ′′(x0) ≈f(x0 +∆x)− 2f(x0) + f(x0 −∆x)

∆x2.

(86)

Page 75: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Differences

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 75

Selected finite differences approximation to first andsecond derivatives are given in the following table.These can be used to solve ordinary differentialequations by replacing derivatives by theirapproximations.

Approximation Type Order

f ′(x0)f(x0+∆x)−f(x0)

∆xforward 1st

f ′(x0)f(x0)−f(x0−∆x)

∆xbackward 1st

f ′(x0)f(x0+∆x)−f(x0−∆x)

2∆xcentral 2nd

f ′′(x0)f(x0+∆x)−2f(x0)+f(x0−∆x)

∆x2symmetric 2nd

Page 76: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Differences

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 76

Equations for f ′ approximate the slope of the tangentin x0 by means of chords (backward, forward andcentral finite difference).

Page 77: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Differences

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 77

The typical subscript notation is

f(x0 +mh, y0 + nh) ≡ fi+mj+n. (87)

Now it is possible to express selected finite differencesapproximations to derivatives in somewhat simplermanner

Approximation Type Order

f ′ifi+1−fi

hforward 1st

f ′ifi−fi−1

hbackward 1st

f ′ifi+1−fi−1

2hcentral 2nd

f ′′ifi+1−2fi+fi−1

h2symmetric 2nd

Page 78: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 78

Poisson equation is ∇2Uz = a. Two dimensionalversions of this equation is written as

∂2Uz∂x2

+∂2Uz∂y2

= a. (88)

The next step would be to replace second orderderivatives by symmetric finite differenceapproximation

Ui+1j − 2Uij + Ui−1jh2

+Uij+1 − 2Uij + Uij−1

h2= a.

(89)It can be rewritten to give Uij as a function ofsurrounding variables

Uij =Ui+1j + Ui−1j + Uij+1 + Uij−1 − ah2

4. (90)

Page 79: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Poisson equation - mesh and boundary

conditions

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 79

The domain is discretised in the x and y directions bymeans of constant mesh size h (figure on the left). Uzis unknown at black mesh points and known at whitepoints from the boundary condition.

For instance the Dirichletboundary conditionspecifies the values of Uzdirectly. In this case Uz = 0meaning no slip wall. If theboundary values are knownthen discrete Poissonequation gives a systemof linear equations for Uij.

Page 80: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Poisson equation - solution methods

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 80

The accuracy of results depends on the size of themesh represented here by h. Mesh size should bedecreased until there is no significant influence onnumerical results.The set of linear equations can be solved eitherdirectly by means of an appropriate method (Gausselimination for instance) or indirectly by means ofiterative solution methods or the relaxation method(point-Jacobi iteration)

Un+1ij =

Uni+1j + Un

i−1j + Unij+1 + Un

ij−1 − ah24

(91)

or point-Gauss-Seidel (faster than point-Jacobi)

Un+1ij =

Uni+1j + Un+1

i−1j + Unij+1 + Un+1

ij−1 − ah24

. (92)

Page 81: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Poisson equation - solution methods

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 81

Another indirect method is so called SuccessiveOver-Relaxation method

Un+1ij = (1− w)Un

ij+

wUni+1j + Un+1

i−1j + Unij+1 + Un+1

ij−1 − ah24

(93)

where w is a relaxation parameter. For w ∈]1, 2[ wehave over-relaxation and for w := 1 this methodcorresponds to the point-Gauss-Seidel method. Onecan also consider under-relaxation method forw ∈]0, 1[.The best choice of w value needs numericalexperiments. It also depends on specific problems.

Page 82: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Poisson FDM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 82

Data: Read input variables and BCsw ← 1; n← 1;repeat

R← 0;for i← 1 to imax do

for j ← 1 to jmax do

if not boundary(Unij) then

Un+1ij ← Un

i+1j+Un+1i−1j+U

nij+1+U

n+1ij−1−ah

2

4;

R← max(

|Un+1ij − Un

ij|, R)

;

Un+1ij ← (1− w)Un

ij + wUn+1ij ;

n← n+ 1;

until n ≤ nmax and R > Rmin;

Page 83: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 83

24

68

102

4

6

810

0

3

6

2 4 6 8 10

2

4

6

8

10

x

y

Page 84: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Laplace equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 84

Laplace equation is ∇2ϕ = 0. Two dimensionalversions of this equation is written as

∂2ϕ

∂x2+∂2ϕ

∂y2= 0. (94)

Replacing second order derivatives by symmetric finitedifference approximation

ϕi+1j − 2ϕij + ϕi−1jh2

+ϕij+1 − 2ϕij + ϕij−1

h2= 0.

(95)It can be rewritten to give ϕij as a function ofsurrounding variables

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

4. (96)

Page 85: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Laplace eq. – Neumann boundary condition

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 85

Neumann boundary condition specifies values of thederivative ∂

∂nof a solution ϕ on boundary ∂Ω to fulfil

∂ϕ

∂n= N(x, y) (97)

where the normal derivatives is defined as

∂ϕ

∂n= n · ∇ϕ = nx

∂ϕ

∂x+ ny

∂ϕ

∂y(98)

and (x, y) ∈ ∂Ω. If U = ∇ϕ we get

∂ϕ

∂n= n ·U = nxUx + nyUy. (99)

Page 86: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Laplace eq. – Neumann boundary condition

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 86

We have two equation for apoint located on boundary ‘2’

∂2f

∂x2=fi+1j − 2fij + fi−1j

h2,

∂f

∂x=fi+1j − fi−1j

2h= Nij .

Point fi−1j is located outsidethe Ω area. Eliminating it weget

∂2f

∂x2=

2fi+1j − 2Nijh− 2fijh2

and

fij =2fi+1j + fi+1j + fij−1 − 2Nijh

4.

Page 87: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Laplace FDM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 87

Data: Read input variables and BCsw ← 1; n← 1;repeat

R← 0;for i← 1 to imax do

for j ← 1 to jmax do

if boundary(ϕnij) 6= 0 then

switch ϕ(Unij) do

case 1: ϕn+1ij ←

ϕni+1j+ϕ

n+1

i−1j+ϕn

ij+1+ϕn+1

ij−1

4;

;

case 2: ϕn+1ij ←

2ϕni+1j+ϕn

ij+1+ϕn+1

ij−1−2hNij

4;

;...

case 6: ϕn+1ij ←

2ϕni+1j+2ϕn

ij+1−2hNij

4;

;...

R← max(

|ϕn+1ij − ϕn

ij |, R)

;

ϕn+1ij ← (1− w)ϕn

ij + wϕn+1ij ;

n← n+ 1;

until n ≤ nmax and R > Rmin;

Page 88: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - Laplace equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 88

2 4 6 810 12 14 16 2

46810

−10−50

Page 89: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Biharmonic equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 89

The biharmonic equation is ∇4ψ ≡ ∇2 · ∇2ψ = 0.Two dimensional versions of this equation is written as

∂4ψ

∂x4+ 2

∂4ψ

∂x2∂y2+∂4ψ

∂y4= 0. (101)

It is a fourth-order elliptic partial differential equationthat describes creeping flows in terms of a streamfunction ψ where the velocity components areUx =

∂ψ∂y

and Uy = −∂ψ∂x.

The Dirichlet boundary condition specifies both: astream function ψ and its normal derivative ∂ψ

∂n. Two

conditions are needed due to the fourth order of thebiharmonic equation.

Page 90: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Biharmonic equation - approximation to

derivatives

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 90

The finite difference approximations to ∂4ψ∂x4

, ∂4ψ∂y4

are

∂4ψ

∂x4=ψi+2j + ψi−2j − 4ψi+1j − 4ψi−1j + 6ψij

h4,

(102a)

∂4ψ

∂y4=ψij+2 + ψij−2 − 4ψij+1 − 4ψij−1 + 6ψij

h4.

(102b)

The fourth order mixed derivative is approximated as

∂4ψ

∂x2∂y2=ψi+1j+1 + ψi−1j−1 + ψi−1j+1 + ψi+1j−1

h4

+4ψij − 2ψi+1j − 2ψi−1j − 2ψij+1 − 2ψij−1

h4. (103)

Page 91: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Biharmonic equation - discrete equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 91

From the discrete biharmonic equations ψij can beexpressed as a function of surrounding variables

ψij =−ψi+2j − ψi−2j − ψij+2 − ψij−2 + 4ψij

20

+ 8ψi−1j + ψij+1 + ψij−1 + ψi+1j

20

− 2ψi+1j+1 + ψi−1j−1 + ψi−1j+1 + ψi+1j−1

20. (104)

Page 92: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Biharmonic equation - boundary conditions

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 92

From the below figure two purely geometricrelationships arise ∂ψ

∂n= n · ∇ψ = −Ul,

∂ψ∂l

= l · ∇ψ = Un. For an impermeable boundary one

gets Un = 0⇒ ∂ψ∂l

= 0. The general relationshipbetween volumetric flow rate and the stream functionsis

V =

L

U · n dL =

L

∂ψ

∂ldL =

L

dψ = ψA − ψB.

(105)

Page 93: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Biharmonic FDM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 93

Data: Read input variables and BCsw ← 1; n← 1;repeat

R← 0;for i← 1 to imax do

for j ← 1 to jmax do

if not boundary(Unij) then

Un+1ij ← −Un

i+2j−Uni−2j−U

nij+2−U

nij−2+4Un

ij

20+

8Uni−1j+U

nij+1+U

nij−1+U

ni+1j

20−

2Uni+1j+1+U

ni−1j−1+U

ni−1j+1+U

ni+1j−1

20;

R← max(

|Un+1ij − Un

ij|, R)

;

Un+1ij ← (1− w)Un

ij + wUn+1ij ;

n← n+ 1;

until n ≤ nmax and R > Rmin;

Page 94: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - biharmonic equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 94

15

1015

20 14

812

0

0.5

1

Page 95: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Complex geometry

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 95

Point 1 is located insidethe Ω area

f1 =h f0 + d f2h+ d

(106)

Point 1 is located outsidethe Ω area

f1 =h f0 − d f2h− d (107)

Page 96: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Navier-Stokes equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 96

Typical numerical approaches for the incompressibleNavier-Stokes equations:

Ωz-ψ (vorticity-stream function) formulationmethod

Artificial compressibility method Pressure/velocity correction (operator splitting

methods)

Projection methods MAC (Marker-and-Cell) Fractional step method SIMPLE (Semi-Implicit Method for Pressure

Linked Equations), SIMPLER (SIMPLERevisited), SIMPLEC

Page 97: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Bad idea

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 97

The incompressible Navier-Stokes equations

∂U

∂t+U · ∇U = −1

ρ∇p+ ν∇2U. (108)

Explicit forward difference in time

Un+1 −Un

∆t+Un ·∇Un = −1

ρ∇pn+ν∇2Un. (109)

Problems:

∇ ·Un+1 6= 0,pn+1 =?

Page 98: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Better idea

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 98

The incompressible Navier-Stokes equations

∂U

∂t+U · ∇U = −1

ρ∇p+ ν∇2U, (110a)

∇ ·U = 0. (110b)

Un+1 −Un

∆t+Un · ∇Un = −1

ρ∇pn+1 + ν∇2Un, (111a)

∇ ·Un+1 = 0. (111b)

Problems:

∇2pn+1 = ρ∆t∇ · (Un −∆tUn · ∇Un +∆t ν∇2Un)

BCs?

Page 99: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Semi implicit

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 99

The incompressible Navier-Stokes equations

∂U

∂t+U · ∇U = −1

ρ∇p+ ν∇2U, (112a)

∇ ·U = 0. (112b)

Semi implicit approach

Un+1 −Un

∆t+Un · ∇Un+1 = −1

ρ∇pn+1 + ν∇2Un+1, (113a)

∇ ·Un+1 = 0. (113b)

Page 100: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Fully implicit

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 100

The incompressible Navier-Stokes equations

∂U

∂t+U · ∇U = −1

ρ∇p+ ν∇2U, (114a)

∇ ·U = 0. (114b)

Fully implicit approach

Un+1 −Un

∆t+Un+1 · ∇Un+1 = −1

ρ∇pn+1 + ν∇2Un+1,

(115a)

∇ ·Un+1 = 0. (115b)

Page 101: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Artificial compressibility method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 101

The incompressible Navier-Stokes equations

∂U

∂t+U · ∇U = −1

ρ∇p+ ν∇2U, (116a)

∇ ·U = 0. (116b)

Explicit forward difference in time

Un+1 −Un

∆t+Un · ∇Un = − 1

ρ0∇pn + ν∇2Un, (117a)

βpn+1 − pn

∆t+∇ ·Un = 0. (117b)

Page 102: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Projection method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 102

Ut −Un

∆t= −Un · ∇Un + ν∇2Un, (118)

∇ ·Ut 6= 0, BC

Un+1 −Ut

∆t= −1

ρ∇pn+1, (119)

∇ ·Un+1 = 0, ¬BC

∇2pn+1 =ρ

∆t∇ ·Ut (120)

Page 103: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Square cylinder

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 103

Page 104: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Square cylinder

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 104

Page 105: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Square cylinder

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 105

Page 106: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Square cylinder

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 106

Page 107: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Square cylinder

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 107

Page 108: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Square cylinder

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 108

Page 109: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Square cylinder

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 109

Page 110: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Vorticity-stream function formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 110

The incompressible 2D Navier-Stokes equations∂U

∂t+U · ∇U = −1

ρ∇p+ ν∇2U, (121a)

Ωz =∂Uy∂x− ∂Ux

∂y. (121b)

2D Helmholtz equation (Ux =∂ψ∂y, Uy = −∂ψ

∂x)

∂Ωz

∂t+U · ∇Ωz = ν∇2Ωz, (122a)

∇2ψ = −Ωz. (122b)

Ωn+1z − Ωn

z

∆t+Un · ∇Ωn

z = ν∇2Ωnz , (123a)

∇2ψn+1 = −Ωn+1z . (123b)

Page 111: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Finite element method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 111

Page 112: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 112

The mathematical foundation of the finite elementmethod is in the method of weighted residuals.Imagine ordinary differential equation

y′′(x) + 20x = 0 (124)

subjected to boundary conditions y(0) = y(1) = 0.The exact general solution of this equation is

y(x) := −10

3x3 + C1x+ C2 (125)

and a specific solution subjected to boundaryconditions

y(x) := −10

3(x3 − x). (126)

Page 113: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 113

The method seeks an approximate solution y in thegeneral form

y(x) :=N∑

i=1

CiNi(x) (127)

where Ni are known trial functions which should becontinuous and fulfilled boundary conditions. Theconstants Ci are unknown and they will bedetermined. A residual R appears when substitutingapproximate solution y into the differential equations

R(x) := y′′(x) + 20x 6= 0. (128)

The unknown Ci constant are determined fori = 1, . . . N from

∫ 1

0

Wi(x)R(x) dx = 0. (129)

Page 114: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 114

∫ 1

0

Wi(x)R(x) dx = 0 i = 1, . . . , N (130)

Choices for the weighting functions Wi

Collocation method Wi(x) := δ(x− xi) Subdomain method

Wi(x) := H(x− xi−1)−H(x− xi) Galerkin’s method Wi(x) := Ni(x)

∫ 1

0

Ni(x)R(x) dx = 0 i = 1, . . . , N (131)

Least Squares Method Wi(x) :=∂R∂Ci

∫ 1

0

∂R

∂CiR(x) dx = 0 i = 1, . . . , N (132)

Page 115: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 115

A polynomial trial functions can be assumed

N(x) := xr(x− 1)s. (133)

It is continuous and fulfils boundary conditions. Justone trial function for r = s = 1 is the simplest case

N1(x) := x(x− 1). (134)

The approximate solution y(x) :=∑N

i=1CiNi(x)where N := 1 takes the following form

y(x) = C1N1(x) = C1(x2 − x). (135)

Residual may now be expressed as

R(x) = 2C1 + 20x 6= 0. (136)

Page 116: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 116

The unknown constant C1 may be determined uponintegrating (Galerkin’s method of weighted residuals)

∫ 1

0

x(x− 1)(2C1 + 20x) dx = 0. (137)

This gives −13(5 + C1) = 0 and allows to determine

C1 = −5. The approximate solution is now

y(x) = −5x(x− 1) (138)

and can be compared with the exact solution

y(x) := −10

3(x3 − x). (139)

Page 117: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 117

The simplest case with just one trial functionapproximates the exact solution more or lessacceptably. Better agreement is possible with morethan one trial functions.

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

y

y

Page 118: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 118

The two polynomial trial functions can be assumed

N1(x) := x(x− 1), N2(x) := x2(x− 1). (140)

Both are continuous and fulfil boundary conditions.The approximate solution y(x) :=

∑Ni=1CiNi(x)

where N := 2 takes the following form

y(x) = C1N1(x)+C2N2(x) = C1(x2−x)+C2(x

3−x2).(141)

Residual may now be expressed as

R(x) = 2C1 + 2C2(3x− 1) + 20x 6= 0. (142)

Page 119: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 119

The unknown constants C1, C2 may be determinedupon integrating

∫ 1

0

x(x− 1)(2C1 + 2C2(3x− 1) + 20x) dx = 0,

∫ 1

0

x2(x− 1)(2C1 + 2C2(3x− 1) + 20x) dx = 0.

This gives 10 + 2C1 + C2 = 0 and1 + 1

6C1 +

215C2 = 0 and allows to determine

C1 = C2 = −103. The approximate solution is now

y(x) = −10

3x(x− 1)(x+ 1). (143)

Page 120: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 120

The case with two trial function approximates theexact solution very well. It is far better that theprevious case. There is no visible difference. In fact, itis even the exact solution

−10

3x(x− 1)(x+ 1) = −10

3(x3 − x). (144)

Page 121: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method of weighted residuals - comments

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 121

The method of weighted residuals constitutesfoundation of the final element method

The method exploits an integral formulation tominimise residual errors

Trail functions of this method are global. It isusually difficult task to find a proper one thatsatisfies boundary conditions. The moredimensions the worse.

Page 122: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Finite Element method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 122

The approximate solution is defined as

y(x) =N+1∑

i=1

yini(x) (145)

over the interval [x1;xN+1] which is divided into Nsubintervals (elements). The unknown values of yi atpoint xi correspond to constants Ci of the weightedresiduals method. However, the trial function is localand defined as

ni(x) =

x−xi−1

xi−xi−1xi−1 ≤ x ≤ xi,

xi+1−xxi+1−xi

xi ≤ x ≤ xi+1,

0 otherwise

(146)

Page 123: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Trial functions

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 123

Page 124: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Trial function

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 124

For instance, if x ∈ [x3;x4] we have a linearinterpolation

y(x) = y3n3(x) + y4n4(x) = y3x4 − xx4 − x3

+ y4x− x3x4 − x3

.

(147)The above definition arises from the equation of theline passing through two different points (x3, y3) and(x4, y4)

(y − y3)(x4 − x3) = (y4 − y3)(x− x3) (148)

or knowing that y = a+ bx we solve for a and b from

y3 = a+ bx3, (149a)

y4 = a+ bx4. (149b)

Page 125: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 125

Let us consider the same differential equationy′′ + 20x = 0 as previously. The approximate solutionis in the form y(x) =

∑N+1i=1 yini(x). The idea of

minimising the residual R(x) = y′′ + 20x 6= 0 isadapted from the weighted residuals to the finiteelement method∫ xN+1

x1

nj(x)R(x) dx = 0 j = 1, . . . , N + 1.

The unknown values yj may be determined uponintegrating (Galerkin’s finite element method)

∫ xN+1

x1

nj(x)

(

N+1∑

i=1

(yini(x))′′ + 20x

)

dx = 0

j = 1, . . . , N + 1. (150)

Page 126: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 126

For the three trial functions nj we have threeequations. However, in any sub interval only two trialfunctions are nonzero. If so∫ x2

x1

n1(x) ((y1n1(x) + y2n2(x))′′ + 20x) dx = 0

∫ x2

x1

n2(x) ((y1n1(x) + y2n2(x))′′ + 20x) dx+

∫ x3

x2

n2(x) ((y2n2(x) + y3n3(x))′′ + 20x) dx = 0

∫ x3

x2

n3(x) ((y2n2(x) + y3n3(x))′′ + 20x) dx = 0

Page 127: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 127

We can decouple the second equation for the timebeing and couple it latter at the global assemblyprocess. We have then

∫ xj+1

xj

nk(x) ((yjnj(x) + yj+1nj+1(x))′′ + 20x) dx = 0

j = 1, . . . , N ; k = j, j + 1. (151)

The above equation is valid for each subinterval(element) and suggest the so called ‘element’formulation. It is also well known that

∫ xN+1

x1

y(x) dx =N∑

j=1

∫ xj+1

xj

y(x) dx. (152)

Page 128: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

‘Element’ formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 128

The approximate solution is expressed as

ye = yjN1(x) + yj+1N2(x) = N · ye (153)

where the known local trial functions N and theunknown nodal values ye are collected as vectors

N := (N1, N2), (154a)

ye := (yj, yj+1). (154b)

The local trial functions are simply a linearinterpolation

N1 :=xj+1 − xxj+1 − xj

xj ≤ x ≤ xj+1, (155a)

N2 :=x− xj

xj+1 − xjxj ≤ x ≤ xj+1. (155b)

Page 129: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

‘Element’ formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 129

For each element we have the Galerkin residualcondition

∫ xj+1

xj

NR dx = 0 j = 1, . . . , N. (156)

Taking under consideration our differential equationy′′ + 20x = 0 and the approximate solution ye it isnow possible to express the residual as

∫ xj+1

xj

N

(

d2yedx2

+ 20x

)

dx = 0. (157)

The second derivative has to be replaced. This is dueto linear nature of the trial functions.

Page 130: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

‘Element’ formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 130

Integration by parts makes it possible to replace thesecond derivative

Ndyedx

xj+1

xj

−∫ xj+1

xj

dN

dx

dyedx

dx+

∫ xj+1

xj

N20x dx = 0.

Finally, matrix form of the Galerkin residual conditionfor each element is now

∫ xj+1

xj

dN

dx

dN

dxdx·ye =

∫ xj+1

xj

N20x dx+Ndyedx

xj+1

xj

j = 1, . . . , N.

Page 131: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 131

The so called ‘stiffness’ matrix for each element e maybe introduced

Ke :=

∫ xj+1

xj

dN

dx

dN

dxdx. (158)

The above matrix is symmetric. The so called‘displacement’ vector is also introduced

Fe :=

∫ xj+1

xj

N20x dx+ Ndyedx

xj+1

xj

. (159)

The Galerkin residual condition for each element maynow be written as

Ke · ye = Fe. (160)

Page 132: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 132

It is possible to simplify the matrices even further. Forthe linear trial functions one gets the ‘stiffness’ matrix

Ke :=

∫ xj+1

xj

(

dN1

dxdN1

dxdN1

dxdN2

dxdN1

dxdN2

dxdN2

dxdN2

dx

)

dx =1

xj+1 − xj

(

1 −1−1 1

)

and the ‘displacement vector’

Fe :=

∫ xj+1

xj

(

N120xN220x

)

dx+

(

N1dyedx

xj+1

xj

N2dyedx

xj+1

xj

)

.

If the gradients are dropped, as discussed further, wehave

Fe = −10

3(xj − xj+1)

(

2xj + xj+1

xj + 2xj+1

)

.

Page 133: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equations - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 133

For the interval [0; 1] divided equally into 3 elementswe have the element matrices

K1 = K2 = K3 =

(

3 −3−3 3

)

.

The global assembly process (coupling):

K =

K111 K12

1 0 0K12

1 K221 +K11

2 K122 0

0 K122 K22

2 +K113 K12

3

0 0 K123 K22

3

results in

K =

3 −3 0 0−3 6 −3 00 −3 6 −30 0 −3 3

.

Page 134: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equations - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 134

The ‘displacement’ vector for equally divided interval[0; 1] take form

F1 =

(

1027− dy(0)

dx2027

+dy( 1

3)

dx

)

,F2 =

(

4027− dy( 1

3)

dx5027

+dy( 2

3)

dx

)

,F3 =

(

7027− dy( 2

3)

dx8027

+ dy(1)dx

)

.

After the global assembly process one finally gets

F =

F 11

F 21 + F 1

2

F 22 + F 1

3

F 23

=

1027− dy(0)

dx602712027

8027

+ dy(1)dx

.

Page 135: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

System of equations - example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 135

The global (assembled) system of linear equations is

3 −3 0 0−3 6 −3 00 −3 6 −30 0 −3 3

·

y1y2y3y4

=

1027− dy(0)

dx602712027

8027

+ dy(1)dx

.

It cannot, however, be solved yet. This is due tonecessity of applying the global boundary conditions.These are y1 = y4 = 0. Two typical methods ofapplying them are discussed further.

Page 136: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Boundary conditions

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 136

Extracting only these equations that are related tounknown functions y2 and y3 for y1 = y4 = 0 results in

· · · ·· 6 −3 ·· −3 6 ·· · · ·

·

·y2y3·

=

·602712027

·

or simpler in

(

6 −3−3 6

)

·(

y2y3

)

=

(

602712027

)

The above system may now be solved to obtain theunknown values y2, y3.

Page 137: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Boundary conditions

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 137

The second method does not change the layout of thematrices. However, it involves modification of specificelements by multiplying them by a ‘large’ number.These elements are located on the diagonal of the‘stiffness’ matrix and corresponding positions of the‘displacement’ vector (if non-zero)

3 · 107 −3 0 0−3 6 −3 00 −3 6 −30 0 −3 3 · 107

·

y1y2y3y3

=

0602712027

0

.

Page 138: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

ODE FEM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 138

Data: Read N elements, nodes and BCsCreate global matrix K and vectors F, y;for e← 1 to N do

Ke ←∫

edNdx

dNdx

dx;Fe ←

eN20x dx;

Add Ke to K;Add Fe to F;

Apply BCs;Solve linear system K · y = F;

Page 139: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - ODE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 139

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

3 elements, 4 nodes

Page 140: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - ODE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 140

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

6 elements, 7 nodes

Page 141: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - ODE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 141

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

9 elements, 10 nodes

Page 142: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - ODE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 142

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

15 elements, 16 nodes

Page 143: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Linear and quadratic interpolation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 143

Considering line equation ye = a+ bx and utilising itfor two different points (xj, yj) and (xj+1, yj+1) wecan get the following system of equations

(

yjyj+1

)

=

(

1 xj1 xj+1

)

·(

ab

)

. (161)

It can be easily solved for a and b(

ab

)

=

(

1 xj1 xj+1

)−1

·(

yjyj+1

)

. (162)

Keeping in mind that ye = N · ye whereN = (N1, N2) and ye = (yj, yj+1) we can utilise thesolution for a and b to get

ye = a+bx =xj+1 − xxj+1 − xj

yj+x− xj

xj+1 − xjyj+1 = N1yj+N2yj+1.

Page 144: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Linear and quadratic interpolation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 144

Introducing L1 and L2 for a one-dimensional element

L1 := N1 =xj+1 − xxj+1 − xj

, (163a)

L2 := N2 =x− xj

xj+1 − xj(163b)

one can formulate similar system of equation forquadratic interpolation ye = a+ bx+ cx2 through thepoints (xj, yj), (xj+ 1

2, yj+ 1

2) and (xj+1, yj+1)

yjyj+ 1

2

yj+1

=

1 xj x2j1 xj+ 1

2x2j+ 1

2

1 xj+1 x2j+1

·

abc

. (164)

Page 145: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Linear and quadratic interpolation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 145

0 0.2 0.4 0.6 0.8 1

0

0.5

1

L1 L2

0 0.2 0.4 0.6 0.8 1

0

0.5

1

N1 N2 N3

The quadratictrial functionscan be alsoexpressed interms of lineartrial functions

N1 := L1 (2L1 − 1) ,

N2 := 4L1L2,

N3 := L2 (2L2 − 1)

Page 146: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Quadratic interpolation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 146

The ‘stiffness’ matrix for each element e may now becalculated as

Ke :=

∫ xj+1

xj

dN

dx

dN

dxdx =

1

3(xj+1 − xj)

7 −8 1−8 16 −81 −8 7

.

The ‘displacement’ vector is now

Fe :=

∫ xj+1

xj

N20x dx =10

3(xj+1−xj)

xj2(xj + xj+1)

xj+1

.

The Galerkin residual condition for each element isthe same as previously

Ke · ye = Fe. (166)

Page 147: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

ODE quadratic FEM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 147

Data: Read N linear elements, n nodes and BCsInsert midpoints xj+ 1

2← xj+xj+1

2;

n← 2n− 1 ;Create global matrix K and vectors F, y;for e← 1 to N do

Ke ←∫

edNdx

dNdx

dx;Fe ←

eN20x dx;

Add Ke to K;Add Fe to F;

Apply BCs;Solve linear system K · y = F;

Page 148: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

ODE - linear vs quadratic interpolation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 148

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

6 elements, 7 nodes. 3 elements, 7 nodes.

Page 149: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesh refinement

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 149

The generalised p-norm is given by

‖f‖p :=(∫

L

|f(x)|p dx) 1

p

(167)

where for p := 2 we have a special case

‖f‖2 :=√

L

f2(x) dx. (168)

The error E := y − y of a finite element solution ymay now be defined by means of 2-norm. It may takethe following form

‖E ′‖22 ≤ CN∑

e=1

r2e . (169)

Page 150: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesh refinement

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 150

The element residue re is defined as

re := |Le| ‖f + y′′e‖2 (170)

but due to the linear form of trial functions N ′′i = 0 itis true that y′′e = 0. This means that the elementresidue is re := |Le| ‖f‖2 and solution error

‖E ′‖22 ≤ CN∑

e=1

|Le|2‖f‖22. (171)

Element’s length is |Le| = xj+1 − xj and utilising thetrapezoidal rule we can express the element residue as

re := |Le|√

Le

f(x)2 dx ≈ (xj+1 − xj)32

f2j + f2

j+1

2.

The above approximation is used for mesh refinement.

Page 151: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesh refinement - results

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 151

0.00

0.50

1.00

0

0.5

1

1.5

x

y

0 0.2 0.4 0.6 0.8 10

1

2

3

x

Residue

Page 152: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesh refinement - results

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 152

0.00

0.50

0.75

1.00

0

0.5

1

1.5

x

y

0 0.2 0.4 0.6 0.8 10

1

2

3

x

Residue

Page 153: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesh refinement - results

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 153

0.00

0.25

0.50

0.75

1.00

0

0.5

1

1.5

x

y

0 0.2 0.4 0.6 0.8 10

1

2

3

x

Residue

Page 154: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesh refinement - results

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 154

0.00

0.25

0.50

0.75

0.87

1.00

0

0.5

1

1.5

x

y

0 0.2 0.4 0.6 0.8 10

1

2

3

x

Residue

Page 155: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesh refinement - results

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 155

0.00

0.25

0.50

0.63

0.75

0.87

1.00

0

0.5

1

1.5

x

y

0 0.2 0.4 0.6 0.8 10

1

2

3

x

Residue

Page 156: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mesh refinement - results

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 156

0.00

0.25

0.38

0.50

0.63

0.75

0.87

1.00

0

0.5

1

1.5

x

y

0 0.2 0.4 0.6 0.8 10

1

2

3

x

Residue

Page 157: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

FEM for Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 157

Letthe two dimensional formof Poisson equation on Ω

∂2U

∂x2+∂2U

∂y2= −a (172)

be subjected to the Dirichlet boundary conditionU(x, y) = 0 for every (x, y) ∈ ∂Ω. It is true that

∫∫

Ω

f(x, y) dx dy =∑

e

∫∫

Ωe

f(x, y) dx dy. (173)

Page 158: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

‘Element’ formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 158

The approximate solution is expressed as

Ue = N ·Ue (174)

where the known local trial functions N and theunknown nodal values Ue are

N := (N1, N2, N3), (175a)

Ue := (U1, U2, U3). (175b)

For each element we have the Galerkin residualcondition

∫∫

Ωe

NR dx = 0. (176)

Page 159: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

‘Element’ formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 159

Taking under consideration Poisson equation and theapproximate solution Ue it is now possible to expressthe residual as

∫∫

Ωe

N

(

∂2Ue∂x2

+∂2Ue∂y2

+ a

)

dx dy = 0. (177)

The second derivative has to be replaced (due tolinear nature of the trial functions). This can be doneby means of Green’s first identity∫∫

S

(

ψ∂2ϕ

∂x2+ ψ

∂2ϕ

∂y2

)

dx dy =

∂S

ψ∂ϕ

∂ndL

−∫∫

S

(

∂ψ

∂x

∂ϕ

∂x+∂ψ

∂y

∂ϕ

∂y

)

dx dy. (178)

Page 160: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

‘Element’ formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 160

Integration by means of Green’s identity makes itpossible to replace the second derivative

∫∫

Ωe

(

∂N

∂x

∂Ue∂x

+∂N

∂y

∂Ue∂y

)

dx dy

−∫

∂Ωe

N∂Ue∂n

dL−∫∫

Ωe

Na dx dy = 0. (179)

The matrix form of the Galerkin residual condition foreach element can now be expressed

∫∫

Ωe

(

∂N

∂x

∂N

∂x+∂N

∂y

∂N

∂y

)

dx dy ·Ue =

∫∫

Ωe

Na dx dy.

Page 161: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 161

Introducing the ‘stiffness’ matrix for each element e

Ke :=

∫∫

Ωe

(

∂N

∂x

∂N

∂x+∂N

∂y

∂N

∂y

)

dx dy (180)

and the ‘displacement’ vector

Fe :=

∫∫

Ωe

Na dx dy (181)

one may obtain the Galerkin residual condition foreach element in the form

Ke ·Ue = Fe. (182)

Page 162: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 162

The expanded version of the ‘stiffness’ matrix is

Ke :=

∫∫

Ωe

(

∂N1

∂x∂N1

∂x+∂N1

∂y∂N1

∂y∂N1

∂x∂N2

∂x+∂N1

∂y∂N2

∂y∂N1

∂x∂N3

∂x+∂N1

∂y∂N3

∂y∂N1

∂x∂N2

∂x+∂N1

∂y∂N2

∂y∂N2

∂x∂N2

∂x+∂N2

∂y∂N2

∂y∂N2

∂x∂N3

∂x+∂N2

∂y∂N3

∂y∂N1

∂x∂N3

∂x+∂N1

∂y∂N3

∂y∂N2

∂x∂N3

∂x+∂N2

∂y∂N3

∂y∂N3

∂x∂N3

∂x+∂N3

∂y∂N3

∂y

)

dx dy.

Similarly, the same for the ‘displacement’ vector

Fe := a

∫∫

Ωe

N1

N2

N3

dx dy. (183)

The actual form of matrices depends on the trialfunctions. Linear form of these are discussed further.

Page 163: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Linear trial function

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 163

Considering plane equation

Ue = a+ bx+ cy (184)

one can formulate the following system of equations

U1 = a+ bxi + cyi (185a)

U2 = a+ bxj + cyj (185b)

U3 = a+ bxk + cyk (185c)

for three different points (xi, yi), (xj, yj), (xk, yk).Solving these for a, b and c results in

Ue =U1

2Se(ai+bix+ciy)+

U2

2Se(aj+bjx+cjy)+

U3

2Se(ak+bkx+cky).

Page 164: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Linear trial function

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 164

The linear trial functions then are

N1 =1

2Se(ai + bix+ ciy),

N2 =1

2Se(aj + bjx+ cjy),

N3 =1

2Se(ak + bkx+ cky)

where

ai = xjyk − xkyj ; aj = xkyi − xiyk; ak = xiyj − xjyi;bi = yj − yk; bj = yk − yi; bk = yi − yj;ci = xk − xj; cj = xi − xk; ck = xj − xi;

Se =1

2|ckbj − cjbk|;

Page 165: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Linear interpolation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 165

00.5

1 0

0.5

1

0

0.5

1

x

y

z

00.5

1 0

0.5

1

0

0.5

1

x

y

z

00.5

1 0

0.5

1

0

0.5

1

x

y

z

00.5

1 0

0.5

1

0

0.5

1

x

y

z

Page 166: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Integrals and derivatives

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 166

Now it is possible to calculate necessary derivativesappearing in the ‘stiffness’ matrix

∂N1

∂x=

bi2Se

,∂N2

∂x=

bj2Se

,∂N3

∂x=

bk2Se

,

∂N1

∂y=

ci2Se

,∂N2

∂y=

cj2Se

,∂N3

∂y=

ck2Se

.

The same concerns integrals appearing in the‘displacement’ vector

∫∫

Se

Nα1 N

β2N

γ3 dx dy = 2Se

α!β!γ!

(α+ β + γ + 2)!. (188a)

Page 167: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 167

Now it is possible to simplify the matrices evenfurther. For the linear trial functions one gets the‘stiffness’ matrix

Ke =1

4Se

b2i + c2i bibj + cicj bibk + cickbibj + cicj b2j + c2j bjbk + cjckbibk + cick bjbk + cjck b2k + c2k

(189)

and the ‘displacement vector’

Fe =Se3

aiajak

. (190)

Page 168: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Four element example

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 168

1(0, 0) 2(10, 0)

3(10, 10)4(0, 10)

5(5, 5)

1

2

3

∂Ω

U = 0

U = 0

U=0

U=0

Page 169: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Global matrix

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 169

The global assembly process (coupling) for theconsidered four element case:

K=

K111 +K11

4 K121 0 K12

4 K131 +K13

4K12

1 K221 +K11

2 K122 0 K23

1 +K132

0 K122 K22

2 +K113 K12

3 K232 +K13

3K12

4 0 K123 K22

3 +K224 K23

3 +K234

K131 +K13

4 K231 +K13

2 K232 +K13

3 K233 +K23

4 K331 +K33

2 +K333 +K33

4

.

The element matrices are identical

K1 = K2 = K3 = K4 =1

2

1 0 −10 1 −1−1 −1 1

.

Finally, the global ‘stiffness’ matrix is

K =

1 0 0 0 −10 1 0 0 −10 0 1 0 −10 0 0 1 −1−1 −1 −1 −1 4

.

Page 170: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Global vector

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 170

The ‘displacement’ element vector for the consideredfour elements

F1 = F2 = F3 = F4 =25

3

111

.

After the global assembly process one finally gets

F =

F 11 + F 1

4

F 21 + F 1

2

F 22 + F 1

3

F 23 + F 2

4

F 31 + F 3

2 + F 33 + F 3

4

=50

3

11112

.

Page 171: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Poisson FEM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 171

Data: Read N elements, nodes and BCsCreate global matrix K and vectors F, y;for e← 1 to N do

Ke ←∫∫

Ωe

(

∂N∂x

∂N∂x

+ ∂N∂y

∂N∂y

)

dx dy;

Fe ←∫∫

ΩeNa dx dy;

Add Ke to K;Add Fe to F;

Apply BCs;Solve linear system K · y = F;

Page 172: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - PDE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 172

24

68

10

24

6810

0

3

6

4 elements, 5 nodes

Page 173: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - PDE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 173

24

68

10

24

6810

0

3

6

8 elements, 9 nodes

Page 174: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - PDE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 174

24

68

10

24

6810

0

3

6

50 elements, 36 nodes

Page 175: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - PDE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 175

24

68

10

24

6810

0

3

6

200 elements, 121 nodes

Page 176: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - PDE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 176

24

68

10

24

6810

0

3

6

800 elements, 441 nodes

Page 177: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

FEM for Laplace equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 177

Let the two dimensional form of Laplace equation

∂2ϕ

∂x2+∂2ϕ

∂y2= 0 (191)

or ∇2ϕ = 0 on Ω be subjected to both boundaryconditions on ∂Ω:

Neumann

∂ϕ

∂n= n·∇ϕ = n·(Ux, Uy) = nxUx+nyUy =: −fN ,

Dirichlet (as previously)

ϕ = const =: fD. (192)

Page 178: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

‘Element’ formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 178

As previously, FEM formulation for Poisson equationsubjected to Dirichlet and Neumann BCs is∫∫

Ωe

(

∂N

∂x

∂Ue∂x

+∂N

∂y

∂Ue∂y

)

dx dy

−∫

∂Ωe

N∂Ue∂n

dL−∫∫

Ωe

Na dx dy = 0.

Poisson ∇2ϕ = −a with Dirichlet BC

∫∫

Ωe

(

∂N

∂x

∂N

∂x+∂N

∂y

∂N

∂y

)

dx dy·Ue =

∫∫

Ωe

Na dx dy,

Laplace ∇2ϕ = 0 with Dirichlet + Neumann BC∫∫

Ωe

(

∂N

∂x

∂N

∂x+∂N

∂y

∂N

∂y

)

dx dy·ϕe = −∫

∂Ωe

NfN dL.

Page 179: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 179

Introducing the ‘stiffness’ matrix as previously foreach element e

Ke :=

∫∫

Ωe

(

∂N

∂x

∂N

∂x+∂N

∂y

∂N

∂y

)

dx dy (193)

and the ‘displacement’ vector

Fe := −∫

∂Ωe

NfN dL (194)

one may obtain the Galerkin residual condition foreach element in the form

Ke ·ϕe = Fe. (195)

Page 180: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 180

The expanded version of the ‘stiffness’ matrix look thesame as previously but the ‘displacement’ vector isnow

Fe := fN

∂Ωe

N dL = −1

2|L|fN1. (196)

The vector 1 may take of the three following forms

110

,

101

,

011

. (197)

|L| stands for element side length.

Page 181: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Laplace FEM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 181

Data: Read N elements, nodes and BCsCreate global matrix K and vectors F, y;for e← 1 to N do

Ke ←∫∫

Ωe

(

∂N∂x

∂N∂x

+ ∂N∂y

∂N∂y

)

dx dy;

Fe ← −∫

∂ΩeNfN dL;

Add Ke to K;Add Fe to F;

Apply BCs;Solve linear system K · y = F;

Page 182: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Geometry and mesh - Laplace equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 182

∂ϕ∂x=Ux

∂ϕ∂y

= 0

∂ϕ∂y

= 0

∂ϕ∂n

= 0

ϕ=const

456 nodes and 818 elements

Page 183: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - Laplace equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 183

−10

12 0

1

−2

1

−10

12 0

1

1

2

Page 184: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Geometry and mesh - Laplace equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 184

∂ϕ∂x=Ux

∂ϕ∂y

= 0

∂ϕ∂y

= 0

∂ϕ∂n

= 0∂ϕ∂y

= 0

ϕ=const

351 nodes and 607 elements

Page 185: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results - Laplace equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 185

−10

12 0

1

−2

1

−10

12 0

1

0

1

2

Page 186: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Creeping flow – Stokes equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 186

Re≪ 1

0 = ρg −∇p+ µ∇2U,

∇ ·U = 0.

0 = ρgx −∂p

∂x+ µ

(

∂2Ux∂x2

+∂2Ux∂y2

)

,

0 = ρgy −∂p

∂y+ µ

(

∂2Uy∂x2

+∂2Uy∂y2

)

,

∂Ux∂x

+∂Uy∂y

= 0.

Page 187: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

FEM formulation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 187

The approximate solution is expressed as

Ue = N ·Ue

where the quadratic trial functions N and theunknown nodal values Ue are

N := (N1, N2, N3, N4, N5, N6),

Ue := (U1, U2, U3, U4, U5, U6).

For each element we have the Galerkin residualcondition

∫∫

Ωe

NR dx = 0.

Page 188: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Quadratic interpolation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 188

The quadratictrial func-tions can beexpressed interms of lineartrial functions

N1 := L1 (2L1 − 1) ,

N2 := L2 (2L2 − 1) ,

N3 := L3 (2L3 − 1) ,

N4 := 4L1L2,

N5 := 4L2L3,

N6 := 4L1L3.

Page 189: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Momentum conservation equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 189

The Galerkin residual condition

∫∫

Ωe

N

(

ρgx −∂pe∂x

+ µ

(

∂2Uxe∂x2

+∂2Uxe∂y2

))

dx dy = 0

by means of Green’s first identity

∫∫

S

(

ψ∂2ϕ

∂x2+ ψ

∂2ϕ

∂y2

)

dx dy =

∂S

ψ∂ϕ

∂ndL

−∫∫

S

(

∂ψ

∂x

∂ϕ

∂x+∂ψ

∂y

∂ϕ

∂y

)

dx dy

Page 190: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Momentum conservation equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 190

is

ρgx

∫∫

Ωe

N dx dy −∫∫

Ωe

N∂N

∂xdx dy · pe

− µ∫∫

Ωe

(

∂N

∂x

∂N

∂x+∂N

∂y

∂N

∂y

)

dx dy ·Uxe = 0

orKpxe · pe +Kxye ·Uxe = gxFe.

Similarly

Kpye · pe +Kxye ·Uye = gyFe.

Page 191: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Momentum conservation equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 191

Kpxe :=

∫∫

Ωe

N∂N

∂xdx dy

Kpye :=

∫∫

Ωe

N∂N

∂ydx dy

Kxye := µ

∫∫

Ωe

(

∂N

∂x

∂N

∂x+∂N

∂y

∂N

∂y

)

dx dy

Fe := ρ

∫∫

Ωe

N dx dy

Page 192: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mass conservation equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 192

The Galerkin residual condition

∫∫

Ωe

N

(

∂Uxe∂x

+∂Uye∂y

)

dx dy = 0.

The matrix form of the Galerkin residual condition foreach element can now be expressed

∫∫

Ωe

N∂N

∂xdx dy ·Uxe +

∫∫

Ωe

N∂N

∂ydx dy ·Uye = 0

orKuxe ·Uxe +Kuye ·Uye = 0.

Page 193: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mass conservation equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 193

Kuxe :=

∫∫

Ωe

N∂N

∂xdx dy

Kuye :=

∫∫

Ωe

N∂N

∂ydx dy

Page 194: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Element equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 194

Kpxe · pe +Kxye ·Uxe = gxFe,

Kpye · pe +Kxye ·Uye = gyFe,

Kuxe ·Uxe +Kuye ·Uye = 0

K6×6xye 06×6 K6×3

pxe

06×6 K6×6xye K6×3

pye

K3×6uxe K3×6

uye 03×3

·

U6×1xe

U6×1ye

p3×1e

=

gxF6×1e

gyF6×1e

03×1

K15×15e · u15×1

e = f15×1e

Page 195: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Finite volume method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 195

Page 196: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

The method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 196

Equations are investigated in integral form incomparison with FDM. FVM is more flexible thanFDM in terms of spatial discretisation.Let us consider differential form of the generaltransport equation

∂(ρf)

∂t+∇ · (ρfU) = ∇ · (Γ∇f) + Sf . (203)

To obtain the integral form of this equation one needsGauss’s (divergence) theorem. Two dimensionalversion has the following form

∫∫

Ωi

∇ ·w dΩ =

∂Ω+i

w · dL (204)

where dΩ ≡ dx dy and dL ≡ n dL ≡ ı dy − dx.

Page 197: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Integral form

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 197

Integrating over the two dimensional domain (finite‘volume’) Ωi and utilising Gauss’s theorem results in

d

dt

∫∫

Ωi

ρf dΩ+

∂Ω+i

ρfU · dL =

∂Ω+i

Γ∇f · dL+∫∫

Ωi

Sf dΩ.

For the sake of simplicity it is further assumed that wedeal with an incompressible case ρ = const.First and last integral in the above equation suggestthe following definition of an average fi value of fover Ωi

fi :=1

|Ωi|

∫∫

Ωi

f dΩ. (205)

The average value fi is typically located at the centreof the volume Ωi.

Page 198: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Spatial discretisation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 198

The next step would be the spatial discretisation overthe volume Ωi boundary ∂Ωi. The line integralrepresents the total flux out of volume Ωi and isreplaced by a sum

∂Ω+i

w · dL ≈∑

k

wk ·∆Lk. (206)

Boundary ∂Ωi consists of lines indexed by subscript k.There are at least three lines (triangle). The vector wis either fU or Γ∇f . Because that vector w istypically not constant along each line it has to beapproximated by a single value wk at the centre ofeach line.

Page 199: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Time discretisation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 199

The last step would be time discretisation. Amongmany possibilities the simplest is the first orderforward finite difference approximation

dfidt≈ fn+1

i − fni∆t

. (207)

Time step of this approximation is denoted here as ∆t.Finally, one gets the following discretised version oftransport equation (i.e. Finite Volume Scheme)

ρfn+1i − fni

∆t|Ωi|+ ρ

k

(fU)k ·∆Lk =

k

(Γ∇f)k ·∆Lk + Sfi|Ωi|. (208)

|Ωi| stands for the area of control volume Ωi.

Page 200: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

1D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 200

xi−1 xi xi+1

xi−12

xi+12

∆xi

∆xi−1 ∆xi+1

x0x1 x2 x3 = xN

xN+1

∆x1 ∆xN

∆x12

∆xN2

Page 201: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

1D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 201

One dimensional and steady state diffusion equationof a f quantity arises from the general transportequation (convection-diffusion equation)

∂(ρf)

∂t+∇ · (ρUf) = ∇ · (Γ∇f) + Sf . (209)

If the diffusion coefficient Γ is constant then theabove equation simplifies to

∇ · (Γ∇f) + Sf = 0 (210)

or more precisely

d

dx

(

Γdf

dx

)

+ Sf = 0. (211)

Page 202: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

1D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 202

The integral form of one dimensional diffusionequation takes the following form

∫ xi+1

2

xi− 1

2

d

dx

(

Γdf

dx

)

dx+

∫ xi+1

2

xi− 1

2

Sf dx = 0. (212)

There is no need to take advantage of Gauss’stheorem. This is because the first term can beintegrated directly

(

Γdf

dx

)

i+ 12

−(

Γdf

dx

)

i− 12

+ Sfi∆xi = 0 (213)

where ∆xi := xi+ 12− xi− 1

2.

Page 203: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

1D FVM diffusion problem - Dirichlet BC

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 203

The average value of Sf at the centre of finite volumecan be approximated by means of trapezoidal rule bymeans of known values of Sf at the boundary of finitevolume

Sfi =Sfi− 1

2+ Sfi+ 1

2

2. (214)

Let us consider ODE

y′′(x) + 20x = 0 (215)

subjected to the Dirichlet boundary conditionsy(0) = y(1) = 0. The specific solution is

y(x) := −10

3(x3 − x). (216)

Page 204: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

1D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 204

In other word, the diffusion coefficient Γ := 1 andsource term Sf := 20x. If so, then discrete version ofone dimensional diffusion equation is now

dfi+ 12

dx−

dfi− 12

dx+ Sfi∆xi = 0. (217)

Derivatives or diffusive fluxes at the boundary of finitevolume are approximated by means of the secondorder scheme as

dfi+ 12

dx≈ fi+1 − fixi+1 − xi

, (218a)

dfi− 12

dx≈ fi − fi−1xi − xi−1

. (218b)

Page 205: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

1D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 205

The specific form of a finite volume scheme is now

fi+1 − fixi+1 − xi

− fi − fi−1xi − xi−1

+ Sfi∆xi = 0. (219)

It can also be rewritten to give fi as a function ofsurrounding variables

fi =∆xi+1fi−1 +∆xi−1fi+1 + Sfi∆xi−1∆xi+1∆xi

∆xi−1 +∆xi+1

where ∆xi−1 := xi − xi−1 and ∆xi+1 := xi+1 − xi.For ∆xi−1 = ∆xi+1 = ∆xi = h (i.e. uniform mesh)the finite volume scheme is reduced to a finitedifference scheme

fi =fi−1 + fi+1 + Sfih

2

2. (220)

Page 206: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

1D FVM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 206

Data: Read volumes data and BCsCreate nodes and ghost nodes;n← 1;repeat

R← 0;for i← 2 to imax − 1 do

fn+1i ← ∆xi+1f

ni−1+∆xi−1f

ni+1+Sfi∆xi−1∆xi+1∆xi

∆xi−1+∆xi+1;

R← max(

|fn+1i − fni |, R

)

;

Update ghost nodes;n← n+ 1;

until n ≤ nmax and R > Rmin;

Page 207: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results for nonuniform and uniform grids

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 207

0.2 0.5 0.72 0.920

0.5

1

1.5

x

y

0.13 0.38 0.63 0.880

0.5

1

1.5

x

y

Page 208: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

1D FVM diffusion problem - Neumann BC

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 208

Let us consider the same ordinary differential equation

y′′(x) + 20x = 0 (221)

subjected to both the Dirichlet y(0) = 0 andNeumann y′(1) = 0 boundary conditions. The specificsolution is now

y(x) := −10x(

x2

3− 1

)

. (222)

Page 209: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results for nonuniform and uniform grids

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 209

0.2 0.5 0.72 0.920

2

4

6

x

y

0.13 0.38 0.63 0.880

2

4

6

x

y

Page 210: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

2D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 210

Two dimensional and steady state diffusion equationof a f quantity arises, as previously, from the generaltransport equation (convection-diffusion equation)

∇ · (Γ∇f) + Sf = 0 (223)

If the diffusion coefficient is constant Γ := 1 and thesource term Sf := a then the above equationsimplifies to

∇ · ∇f + a = 0 (224)

or ∇2f = −a which is Poisson equation.

Page 211: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

2D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 211

The discrete version of the diffusion equation(simplified version of general transport equation) is

k

(Γ∇f)k ·∆Lk + Sfij|Ωij | = 0. (225)

For a structural and Cartesian mesh (next slide) thenormal ∆Lk vectors are

∆LAB = |AB |ı = ∆yi ı, (226a)

∆LBC = |BC| = ∆xi , (226b)

∆LCD = |CD| (−ı) = −∆yi ı, (226c)

∆LDA = |DA| (−) = −∆xi . (226d)

Page 212: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

2D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 212

fi−1j−1

fij−1

fi+1j−1

fi−1j fij fi+1j

fi−1j+1 fij+1 fi+1j+1

A

BC

D∆~LAB

∆~LBC

∆~LCD

∆~LDA

Page 213: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

2D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 213

The discrete version of two dimensional diffusionequation is now

Γ∂fi+ 1

2j

∂x∆yi + Γ

∂fij+ 12

∂y∆xi

− Γ∂fi− 1

2j

∂x∆yi − Γ

∂fij− 12

∂y∆xi + Sfij|Ωij | = 0

(227)where the area of volume Ωij is |Ωij| = ∆xi∆yi andthe diffusion coefficient is constant Γ := 1. If so, then

∂fi+ 12j

∂x∆yi +

∂fij+ 12

∂y∆xi −

∂fi− 12j

∂x∆yi

−∂fij− 1

2

∂y∆xi + Sfij∆xi∆yi = 0. (228)

Page 214: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

2D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 214

The average value of Sf at the centre of finite volumeis approximated by means of known values of Sf atthe boundary of finite volume

Sfij =1

4

(

Sfi− 12j− 1

2+ Sfi+ 1

2j− 1

2Sfi− 1

2j+ 1

2+ Sfi+ 1

2j+ 1

2

)

.

Derivatives at the boundary of finite volume areapproximated by means of the second order scheme as

∂fi+ 12j

∂x≈ fi+1j − fijxi+1j − xij

=fi+1j − fij∆xi+1

, (229a)

∂fij+ 12

∂y≈ fij+1 − fijyij+1 − yij

=fij+1 − fij∆yj+1

, (229b)

Page 215: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

2D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 215

∂fi− 12j

∂x≈ fij − fi−1jxij − xi−1j

=fij − fi−1j∆xi−1

, (230a)

∂fij− 12

∂y≈ fij − fij−1yij − yij−1

=fij − fij−1∆yj−1

. (230b)

The specific form of a finite volume scheme is now

Sfij∆xi∆yi+fi−1j∆yi∆xi−1

+fi+1j∆yi∆xi+1

+fij−1∆xi∆yj−1

+fij+1∆xi∆yj+1

fij

(

∆yi∆xi−1

+∆yi∆xi+1

+∆xi∆yj−1

+∆xi∆yj+1

)

= 0.

Page 216: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

2D FVM diffusion problem

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 216

It can also be rewritten to give fij as a function ofsurrounding variables

fij =

fi−1j∆yi∆xi−1

+fi+1j∆yi∆xi+1

+fij−1∆xi∆yj−1

+fij+1∆xi∆yj+1

+ Sfij∆xi∆yi∆yi

∆xi−1+ ∆yi

∆xi+1+ ∆xi

∆yj−1+ ∆xi

∆yj+1

.

For∆xi = ∆yi = ∆xi−1 = ∆xi+1 = ∆yi−1 = ∆yi+1 = h(i.e. uniform mesh) the finite volume scheme reducedto a finite difference scheme for Poisson equation

fij =fi−1j + fi+1j + fij−1 + fij+1 + Sfijh

2

4. (231)

Page 217: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

2D FVM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 217

Data: Read volumes data and BCs

Create nodes and ghost nodes;

n← 1;

repeat

R← 0;

for i← 2 to imax − 1 do

for j ← 2 to jmax − 1 do

fn+1ij ←fni−1j∆yi

∆xi−1+

fni+1j∆yi

∆xi+1+

fnij−1∆xi

∆yj−1+

fnij+1∆xi

∆yj+1+Sfij∆xi∆yi

∆yi∆xi−1

+∆yi

∆xi+1+

∆xi∆yi−1

+∆xi

∆yi+1

;

R← max

(

|fn+1ij − fnij |, R

)

;

Update ghost nodes;

n← n+ 1;

until n ≤ nmax and R > Rmin;

Page 218: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Nonuniform and uniform volumes and nodes

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 218

Page 219: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results for nonuniform and uniform mesh

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 219

02

46

810 0

24

6810

0

3

6

02

46

810 0

24

6810

0

3

6

Page 220: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results for nonuniform and uniform mesh

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 220

Page 221: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Monte Carlo method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 221

Page 222: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Monte Carlo integration

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 222

0 0.2 0.4 0.6 0.8 10

0.2

0.4

0.6

0.8

1

x

y

0 0.2 0.4 0.6 0.8 10

0.2

0.4

0.6

0.8

1

xy

f(x) := xx

Page 223: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Monte Carlo integration

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 223

The simplest Monte Carlo integration is based onsampling uniformly distributed points (U ,U)

∫ 1

0

f(x) dx ≈ 1

n

n∑

i=1

F (U ,U) (232)

where

F (x, y) :=

1; if f(x) ≥ y

0; otherwise. (233)

Page 224: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Estimation of π

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 224

−1 −0.5 0 0.5 1

−1

−0.5

0

0.5

1

x

y

Page 225: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Estimation of π

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 225

The area |D| = π of an unit circle

D :=

(x, y) : x2 + y2 ≤ 1

(234)

is estimated as

π =

∫∫

D

F (x) dx ≈ 4

n

n∑

i=1

F (U ,U) (235)

where

F (x, y) :=

1; if x2 + y2 ≤ 1

0; otherwise. (236)

Page 226: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Wiener process and random walk 1D

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 226

0 20 40 60 80 1000

0.2

0.4

0.6

0.8

1

Page 227: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 227

Poisson equation subjected to the Dirichlet boundarycondition

∇2U(x) = −f(x); ∀x ∈ Ω, (237a)

U(x) = g(x); ∀x ∈ ∂Ω. (237b)

It can be solved as an expected value of random pathsof a stochastic process

U(x) = E

[

g(Wτ ) +12

∫ τ

0

f(Wt) dt

]

(238)

where t is a terminal time of a random walk

τ = inf t :Wt ∈ ∂Ω . (239)

Page 228: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 228

If the Dirichlet boundary condition is g(x) = 0 then

U(x) = 12E

[∫ τ

0

f(Wt) dt

]

. (240)

We can also estimate

∫ τ

0

f(Wt) dt ≈m∑

i=1

fi(Wτ )∆t =m∑

i=1

fi(Wτ )h

V (h).

(241)Let us consider an ordinary differential equationy′′(x) = −20x subjected to boundary conditionsy(0) = y(1) = 0 (i.e. U := y, f(x) := 20x,g(x) := 0).

Page 229: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Monte Carlo ODE pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 229

Data: Read input variablesfor i← 1 to imax do

if not boundary(xi) thenS ← 0;for k ← 1 to n do

I ← 0;α← i;while not boundary(xα) do

α← α + 2⌊U(0, 1) + 12⌋ − 1;

I ← I + 20f(xα);

S ← S + I;

yi ← h2

2Sn;

Page 230: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results – ODE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 230

n = 10

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

Page 231: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results – ODE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 231

n = 100

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

Page 232: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results – ODE

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 232

n = 1000

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

x

y

Page 233: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Monte Carlo Poisson pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 233

Data: Read input variables and BCsfor i← 1 to imax do

for j ← 1 to jmax do

if not boundary(Uij) thenτn ← 0;for k ← 1 to n do

S ← 0;α← i; β ← j;while not boundary(Uαβ) do

α← α+ 2⌊U(0, 1) + 12⌋ − 1;

β ← β + 2⌊U(0, 1) + 12⌋ − 1;

S ← S + 1;τn ← τn + S;

Uij ← −a h2

2τnn;

Page 234: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results – Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 234

24

68

102

4

6

810

0

3

6

n = 10

Page 235: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results – Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 235

24

68

102

4

6

810

0

3

6

n = 50

Page 236: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results – Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 236

24

68

102

4

6

810

0

3

6

n = 100

Page 237: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results – Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 237

24

68

102

4

6

810

0

3

6

n = 500

Page 238: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Results – Poisson equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 238

24

68

102

4

6

810

0

3

6

n = 5000

Page 239: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Lattice Boltzmann method

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 239

Page 240: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Definitions and ideas

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 240

The kinetic theory of gases treats gas as a largenumber of small molecules. They are in constant (andrandom) motion and constantly collide with oneanother.Knowing the position and velocity of each particle atsome instant in time it would be possible to know theexact dynamical state of the whole system. Themotion of particles could then be described by meansof classical mechanics. This would allow for predictionof all future states of the system.Due to the large number of molecules a statisticaltreatment is possible and necessary.

Page 241: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Assumptions

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 241

The gas is compose of small molecules whichmeans that the average distance separatingparticles is large in comparison with their size.

Molecules are in constant and random motion The large number of molecules make it possible to

apply statistical treatment Molecules have the same mass and spherical

shape Molecules constantly and elastically collide The only interaction is due to collision (no other

forces on one another)

Page 242: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Phase space and the distribution function

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 242

For N molecules we can think of phase space in whichthe coordinates consist of the position xi, velocityvectors (vi) and the time t. For a three dimensionalcase we have 6N dimensional phase space (threecoordinates + three velocities times N molecules).The system can be described by a probabilitydistribution function f that depends on 6N variablesplus time t.For a single molecule this reduces to 6 dimensionalphase space (x1, x2, x3, v1, v2, v3). This can betreated as a statistical approach in which a system isrepresented by an ensemble of many copies.

Page 243: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Interpretation of the distribution function

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 243

The elementary volume and dV and product dv ofelementary velocities are defined as

dV :=D∏

i=1

dxi, dv :=D∏

i=1

dvi (242)

where D means the physical dimension size. Thedistribution f that depends on r,v, t represents theprobability of finding a particular molecule mass witha given position and velocity per unit phase space.

RD

RD

f(r,v, t) dV dv (243)

The above integrate represents the total mass ofmolecules.

Page 244: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Continuous Boltzmann equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 244

If no collisions occur then the probability of finding aparticular molecule mass with a given position andvelocity at (r,v, t) equals the probability at(r+ dr,v + dv, t + dt)

f(r+ dr,v+ dv, t+ dt) dV dv−f(r,v, t) dV dv = 0.

If, however, collisions take place then

f(r+ dr,v+ dv, t+ dt) dV dv−f(r,v, t) dV dv =

Ω(f) dV dv dt

where Ω is so called collision operator. It takes underconsideration collisions during dt interval.

Page 245: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Continuous Boltzmann equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 245

We can now expand the left hand side of the previousequation by means of Taylor’s theorem

f(r+ dr,v + dv, t + dt) ≈

f(r,v, t) + dr · ∇f + dv · ∇vf +∂f

∂tdt. (244)

The two above equations give the Boltzmann equation

∂f

∂t+ v · ∇f +

F

m· ∇vf = Ω(f) (245)

where v = drdt

and mdvdt

= F.

Page 246: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Collision operator

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 246

The simplification of the complicated collisionoperator Ω is needed. It should, however, fulfil at leasttwo conditions:

conservation of collision invariants ϕ

RD

ϕΩdv = 0 (246)

where collision invariants are: 1 (obvious), v and12‖v‖2.

tendency to the Maxwell-Boltzmann distribution(relaxation to local equilibrium)

Page 247: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

BGK approximation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 247

The BGK (Bhatnagar-Gross-Krook) approximation isthe most popular simplification of the collisionoperator

Ω =1

τ(f eq − f) . (247)

It expresses relaxation to local equilibrium f eq withthe relaxation time τ . Both conditions are fulfilled.The Boltzmann equations without external forces F isnow

∂f

∂t+ v · ∇f =

1

τ(f eq − f) . (248)

Now the equation is linear! More precisely it is a linearpartial differential equation.

Page 248: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Maxwell-Boltzmann distribution

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 248

It is the basic law of the kinetic theory of gases. TheMaxwell-Boltzmann distribution is used for moleculesbeing not far from thermodynamic equilibrium. Othereffects like quantum effects and relativistic speeds areneglected. The distribution is

f eq = ρ (2πRT )−D2 e−

‖v−U‖2

2RT =

ρ(√

2πcs

)−D

e−

‖c‖2

2c2s . (249)

This distribution is valid for freely moving moleculeswithout interacting with one another. The exceptionsare only elastic collisions.

Page 249: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

From Boltzmann eq. to conservation eqs

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 249

It is possible to derive the conservation laws from theBoltzmann equation. Firstly, from the interpretationof distribution function f it arises the definition ofmacroscopic density

ρ(r, t) =

RD

f(r,v, t) dv. (250)

The average value of a quantity ϕ is defined as

〈ϕ〉 =

RD

ϕf dv

RD

f dv=

1

ρ

RD

ϕf dv. (251)

The integration is carried out over velocity space.

Page 250: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Averaged Boltzmann equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 250

Multiplying the Boltzmann equation by ϕ and thenintegrating over velocity space results in

RD

ϕ∂f

∂tdv +

RD

ϕv · ∇f dv +∫

RD

ϕF

m· ∇vf dv =

RD

ϕΩ(f) dv. (252)

Taking advantage of the average definition theaveraged Boltzmann equation may now be rewrittenas

∂t(ρ〈ϕ〉) +∇ · (ρ〈ϕv〉)− ρf · 〈∇vϕ〉 = 0. (253)

Page 251: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Mass conservation equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 251

Substituting ϕ := 1 into the averaged Boltzmannequation we have

∂ρ

∂t+∇ · (ρ〈v〉) = 0. (254)

Comparing the above equation with the massconservation equation

∂ρ

∂t+∇ · (ρU) = 0 (255)

it becomes obvious that the macroscopic velocity U

must be

U = 〈v〉 = 1

ρ

RD

v f dv. (256)

Page 252: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Momentum conservation equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 252

Substituting ϕ← v into the averaged Boltzmannequation we have

∂t(ρU) +∇ · (ρ〈vv〉)− ρf = 0. (257)

Introducing the microscopic velocity c in the meanvelocity frame

c(r,v, t) := v −U(r, t) (258)

it is possible to define the stress tensor

σ := −ρ〈cc〉 = −∫

RD

ccf dv. (259)

Now, the averaged Boltzmann equations becomes themacroscopic momentum conservation equation

∂t(ρU) +∇ · (ρUU) = ρf +∇ · σ. (260)

Page 253: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Energy conservation equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 253

Substituting ϕ := 12‖v‖2 ≡ 1

2v · v into the averaged

Boltzmann equation we have

e :=1

2〈‖c‖2〉 = 1

RD

‖c‖2f dv. (261)

Introducing the heat vector q definition

q :=1

2ρ〈c‖c‖2〉 = 1

2

RD

c‖c‖2f dv (262)

we have the macroscopic energy conservation equation

∂t

(

ρ

(

e+1

2‖U‖2

))

+∇·(

ρ

(

e+1

2‖U‖2

)

U

)

=

ρf ·U+∇ · (σ ·U− q) . (263)

Page 254: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Equation of state

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 254

From the definition of the stress tensor σ := −ρ〈cc〉and the internal energy e := 2−1〈c · c〉 we have

tr〈cc〉 = 2e. (264)

Additionally, by means of the stress tensor we havepressure definition p := −D−1 trσ. Combining theseresults in

2ρe = pD. (265)

The above equation together with the equipartition ofenergy for mono-atomic gases gives the equation ofstate

p = ρRT = ρc2s. (266)

Page 255: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Velocity space discretisation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 255

The velocity space v is discretised into a finite set ofQ velocities vn where Q = |vn|. Discretedistributions are defined by means of the discretisedvelocity space

fn(r, t) = Wn f(r,vn, t), (267a)

f eqn (r, t) = Wn feq(r,vn, t). (267b)

Wn are the weights of the Gaussian quadrature rule.The density may now be approximated as

RD

f(r,v, t) dv ≈∑

n

Wnf(r,vn, t) =∑

n

fn(r, t).

Page 256: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Discrete Boltzmann equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 256

The discrete distribution function fn satisfies thediscrete Boltzmann equation (with BGKapproximation)

∂fn∂t

+ vn · ∇fn =1

τ(f eqn − fn) . (268)

The fluid density, velocity and internal energy are nowcalculated from the discrete distribution function:

Quantity Continuous discreteρ

RD f dv∑

n fnρU

RD v f dv∑

n vnfnρe 1

2

RD ‖v −U‖2f dv 12

n ‖vn −U‖2fn

Page 257: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Quadratures

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 257

To recover correct form of the Navier-Stokesequations the discrete velocity set has to be chosen sothe following quadratures hold exactly

∀0≤m≤3

RD

f eqm∏

i=0

v dv =∑

n

f0n

m∏

i=0

vn. (269)

The above may be reduced to

I :=

RD

e−

‖v‖2

2c2s ψ(v) dv ≈∑

n

Wne−

‖vn‖2

2c2s ψ(vn) (270)

where

Wn = e‖vn‖2

2c2s

(√2πcs

)D

wn (271)and

wn = π−D2

D∏

i=1

ωi. (272)

Page 258: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Space discretisation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 258

The space discretisation follows the velocity spacediscretisation. This means it is discretised into alattices (D1Q3, D2Q9, D3Q27 discussed further).From the quadratures it arises speed of the model

c =√3cs. (273)

The speed c is used for space discretisation in thefollowing manner ∆xi = c∆t where ∆t representstime step (time space discretisation).One may also introduce dimensionless lattice velocities

en :=vn

c. (274)

Page 259: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Lattice Boltzmann equation

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 259

Introducing the substantial derivative symboldndt

:= ∂∂t+ vn · ∇ makes it possible to rewrite the

discretised Boltzmann equation

dnfndt

=1

τ(f eqn − fn) . (275)

The substantial derivative is approximated by means of

dnfn(r, t)

dt=fn(r+ vn∆t, t+∆t)− fn(r, t)

∆t+O (∆t) .

From the two above one gets the Lattice Boltzmannequation

fn(r+vn∆t, t+∆t)−fn(r, t) =1

τ

(

f0n(r, t)− fn(r, t)

)

.

where dimensionless collision time is τ := τ∆t.

Page 260: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Equations

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 260

Continuous Boltzmann equation∂f

∂t+ v · ∇f = Ω(f) (276)

Continuous Boltzmann equation with BGKapproximation

∂f

∂t+ v · ∇f =

1

τ(f eq − f) (277)

Discrete Boltzmann equation

∂fn∂t

+ vn · ∇fn =1

τ(f eqn − fn) (278)

Lattice Boltzmann equation

fn(r+vn∆t, t+∆t)−fn(r, t) =1

τ

(

f0n(r, t)− fn(r, t)

)

(279)

Page 261: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Typical lattices

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 261

Page 262: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

D1Q3 lattice

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 262

wn =

23, n = 0;

16, n ∈ 1, 2.

Page 263: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

D2Q9 lattice

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 263

wn =

49, n = 0;

19, n ∈ 1, . . . , 4;

136, n ∈ 5, . . . , 8.

Page 264: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

D3Q27 lattice

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 264

wn =

827, n = 0;

227, n ∈ 1, . . . , 6;

154, n ∈ 15, . . . , 26;

1216

, n ∈ 7, . . . , 14;

Page 265: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

D3Q19 lattice

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 265

wn =

13, n = 0;

218, n ∈ 1, . . . , 6;

136, n ∈ 7, . . . , 18;

Page 266: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

D3Q15 lattice

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 266

wn =

29, n = 0;

19, n ∈ 1, . . . , 6;

172, n ∈ 7, . . . , 14;

Page 267: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Expansion of the Maxwell-Boltzmann

distribution

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 267

The Maxwell-Boltzmann distribution can berearranged

f eq = ρ(√

2πcs

)−D

e−

‖v‖2

2c2s e−

(

‖U‖2

2c2s−v·U

c2s

)

. (280)

Now f eq can be expanded into a Taylor series in termsof the fluid velocity

f0 := ρ(√

2πcs

)−D

e−

‖v‖2

2c2s

(

1 +v ·Uc2s

+(v ·U)2

2c4s− ‖U‖

2

2c2s

)

.

This is valid for low Mach numbers

f eq = f0 +O(‖U‖3

c3s

)

= f0 +O(

Ma3)

. (281)

Page 268: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Discrete Maxwell-Boltzmann distribution

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 268

The discrete equilibrium distribution is defined bymeans of the discretised velocity space

f0n(r, t) = Wnf

0(r,vn, t) (282)

where weights are

Wn = e‖vn‖2

2c2s

(√2πcs

)D

wn. (283)

Together with the Taylor expansion for low Machnumbers we have

f0n := wnρ

(

1 +vn ·Uc2s

+(vn ·U)2

2c4s− ‖U‖

2

2c2s

)

.

Page 269: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Streaming and collision

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 269

The Lattice Boltzmann equation

fn(r+vn∆t, t+∆t) = fn(r, t)+1

τ

(

f0n(r, t)− fn(r, t)

)

.

The collision step

f tn(r, t+∆t) = fn(r, t) +1

τ

(

f0n(r, t)− fn(r, t)

)

.

The streaming step

fn(r+ vn∆t, t +∆t) = f tn(r, t+∆t).

Page 270: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Streaming

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 270

Page 271: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Streaming

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 271

Page 272: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Streaming

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 272

Page 273: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

LBM pseudocode

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 273

k ← 0;repeat

R← 0;ρ←

n fn;U← 1

ρ

n vnfn;

Calculate residue;

f0n ← wnρ

(

1 + vn·Uc2s

+ (vn·U)2

2c4s− ‖U‖2

2c2s

)

;

f tn(r, t+∆t)← fn(r, t) +1τ(f0n(r, t)− fn(r, t));

Apply Bounceback;fn(r+ vn∆t, t +∆t)← f tn(r, t+∆t);Apply other BCs;k ← k + 1;

until k < kmax and R > Rmin;

Page 274: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Chapman-Enskog expansion

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 274

The Navier-Stokes equations can be recovered fromthe Lattice Boltzmann equation

∂t(ρU) +∇ · (ρUU) = −∇p+ µ∇2U (284)

through the Chapman-Enskog expansion (multi-scaleanalysis). The expansion of the discreteMaxwell-Boltzmann distribution is used

f0n := wnρ

(

1 +vn ·Uc2s

+(vn ·U)2

2c4s− ‖U‖

2

2c2s

)

.

The first RHS term is responsible for ∇p, the secondfor ∇2U, the last two terms are related to ρUU.

Page 275: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Simplifications

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 275

Knowing the structure of the discreteMaxwell-Boltzmann distribution we can now drop thenonlinear terms

f0n := wnρ

(

1 +vn ·Uc2s

)

(285)

to recover Stokes equations

∂t(ρU) = −∇p+ µ∇2U. (286)

For both cases the dynamic viscosity is defined as

µ := ρ

(

τ − 1

2

)

c2s∆t. (287)

Page 276: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Example - input

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 276

1 60 2023 1000000000122222222222222222222222222222222222222222222222224 1000000000122222222222222222222222222222222222222222222222225 1000000000122222222222222222222222222222222222222222222222226 1000000000122222222222222222222222222222222222222222222222227 1000000000122222222222222222222222222222222222222222222222228 1000000000111111111111111111111111111111111111111111111111119 100000000000000000000000000000000000000000000000000000000001

10 10000000000000000000000000000000000000000000000000000000000111 10000000000000000000000000000000000000000000000000000000000112 10000000000000000000000000000000000000000000000000000000000113 10000000000000000000000000000000000000000000000000000000000114 10000000000000000000000000000000000000000000000000000000000115 10000000000000000000000000000000000000000000000000000000000116 10000000000000000000000000000000000000000000000000000000000117 10000000000000000000000000000000000000000000000000000000000118 10000000000000000000000000000000000000000000000000000000000119 10000000000000000000000000000000000000000000000000000000000120 10000000000000000000000000000000000000000000000000000000000121 10000000000000000000000000000000000000000000000000000000000122 1111111111111111111111111111111111111111111111111100000000012324 22526 PT27 0 20 10 2028 0 .42930 VB31 50 0 60 032 0 .01

Page 277: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Advantages over conventional methods

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 277

Possibility of microscopic interactionsincorporation

Easier dealing with complex boundaries Parallelisation of the method (the collision and

streaming processes are local)

Page 278: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Other methods

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 278

Page 279: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

Other methods

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 279

Boundary element method Smoothed-particle hydrodynamics

Page 280: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

References

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 280

Page 281: Fluid Mechanics – Applications and Numerical Methodskrzyte/students/numerical_methods.pdf · K. Tesch; Fluid Mechanics – Applications and Numerical Methods 1 Fluid Mechanics –

List of references

Contents

Description of fluidat different scales

Turbulencemodelling

Finite differencemethod

Finite elementmethod

Finite volumemethod

Monte Carlo method

Lattice Boltzmannmethod

Other methods

References

K. Tesch; Fluid Mechanics – Applications and Numerical Methods 281

[1] Ferziger J.H., Peric M., Computational Methods for Fluid Dynamics,Springer-Verlag, Berlin, 2002

[2] Pope S. B., Turbulent Flows, Cambridge University Press, Cambridge,2000

[3] Succi S., The Lattice Boltzmann Equation for Fluid Dynamics and

Beyond, Oxford University Press, Oxford, 2001

[4] Tesch K., Fluid Mechanics, Wyd. PG, 2008, 2013 (in Polish)

[5] Wilcox D. C., Turbulence Modeling for CFD, DCW Industries,California, 1994

[6] Zienkiewicz O. C., Taylor R. L., The Finite Element Method,Butterworth-Heinemann, Oxford, 2000