You are on page 1of 281

Fluid Mechanics – Applications and

Numerical Methods

Krzysztof Tesch

Fluid Mechanics Department


Gdańsk University of Technology

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


Contents

Contents
Description of fluid at different scales
Description of fluid
at different scales
Turbulence modelling Turbulence
modelling
Finite difference method Finite difference
method
Finite element method Finite element
method
Finite volume method Finite volume
method

Monte Carlo method Monte Carlo method


Lattice Boltzmann
Lattice Boltzmann method method

Other methods
Other methods References

References

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method

Description of fluid at different Finite element


method
Finite volume
scales method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Descriptions

Fluid motion may be described by three types of Contents


Description of fluid
mathematical models according to the observed scales: at different scales
Turbulence
■ Microscopic description (molecular mechanics and modelling
Finite difference
dynamics) method

■ Mesoscopic description (kinetic theory, DPD) Finite element


method
■ Macroscopic description (classical fluid mechanics) Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Microscopic description

Molecular mechanics takes advantage of classical Contents


Description of fluid
mechanics equations to model molecular systems at different scales
Turbulence
whereas molecular dynamics simulates movements of modelling

atoms in the context of N-body simulation. The Finite difference


method
motion of molecules is determined by solving the Finite element
method
Newtons’s equation of motion Finite volume
method
N
d2 ri X Monte Carlo method

m 2 = Gi + fij . (1) Lattice Boltzmann


dt j=16=i
method

Other methods

References
The force exerted on a molecule consists of the
external force such as gravity Gi and the
intermolecular force fij = −∇V usually described by
mans of the Lennard-Jones potential

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


Microscopic description

" 12  6 # Contents


σ σ Description of fluid
V = 4ǫ − . (2) at different scales
krk krk Turbulence
modelling

In the above equations krk is the distance between Finite difference


method
particles, ǫ – the depth of the potential well that Finite element
method
characterises the interaction strength and σ – the Finite volume
finite distance describing the interaction range. method

Monte Carlo method


Further, the ensemble average makes it possible to Lattice Boltzmann
obtain a macroscopic quantity from the corresponding method

Other methods
microscopic variable. The disadvantage of molecular
References
dynamics method is that the total number of
molecules even in small volume is too large –
proportional to 1023 .

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


Molecular dynamics pseudocode

Contents
t ← 0; Description of fluid
at different scales
Calculate initial molecule position r; Turbulence
while not the end of calculations do modelling
Finite difference
fij ← −∇V ; method

a ← m−1 fij ; Finite element


method
r ← r + v ∆t + 12 a ∆t2 ; Finite volume
method
t ← t + ∆t; Monte Carlo method
Lattice Boltzmann
method

Other methods

References

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


Molecular dynamics - example

Contents
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

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


Mesoscopic description

The key concept is the probability distribution Contents


Description of fluid
function f (N ) in the phase space. The phase space is at different scales
Turbulence
constituted of 3N spatial coordinates q1 , . . . , qN and modelling

3N momenta p1 , . . . , pN . The probability distribution Finite difference


method
function f (N ) allows to express the probability to find Finite element
method
a particle within the infinitesimal phase space Finite volume
method

Monte Carlo method


(q1 , q1 + dq) × . . . × (qN , qN + dq)× Lattice Boltzmann
method
(p1 , p1 + dp) × . . . × (pN , pN + dp). (3)
Other methods

References
The total number of molecules within the infinitesimal
phase space is then

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

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


Mesoscopic description

The time evolution of the probability distribution Contents


Description of fluid
function f (N ) follows the Liouville equation at different scales
Turbulence
modelling
(N ) N 
(N ) (N ) (N )

df ∂f X ∂f dpi ∂f dqi Finite difference
= + · + · = 0. method
dt ∂t i=1
∂pi dt ∂qi dt Finite element
method
Finite volume
This means that the distribution function is constant method

Monte Carlo method


along any trajectory in phase space. Lattice Boltzmann
The reduced probability distribution function is method

Other methods
defined as
References

Fs (q1 , . . . , qs , p1 , . . . , ps ) =
Z Z
f (N ) (q1 , . . . , qN , p1 , . . . , pN ) dq N −s dpN −s .
R3(N −s) R3(N −s)

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


Mesoscopic description

The above function is called the s-particle probability Contents


distribution function. A chain of evolution equations Description of fluid
at different scales
for Fs for 1 ≤ s ≤ N is derived and called BBGKY Turbulence
hierarchy. This means that the sth equation for the modelling
Finite difference
s-particle distributions contains s + 1 distribution. method

That hierarchy may be truncated. Truncating it at the Finite element


method
first order results in Boltzmann equation Finite volume
method
∂f Monte Carlo method
+ v · ∇f = Ω(f ) (5)
∂t Lattice Boltzmann
method

for the probability distribution function Other methods

References
f (r, v, t) = mN F1 (q1 , p1 , t) (6)
for binary collisions with uncorrelated velocities before
that collision.

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


Mesoscopic description – DPD

Contents
The DPD (Dissipative Particle Dynamics) method Description of fluid
simulate only a reduced number of degrees of freedom at different scales
Turbulence
(coarse-grained models). The motion of particles is modelling

determined by solving the Newtons’s equation of Finite difference


method
motion Finite element
method

2 N Finite volume
d ri C
X
D R
 method
m 2 = Gi + fij + fij + fij Monte Carlo method
dt j=16=i Lattice Boltzmann
method

Other methods
where the interaction forces are the sum of
References

■ fijC conservative or repulsion forces


■ fijD dissipative forces
■ fijR random force

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


Macroscopic description – conservation
equations

Conservation of mass Contents


Description of fluid
at different scales
dρ Turbulence
+ ρ∇ · U = 0 (7) modelling
dt Finite difference
method
Conservation of linear momentum Finite element
method

dU Finite volume
ρ = ρf + ∇ · σ (8) method

dt Monte Carlo method


Lattice Boltzmann
Decomposition of stress tensor σ = −pt δ + τ. method

Other methods
Another form of conservation of linear momentum
References

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

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


Macroscopic description – energy equations

Contents
Energy Equation Description of fluid
at different scales

Kinetic ρ dedtk = ρf · U + ∇ · (σ · U) − ∇ · q Turbulence


modelling
∂pt
Total ρ de
dt
c
= ∂t
+ ∇ · (τ · U) − ∇ · q Finite difference
method
Mechanical ρ dedtm = ∇ · (σ · U) − σ : D Finite element
Internal ρ de
dt
=σ:D−∇·q method
Finite volume
dpt
Enthalpy ρ dh
dt
= τ : D − ∇ · q + dt
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Macroscopic description – general transport
equations

Contents
∂(ρf )
+ ∇ · (ρUf ) = Sf − ∇ · k (10) Description of fluid
at different scales
∂t Turbulence
Left hand side represents transient and convection modelling
Finite difference
effects. It expresses rate of change method
∂(ρf )
ρ df
dt
≡ ∂t
+ ∇ · (ρUf ). Right hand side represents Finite element
method
sources (positive and negative) and fluxes (transport Finite volume
method
due to other mechanism than convection). Monte Carlo method
Lattice Boltzmann
method
mass conservation equation
Other methods
f := 1, Sf := 0, k := 0 References
linear momentum conservation equation
f ← U, Sf ← ρf, k ← −σ
energy conservation equation
f := ek , Sf := ρf · U, k := q − σ · U

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


Macroscopic description – laws of
thermodynamics

Second law of thermodynamics Contents


Description of fluid
at different scales
ds q Turbulence
ρ ≥ −∇ · . (11) modelling
dt T Finite difference
method
Entropy balance Finite element
method
Finite volume
ds φ q method
ρ = −∇· . (12) Monte Carlo method
dt T T Lattice Boltzmann
method
First law of thermodynamics Other methods

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

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


Macroscopic description – constitutive
equations

Contents
■ Mechanical (rheological) constitutive equations Description of fluid
■ Equations of state at different scales
Turbulence
■ Fluxes modelling
Finite difference
method
Finite element
method
Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Macroscopic description – mechanical
constitutive equations

■ Newtonian fluids τ = 2µD Contents


Description of fluid
■ Non-Newtonian fluids at different scales
Turbulence
◆ Generalised Newtonian fluids τ = 2µ(γ)D modelling
Finite difference
◆ Differential type fluid τ = f (A1 , A2 , . . .) method

dAi ∂U Finite element


method
Ai+1 = +Ai · +∇U·Ai , i = 1, 2, . . .
dt ∂r Finite volume
method
◆ Integral type fluids Monte Carlo method
Rt Lattice Boltzmann
τ= f (t − τ ) (δ − Ct (τ )) dτ method
−∞   Other methods

◆ Rate type fluids τ̇ = f τ, D, Ḋ References

 
τ + λ1 τ̇ = 2µ D + λ2 Ḋ

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


Generalised Newtonian fluids
Szulman
1 Generalised Herschel
1 1
τ = τ0n + (kγ) m
n
τ = τ0 + kγ n + µ∞ γ Contents
  n1 τ0
µ
1
n
τ0
= |γ|
1 1 1
+ k m |γ| m − n µ = |γ| + k|γ|n−1 + µ∞ Description of fluid
at different scales
Turbulence
n := 1, 1 modelling
m := n 1 µ∞ := 0 n := 2
m := n
Finite difference
Generalised Casson method
Herschel-Bulkley Luo-Kuang
1 1 1 √ Finite element
τ n = τ0 + (kγ)
n n
τ = τ0 + kγ n τ = τ0 + k γ + µ∞ γ
  n1 τ0 method
1 τ0 1 τ0
µ = |γ| + k|γ|n−1 µ = |γ| + √k + µ∞
µn = |γ| + kn |γ| Finite volume
method

n := 2 n := 1 n := 1 τ0 := 0 Monte Carlo method


Lattice Boltzmann
Casson Bingham method
√ √ √ Ostwald-de Waele
τ = qτ0 + kγ τ = τ0 + kγ τ = kγ n
√ τ0
√ τ0
Other methods
µ = |γ| + k µ = |γ| +k µ = k|γ|n−1 k := 0,
µ∞ := k, References
τ0 := 0

τ0 := 0 n := 1
τ0 := 0
Newton
τ = kγ
µ=k

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


Macroscopic description – equations of state

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


Description of fluid
at different scales

de ds pt dρ Turbulence
=T + 2 (14) modelling
dt dt ρ dt Finite difference
method
■ Thermal equation of state pt = f (T, ρ−1 ) Finite element
method
Finite volume
pt = ρRT (15) method

Monte Carlo method


■ Caloric equation of state e = f (T, ρ−1 ) Lattice Boltzmann
method
  Other methods
∂pt
de = cv dT + T − pt dρ−1 (16) References
∂T

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


Macroscopic description – fluxes

General form w = −T · ∇ϕ due to assumption Contents


Description of fluid
w = f (∇ϕ). More precisely w depends only on ϕ and at different scales
Turbulence
∇ϕ. modelling
Finite difference
■ Fourier’s law method

q = −λ · ∇T (17) Finite element


method
■ Fick’s law Finite volume

ji = −ρDij · ∇g i (18) method

Monte Carlo method


■ Darcy’s law Lattice Boltzmann
method

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

References

In the case of isotropy T = α δ and


w = −α δ · ∇ϕ = −α∇ϕ.

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


Macroscopic description – applications 1

General form of the Navier-Stokes equation for Contents


Description of fluid
Newtonian fluids at different scales
Turbulence
modelling
dU D

ρ = ρf − ∇p + ∇ · 2µD (20) Finite difference
dt method
Finite element
■ incompressible flow method
■ creeping flow Finite volume
method
■ inviscid flow
Monte Carlo method
■ Boussinesq approximation Lattice Boltzmann
■ Oseen approximation method
■ filtration Other methods
■ one-dimensional flows References
■ heat transfer

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


Macroscopic description – applications 2

Contents
– Incompressible flow (ρ = const) Description of fluid
dU at different scales
ρ = ρf − ∇p + ∇ · (2µD) (21) Turbulence
dt modelling
Finite difference
µ = const method

dU Finite element
ρ = ρf − ∇p + µ∇2 U (22) method
dt Finite volume
method
– creeping flow Monte Carlo method

∂U Lattice Boltzmann
ρ = ρf − ∇p + ∇ · (2µD) (23) method
∂t Other methods

2D creeping flow References

∇4 ψ = 0 (24)

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


Macroscopic description – applications 3

Contents
– inviscid flow (µ = 0) Description of fluid
dU at different scales
ρ = ρf − ∇p (25) Turbulence
dt modelling
Finite difference
potential flows (∇ × U = 0) method
Finite element
method
∇2 ϕ = ∇2 ψ = 0 (26) Finite volume
method

Monte Carlo method


– Boussinesq approximation Lattice Boltzmann
– Oseen approximation U · ∇U ≈ U∞ · ∇U method

Other methods

References
∂U D

ρ + ρU∞ · ∇U = ρf − ∇p + ∇ · 2µD (27)
∂t

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


Macroscopic description – applications 4

– filtration Contents
Description of fluid
at different scales
dU
ρ = ρf − ∇p + µ∇2 U − R1 U (28) Turbulence
modelling
dt Finite difference
method
– one-dimensional flows Finite element
method
Finite volume
2
∇ U =a (29) method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Macroscopic description – applications 5

– heat transfer The ‘fluid’ Fourier equation describes Contents


Description of fluid
the temperature field in the fluid. at different scales
Turbulence
  modelling
∂(ρT ) Finite difference
cv + ∇ · (ρT U) = φµ + ∇ · (λ∇T ) . (30) method
∂t Finite element
method

For solids where U = 0 the above equation simplifies Finite volume


method
to the ‘solid’ Fourier-Kirchhoff equation Monte Carlo method
Lattice Boltzmann
method
∂(ρT )
c = ∇ · (λ∇T ) + SE (31) Other methods
∂t References

where internal energy sources are given by SE .

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


Comments

Generally, the ‘fluid’ equation should be solved Contents


Description of fluid
together with ‘solid’ equation. This is called conjugate at different scales
Turbulence
heat transfer. Not having to know the heat transfer modelling

coefficient is an advantage of this approach. The Finite difference


method
disadvantage is the necessity of increasing the total Finite element
method
number of mesh elements due to the additional solid Finite volume
volume. method

Monte Carlo method


It is not always possible because of storage Lattice Boltzmann
limitations. Then either the temperature or heat flux method

must be specified at the wall. Alternatives, through Other methods

References
boundary conditions, are discussed further such as
specified temperature, specified heat flux, specified
temperature and heat flux, adiabatic or specified heat
transfer coefficient.

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


Macroscopic description – dimensionless form
of equations

Mass conservation equation Contents


Description of fluid
at different scales
∇+ · U+ = 0 (32) Turbulence
Linear momentum conservation equation modelling
Finite difference
+
 
∂U method
+
ρ Sh + + U+ · ∇+ U+ = Finite element
∂t method
Finite volume
ρ+ f + µ + method
= − Eu∇+ p+ + ∇2+ U+ (33) Monte Carlo method
Fr Re Lattice Boltzmann
Fourier-Kirchhoff (internal energy) method

Other methods
+
 
∂T References
ρ cv Sh + + U+ · ∇+ T + =
+ +
∂t
Ec + λ+
= φµ + ∇2+ T + (34)
Re P r Re

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


Macroscopic description – dimensionless
numbers
U
L tch Lf t0
Sh := Ut0
= t0
= U
= U2 Contents
L Description of fluid
ρ0 U 2 at different scales
U2
F r := f0 L
= L
ρ0 f0 Turbulence
modelling
ρ0 U 2
LUρ0 LU Finite difference
Re := µ0
= ν0
= L
µ0 U method
L2 Finite element
p0
p0 method
Eu := ρ0 U 2
= L
ρ0 U 2 Finite volume
L method
U2
Ec := cv0 T0 Monte Carlo method
cv0 µ0 ν0
P r := λ0
= λ0
Lattice Boltzmann
method
cv0 ρ0
Sc := ρ0µD0 0 = Dν00 Other methods

References
Da := KL
0
2
λ0
De := t0
W i := λ0 γ0

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


Macroscopic description – compatibility
conditions
General transport equation
Contents

∂(ρf ) Description of fluid


at different scales
+ ∇ · (ρUf ) = Sf − ∇ · k. (35)
∂t Turbulence
modelling
Finite difference
From Reynolds’ transport theorem arises general method

compatibility condition n̂ · [ρUf + k] = 0. Finite element


method
Finite volume
method
– Mass conservation: f := 1, Sf := 0, k := 0. C.C. Monte Carlo method
takes form n̂ · [ρU] = 0 or n̂ · [U] ≡ [Un ] = 0. Lattice Boltzmann
method
– Linear momentum: f ← U, Sf ← ρf, k ← −σ and
Other methods
C.C. n̂ · [ρUU − σ] = 0 or n̂ · [σ] = [σn ] = 0. References
– Energy conservation: f := ek , Sf := ρf · U,
k := q − σ · U and C.C. n̂ · [ρUek − σ · U + q] = 0
or n̂ · [q] or [λ ∂T
∂n
] = 0.

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


Macroscopic description – boundary
conditions 1

Compatibility conditions are insufficient! Further Contents


Description of fluid
conditions are needed: at different scales
Turbulence
■ adhesion l̂ · U = Ul = 0 modelling
Finite difference
■ thermal equilibrium on surfaces [T ] = 0 method
Finite element
Boundary condition related to heat transfer (arise method
Finite volume
from C.C.) method

Monte Carlo method


■ Dirichlet: T = f1 (x, y, z, t) Lattice Boltzmann
■ Neumann: qn := n̂ · q or qn = f2 (x, y, z, t) method

■ mixed: αT − λ ∂T
∂n
= f3 (P, t) Other methods

References

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


Macroscopic description – boundary
conditions 2

Other surfaces than walls Contents


Description of fluid
at different scales
■ inlet: n − 1 conditions where n stands for the Turbulence
number of equations modelling
Finite difference
■ outlet: Generally, σn = n̂ · σ plus T distribution. method

Usually p distribution due to σn ≈ −pn̂ plus Finite element


method
∂T
∂n
=0 Finite volume
method
∂ϕ
■ symmetry: ∂n = 0 for all scalar variables ϕ Monte Carlo method
■ periodicity (translation and rotation): Lattice Boltzmann
method
ϕ(P1 ) = ϕ(P2 ) where P1 and P2 are Other methods
corresponding points on periodic surfaces References

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


Mathematical classification

The Navier-Stokes equations are second order Contents


Description of fluid
nonlinear partial differential equations. In general, at different scales
Turbulence
they cannot be classified. However they posses modelling

properties of quasi-linear, semi-linear and linear second Finite difference


method
order partial differential equations. Sometimes they Finite element
method
can be simplified to those and can be divided into: Finite volume
method
■ hyperbolic, Monte Carlo method
■ parabolic, Lattice Boltzmann
method
■ elliptic. Other methods

References

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


Semi-linear second order PDEs

For two independent variables x, y: Contents


Description of fluid
at different scales

∂ 2U ∂ 2U ∂ 2U Turbulence
modelling
A(x, y) 2 + B(x, y) + C(x, y) 2 +
∂x ∂x∂y ∂y Finite difference
method
 
∂U ∂U Finite element
F x, y, U, , = 0 (36) method
∂x ∂y Finite volume
method

for all (x, y) over a domain Ω the above equation is: Monte Carlo method
Lattice Boltzmann
method
■ hyperbolic if B 2 − 4A C > 0, Other methods
■ parabolic if B 2 − 4A C = 0, References
■ elliptic if B 2 − 4A C < 0.

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


Important elliptic second order PDEs

■ Laplace equation Contents


Description of fluid
at different scales
∂ 2U ∂ 2U Turbulence

2
+ 2
= 0. (37) modelling
∂x ∂y Finite difference
method
■ Poisson equation Finite element
method

∂ 2U ∂ 2U Finite volume
method
2
+ 2
= f (x, y). (38)
∂x ∂y Monte Carlo method
Lattice Boltzmann
■ Helmholtz equation method

Other methods
2 2
∂ U ∂ U 2 References
2
+ 2
+ k U = 0. (39)
∂x ∂y

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


Important parabolic second order PDEs

■ Heat equation Contents


Description of fluid
at different scales
∂U ∂ 2U Turbulence
− α 2 = 0, (40) modelling
∂t ∂x Finite difference
method
Finite element
2
∂U ∂ U method
− α 2 = f (x, t). (41) Finite volume
∂t ∂x method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Important hyperbolic second order PDEs

■ Wave equation Contents


Description of fluid
at different scales
∂ 2U 2 ∂ 2
U Turbulence

2
−a 2
= 0. (42) modelling
∂t ∂x Finite difference
method
■ Telegraph equations Finite element
method

∂ 2U ∂ 2U ∂U Finite volume
method
2
−a 2 −b − c U = 0. (43)
∂x ∂t ∂t Monte Carlo method
Lattice Boltzmann
method

Other methods

References

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


Important mixed type second order PDEs

■ Euler-Tricomi equation Contents


Description of fluid
at different scales
∂ 2U ∂ 2U Turbulence

2
− x 2 = 0. (44) modelling
∂x ∂y Finite difference
method
Finite element
It is of hyperbolic type for x > 0, parabolic at method

x = 0 and elliptic for x < 0. Finite volume


method
■ Generalised Euler-Tricomi equation Monte Carlo method
Lattice Boltzmann
∂ 2U ∂ 2U method

2
− f (x) 2 = 0. (45) Other methods
∂x ∂y References

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


Important mixed type second order PDEs

■ Potential gas flow


Contents
2 ′ 2 ′
2 ∂ ϕ ∂ ϕ Description of fluid
at different scales
(1 − M a∞ ) 2 + 2
= 0. (46)
∂x ∂y Turbulence
modelling

It is of hyperbolic type for M a2∞ > 1, parabolic at Finite difference


method
M a2∞ = 1 and elliptic for M a2∞ < 1. Finite element
method
The velocity potential for the x axis dominated Finite volume
flow is method

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


Lattice Boltzmann
method
Velocity components are then given as Other methods
∂ϕ References
Ux (x, y) = = U∞ + Ux′ (x, y), (48a)
∂x
∂ϕ
Uy (x, y) = = Uy′ (x, y). (48b)
∂y

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element

Turbulence modelling method


Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Turbulence features

■ Irregularity Contents
Description of fluid
■ Unsteadiness at different scales
Turbulence
■ 3-D in terms of space and vortex structures modelling

■ Diffusivity Finite difference


method
■ Dissipation Finite element
method
■ Energy cascade Finite volume
■ Need for constant energy supply method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Kolmogorov scales 1

Kolmogorov scales are the smallest vorticity scales Contents


Description of fluid
where nearly the whole dissipation takes place. There at different scales

are three scales, for velocity UK = (νε)1/4 , length Turbulence


modelling
1/4 1/2
LK = (ν 3 ε−1 ) and time tK = (νε−1 ) . Finite difference
method
The Reynolds number for these scales Finite element
method
Finite volume
1/4 3 −1 1/4
UK LK (νε) (ν ε ) method
ReK = = = 1. (49) Monte Carlo method
ν ν Lattice Boltzmann
method
It means that at this level the inertial forces are of the Other methods

same order as the viscous forces. References

The dissipation intensity of the kinetic energy of


fluctuation can also be estimated in terms of a length
scale for large scale motion (vorticity) as

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


Kolmogorov scales 2

U2 U2 U3
ε∼ = = . (50) Contents
t L/U L Description of fluid
at different scales
It means that the energy U 2 of the large scales is Turbulence
modelling
dissipated proportionally to time L/U . Substituting Finite difference
the dissipation in equation for Lk with that for ε we method
Finite element
have  3 1/4 method
ν L Finite volume
LK = 3
. (51) method
U Monte Carlo method

Introducing a Reynolds number for large scales Lattice Boltzmann


method
ReL = UL ν
it is possible to find a relation for the ratio Other methods

of length scales by means of this Reynolds number in References

the form of
 3 1/4  3/4
L U UL 3/4
∼ 3
L = = Re L . (52)
LK ν L ν

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


Turbulence glossary

■ DNS – Direct Numerical Simulation Contents


Description of fluid
■ LES – Large Eddy Simulation at different scales
■ RANS – Raynolds Averaged Navier-Stokes Turbulence
■ URANS – Unsteady Raynolds Averaged modelling
Finite difference
Navier-Stokes method
■ DES – Detached Eddy Simulation Finite element
method
■ SST – Shear Stress Transport Finite volume
■ RNG – ReNormalisation Group method
■ EARSM – Explicit Algebraic Reynolds Stress Monte Carlo method

Models Lattice Boltzmann


method
■ RST – Reynolds Stress Transport Other methods

References

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


Turbulence modelling

■ DNS Contents
Description of fluid
■ LES at different scales
Turbulence
■ RANS modelling
Finite difference
◆ Models based on the Boussinesq hypothesis method

(0-eq, 1-eq, 2-eq models) Finite element


method
◆ Models which do not take advantage of the Finite volume
method
Boussinesq hypothesis Monte Carlo method

■ RST models Lattice Boltzmann


method
■ EARSM Other methods

References

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


Decompositions and averages

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


Description of fluid
at different scales
N
Realisations f¯(r) := lim 1
P Turbulence
■ N
fi (r, t) modelling
N →∞ i=1 Finite difference
Rτ method
■ Time f¯τ (r) := lim τ f (r, t) dt
1
Finite element
τ →∞ 0 method
t+∆t Finite volume
¯ 1
R method
■ Time ft (r, t) := ∆t f (r, t) dt
Monte Carlo method
t RRR
■ Spatial f¯V (r, t) := |V1 | V
f (r, t) dV Lattice Boltzmann
method

Other methods

References

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


Comments

In practice it is usually enough to know what the Contents


Description of fluid
average velocity is (not the fluctuation). The velocity at different scales
Turbulence
vector field is be decomposed into average and modelling

fluctuation components U = Ū + U′ . The time of Finite difference


method
averaging ∆t should be chosen to be greater than the Finite element
method
fluctuation range and smaller than the function that is Finite volume
going to be averaged. The averaging process of the method

Monte Carlo method


Navier-Stokes equation introduces a number of new Lattice Boltzmann
unknown functions. method

Other methods

References

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


RANS 1

■ Averaged mass conservation equation


Contents
Description of fluid
∇ · Ū = 0 (53) at different scales
Turbulence
modelling
■ Averaged Navier-Stokes equation
Finite difference
method
∂ Ū Finite element
+ ρ∇ · ŪŪ = ρf̄ − ∇p̄ + µ∇2 Ū − ρ∇ · U′ U′

ρ (54) method
∂t Finite volume
method

Reynolds stress tensor R := −ρU′ U′ and the Monte Carlo method


Lattice Boltzmann
total stress tensor σ̄ := −p̄δ + 2µD̄ + R makes it method

possible to obtain the averaged momentum Other methods

References
equation
dŪ
ρ = ρf̄ + ∇ · σ̄ (55)
dt

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


RANS 2

■ Averaged Fourier-Kirchhoff equation Contents


Description of fluid
at different scales
 
∂(ρT̄ )  Turbulence
modelling
cv + ∇ · ρT̄ Ū =
∂t Finite difference
method
2

′ ′
= 2µD̄ + ∇ · (λ∇T̄ ) − cv ∇ · ρT U + ρε. Finite element
method
(56) Finite volume
method

Monte Carlo method


The averaging process of the Navier-Stokes equation Lattice Boltzmann
introduces six unknown (because of the symmetry) method

Other methods
components of the Reynolds stress tensor. The
References
averaged Fourier-Kirchhoff equations gives a further
three of the vector T ′ U′ .

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


Comments

It is important to realise that the closure of system of Contents


Description of fluid
the mass conservation and Navier-Stokes equations at different scales
Turbulence
has been lost. Further modelling is required. modelling

Formulating additional relationships for unknown Finite difference


method
functions to achieve closure of equations is called Finite element
method
turbulence modelling. Any additional closure equation Finite volume
must fulfil a few basic criteria such as coordinate method

Monte Carlo method


invariance. This is fulfilled by proper tensor Lattice Boltzmann
formulation of the exact and modelled equations. method

Another criterion is called realisability meaning that a Other methods

References
solution must be physical.
Practically, however, it is difficult to achieve all these
requirements. This is because some parts of the exact
transport equations are modelled or even dropped.

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


Closure

There are two main approaches to achieve closure. Contents


Description of fluid
The models may be divided between those which at different scales
Turbulence
assume the eddy viscosity hypothesis and those which modelling

do not Finite difference


method

■ Models not assuming the eddy viscosity hypothesis Finite element


method
Finite volume
◆ Reynolds stress transport equation method

◆ Algebraic stress tensor models Monte Carlo method


Lattice Boltzmann
■ Boussinesq hypothesis assumed method

Other methods

References

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


Reynolds stress transport equation

∂R
+ ∇ · ŪR = −∇Ū · (RT + R)+
 Contents

∂t Description of fluid
at different scales
2 −1
  2 Turbulence
+ ∇ · Ck ε + ν ∇R − Π + ρεδ (57) modelling
3 Finite difference
method
The left hand side represents unsteadiness and Finite element
method
convection. On the right hand side the two first terms Finite volume
represent production. The two terms under divergence method

Monte Carlo method


are responsible for diffusion. Lattice Boltzmann
The right hand side fourth term is the second method

Other methods
unknown tensor Π need to be modelled. The last
References
right hand side term 23 ρεδ is the so called dissipation
tensor for isotropic turbulence.

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


Algebraic stress tensor models

Without using the eddy viscosity hypothesis two Contents


Description of fluid
transport equations for k and a second variable are at different scales
Turbulence
formulated. Instead of the linear Boussinesq modelling

hypothesis – algebraic, non-linear relationships are Finite difference


method
formulated between the stress anisotropy tensor a and Finite element
method
the average flow properties. The tensor a is related to Finite volume
the Reynolds stress tensor by: method

Monte Carlo method

R 2 Lattice Boltzmann
a := − δ. (58) method

k 3 Other methods

References
Typically, relationships depend on average strain rate
and spin tensors

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

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


Boussinesq hypothesis

The turbulence stresses is related to the mean flow Contents


Description of fluid
Rxy = µt ∂∂y
Ūx
. This linear relationship is at different scales
Turbulence
modelling

R = a0 δ + 2µt D̄. (60) Finite difference


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

2 Monte Carlo method


R = − ρkδ + 2µt D̄. (61) Lattice Boltzmann
3 method

The Reynolds equation becomes Other methods

References

∂(ρŪ)  
+ ∇ · ρŪŪ = ρf̄ − ∇pe + ∇ · 2µe D̄ (62)
∂t
where µe := µt + µ, pe := p̄ + 23 ρk.

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


Eddy viscosity and diffusivity hypothesis

The eddy diffusivity hypothesis is introduced by direct Contents


Description of fluid
analogy with the eddy viscosity hypothesis. It reduces at different scales
Turbulence
the number of unknown functions in the modelling

Fourier-Kirchhoff equation −cv ρT ′ U′ = λt ∇T̄ . Finite difference


method
The Fourier-Kirchhoff equation then becomes Finite element
method
Finite volume
 
∂(ρT̄ )  2
 method
cv + ∇ · ρT̄ Ū = 2µD̄ +∇· λe ∇T̄ +ρε,
∂t Monte Carlo method
Lattice Boltzmann
(63) method

where λt can be estimated by means of the turbulent Other methods

Prandtl number λt = µPtrctv . Effective conductivity is References

introduced by means of the definition


λe := λt + λ = µPtrctv + λ.

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


Trace of RST equation

Calculating the trace of the Reynolds stress transport Contents


equation Description of fluid
at different scales
Turbulence
∂R modelling
+ ∇ · ŪR = −∇Ū · (RT + R)+

Finite difference
∂t method

2 −1
  2 Finite element
+ ∇ · Ck ε + ν ∇R − Π + ρεδ (64) method
3 Finite volume
method
results in kinetic energy k transport equation which is
Monte Carlo method
used in the preceding one- and two-equation Lattice Boltzmann
turbulence models tr R = −2ρk for µt = Cµ ρk 2 ε−1 . method

Other methods
The traces of Π by definition tr Π = 0 and the References
transport equation for k takes the following form

∂(ρk) −1
 
+∇·(ρk Ū) = ∇Ū : R+∇· µt σk + µ ∇k −ρε
∂t
(65)
K. Tesch; Fluid Mechanics – Applications and Numerical Methods 56
Zero-equation model

Zero k and ε are assumed. It allows the Boussinesq Contents


equation to be reduced to R = 2µt D̄. Description of fluid
at different scales
Eddy viscosity µt is modelled by means of the Turbulence
modelling
Prandtl-Kolmogorov hypothesis. This hypothesis
Finite difference
comes directly from dimensionless analysis µt = cρU L. method

The velocity scale U is often approximated by means Finite element


method
of the maximal velocity |Ū|max and length scale L by Finite volume
method
the volume
p of the flow domain |V | by U ∼ |Ū|max , Monte Carlo method
L ∼ 3 |V |. Lattice Boltzmann
method
The Boussinesq hypothesis takes the following form Other methods
p
R = Cρ 3 |V ||Ū|max D̄ (66) References

No new unknown functions! However, zero-equation


models are not as accurate but they are robust (first
approximation for more complex models).

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


One-equation model

One transport equation for k is introduced Contents


Description of fluid
at different scales
∂(ρk) −1
  Turbulence
+∇·(ρk Ū) = ∇Ū : R+∇· µt σk + µ ∇k −ρε modelling
∂t Finite difference
method
2
where ‘production’ ∇Ū : R = 2µt D̄√ . According to Finite element
method
U3
Prandl-Kolmogorov hypothesis U = k and ε ∼ L so Finite volume
method
ε = k 3/2 L−1 . Finally, the k transport equation arrives Monte Carlo method
Lattice Boltzmann
dk method
= 2µt D̄2 + ∇ · µt σk−1 + µ ∇k − ρk 3/2 L−1
 
ρ Other methods
dt
√ (67) References

where eddy viscosity is estimated as µt = ρ kL by


means of another Prandtl hypothesis.

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


Two-equation k-ε model

Two additional equations have to be formulated. The Contents


first, for the kinetic energy k, comes from the Description of fluid
at different scales
Reynolds stress transport equation Turbulence
modelling
  
dk 2 µt Finite difference
ρ = 2µt D̄ + ∇ · + µ ∇k − ρε method

dt σk Finite element
method
and that for the dissipation ε is analogous to it Finite volume
method
   2 Monte Carlo method
dε ε µ t ε
ρ = Cε1 2µt D̄2 + ∇ · + µ ∇ε − Cε2 ρ . Lattice Boltzmann
method
dt k σε k
Other methods
(68)
References
Both of them are transport equations for a scalar
function. The eddy viscosity depends on both k and ε
and is postulated, as previously, to have the form
k2
µt = Cµ ρ ε .

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


Comments

The five constants in equations are empirical, that is, Contents


Description of fluid
should be deduced from experiment for a specific at different scales
Turbulence
geometry. This ‘standard’ set is given by modelling
Finite difference
method
σk = 1, σε = 1.3, Finite element
method
Cµ = 0.09, Cε1 = 1.44, Cε2 = 1.92. (69) Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Two-equation k-ω model

The turbulent frequency ω is proportional to the ratio Contents


Description of fluid
of dissipation and kinetic energy ω ∼ kε and using the at different scales
Turbulence
constant Cµ , they are then related by ε = Cµ kω. The modelling

eddy viscosity takes the form µt = ρ ωk . The two Finite difference


method
transport equations take the following form Finite element
method
  
dk 2 µt Finite volume
ρ = 2µt D̄ +∇· + µ ∇k −Cµ ρkω (70) method

dt σk1 Monte Carlo method


   Lattice Boltzmann
dω ω 2 µt method
ρ = α1 2µt D̄ + ∇ · + µ ∇ω − β1 ρω 2 Other methods
dt k σω1 References
(71)
This ‘standard’ set is constant is σk1 = 2, σω1 = 2,
Cµ = 0.09, α1 = 95 , β1 = 403
.

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


Two equations SST model
The shear stress model combines the k − ω model near
the wall with the k − ε far from it. Firstly, the k − ε Contents
Description of fluid
model has to be transformed to the k − ω formulation at different scales

by means of relation ε = Cµ kω. This results in Turbulence


modelling

   Finite difference
∂(ρk)  2 µt method

+∇· ρk Ū = 2µt D̄ +∇· + µ ∇k −Cµ ρkω, Finite element


∂t σk2 method
Finite volume
   method
∂(ρω)  ω 2 µt Monte Carlo method
+ ∇ · ρω Ū = α2 2µt D̄ + ∇ · + µ ∇ω + Lattice Boltzmann
∂t k σω2 method

2 ρ Other methods
−β2 ρω + 2 σω2 ∇k · ∇ω.
ω References

Additional cross-diffusion terms now appear. The


‘standard’ set of constants is different from that for
the original k − ε σk2 = 1, σω2 = 0.856, Cµ = 0.09,
α2 = 0.44, β2 = 0.0828.
K. Tesch; Fluid Mechanics – Applications and Numerical Methods 62
Two equations SST model

Secondly, the equations for the k − ω model are Contents


multiplied by a blending function F1 and the Description of fluid
at different scales
transformed k − ε equations by (1 − F1 ). The Turbulence
modelling
equations then are added. This results in
Finite difference
   method
∂(ρk)  2 µt Finite element
+∇· ρk Ū = 2µt D̄ +∇· + µ ∇k −Cµ ρkω, method
∂t σk3 Finite volume
method

Monte Carlo method


  
∂(ρω)  ω 2 µt
+ ∇ · ρω Ū = α3 2µt D̄ + ∇ · + µ ∇ω + Lattice Boltzmann
∂t k σω3 method

Other methods
2 2
−β3 ρω + (1 − F1 ) ρσω3 ∇k · ∇ω. References
ω
Constants marked with the subscript ‘3’, namely σk3 ,
σω3 , α3 , β3 are linear combinations of constants from
the component models C3 = F1 C1 + (1 − F1 )C2 .

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


Additional passive transport equation

The additional variable transport equation may be


Contents
added to the closed system after averaging, as Description of fluid
∂(ρf¯) ¯

′ ′
 at different scales

+∇· ρf Ū = −∇· ρf U −∇· k̄+ S̄f . (72) Turbulence


∂t modelling
Finite difference
The first term of the right hand side can be modelled method

by means of the eddy diffusivity hypothesis and the Finite element


method
turbulent diffusivity coefficient Γ , −ρf ′ U′ = Γ ∇f¯ Finite volume
method
and the additional transport equation takes the form Monte Carlo method
Lattice Boltzmann
¯
∂(ρf )

µt
 
method
¯ + ρD ∇f¯ + S̄f

+ ∇ · ρf Ū = ∇ · Other methods
∂t Sct
References
(73)
where the turbulent diffusivity coefficient Γ may be
represented as a function of the eddy viscosity and the
µt µ
turbulent Schmidt number Γ := Sc t
where Sc := ρD
.

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


Turbulent boundary layer

■ y + < 11 laminar sub- Contents


Description of fluid
1 2 5 10 20 50 100 200
25 25 layer at different scales
Turbulence
20 20
■ 5 < y + < 30 buffer modelling
15 15
region Finite difference
U+

10 10 method

5 5
■ 11 < y + < 250 turbu- Finite element
method
0 0
lent sublayer (log-law Finite volume
1 2 5 10 20 50 100 200
layer) method
y+ Monte Carlo method
Friction velocity Uτ :=
q
τ̄0
ρ
■ y + < 250 inner turbu- Lattice Boltzmann
Characteristic length l := Uτ
ν lent boundary layer method
y
dimensionless distance y + := l ■ y + > 250 outer turbu- Other methods

Ūx References
dimensionless velocity U + := Uτ lent boundary layer

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


Filtration of N-S equations 1

Filtration of the N-S equations is associated with LES


Contents
method. Small scales are removed by means of Description of fluid
filtering at different scales

Z Z Z Z+∞ Turbulence
modelling
f¯(r, t) = f (r ′′ , t′′ )G(r − r ′′ , t − t′′ ) dt′′ dV ′′ Finite difference
method
R3 −∞ Finite element
method
where G is a filter. Typically it is a product Finite volume
method
3
Y Monte Carlo method

G(r − r ′′ , t − t′′ ) := Gt (t − t′′ ) Gvi (xi − x′′i ). (74) Lattice Boltzmann


method
i=1 Other methods

References
′′ −1 ′′
For Gt (t − t ) := τ H(t ) and
Gvi (xi − x′′i ) := δ(xi − x′′i ) we have time average
τ
f¯τ (r) := lim 1 f (r, t) dt.
R
τ →∞ τ 0

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


Filtration of N-S equations 2

Filtration of the N-S equations results in Contents


Description of fluid
∂ Ū   at different scales

ρ +ρ∇· ŪŪ = ρf̄ −∇p+∇· 2µD̄ − ρ (L + C + R) Turbulence


∂t modelling

(75) Finite difference


where Leonard’s decomposition method
Finite element
method
L := ŪŪ − ŪŪ, C := ŪU′ + U′ Ū, R := U′ U′ Finite volume
(76) method

Monte Carlo method


represents the cross stress tensor C (interactions Lattice Boltzmann
between large and small scales), Reynolds subgrid method

Other methods
tensor R (interactions among subgrid scales) and
References
Leonard tensor L (interactions among the large
scales).
For L = 0 and C = 0 we have Reynolds equations.

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element

Finite difference method method


Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


The method

Contents
The finite difference method (introduced by Euler in Description of fluid
XVIII century) replaces the region by a finite mesh of at different scales
Turbulence
points at which the dependent variable is modelling

approximated. Finite difference


method
All partial derivatives Finite element
method
at each mesh point Finite volume
are approximated from method

Monte Carlo method


neighbouring values Lattice Boltzmann
by means of Taylor’s method

Other methods
theorem. This
References
means that derivatives
at each point
are approximated by
difference quotients.

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


Taylor’s theorem

Assuming that f has continuous derivatives over Contents


Description of fluid
certain interval the Taylor expansion is used at different scales
Turbulence
modelling
m−1
X dn f (x0 ) dm f (c) Finite difference
f (x0 + ∆x) = + . (77) method

n=0
n! m! Finite element
method
Finite volume
where x := x0 + ∆x, c = x0 + θ∆x and θ ∈]0; 1[. method

Monte Carlo method


The above equation may also be written as Lattice Boltzmann
method

1 ′′ Other methods
f (x0 + ∆x) = f (x0 ) + f (x0 )∆x + f (x0 )∆x2

References
2
1 ′′′ 3 1 (m)
+ f (x0 )∆x + . . . + f (c)∆xm . (78)
6 m!

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


Taylor’s theorem

Contents
Instead of f (m) at unknown point c it is rewritten in Description of fluid
terms of another unknown quantity of order ∆xm at different scales
Turbulence
modelling
2
∆x Finite difference
f (x0 + ∆x) = f (x0 ) + f ′ (x0 )∆x + f ′′ (x0 ) method
2 Finite element
method
(m−1) ∆xm−1
+ ... + f (x0 ) + O(∆xm ) (79) Finite volume
method
(m − 1)!
Monte Carlo method
Lattice Boltzmann
m
Discarding (truncating) O(∆x ) one gets an method

approximation to f . The error in this approximation is Other methods

O(∆xm ). Roughly speaking it says that knowing the References

value of f and the values of its derivatives at x0 it is


possible to write down the equation for its value at
the point x0 + ∆x.

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


First order finite difference

Taking under consideration the Taylor expansion up to


Contents
the first derivative Description of fluid
at different scales

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


modelling
Finite difference
then neglecting O(∆x) and rearranging gives the first method
Finite element
order finite difference approximation to f ′ (x0 ) method
Finite volume
method
′ f (x0 + ∆x) − f (x0 ) Monte Carlo method
f (x0 ) ≈ . (81)
∆x Lattice Boltzmann
method

This approximation is called a forward approximation. Other methods

References
Replacing ∆x by −∆x in Taylor expansion one gets
backward approximation
′ f (x0 ) − f (x0 − ∆x)
f (x0 ) ≈ . (82)
∆x

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


Second order finite difference

Taking under consideration the Taylor expansion up to Contents


Description of fluid
the second derivative at different scales
Turbulence
2 modelling
∆x
f (x0 +∆x) = f (x0 )+f ′ (x0 )∆x+f ′′ (x0 ) +O(∆x3 ) Finite difference
2 method

(83) Finite element


method
then neglecting O(∆x2 ). Doing the same for −∆x Finite volume
method
and combining the two above we have Monte Carlo method
Lattice Boltzmann

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


f (x0 ) ≈ (84) Other methods
2∆x References

after neglecting O(∆x2 ). This is so called the second


order central difference approximation to f ′ (x0 ).

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


Second order finite difference

Higher order approximation to derivatives is also Contents


possible. This can be done by taking more terms in Description of fluid
at different scales
the Taylor expansion. Doing so up to the third we get Turbulence
modelling

1 ′′ Finite difference

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

2 Finite element
method
1 ′′′
+ f (x0 )∆x3 + O(∆x4 ). (85) Finite volume
method
6 Monte Carlo method
Lattice Boltzmann
Replacing ∆x for −∆x and combing the results then method

dropping O(∆x4 ) gives the second order symmetric Other methods

difference approximation to f ′′ References

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


f (x0 ) ≈ 2
.
∆x
(86)

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


Differences

Selected finite differences approximation to first and Contents


Description of fluid
second derivatives are given in the following table. at different scales
Turbulence
These can be used to solve ordinary differential modelling

equations by replacing derivatives by their Finite difference


method
approximations. Finite element
method
Approximation Type Order Finite volume
method
f (x0 +∆x)−f (x0 )
f ′ (x0 ) ∆x
forward 1st Monte Carlo method
Lattice Boltzmann
f (x0 )−f (x0 −∆x)
f ′ (x0 ) ∆x
backward 1st method

Other methods
f (x0 +∆x)−f (x0 −∆x)
f ′ (x0 ) 2∆x
central 2nd References

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


f ′′ (x0 ) ∆x2
symmetric 2nd

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


Differences

Equations for f ′ approximate the slope of the tangent Contents


Description of fluid
in x0 by means of chords (backward, forward and at different scales
Turbulence
central finite difference). modelling
Finite difference
method
Finite element
method
Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Differences

The typical subscript notation is Contents


Description of fluid
at different scales
f (x0 + m h, y0 + n h) ≡ fi+m j+n . (87) Turbulence
modelling

Now it is possible to express selected finite differences Finite difference


method
approximations to derivatives in somewhat simpler Finite element
method
manner Finite volume
method

Approximation Type Order Monte Carlo method


Lattice Boltzmann
fi+1 −fi
fi′ h
forward 1st method

Other methods
fi −fi−1
fi′ h
backward 1st References

fi+1 −fi−1
fi′ 2h
central 2nd
fi+1 −2fi +fi−1
fi′′ h2
symmetric 2nd

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


Poisson equation

Poisson equation is ∇2 Uz = a. Two dimensional Contents


versions of this equation is written as Description of fluid
at different scales
∂ 2 Uz ∂ 2 Uz Turbulence
2
+ 2
= a. (88) modelling
∂x ∂y Finite difference
The next step would be to replace second order method
Finite element
derivatives by symmetric finite difference method

approximation Finite volume


method

Monte Carlo method


Ui+1j − 2Uij + Ui−1j Uij+1 − 2Uij + Uij−1
2
+ 2
= a. Lattice Boltzmann
h h method

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


Other methods

References
surrounding variables

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


Uij = . (90)
4

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


Poisson equation - mesh and boundary
conditions

The domain is discretised in the x and y directions by Contents


Description of fluid
means of constant mesh size h (figure on the left). Uz at different scales
Turbulence
is unknown at black mesh points and known at white modelling

points from the boundary condition. Finite difference


method
For instance the Dirichlet Finite element
method
boundary condition Finite volume
specifies the values of Uz method

Monte Carlo method


directly. In this case Uz = 0 Lattice Boltzmann
meaning no slip wall. If the method

boundary values are known Other methods

References
then discrete Poisson
equation gives a system
of linear equations for Uij .

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


Poisson equation - solution methods

The accuracy of results depends on the size of the Contents


mesh represented here by h. Mesh size should be Description of fluid
at different scales
decreased until there is no significant influence on Turbulence
modelling
numerical results.
Finite difference
The set of linear equations can be solved either method

directly by means of an appropriate method (Gauss Finite element


method
elimination for instance) or indirectly by means of Finite volume
method
iterative solution methods or the relaxation method Monte Carlo method
(point-Jacobi iteration) Lattice Boltzmann
method
n n n n 2
U i+1j + U i−1j + U ij+1 + U ij−1 − ah Other methods
Uijn+1 = (91) References
4
or point-Gauss-Seidel (faster than point-Jacobi)
n n+1 n n+1
Ui+1j + Ui−1j + Uij+1 + Uij−1 − ah2
Uijn+1 = . (92)
4

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


Poisson equation - solution methods

Another indirect method is so called Successive Contents


Description of fluid
Over-Relaxation method at different scales
Turbulence
modelling

Uijn+1 = (1 − w)Uijn + Finite difference


method
n n+1 n n+1
Ui+1j + Ui−1j + Uij+1 + Uij−1 − ah2 Finite element
method
w (93)
4 Finite volume
method

Monte Carlo method


where w is a relaxation parameter. For w ∈]1, 2[ we Lattice Boltzmann
have over-relaxation and for w := 1 this method method

Other methods
corresponds to the point-Gauss-Seidel method. One
References
can also consider under-relaxation method for
w ∈]0, 1[.
The best choice of w value needs numerical
experiments. It also depends on specific problems.

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


Poisson FDM pseudocode

Data: Read input variables and BCs Contents


Description of fluid
w ← 1; n ← 1; at different scales

repeat Turbulence
modelling
R ← 0; Finite difference
method
for i ← 1 to imax do Finite element
for j ← 1 to jmax do method
Finite volume
if not boundary(Uijn ) then method
n+1 n+1
n
Ui+1j +Ui−1j n
+Uij+1 +Uij−1 −ah2 Monte Carlo method
Uijn+1 ← 4
; Lattice Boltzmann
R ← max |Uijn+1 − Uijn |, R ;
 method

Other methods
Uijn+1 ← (1 − w)Uijn + w Uijn+1 ; References

n ← n + 1;
until n ≤ nmax and R > Rmin ;

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


Results - Poisson equation

10 Contents
Description of fluid
at different scales
8 Turbulence
modelling
Finite difference
6 method

y
Finite element
method
6 4 Finite volume
method
3
10 Monte Carlo method
0 8 2
Lattice Boltzmann
2 6 method
4 4
6 2 4 6 8 10
8 2 Other methods
10 x
References

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


Laplace equation

Laplace equation is ∇2 ϕ = 0. Two dimensional Contents


versions of this equation is written as Description of fluid
at different scales
∂ 2ϕ ∂ 2ϕ Turbulence
2
+ 2 = 0. (94) modelling
∂x ∂y Finite difference
Replacing second order derivatives by symmetric finite method
Finite element
difference approximation method
Finite volume
ϕi+1j − 2ϕij + ϕi−1j ϕij+1 − 2ϕij + ϕij−1 method

2
+ 2
= 0. Monte Carlo method
h h Lattice Boltzmann

It can be rewritten to give ϕij as a function of (95) method

Other methods
surrounding variables References

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


ϕij = . (96)
4

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


Laplace eq. – Neumann boundary condition

Neumann boundary condition specifies values of the Contents


Description of fluid

derivative ∂n of a solution ϕ on boundary ∂Ω to fulfil at different scales
Turbulence
modelling
∂ϕ Finite difference
= N (x, y) (97) method
∂n Finite element
method
where the normal derivatives is defined as Finite volume
method

∂ϕ ∂ϕ ∂ϕ Monte Carlo method


= n̂ · ∇ϕ = nx + ny (98) Lattice Boltzmann
∂n ∂x ∂y method

Other methods

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

∂ϕ
= n̂ · U = nx Ux + ny Uy . (99)
∂n

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


Laplace eq. – Neumann boundary condition

We have two equation for a Contents


point located on boundary ‘2’ Description of fluid
at different scales
Turbulence
∂ 2f fi+1j − 2fij + fi−1j modelling

2
= 2
, Finite difference
∂x h method
∂f fi+1j − fi−1j Finite element
= = Nij . method
∂x 2h Finite volume
method

Point fi−1j is located outside Monte Carlo method


Lattice Boltzmann
the Ω area. Eliminating it we method

get Other methods

2 References
∂ f 2fi+1j − 2Nij h − 2fij
2
=
∂x h2
and
2fi+1j + fi+1j + fij−1 − 2Nij h
fij = .
4
K. Tesch; Fluid Mechanics – Applications and Numerical Methods 86
Laplace FDM pseudocode

Data: Read input variables and BCs


w ← 1; n ← 1; Contents
repeat Description of fluid
R ← 0; at different scales
for i ← 1 to imax do Turbulence
modelling
for j ← 1 to jmax do
if boundary(ϕnij ) 6= 0 then
Finite difference
n ) do method
switch ϕ(Uij
n+1 n+1 Finite element
ϕn n
i+1j +ϕi−1j +ϕij+1 +ϕij−1
case 1: ϕn+1
ij ← 4
; method

; Finite volume
n+1 method
2ϕn n
i+1j +ϕij+1 +ϕij−1 −2hNij
case 2: ϕn+1

ij 4
; Monte Carlo method
; Lattice Boltzmann
.. method
.
n+1 2ϕn n
i+1j +2ϕij+1 −2hNij Other methods
case 6: ϕij ← 4
;
; References
.
..
 
n+1 n
R ← max |ϕij − ϕij |, R ;
ϕn+1
ij ← (1 − w)ϕn n+1
ij + w ϕij ;

n ← n + 1;
Fluid nMechanics
K. Tesch; until ≤ nmax and R > Rmin ;and Numerical Methods
– Applications 87
Results - Laplace equation

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element
method
Finite volume
0 method
−5 Monte Carlo method
−10 Lattice Boltzmann
method
2 4 10
6 8 8 Other methods
10 12 4 6
References
14 16 2

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


Biharmonic equation

The biharmonic equation is ∇4 ψ ≡ ∇2 · ∇2 ψ = 0. Contents


Description of fluid
Two dimensional versions of this equation is written as at different scales
Turbulence
∂ 4ψ ∂ 4ψ ∂ 4ψ modelling

4
+ 2 2 2 + 4 = 0. (101) Finite difference
∂x ∂x ∂y ∂y method
Finite element
It is a fourth-order elliptic partial differential equation method

that describes creeping flows in terms of a stream Finite volume


method
function ψ where the velocity components are Monte Carlo method

Ux = ∂ψ ∂y
and U y = − ∂ψ
∂x
. Lattice Boltzmann
method
The Dirichlet boundary condition specifies both: a Other methods

stream function ψ and its normal derivative ∂ψ ∂n


. Two References

conditions are needed due to the fourth order of the


biharmonic equation.

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


Biharmonic equation - approximation to
derivatives
∂4ψ ∂4ψ
The finite difference approximations to ,
∂x4 ∂y 4
are Contents
Description of fluid
at different scales
∂ 4ψ ψi+2j + ψi−2j − 4ψi+1j − 4ψi−1j + 6ψij
4
= 4
, Turbulence
modelling
∂x h
Finite difference
(102a) method

∂ 4ψ ψij+2 + ψij−2 − 4ψij+1 − 4ψij−1 + 6ψij Finite element


method
4
= 4
.
∂y h Finite volume
method
(102b) Monte Carlo method
Lattice Boltzmann
method
The fourth order mixed derivative is approximated as Other methods

∂ 4ψ ψi+1j+1 + ψi−1j−1 + ψi−1j+1 + ψi+1j−1 References

2 2
=
∂x ∂y h4
4ψij − 2ψi+1j − 2ψi−1j − 2ψij+1 − 2ψij−1
+ 4
. (103)
h

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


Biharmonic equation - discrete equation

From the discrete biharmonic equations ψij can be Contents


expressed as a function of surrounding variables Description of fluid
at different scales
Turbulence
−ψi+2j − ψi−2j − ψij+2 − ψij−2 + 4ψij modelling
ψij = Finite difference
20 method

ψi−1j + ψij+1 + ψij−1 + ψi+1j Finite element


+8 method
20 Finite volume
method
ψi+1j+1 + ψi−1j−1 + ψi−1j+1 + ψi+1j−1
−2 . (104) Monte Carlo method
20 Lattice Boltzmann
method

Other methods

References

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


Biharmonic equation - boundary conditions

From the below figure two purely geometric Contents


Description of fluid
relationships arise ∂ψ
∂n
= n̂ · ∇ψ = −Ul , at different scales

∂ψ Turbulence
∂l
= l̂ · ∇ψ = Un . For an impermeable boundary one modelling

gets Un = 0 ⇒ ∂ψ ∂l
= 0. The general relationship Finite difference
method
between volumetric flow rate and the stream functions Finite element
method
is Finite volume
method

∂ψ
Z Z Z
Monte Carlo method
V̇ = U · n̂ dL = dL = dψ = ψA − ψB . Lattice Boltzmann
∂l method
L L L Other methods
(105) References

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


Biharmonic FDM pseudocode
Data: Read input variables and BCs
w ← 1; n ← 1; Contents
Description of fluid
repeat at different scales

R ← 0; Turbulence
modelling
for i ← 1 to imax do Finite difference
method
for j ← 1 to jmax do Finite element
if not boundary(Uijn ) then method
n
−Ui+2j n
−Ui−2j n
−Uij+2 n
−Uij−2 n
+4Uij Finite volume
n+1
Uij ← 20
+ method
n
Ui−1j n
+Uij+1 n
+Uij−1 n
+Ui+1j Monte Carlo method
8 20
− Lattice Boltzmann
n n n n
Ui+1j+1 +Ui−1j−1 +Ui−1j+1 +Ui+1j−1 method
2 20
; Other methods
R ← max |Uijn+1 − Uijn |, R ;

References

Uijn+1 ← (1 − w)Uijn + w Uijn+1 ;

n ← n + 1;
until n ≤ nmax and R > Rmin ;
K. Tesch; Fluid Mechanics – Applications and Numerical Methods 93
Results - biharmonic equation

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element
method
Finite volume
1 method

0.5 Monte Carlo method

0 Lattice Boltzmann
method
1 12
5 8 Other methods
10
15 4 References
20 1

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


Complex geometry

Contents
Point 1 is located inside Description of fluid
at different scales
the Ω area Turbulence
modelling
h f0 + d f2 Finite difference
f1 = (106) method
h+d Finite element
method
Finite volume
method

Monte Carlo method


Lattice Boltzmann
method
Point 1 is located outside
Other methods
the Ω area References

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

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


Navier-Stokes equations

Typical numerical approaches for the incompressible Contents


Description of fluid
Navier-Stokes equations: at different scales
Turbulence
■ Ωz -ψ (vorticity-stream function) formulation modelling
Finite difference
method method

■ Artificial compressibility method Finite element


method
■ Pressure/velocity correction (operator splitting Finite volume
method
methods) Monte Carlo method

◆ Projection methods Lattice Boltzmann


method
◆ MAC (Marker-and-Cell) Other methods

◆ Fractional step method References

◆ SIMPLE (Semi-Implicit Method for Pressure


Linked Equations), SIMPLER (SIMPLE
Revisited), SIMPLEC

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


Bad idea

The incompressible Navier-Stokes equations Contents


Description of fluid
at different scales
∂U 1 Turbulence
+ U · ∇U = − ∇p + ν∇2 U. (108) modelling
∂t ρ Finite difference
method

Explicit forward difference in time Finite element


method
Finite volume
Un+1 − Un 1 n method

+ U · ∇U = − ∇p + ν∇2 Un . (109)
n n
Monte Carlo method
∆t ρ Lattice Boltzmann
method

Problems: Other methods

References

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

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


Better idea

The incompressible Navier-Stokes equations Contents


Description of fluid
at different scales
∂U 1 Turbulence
+ U · ∇U = − ∇p + ν∇2 U, (110a) modelling
∂t ρ Finite difference
method
∇ · U = 0. (110b) Finite element
method

n+1 n Finite volume


U −U n n 1 n+1 method
+ U · ∇U = − ∇p + ν∇2 Un , (111a)
∆t ρ Monte Carlo method
Lattice Boltzmann
∇ · Un+1 = 0. (111b) method

Other methods

References
Problems:
ρ
∇2 pn+1 = ∆t
∇ · (Un − ∆t Un · ∇Un + ∆t ν∇2 Un )
BCs?

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


Semi implicit

The incompressible Navier-Stokes equations Contents


Description of fluid
at different scales
∂U 1 Turbulence
+ U · ∇U = − ∇p + ν∇2 U, (112a) modelling
∂t ρ Finite difference
method
∇ · U = 0. (112b) Finite element
method
Finite volume
Semi implicit approach method

Monte Carlo method


n+1 n
U −U n n+1 1 n+1 Lattice Boltzmann
+ U · ∇U = − ∇p + ν∇2 Un+1 , (113a) method
∆t ρ Other methods

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

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


Fully implicit

The incompressible Navier-Stokes equations Contents


Description of fluid
at different scales
∂U 1 Turbulence
+ U · ∇U = − ∇p + ν∇2 U, (114a) modelling
∂t ρ Finite difference
method
∇ · U = 0. (114b) Finite element
method
Finite volume
Fully implicit approach method

Monte Carlo method


n+1 n
U −U n+1 n+1 1 n+1 Lattice Boltzmann
+U · ∇U = − ∇p + ν∇2 Un+1 , method
∆t ρ Other methods
(115a) References

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

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


Artificial compressibility method

The incompressible Navier-Stokes equations Contents


Description of fluid
at different scales
∂U 1 Turbulence
+ U · ∇U = − ∇p + ν∇2 U, (116a) modelling
∂t ρ Finite difference
method
∇ · U = 0. (116b) Finite element
method
Finite volume
Explicit forward difference in time method

Monte Carlo method


n+1 n
U −U 1 Lattice Boltzmann
+ U · ∇U = − ∇pn + ν∇2 Un , (117a)
n n method
∆t ρ0 Other methods

pn+1 − pn References
β + ∇ · Un = 0. (117b)
∆t

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


Projection method

Ut − Un Contents

= −Un · ∇Un + ν∇2 Un , (118) Description of fluid


∆t at different scales
Turbulence
∇ · Ut 6= 0, BC modelling
Finite difference
method
Un+1 − Ut 1 n+1 Finite element
= − ∇p , (119) method
∆t ρ Finite volume
method

∇ · Un+1 = 0, ¬BC Monte Carlo method


Lattice Boltzmann

2 n+1 ρ method

∇p = ∇ · Ut (120) Other methods


∆t References

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


Square cylinder

Contents
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

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


Square cylinder

Contents
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

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


Square cylinder

Contents
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

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


Square cylinder

Contents
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

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


Square cylinder

Contents
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

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


Square cylinder

Contents
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

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


Square cylinder

Contents
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

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


Vorticity-stream function formulation
The incompressible 2D Navier-Stokes equations
∂U 1 Contents
+ U · ∇U = − ∇p + ν∇2 U, (121a) Description of fluid
∂t ρ at different scales
Turbulence
∂Uy ∂Ux modelling
Ωz = − . (121b)
∂x ∂y Finite difference
method
Finite element
∂ψ
2D Helmholtz equation (Ux = ∂y
, Uy = − ∂ψ
∂x
) method
Finite volume
method

∂Ωz Monte Carlo method


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

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

References

Ωn+1
z − Ω n
z
+ Un · ∇Ωnz = ν∇2 Ωnz , (123a)
∆t
∇2 ψ n+1 = −Ωn+1
z . (123b)

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element

Finite element method method


Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Method of weighted residuals

The mathematical foundation of the finite element Contents


Description of fluid
method is in the method of weighted residuals. at different scales
Turbulence
Imagine ordinary differential equation modelling
Finite difference

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


Finite element
method

subjected to boundary conditions y(0) = y(1) = 0. Finite volume


method
The exact general solution of this equation is Monte Carlo method
Lattice Boltzmann
method
10 3
y(x) := − x + C1 x + C2 (125) Other methods
3 References

and a specific solution subjected to boundary


conditions
10 3
y(x) := − (x − x). (126)
3

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


Method of weighted residuals

The method seeks an approximate solution ŷ in the Contents


general form N Description of fluid
X at different scales
ŷ(x) := Ci Ni (x) (127) Turbulence
modelling
i=1
Finite difference
where Ni are known trial functions which should be method

continuous and fulfilled boundary conditions. The Finite element


method
constants Ci are unknown and they will be Finite volume
method
determined. A residual R appears when substituting Monte Carlo method
approximate solution ŷ into the differential equations Lattice Boltzmann
method

R(x) := ŷ ′′ (x) + 20x 6= 0. (128) Other methods

References
The unknown Ci constant are determined for
i = 1, . . . N from
Z 1
Wi (x)R(x) dx = 0. (129)
0

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


Method of weighted residuals
Z 1
Wi (x)R(x) dx = 0 i = 1, . . . , N (130) Contents
0 Description of fluid
at different scales

Choices for the weighting functions Wi Turbulence


modelling

■ Collocation method Wi (x) := δ(x − xi ) Finite difference


method
■ Subdomain method Finite element
method
Wi (x) := H(x − xi−1 ) − H(x − xi ) Finite volume
method
■ Galerkin’s method Wi (x) := Ni (x)
Monte Carlo method
Z 1 Lattice Boltzmann
method
Ni (x)R(x) dx = 0 i = 1, . . . , N (131) Other methods
0
References
∂R
■ Least Squares Method Wi (x) := ∂Ci
Z 1
∂R
R(x) dx = 0 i = 1, . . . , N (132)
0 ∂Ci

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


Method of weighted residuals - example

A polynomial trial functions can be assumed Contents

N (x) := xr (x − 1)s .
Description of fluid
(133) at different scales
Turbulence
It is continuous and fulfils boundary conditions. Just modelling

one trial function for r = s = 1 is the simplest case Finite difference


method
Finite element
N1 (x) := x(x − 1). (134) method
PN Finite volume
The approximate solution ŷ(x) := i=1 Ci Ni (x) method

where N := 1 takes the following form Monte Carlo method


Lattice Boltzmann
method

ŷ(x) = C1 N1 (x) = C1 (x2 − x). (135) Other methods

References

Residual may now be expressed as

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

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


Method of weighted residuals - example

The unknown constant C1 may be determined upon Contents


Description of fluid
integrating (Galerkin’s method of weighted residuals) at different scales
Turbulence
Z 1 modelling
Finite difference
x(x − 1)(2C1 + 20x) dx = 0. (137) method
0 Finite element
method

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


method

C1 = −5. The approximate solution is now Monte Carlo method


Lattice Boltzmann
method
ŷ(x) = −5x(x − 1) (138) Other methods

References
and can be compared with the exact solution
10 3
y(x) := − (x − x). (139)
3

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


Method of weighted residuals - example

The simplest case with just one trial function Contents


Description of fluid
approximates the exact solution more or less at different scales
Turbulence
acceptably. Better agreement is possible with more modelling

than one trial functions. Finite difference


method
1.5 Finite element
y method
ŷ Finite volume
1 method

Monte Carlo method


y

Lattice Boltzmann
0.5 method

Other methods

References
0
0 0.2 0.4 0.6 0.8 1
x

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


Method of weighted residuals - example

The two polynomial trial functions can be assumed Contents


Description of fluid
at different scales
N1 (x) := x(x − 1), N2 (x) := x2 (x − 1). (140) Turbulence
modelling
Finite difference
Both are continuous and fulfil boundary
PN conditions. method

The approximate solution ŷ(x) := i=1 Ci Ni (x) Finite element


method
where N := 2 takes the following form Finite volume
method

Monte Carlo method


ŷ(x) = C1 N1 (x)+C2 N2 (x) = C1 (x2 −x)+C2 (x3 −x2 ). Lattice Boltzmann
(141) method

Other methods
Residual may now be expressed as
References

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

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


Method of weighted residuals - example

The unknown constants C1 , C2 may be determined Contents


Description of fluid
upon integrating at different scales
Turbulence
Z 1 modelling
Finite difference
x(x − 1)(2C1 + 2C2 (3x − 1) + 20x) dx = 0, method
0 Finite element
Z 1 method

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


method
0
Monte Carlo method
Lattice Boltzmann
This gives 10 + 2C1 + C2 = 0 and method
2
1 + 61 C1 + 15 C2 = 0 and allows to determine Other methods

C1 = C2 = − 10 3
. The approximate solution is now References

10
ŷ(x) = − x(x − 1)(x + 1). (143)
3

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


Method of weighted residuals - example

The case with two trial function approximates the Contents


Description of fluid
exact solution very well. It is far better that the at different scales
Turbulence
previous case. There is no visible difference. In fact, it modelling

is even the exact solution Finite difference


method

10 10 3 Finite element
method
− x(x − 1)(x + 1) = − (x − x). (144)
3 3 Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Method of weighted residuals - comments

■ The method of weighted residuals constitutes Contents


Description of fluid
foundation of the final element method at different scales
Turbulence
■ The method exploits an integral formulation to modelling

minimise residual errors Finite difference


method
■ Trail functions of this method are global. It is Finite element
method
usually difficult task to find a proper one that Finite volume
satisfies boundary conditions. The more method

Monte Carlo method


dimensions the worse. Lattice Boltzmann
method

Other methods

References

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


Finite Element method

The approximate solution is defined as Contents


Description of fluid
at different scales
N
X +1 Turbulence
modelling
ŷ(x) = yi ni (x) (145) Finite difference
i=1 method
Finite element
over the interval [x1 ; xN +1 ] which is divided into N method
Finite volume
subintervals (elements). The unknown values of yi at method

point xi correspond to constants Ci of the weighted Monte Carlo method


Lattice Boltzmann
residuals method. However, the trial function is local method

and defined as Other methods


 x−xi−1 References

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

ni (x) = xxi+1i+1 −x
−x i
xi ≤ x ≤ xi+1 , (146)

0 otherwise

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


Trial functions

Contents
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

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


Trial function

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


interpolation Description of fluid
at different scales

x4 − x x − x3 Turbulence
ŷ(x) = y3 n3 (x) + y4 n4 (x) = y3 + y4 . modelling

x4 − x3 x4 − x3 Finite difference
method
(147) Finite element
The above definition arises from the equation of the method
Finite volume
line passing through two different points (x3 , y3 ) and method

(x4 , y4 ) Monte Carlo method


Lattice Boltzmann
(ŷ − y3 )(x4 − x3 ) = (y4 − y3 )(x − x3 ) (148) method

Other methods
or knowing that ŷ = a + bx we solve for a and b from References

y3 = a + bx3 , (149a)
y4 = a + bx4 . (149b)

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


Method

Let us consider the same differential equation Contents


y ′′ + 20x = 0 as previously.
PN +1 The approximate solution Description of fluid
at different scales
is in the form ŷ(x) = i=1 yi ni (x). The idea of Turbulence
minimising the residual R(x) = ŷ ′′ + 20x 6= 0 is modelling
Finite difference
adapted from the weighted residuals to the finite method

element method Finite element


method
Z xN +1 Finite volume
method
nj (x)R(x) dx = 0 j = 1, . . . , N + 1. Monte Carlo method
x1 Lattice Boltzmann
The unknown values yj may be determined upon method

Other methods
integrating (Galerkin’s finite element method) References
Z xN +1 N +1
!
X
nj (x) (yi ni (x))′′ + 20x dx = 0
x1 i=1
j = 1, . . . , N + 1. (150)

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


Method

For the three trial functions nj we have three Contents


Description of fluid
equations. However, in any sub interval only two trial at different scales
Turbulence
functions are nonzero. If so modelling
Z x2 Finite difference
method
n1 (x) ((y1 n1 (x) + y2 n2 (x))′′ + 20x) dx = 0 Finite element
x1 method
Finite volume
method
Z x2
Monte Carlo method
n2 (x) ((y1 n1 (x) + y2 n2 (x))′′ + 20x) dx+ Lattice Boltzmann

Zx1 x3 method

Other methods
′′
n2 (x) ((y2 n2 (x) + y3 n3 (x)) + 20x) dx = 0 References
x2
Z x3
n3 (x) ((y2 n2 (x) + y3 n3 (x))′′ + 20x) dx = 0
x2

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


Method

We can decouple the second equation for the time Contents


Description of fluid
being and couple it latter at the global assembly at different scales
Turbulence
process. We have then modelling
Finite difference
Z xj+1 method

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


method
xj Finite volume
method
j = 1, . . . , N ; k = j, j + 1. (151) Monte Carlo method
Lattice Boltzmann
The above equation is valid for each subinterval method

Other methods
(element) and suggest the so called ‘element’
References
formulation. It is also well known that
Z xN +1 XN Z xj+1
y(x) dx = y(x) dx. (152)
x1 j=1 xj

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


‘Element’ formulation

The approximate solution is expressed as Contents


Description of fluid
at different scales
ŷe = yj N1 (x) + yj+1 N2 (x) = N · ye (153) Turbulence
modelling

where the known local trial functions N and the Finite difference
method
unknown nodal values ye are collected as vectors Finite element
method

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


method

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


Lattice Boltzmann
The local trial functions are simply a linear method

interpolation Other methods

References
xj+1 − x
N1 := xj ≤ x ≤ xj+1 , (155a)
xj+1 − xj
x − xj
N2 := xj ≤ x ≤ xj+1 . (155b)
xj+1 − xj

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


‘Element’ formulation

For each element we have the Galerkin residual Contents


Description of fluid
condition at different scales
Turbulence
Z xj+1 modelling

N R dx = 0 j = 1, . . . , N. (156) Finite difference


method
xj
Finite element
method
Taking under consideration our differential equation Finite volume
method
y ′′ + 20x = 0 and the approximate solution ŷe it is Monte Carlo method
now possible to express the residual as Lattice Boltzmann
method
Z xj+1  2  Other methods
d ŷe
N 2
+ 20x dx = 0. (157) References

xj dx

The second derivative has to be replaced. This is due


to linear nature of the trial functions.

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


‘Element’ formulation

Integration by parts makes it possible to replace the Contents


Description of fluid
second derivative at different scales
Turbulence
xj+1 Z xj+1 Z xj+1 modelling
dŷe
dN dŷe
N − dx + N20x dx = 0. Finite difference
dx xj
xj dx dx xj
method
Finite element
method

Finally, matrix form of the Galerkin residual condition Finite volume


method
for each element is now Monte Carlo method
Lattice Boltzmann
Z xj+1 Z xj+1 xj+1 method
dN dN dŷe
dx·ye = N20x dx+ N Other methods

xj dx dx xj dx
xj References

j = 1, . . . , N.

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


Element equations

The so called ‘stiffness’ matrix for each element e may Contents


Description of fluid
be introduced at different scales
Turbulence
Z xj+1 modelling
dN dN
Ke := dx. (158) Finite difference

xj dx dx method
Finite element
method
The above matrix is symmetric. The so called Finite volume
method
‘displacement’ vector is also introduced Monte Carlo method

Z xj+1 xj+1 Lattice Boltzmann


dŷe method
Fe := N20x dx + N . (159) Other methods
xj dx xj
References

The Galerkin residual condition for each element may


now be written as
Ke · ye = Fe . (160)

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


Element equations

It is possible to simplify the matrices even further. For Contents

the linear trial functions one gets the ‘stiffness’ matrix Description of fluid
at different scales

Z xj+1  dN1 dN1 dN1 dN2    Turbulence

dx dx dx dx
1 1 −1 modelling
Ke := dN1 dN2 dN2 dN2 dx = Finite difference
xj dx dx dx dx xj+1 − xj −1 1 method
Finite element
method
and the ‘displacement vector’ Finite volume
method

dŷe xj+1
! Monte Carlo method
Z xj+1  
N1 dx xj
N1 20x Lattice Boltzmann
Fe := dx + dŷe xj+1
. method
xj N2 20x N2 dx xj Other methods

References
If the gradients are dropped, as discussed further, we
have  
10 2xj + xj+1
Fe = − (xj − xj+1 ) .
3 xj + 2xj+1

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


Element equations - example

For the interval [0; 1] divided equally into 3 elements Contents


we have the element matrices Description of fluid
  at different scales
3 −3 Turbulence
K1 = K2 = K3 = . modelling
−3 3 Finite difference
The global assembly process (coupling): method
Finite element
 11 method
12

K1 K1 0 0 Finite volume
method
K112 K122 + K211 K 12
2 0 
K=  12 22 11

12 
Monte Carlo method
0 K2 K2 + K3 K3 Lattice Boltzmann

0 0 K312 K322 method

Other methods
results in   References
3 −3 0 0
−3 6 −3 0 
K=  0 −3 6 −3
.

0 0 −3 3

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


Element equations - example

The ‘displacement’ vector for equally divided interval Contents


Description of fluid
[0; 1] take form at different scales
Turbulence
modelling
1
! ! 2
!
10 dy(0) 40 dy( 3 ) dy( 3 )
27
− dx 27
− dx
70
− dx Finite difference
F1 = 20 1
dy( 3 ) , F 2 = 2
dy( 3 )
, F 3 = 27
80 dy(1)
. method

+ dx 50 + dx
27 27
+ dx 27
Finite element
method
Finite volume
After the global assembly process one finally gets method

Monte Carlo method


  10 dy(0)  Lattice Boltzmann
1

F1 27
− dx method

F12 + F21   60  Other methods


F=  =  120 27 .
2 1
F2 + F3    References
27
F32 80
27
+ dy(1)
dx

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


System of equations - example

Contents
The global (assembled) system of linear equations is Description of fluid
at different scales
     10 dy(0)  Turbulence
3 −3 0 0 y1 27
− dx modelling
−3 6 −3 0  y2   60  Finite difference
  ·   =  12027 . method
 0 −3 6 −3 y3    Finite element
27
80 dy(1) method
0 0 −3 3 y4 27
+ dx Finite volume
method

It cannot, however, be solved yet. This is due to Monte Carlo method


Lattice Boltzmann
necessity of applying the global boundary conditions. method

These are y1 = y4 = 0. Two typical methods of Other methods

applying them are discussed further. References

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


Boundary conditions

Extracting only these equations that are related to Contents


Description of fluid
unknown functions y2 and y3 for y1 = y4 = 0 results in at different scales
Turbulence
      modelling
· · · · · · Finite difference
· 6 −3 · y2   60  method
  ·   =  120 27  Finite element
· −3 6 · y3    method
27
Finite volume
· · · · · · method

Monte Carlo method

or simpler in Lattice Boltzmann


method
     60  Other methods
6 −3 y2 27
· = 120 References
−3 6 y3 27

The above system may now be solved to obtain the


unknown values y2 , y3 .

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


Boundary conditions

The second method does not change the layout of the Contents
Description of fluid
matrices. However, it involves modification of specific at different scales
Turbulence
elements by multiplying them by a ‘large’ number. modelling

These elements are located on the diagonal of the Finite difference


method
‘stiffness’ matrix and corresponding positions of the Finite element
method
‘displacement’ vector (if non-zero) Finite volume
method
7
     
3 · 10 −3 0 0 y1 0 Monte Carlo method

 −3 6 −3 0  y2   60  Lattice Boltzmann


method
  ·   =  120 27  .
 0 −3 6 −3  y3   27  Other methods

0 0 −3 3 · 107 y3 0 References

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


ODE FEM pseudocode

Contents
Data: Read N elements, nodes and BCs Description of fluid
Create global matrix K and vectors F, y; at different scales
Turbulence
for e ← 1 Rto N do modelling

Ke ← R e dN dN
dx dx
dx; Finite difference
method
Fe ← e N20x dx; Finite element
method
Add Ke to K; Finite volume
method
Add Fe to F;
Monte Carlo method

Apply BCs; Lattice Boltzmann


method
Solve linear system K · y = F; Other methods

References

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


Results - ODE

1.5 Contents
Description of fluid
at different scales
Turbulence
1 modelling
Finite difference
y

method
Finite element
0.5 method
Finite volume
method
0 Monte Carlo method
0 0.2 0.4 0.6 0.8 1 Lattice Boltzmann
x method

3 elements, 4 nodes Other methods

References

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


Results - ODE

1.5 Contents
Description of fluid
at different scales
Turbulence
1 modelling
Finite difference
y

method
Finite element
0.5 method
Finite volume
method
0 Monte Carlo method
0 0.2 0.4 0.6 0.8 1 Lattice Boltzmann
x method

6 elements, 7 nodes Other methods

References

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


Results - ODE

1.5 Contents
Description of fluid
at different scales
Turbulence
1 modelling
Finite difference
y

method
Finite element
0.5 method
Finite volume
method
0 Monte Carlo method
0 0.2 0.4 0.6 0.8 1 Lattice Boltzmann
x method

9 elements, 10 nodes Other methods

References

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


Results - ODE

1.5 Contents
Description of fluid
at different scales
Turbulence
1 modelling
Finite difference
y

method
Finite element
0.5 method
Finite volume
method
0 Monte Carlo method
0 0.2 0.4 0.6 0.8 1 Lattice Boltzmann
x method

15 elements, 16 nodes Other methods

References

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


Linear and quadratic interpolation
Considering line equation ŷe = a + bx and utilising it
for two different points (xj , yj ) and (xj+1 , yj+1 ) we Contents
Description of fluid
can get the following system of equations at different scales
      Turbulence
yj 1 xj a modelling
= · . (161)
yj+1 1 xj+1 b Finite difference
method
Finite element
It can be easily solved for a and b method
   −1   Finite volume
a 1 xj yj method
= · . (162)
b 1 xj+1 yj+1 Monte Carlo method
Lattice Boltzmann
method
Keeping in mind that ŷe = N · ye where
Other methods
N = (N1 , N2 ) and ye = (yj , yj+1 ) we can utilise the References
solution for a and b to get
xj+1 − x x − xj
ŷe = a+bx = yj + yj+1 = N1 yj +N2 yj+1 .
xj+1 − xj xj+1 − xj

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


Linear and quadratic interpolation
Introducing L1 and L2 for a one-dimensional element
Contents
xj+1 − x Description of fluid
L1 := N1 = , (163a) at different scales
xj+1 − xj Turbulence
modelling
x − xj
L2 := N2 = (163b) Finite difference
method
xj+1 − xj Finite element
method
one can formulate similar system of equation for Finite volume
method
quadratic interpolation ŷe = a + bx + cx2 through the Monte Carlo method
points (xj , yj ), (xj+ 1 , yj+ 1 ) and (xj+1 , yj+1 ) Lattice Boltzmann
2 2 method

Other methods
2   
1 xj xj
  
yj a References

yj+ 1  = 1 xj+ 1 x2j+ 1  ·  b  . (164)


2 2 2
yj+1 2
1 xj+1 xj+1 c

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


Linear and quadratic interpolation
1
Contents
L1 L2 Description of fluid
The quadratic at different scales
0.5 Turbulence
trial functions modelling

can be also Finite difference


method
0 expressed in Finite element
method
terms of linear
0 0.2 0.4 0.6 0.8 1 Finite volume
1 trial functions method

Monte Carlo method


N1 N2 N3
Lattice Boltzmann
N1 := L1 (2L1 − 1) , method
0.5
N2 := 4L1 L2 , Other methods

References
N3 := L2 (2L2 − 1)
0

0 0.2 0.4 0.6 0.8 1

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


Quadratic interpolation

The ‘stiffness’ matrix for each element e may now be Contents


calculated as Description of fluid
at different scales
Turbulence
 
Z xj+1 7 −8 1 modelling
dN dN 1 −8 16 −8 .
Ke := dx = Finite difference

xj dx dx 3(xj+1 − xj ) method
1 −8 7 Finite element
method
Finite volume
The ‘displacement’ vector is now method

Monte Carlo method


 
xj+1 xj Lattice Boltzmann
10
Z
method
Fe := N20x dx = (xj+1 −xj ) 2(xj + xj+1 )  . Other methods
xj 3
xj+1 References

The Galerkin residual condition for each element is


the same as previously
Ke · ye = Fe . (166)

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


ODE quadratic FEM pseudocode

Contents
Data: Read N linear elements, n nodes and BCs Description of fluid
x +x
Insert midpoints xj+ 1 ← j 2 j+1 ; at different scales
2 Turbulence
n ← 2n − 1 ; modelling
Finite difference
Create global matrix K and vectors F, y; method

for e ← 1 Rto N do Finite element


method
Ke ← R e dN dN
dx dx
dx; Finite volume
method
Fe ← e N20x dx; Monte Carlo method
Add Ke to K; Lattice Boltzmann
method
Add Fe to F; Other methods

Apply BCs; References

Solve linear system K · y = F;

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


ODE - linear vs quadratic interpolation

1.5 1.5 Contents


Description of fluid
at different scales
1 1
Turbulence
modelling
y

y
0.5 0.5 Finite difference
method
Finite element
0 0 method
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x Finite volume
method
6 elements, 7 nodes. 3 elements, 7 nodes. Monte Carlo method
Lattice Boltzmann
method

Other methods

References

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


Mesh refinement
The generalised p-norm is given by
Contents
Z  p1 Description of fluid
at different scales
kf kp := |f (x)|p dx (167) Turbulence
L modelling
Finite difference
method
where for p := 2 we have a special case Finite element
method
sZ
Finite volume
method
kf k2 := f 2 (x) dx. (168) Monte Carlo method
L
Lattice Boltzmann
method

The error E := y − ŷ of a finite element solution ŷ Other methods

may now be defined by means of 2-norm. It may take References

the following form


XN
kE ′ k22 ≤ C re2 . (169)
e=1

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


Mesh refinement
The element residue re is defined as
Contents
re := |Le | kf + ŷe′′ k2 (170) Description of fluid
at different scales
but due to the linear form of trial functions Ni′′ = 0 it Turbulence
modelling
is true that ŷe′′ = 0. This means that the element Finite difference
residue is re := |Le | kf k2 and solution error method
Finite element
N
X method

kE ′ k22 ≤ C |Le |2 kf k22 . (171) Finite volume


method
e=1 Monte Carlo method
Lattice Boltzmann
Element’s length is |Le | = xj+1 − xj and utilising the method

trapezoidal rule we can express the element residue as Other methods

References
sZ s
2 2
3 fj + fj+1
re := |Le | f (x)2 dx ≈ (xj+1 − xj ) 2 .
Le 2
The above approximation is used for mesh refinement.

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


Mesh refinement - results

1.5 Contents
Description of fluid
at different scales
1 Turbulence
modelling
y

Finite difference
0.5 method
Finite element
method
0
0.00

0.50

1.00
Finite volume
method
x Monte Carlo method
3
Lattice Boltzmann
method

2 Other methods
Residue

References

0
0 0.2 0.4 0.6 0.8 1
x

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


Mesh refinement - results

1.5 Contents
Description of fluid
at different scales
1 Turbulence
modelling
y

Finite difference
0.5 method
Finite element
method
0
0.00

0.50

0.75

1.00
Finite volume
method
x Monte Carlo method
3
Lattice Boltzmann
method

2 Other methods
Residue

References

0
0 0.2 0.4 0.6 0.8 1
x

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


Mesh refinement - results

1.5 Contents
Description of fluid
at different scales
1 Turbulence
modelling
y

Finite difference
0.5 method
Finite element
method
0
0.00

0.25

0.50

0.75

1.00
Finite volume
method
x Monte Carlo method
3
Lattice Boltzmann
method

2 Other methods
Residue

References

0
0 0.2 0.4 0.6 0.8 1
x

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


Mesh refinement - results

1.5 Contents
Description of fluid
at different scales
1 Turbulence
modelling
y

Finite difference
0.5 method
Finite element
method
0
0.00

0.25

0.50

0.75
0.87

1.00
Finite volume
method
x Monte Carlo method
3
Lattice Boltzmann
method

2 Other methods
Residue

References

0
0 0.2 0.4 0.6 0.8 1
x

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


Mesh refinement - results

1.5 Contents
Description of fluid
at different scales
1 Turbulence
modelling
y

Finite difference
0.5 method
Finite element
method
0
0.00

0.25

0.50
0.63
0.75
0.87

1.00
Finite volume
method
x Monte Carlo method
3
Lattice Boltzmann
method

2 Other methods
Residue

References

0
0 0.2 0.4 0.6 0.8 1
x

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


Mesh refinement - results

1.5 Contents
Description of fluid
at different scales
1 Turbulence
modelling
y

Finite difference
0.5 method
Finite element
method
0
0.00

0.25
0.38
0.50
0.63
0.75
0.87

1.00
Finite volume
method
x Monte Carlo method
3
Lattice Boltzmann
method

2 Other methods
Residue

References

0
0 0.2 0.4 0.6 0.8 1
x

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


FEM for Poisson equation

Let Contents
Description of fluid
the two dimensional form at different scales
Turbulence
of Poisson equation on Ω modelling
Finite difference
∂ 2U ∂ 2U method

2
+ 2
= −a (172) Finite element
∂x ∂y method
Finite volume
method
be subjected to the Dirichlet boundary condition Monte Carlo method
U (x, y) = 0 for every (x, y) ∈ ∂Ω. It is true that Lattice Boltzmann
method
ZZ X ZZ Other methods

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

Ω e Ωe

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


‘Element’ formulation

The approximate solution is expressed as Contents


Description of fluid
at different scales

Ûe = N · Ue (174) Turbulence


modelling
Finite difference
where the known local trial functions N and the method
Finite element
unknown nodal values Ue are method
Finite volume
method
N := (N1 , N2 , N3 ), (175a) Monte Carlo method

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


method

Other methods
For each element we have the Galerkin residual References

condition ZZ
N R dx = 0. (176)
Ωe

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


‘Element’ formulation

Taking under consideration Poisson equation and the Contents


approximate solution Ûe it is now possible to express Description of fluid
at different scales
the residual as Turbulence
modelling
!
∂ 2 Ûe ∂ 2 Ûe
ZZ Finite difference
method
N 2
+ 2
+ a dx dy = 0. (177)
Ωe ∂x ∂y Finite element
method
Finite volume
method
The second derivative has to be replaced (due to Monte Carlo method
linear nature of the trial functions). This can be done Lattice Boltzmann
method
by means of Green’s first identity Other methods
ZZ  2 2

∂ ϕ ∂ ϕ ∂ϕ
Z
References
ψ 2 + ψ 2 dx dy = ψ dL
S ∂x ∂y ∂S ∂n
ZZ  
∂ψ ∂ϕ ∂ψ ∂ϕ
− + dx dy. (178)
S ∂x ∂x ∂y ∂y

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


‘Element’ formulation

Integration by means of Green’s identity makes it Contents


Description of fluid
possible to replace the second derivative at different scales
Turbulence
! modelling

∂N ∂ Ûe ∂N ∂ Ûe
ZZ Finite difference
+ dx dy method

Ωe ∂x ∂x ∂y ∂y Finite element
method
Finite volume
∂ Ûe
Z ZZ
method
− N dL − Na dx dy = 0. (179)
∂Ωe ∂n Ωe
Monte Carlo method
Lattice Boltzmann
method
The matrix form of the Galerkin residual condition for Other methods

each element can now be expressed References

ZZ  
∂N ∂N ∂N ∂N
ZZ
+ dx dy · Ue = Na dx dy.
Ωe ∂x ∂x ∂y ∂y Ωe

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


Element equation

Introducing the ‘stiffness’ matrix for each element e Contents


Description of fluid
at different scales
ZZ  
∂N ∂N ∂N ∂N Turbulence
Ke := + dx dy (180) modelling

Ωe ∂x ∂x ∂y ∂y Finite difference
method
Finite element
and the ‘displacement’ vector method
Finite volume
method
ZZ
Fe := Na dx dy (181) Monte Carlo method
Ωe Lattice Boltzmann
method

one may obtain the Galerkin residual condition for Other methods

References
each element in the form

Ke · Ue = Fe . (182)

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


Element equation

The expanded version of the ‘stiffness’ matrix is Contents


Description of fluid
at different scales
∂N1 ∂N1 ∂N1 ∂N1 ∂N1 ∂N2 ∂N1 ∂N2 ∂N1 ∂N3 ∂N1 ∂N3
!
ZZ
∂x ∂x
+ ∂y ∂y ∂x ∂x
+ ∂y ∂y ∂x ∂x
+ ∂y ∂y Turbulence
∂N1 ∂N2 ∂N1 ∂N2 ∂N2 ∂N2 ∂N2 ∂N2 ∂N2 ∂N3 ∂N2 ∂N3 modelling
Ke := ∂x ∂x
+ ∂y ∂y ∂x ∂x
+ ∂y ∂y ∂x ∂x
+ ∂y ∂y dx Finite
dy. difference
∂N1 ∂N3 ∂N1 ∂N3 ∂N2 ∂N3 ∂N2 ∂N3 ∂N3 ∂N3 ∂N3 ∂N3
Ωe ∂x ∂x
+ ∂y ∂y ∂x ∂x
+ ∂y ∂y ∂x ∂x
+ ∂y ∂y method
Finite element
method
Similarly, the same for the ‘displacement’ vector Finite volume
method
 
ZZ N1 Monte Carlo method
Lattice Boltzmann
Fe := a N2  dx dy. (183) method
Ωe N3 Other methods

References

The actual form of matrices depends on the trial


functions. Linear form of these are discussed further.

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


Linear trial function

Considering plane equation Contents


Description of fluid
at different scales
Ûe = a + bx + cy (184) Turbulence
modelling

one can formulate the following system of equations Finite difference


method
Finite element
U1 = a + bxi + cyi (185a) method
Finite volume
U2 = a + bxj + cyj (185b) method

Monte Carlo method


U3 = a + bxk + cyk (185c) Lattice Boltzmann
method

Other methods
for three different points (xi , yi ), (xj , yj ), (xk , yk ).
References
Solving these for a, b and c results in
U1 U2 U3
Ûe = (ai +bi x+ci y)+ (aj +bj x+cj y)+ (ak +bk x+ck y).
2Se 2Se 2Se

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


Linear trial function

The linear trial functions then are Contents


Description of fluid
at different scales
1 Turbulence
N1 = (ai + bi x + ci y), modelling
2Se Finite difference
1 method
N2 = (aj + bj x + cj y), Finite element
2Se method

1 Finite volume
N3 = (ak + bk x + ck y) method

2Se Monte Carlo method

where Lattice Boltzmann


method

Other methods
ai = xj yk − xk yj ; aj = xk yi − xi yk ; ak = xi yj − xj yi ;
References
bi = yj − yk ; bj = yk − yi ; bk = yi − yj ;
ci = x k − x j ; cj = x i − x k ; ck = x j − x i ;
1
Se = |ck bj − cj bk |;
2
K. Tesch; Fluid Mechanics – Applications and Numerical Methods 164
Linear interpolation

Contents
Description of fluid
at different scales
1 1
Turbulence
modelling
Finite difference
0.5 0.5
method
z

z
1 1
Finite element
method
0 0.5 0 0.5
0 0 Finite volume
0.5 y 0.5 y
1 0 1 0 method
x x
Monte Carlo method
Lattice Boltzmann
method
1 1
Other methods

References
0.5 0.5
z

1 1

0 0.5 0 0.5
0 0
0.5 y 0.5 y
1 0 1 0
x x

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


Integrals and derivatives

Now it is possible to calculate necessary derivatives Contents


Description of fluid
appearing in the ‘stiffness’ matrix at different scales
Turbulence
modelling
∂N1 bi ∂N2 bj ∂N3 bk
= , = , = , Finite difference
method
∂x 2Se ∂x 2Se ∂x 2Se Finite element
∂N1 ci ∂N2 cj ∂N3 ck method
= , = , = . Finite volume
∂y 2Se ∂y 2Se ∂y 2Se method

Monte Carlo method


The same concerns integrals appearing in the Lattice Boltzmann
method
‘displacement’ vector Other methods

References
α!β!γ!
ZZ
α β γ
N1 N2 N3 dx dy = 2Se . (188a)
Se (α + β + γ + 2)!

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


Element equation

Now it is possible to simplify the matrices even Contents


Description of fluid
further. For the linear trial functions one gets the at different scales
Turbulence
‘stiffness’ matrix modelling
 2 Finite difference
2

b + ci bi bj + ci cj bi bk + ci ck method
1  i Finite element
Ke = bi bj + ci cj b2j + c2j bj bk + cj ck  (189) method
4Se
bi bk + ci ck bj bk + cj ck b2k + c2k Finite volume
method

Monte Carlo method


and the ‘displacement vector’ Lattice Boltzmann
method

Other methods
 
a
Se  i  References
Fe = aj . (190)
3
ak

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


Four element example

Contents
Description of fluid
∂Ω at different scales
4(0, 10) 3(10, 10)
Turbulence
U =0 modelling
3 Finite difference
method
U =0

U =0
Finite element
Ω 4 5(5, 5) 2 method
Finite volume
method

U =0
1 Monte Carlo method
Lattice Boltzmann
1(0, 0) 2(10, 0) method

Other methods

References

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


Global matrix

The global assembly process (coupling) for the


Contents
considered four element case: Description of fluid
K 11 + K 11 at different scales
1 4 K112 0 K412 K113 + K413 
Turbulence
K112 K122 + K211 K212 0 K123 + K213
K = 0 K212 K222 + K311 K312 K223 + K313 modelling
.
Finite difference
K412 0 K312 K322 + K422 K323 + K423
method
K113 + K413 23
K1 + K213 K223 + K313 K323 + K423 K133 + K233 + K333 + K433 Finite element
method
The element matrices are identical Finite volume
method
 
1 0 −1 Monte Carlo method
1 Lattice Boltzmann
K1 = K2 = K3 = K4 = 0 1 −1 . method
2
−1 −1 1 Other methods

References
Finally, the global ‘stiffness’ matrix is
 1 0 0 0 −1
0 1 0 0 −1
K= 0 0 1 0 −1 .
0 0 0 1 −1
−1 −1 −1 −1 4

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


Global vector

The ‘displacement’ element vector for the considered Contents


Description of fluid
four elements at different scales
Turbulence
  modelling
1
25   Finite difference
F1 = F2 = F3 = F4 = 1 . method
3 Finite element
1 method
Finite volume
method
After the global assembly process one finally gets Monte Carlo method
Lattice Boltzmann
1 1
   
F1 + F4 1 method

2 1 Other methods
 F 1 + F2
 1
 50  
 References
2 1
F= F2 + F3 = 1 .
 2 2
 3  
 F3 + F4  1
F13 + F23 + F33 + F43 2

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


Poisson FEM pseudocode

Contents
Data: Read N elements, nodes and BCs Description of fluid
Create global matrix K and vectors F, y; at different scales
Turbulence
for e ← 1 to Ndo  modelling
Finite difference
Ke ← Ωe ∂N ∂N ∂N ∂N
RR
∂x ∂x
+ ∂y ∂y
dx dy; method
RR Finite element
Fe ← Ωe Na dx dy; method
Finite volume
Add Ke to K; method

Add Fe to F; Monte Carlo method


Lattice Boltzmann
method
Apply BCs;
Other methods
Solve linear system K · y = F; References

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


Results - PDE

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
6 Finite element
method
3 Finite volume
10 method
0 8 Monte Carlo method
6
2 4 Lattice Boltzmann
4 method
6 2
8 Other methods
10
References
4 elements, 5 nodes

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


Results - PDE

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
6 method
Finite element
3 method
10 Finite volume
0 8 method
6
2 4 Monte Carlo method
4
6 2 Lattice Boltzmann
8 method
10
Other methods
8 elements, 9 nodes
References

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


Results - PDE

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
6 method
Finite element
3 method
10 Finite volume
0 8 method
6
2 4 Monte Carlo method
4
6 2 Lattice Boltzmann
8 method
10
Other methods
50 elements, 36 nodes References

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


Results - PDE

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
6
Finite element
method
3
10 Finite volume
0 8 method
6 Monte Carlo method
2 4
4 Lattice Boltzmann
6 2 method
8
10 Other methods
200 elements, 121 nodes References

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


Results - PDE

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
6
Finite element
method
3
10 Finite volume
0 8 method
6 Monte Carlo method
2 4
4 Lattice Boltzmann
6 2 method
8
10 Other methods
800 elements, 441 nodes References

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


FEM for Laplace equation

Let the two dimensional form of Laplace equation Contents


Description of fluid
at different scales
∂ 2ϕ ∂ 2ϕ Turbulence

2
+ 2 =0 (191) modelling
∂x ∂y Finite difference
method
Finite element
or ∇2 ϕ = 0 on Ω be subjected to both boundary method

conditions on ∂Ω: Finite volume


method

■ Neumann Monte Carlo method


Lattice Boltzmann
method
∂ϕ
= n̂·∇ϕ = n̂·(Ux , Uy ) = nx Ux +ny Uy =: −fN , Other methods
∂n References

■ Dirichlet (as previously)

ϕ = const =: fD . (192)

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


‘Element’ formulation
As previously, FEM formulation for Poisson equation
subjected to Dirichlet and Neumann BCs is Contents
! Description of fluid
at different scales
∂N ∂ Ûe ∂N ∂ Ûe
ZZ
+ dx dy Turbulence
modelling
Ωe ∂x ∂x ∂y ∂y
Finite difference
method
∂ Ûe
Z ZZ
Finite element
− N dL − Na dx dy = 0. method
∂Ωe ∂n Ωe Finite volume
method
■ Poisson ∇2 ϕ = −a with Dirichlet BC Monte Carlo method
ZZ   Lattice Boltzmann
∂N ∂N ∂N ∂N
ZZ
method
+ dx dy·Ue = Na dx dy, Other methods
Ωe ∂x ∂x ∂y ∂y Ωe References

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


ZZ  
∂N ∂N ∂N ∂N
Z
+ dx dy·ϕe = − NfN dL.
Ωe ∂x ∂x ∂y ∂y ∂Ωe

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


Element equation

Introducing the ‘stiffness’ matrix as previously for Contents


Description of fluid
each element e at different scales
Turbulence
ZZ   modelling
∂N ∂N ∂N ∂N
Ke := + dx dy (193) Finite difference

Ωe ∂x ∂x ∂y ∂y method
Finite element
method
and the ‘displacement’ vector Finite volume
method

Monte Carlo method


Z
Fe := − NfN dL (194) Lattice Boltzmann
method
∂Ωe
Other methods

one may obtain the Galerkin residual condition for References

each element in the form

Ke · ϕe = Fe . (195)

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


Element equation

The expanded version of the ‘stiffness’ matrix look the Contents


Description of fluid
same as previously but the ‘displacement’ vector is at different scales
Turbulence
now modelling
Finite difference
1
Z
method
Fe := fN N dL = − |L|fN 1. (196) Finite element
∂Ωe 2 method
Finite volume
method
The vector 1 may take of the three following forms Monte Carlo method
      Lattice Boltzmann
1 1 0 method

1 , 0 , 1 . Other methods


(197)
References
0 1 1

|L| stands for element side length.

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


Laplace FEM pseudocode

Contents
Data: Read N elements, nodes and BCs Description of fluid
Create global matrix K and vectors F, y; at different scales
Turbulence
for e ← 1 to Ndo  modelling
Finite difference
Ke ← Ωe ∂N ∂N ∂N ∂N
RR
∂x ∂x
+ ∂y ∂y
dx dy; method
R Finite element
Fe ← − ∂Ωe NfN dL; method
Finite volume
Add Ke to K; method

Add Fe to F; Monte Carlo method


Lattice Boltzmann
method
Apply BCs;
Other methods
Solve linear system K · y = F; References

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


Geometry and mesh - Laplace equation
∂ϕ
=0
∂y
Contents
Description of fluid
at different scales

ϕ = const
= Ux
Turbulence
∂ϕ modelling
=0
∂n
Finite difference
∂ϕ
∂x

method
∂ϕ
=0 Finite element
∂y
method
Finite volume
method

Monte Carlo method


456 nodes and 818 elements Lattice Boltzmann
method

Other methods

References

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


Results - Laplace equation

Contents
Description of fluid
at different scales
1 Turbulence
modelling
Finite difference
−2 method
Finite element
−1 method
0 1 Finite volume
1 method

2 0 Monte Carlo method


Lattice Boltzmann
method

2 Other methods

References
1
−1
0 1
1
2 0

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


Geometry and mesh - Laplace equation
∂ϕ
=0
∂y
Contents
Description of fluid
= Ux
at different scales

ϕ = const
Turbulence
modelling
∂ϕ
∂x

Finite difference
∂ϕ method
∂ϕ =0 ∂ϕ
=0 ∂n =0 Finite element
∂y ∂y
method
Finite volume
method

Monte Carlo method


351 nodes and 607 elements Lattice Boltzmann
method

Other methods

References

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


Results - Laplace equation

Contents

1 Description of fluid
at different scales
Turbulence
modelling
−2 Finite difference
−1 method

0 1 Finite element
method
1 Finite volume
2 0 method

2 Monte Carlo method


Lattice Boltzmann
method
1 Other methods

References
0
−1
0 1
1
2 0

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


Creeping flow – Stokes equations

Contents
Re ≪ 1 Description of fluid
at different scales
Turbulence
modelling
0 = ρg − ∇p + µ∇2 U, Finite difference
method
∇ · U = 0. Finite element
method
Finite volume
method
∂ 2 Ux ∂ 2 Ux
 
∂p
0 = ρgx − +µ 2
+ 2
, Monte Carlo method
∂x ∂x ∂y Lattice Boltzmann
 2 method
2

∂p ∂ Uy ∂ Uy Other methods
0 = ρgy − +µ 2
+ 2
,
∂y ∂x ∂y References

∂Ux ∂Uy
+ = 0.
∂x ∂y

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


FEM formulation

The approximate solution is expressed as Contents


Description of fluid
at different scales

Ûe = N · Ue Turbulence
modelling
Finite difference
where the quadratic trial functions N and the method
Finite element
unknown nodal values Ue are method
Finite volume
method
N := (N1 , N2 , N3 , N4 , N5 , N6 ), Monte Carlo method

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


method

Other methods
For each element we have the Galerkin residual References

condition ZZ
N R dx = 0.
Ωe

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


Quadratic interpolation

The quadratic
Contents
trial func- Description of fluid
tions can be at different scales
Turbulence
expressed in modelling

terms of linear Finite difference


method
trial functions Finite element
method
Finite volume
N1 := L1 (2L1 − 1) , method

Monte Carlo method


N2 := L2 (2L2 − 1) , Lattice Boltzmann
method
N3 := L3 (2L3 − 1) , Other methods
N4 := 4L1 L2 , References

N5 := 4L2 L3 ,
N6 := 4L1 L3 .

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


Momentum conservation equation

The Galerkin residual condition Contents


Description of fluid
!! at different scales

∂ p̂e ∂ 2 Ûxe ∂ 2 Ûxe


ZZ
Turbulence
N ρgx − +µ 2
+ dx dy = 0 modelling

Ωe ∂x ∂x ∂y 2 Finite difference
method
Finite element
by means of Green’s first identity method
Finite volume
method
ZZ  2 2

∂ ϕ ∂ ϕ ∂ϕ
Z
Monte Carlo method
ψ 2 + ψ 2 dx dy = ψ dL Lattice Boltzmann
S ∂x ∂y ∂S ∂n method
ZZ  
∂ψ ∂ϕ ∂ψ ∂ϕ Other methods

− + dx dy References
S ∂x ∂x ∂y ∂y

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


Momentum conservation equation

is Contents
Description of fluid
at different scales
∂N
ZZ ZZ
Turbulence
ρgx N dx dy − N dx dy · pe modelling

Ωe Ωe ∂x Finite difference
ZZ   method
∂N ∂N ∂N ∂N Finite element
−µ + dx dy · Uxe = 0 method
Ωe ∂x ∂x ∂y ∂y Finite volume
method
or Monte Carlo method

Kpxe · pe + Kxye · Uxe = gx Fe . Lattice Boltzmann


method

Other methods
Similarly
References

Kpye · pe + Kxye · Uye = gy Fe .

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


Momentum conservation equation

Contents
∂N
ZZ
Kpxe := N dx dy Description of fluid

Ωe ∂x at different scales
Turbulence
modelling
∂N
ZZ
Finite difference
Kpye := N dx dy method
Ωe ∂y Finite element
method
Finite volume
  method
∂N ∂N ∂N ∂N
ZZ
Kxye := µ + dx dy Monte Carlo method

Ωe ∂x ∂x ∂y ∂y Lattice Boltzmann
method

ZZ Other methods

Fe := ρ N dx dy References

Ωe

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


Mass conservation equation

The Galerkin residual condition Contents


Description of fluid
! at different scales

∂ Ûxe ∂ Ûye
ZZ
Turbulence
N + dx dy = 0. modelling

Ωe ∂x ∂y Finite difference
method
Finite element
The matrix form of the Galerkin residual condition for method
Finite volume
each element can now be expressed method

Monte Carlo method


∂N ∂N
ZZ ZZ
Lattice Boltzmann
N dx dy · Uxe + N dx dy · Uye = 0 method

Ωe ∂x Ωe ∂y Other methods

References
or
Kuxe · Uxe + Kuye · Uye = 0.

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


Mass conservation equation

Contents
∂N
ZZ
Kuxe := N dx dy Description of fluid

Ωe ∂x at different scales
Turbulence
modelling
∂N
ZZ
Finite difference
Kuye := N dx dy method
Ωe ∂y Finite element
method
Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Element equations

Contents
Description of fluid
at different scales
Kpxe · pe + Kxye · Uxe = gx Fe , Turbulence
modelling
Kpye · pe + Kxye · Uye = gy Fe ,
Finite difference
Kuxe · Uxe + Kuye · Uye = 0 method
Finite element
method
Finite volume
method

6×6 Monte Carlo method


K6×6 K6×3
   6×1   6×1

xye 0 pxe Uxe gx Fe Lattice Boltzmann
6×6
 0 K6×6
xye
6×3 
Kpye · U6×1
ye
 =  gy F 6×1 
e
method

3×3 3×1
K3×6
uxe K3×6
uye 0 p3×1
e 0 Other methods

References

K15×15
e · u 15×1
e = fe
15×1

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element

Finite volume method method


Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


The method
Equations are investigated in integral form in
comparison with FDM. FVM is more flexible than Contents
Description of fluid
FDM in terms of spatial discretisation. at different scales

Let us consider differential form of the general Turbulence


modelling
transport equation Finite difference
method
Finite element
∂(ρf ) method
+ ∇ · (ρf U) = ∇ · (Γ∇f ) + Sf . (203) Finite volume
∂t method

Monte Carlo method


To obtain the integral form of this equation one needs Lattice Boltzmann
method
Gauss’s (divergence) theorem. Two dimensional
Other methods
version has the following form References
ZZ I
∇ · w dΩ = w · dL (204)
Ωi ∂Ω+
i

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

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


Integral form

Integrating over the two dimensional domain (finite Contents


‘volume’) Ωi and utilising Gauss’s theorem results in Description of fluid
at different scales
Turbulence
d
ZZ I I ZZ
modelling
ρf dΩ+ ρf U · dL = Γ∇f · dL+ Sf dΩ. Finite difference
dt Ωi ∂Ω+
i ∂Ω+
i Ωi method
Finite element
method
For the sake of simplicity it is further assumed that we Finite volume
deal with an incompressible case ρ = const. method

Monte Carlo method


First and last integral in the above equation suggest Lattice Boltzmann
the following definition of an average f¯i value of f method

Other methods
over Ωi
1
ZZ References
¯
fi := f dΩ. (205)
|Ωi | Ωi
The average value fi is typically located at the centre
of the volume Ωi .

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


Spatial discretisation

The next step would be the spatial discretisation over Contents


Description of fluid
the volume Ωi boundary ∂Ωi . The line integral at different scales
Turbulence
represents the total flux out of volume Ωi and is modelling

replaced by a sum Finite difference


method
I Finite element
method
X
w · dL ≈ wk · ∆Lk . (206) Finite volume
∂Ω+
i k
method

Monte Carlo method


Lattice Boltzmann
Boundary ∂Ωi consists of lines indexed by subscript k. method

There are at least three lines (triangle). The vector w Other methods

is either f U or Γ∇f . Because that vector w is References

typically not constant along each line it has to be


approximated by a single value wk at the centre of
each line.

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


Time discretisation

The last step would be time discretisation. Among Contents


many possibilities the simplest is the first order Description of fluid
at different scales
forward finite difference approximation Turbulence
modelling

df¯i f¯in+1 − f¯in Finite difference


method
≈ . (207)
dt ∆t Finite element
method
Finite volume
Time step of this approximation is denoted here as ∆t. method

Finally, one gets the following discretised version of Monte Carlo method
Lattice Boltzmann
transport equation (i.e. Finite Volume Scheme) method

f¯in+1 − f¯in
Other methods
X
ρ |Ωi | + ρ (f U)k · ∆Lk = References
∆t k
X
(Γ∇f )k · ∆Lk + S̄f i |Ωi |. (208)
k
|Ωi | stands for the area of control volume Ωi .
K. Tesch; Fluid Mechanics – Applications and Numerical Methods 199
1D FVM diffusion problem

Contents
∆xi−1 ∆xi+1
Description of fluid
at different scales
xi− 1 xi+ 1 Turbulence
2 2
modelling
Finite difference
xi−1 xi xi+1 method
∆xi Finite element
method
Finite volume
∆x1 ∆xN method
2 2
Monte Carlo method
Lattice Boltzmann
x0 xN +1 method
x1 x2 x3 = xN
Other methods
∆x1 ∆xN
References

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


1D FVM diffusion problem

One dimensional and steady state diffusion equation Contents


of a f quantity arises from the general transport Description of fluid
at different scales
equation (convection-diffusion equation) Turbulence
modelling

∂(ρf ) Finite difference


method
+ ∇ · (ρUf ) = ∇ · (Γ∇f ) + Sf . (209)
∂t Finite element
method
Finite volume
If the diffusion coefficient Γ is constant then the method

above equation simplifies to Monte Carlo method


Lattice Boltzmann
method
∇ · (Γ∇f ) + Sf = 0 (210) Other methods

References

or more precisely
 
d df
Γ + Sf = 0. (211)
dx dx

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


1D FVM diffusion problem

The integral form of one dimensional diffusion Contents


Description of fluid
equation takes the following form at different scales
Turbulence
Z x 1   Z x 1 modelling
i+ 2 d df i+ 2
Finite difference
Γ dx + Sf dx = 0. (212) method
x 1 dx
i− 2
dx x 1 i− 2 Finite element
method
Finite volume
There is no need to take advantage of Gauss’s method

theorem. This is because the first term can be Monte Carlo method
Lattice Boltzmann
integrated directly method

Other methods
   
df df References
Γ − Γ + S̄f i ∆xi = 0 (213)
dx i+ 1 dx i− 1
2 2

where ∆xi := xi+ 1 − xi− 1 .


2 2

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


1D FVM diffusion problem - Dirichlet BC

The average value of Sf at the centre of finite volume Contents


Description of fluid
can be approximated by means of trapezoidal rule by at different scales
Turbulence
means of known values of Sf at the boundary of finite modelling

volume Finite difference


Sf i− 1 + Sf i+ 1 method
2 2
S̄f i = . (214) Finite element
method
2 Finite volume
Let us consider ODE method

Monte Carlo method

′′ Lattice Boltzmann
y (x) + 20x = 0 (215) method

Other methods

subjected to the Dirichlet boundary conditions References

y(0) = y(1) = 0. The specific solution is


10 3
y(x) := − (x − x). (216)
3

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


1D FVM diffusion problem
In other word, the diffusion coefficient Γ := 1 and
source term Sf := 20x. If so, then discrete version of Contents
Description of fluid
one dimensional diffusion equation is now at different scales
Turbulence
modelling
dfi+ 1 dfi− 1 Finite difference
2 2
− + S̄f i ∆xi = 0. (217) method
dx dx Finite element
method
Derivatives or diffusive fluxes at the boundary of finite Finite volume
method
volume are approximated by means of the second Monte Carlo method
order scheme as Lattice Boltzmann
method

dfi+ 1 fi+1 − fi Other methods


2
≈ , (218a) References
dx xi+1 − xi
dfi− 1 fi − fi−1
2
≈ . (218b)
dx xi − xi−1

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


1D FVM diffusion problem
The specific form of a finite volume scheme is now
Contents

fi+1 − fi fi − fi−1 Description of fluid


− + S̄f i ∆xi = 0. (219) at different scales
xi+1 − xi xi − xi−1 Turbulence
modelling

It can also be rewritten to give fi as a function of Finite difference


method
surrounding variables Finite element
method
Finite volume
∆xi+1 fi−1 + ∆xi−1 fi+1 + S̄f i ∆xi−1 ∆xi+1 ∆xi method
fi =
∆xi−1 + ∆xi+1 Monte Carlo method
Lattice Boltzmann
method
where ∆xi−1 := xi − xi−1 and ∆xi+1 := xi+1 − xi . Other methods
For ∆xi−1 = ∆xi+1 = ∆xi = h (i.e. uniform mesh) References

the finite volume scheme is reduced to a finite


difference scheme
fi−1 + fi+1 + S̄f i h2
fi = . (220)
2

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


1D FVM pseudocode

Data: Read volumes data and BCs Contents


Description of fluid
Create nodes and ghost nodes; at different scales

n ← 1; Turbulence
modelling
repeat Finite difference
method
R ← 0; Finite element
for i ← 2 to imax − 1 do method
n +∆x
∆xi+1 fi−1 n Finite volume
i−1 fi+1 +S̄f i ∆xi−1 ∆xi+1 ∆xi
fin+1 ← ∆xi−1 +∆x i+1
; method

Monte Carlo method


n+1 n

R← max |fi − fi |, R ; Lattice Boltzmann
method
Update ghost nodes; Other methods
n ← n + 1; References

until n ≤ nmax and R > Rmin ;

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


Results for nonuniform and uniform grids
1.5
Contents
Description of fluid
1 at different scales
Turbulence
y

modelling

0.5 Finite difference


method
Finite element
method
0
0.2 0.5 0.72 0.92 Finite volume
method
x
1.5 Monte Carlo method
Lattice Boltzmann
method
1 Other methods

References
y

0.5

0
0.13 0.38 0.63 0.88
x

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


1D FVM diffusion problem - Neumann BC

Let us consider the same ordinary differential equation Contents


Description of fluid
at different scales

y ′′ (x) + 20x = 0 (221) Turbulence


modelling
Finite difference
subjected to both the Dirichlet y(0) = 0 and method
Finite element
Neumann y ′ (1) = 0 boundary conditions. The specific method

solution is now Finite volume


method
 2  Monte Carlo method
x Lattice Boltzmann
y(x) := −10x −1 . (222) method
3 Other methods

References

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


Results for nonuniform and uniform grids

6 Contents
Description of fluid
at different scales
4 Turbulence
y

modelling

2 Finite difference
method
Finite element
0 method
0.2 0.5 0.72 0.92 Finite volume
x method

Monte Carlo method


6 Lattice Boltzmann
method

4 Other methods
y

References

0
0.13 0.38 0.63 0.88
x

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


2D FVM diffusion problem

Two dimensional and steady state diffusion equation Contents


Description of fluid
of a f quantity arises, as previously, from the general at different scales
Turbulence
transport equation (convection-diffusion equation) modelling
Finite difference
method
∇ · (Γ∇f ) + Sf = 0 (223) Finite element
method

If the diffusion coefficient is constant Γ := 1 and the Finite volume


method
source term Sf := a then the above equation Monte Carlo method

simplifies to Lattice Boltzmann


method
∇ · ∇f + a = 0 (224) Other methods

References
2
or ∇ f = −a which is Poisson equation.

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


2D FVM diffusion problem

The discrete version of the diffusion equation Contents


Description of fluid
(simplified version of general transport equation) is at different scales
Turbulence
X modelling

(Γ∇f )k · ∆Lk + S̄f ij |Ωij | = 0. (225) Finite difference


method
k Finite element
method

For a structural and Cartesian mesh (next slide) the Finite volume
method
normal ∆Lk vectors are Monte Carlo method
Lattice Boltzmann
method
∆LAB = |AB|ı̂ = ∆yi ı̂, (226a) Other methods

∆LBC = |BC|̂ = ∆xi ̂, (226b) References

∆LCD = |CD| (−ı̂) = −∆yi ı̂, (226c)


∆LDA = |DA| (−̂) = −∆xi ̂. (226d)

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


2D FVM diffusion problem

Contents
Description of fluid
fi−1j+1 fij+1 fi+1j+1 at different scales
Turbulence
modelling
~ BC
∆L Finite difference
method

C B Finite element
method
fi−1j fij fi+1j Finite volume
method
~ CD
∆L ~ AB
∆L Monte Carlo method
D A Lattice Boltzmann
method
~ DA
∆L Other methods
fi−1j−1 fi+1j−1
References
fij−1

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


2D FVM diffusion problem
The discrete version of two dimensional diffusion
equation is now Contents
Description of fluid
at different scales

∂fi+ 1 j ∂fij+ 1 Turbulence


modelling
2 2
Γ ∆yi + Γ ∆xi
∂x ∂y Finite difference
method
∂fi− 1 j ∂fij− 1 Finite element
2 2
−Γ ∆yi − Γ ∆xi + S̄f ij |Ωij | = 0 method
∂x ∂y Finite volume
method
(227) Monte Carlo method
where the area of volume Ωij is |Ωij | = ∆xi ∆yi and Lattice Boltzmann
method
the diffusion coefficient is constant Γ := 1. If so, then
Other methods

References
∂fi+ 1 j ∂fij+ 1 ∂fi− 1 j
2 2 2
∆yi + ∆xi − ∆yi
∂x ∂y ∂x
∂fij− 1
2
− ∆xi + S̄f ij ∆xi ∆yi = 0. (228)
∂y
K. Tesch; Fluid Mechanics – Applications and Numerical Methods 213
2D FVM diffusion problem

The average value of Sf at the centre of finite volume Contents


Description of fluid
is approximated by means of known values of Sf at at different scales
Turbulence
the boundary of finite volume modelling
1  
S̄f ij = Sf i− 1 j− 1 + Sf i+ 1 j− 1 Sf i− 1 j+ 1 + Sf i+ 1 j+ 1 . Finite difference
method
4 2 2 2 2 2 2 2 2
Finite element
method
Derivatives at the boundary of finite volume are Finite volume
method
approximated by means of the second order scheme as
Monte Carlo method
Lattice Boltzmann
∂fi+ 1 j fi+1j − fij fi+1j − fij method
2
≈ = , (229a) Other methods
∂x xi+1j − xij ∆xi+1 References
∂fij+ 1 fij+1 − fij fij+1 − fij
2
≈ = , (229b)
∂y yij+1 − yij ∆yj+1

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


2D FVM diffusion problem

Contents
Description of fluid
∂fi− 1 j fij − fi−1j fij − fi−1j at different scales
2
≈ = , (230a) Turbulence
∂x xij − xi−1j ∆xi−1 modelling
Finite difference
∂fij− 1 fij − fij−1 fij − fij−1 method
2
≈ = . (230b) Finite element
∂y yij − yij−1 ∆yj−1 method
Finite volume
method
The specific form of a finite volume scheme is now Monte Carlo method
Lattice Boltzmann
fi−1j ∆yi fi+1j ∆yi fij−1 ∆xi fij+1 ∆xi method
S̄f ij ∆xi ∆yi + + + + − Other methods
∆xi−1 ∆xi+1 ∆yj−1 ∆yj+1 References
 
∆yi ∆yi ∆xi ∆xi
fij + + + = 0.
∆xi−1 ∆xi+1 ∆yj−1 ∆yj+1

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


2D FVM diffusion problem

It can also be rewritten to give fij as a function of Contents


surrounding variables Description of fluid
at different scales
Turbulence
fi−1j ∆yi fi+1j ∆yi fij−1 ∆xi fij+1 ∆xi modelling
∆xi−1
+ ∆xi+1
+ ∆yj−1
+ ∆yj+1
+ S̄f ij ∆xi ∆yi
Finite difference
fij = ∆yi ∆yi ∆xi ∆xi
. method
∆xi−1
+ ∆xi+1 + ∆yj−1 + ∆yj+1 Finite element
method
Finite volume
For method

∆xi = ∆yi = ∆xi−1 = ∆xi+1 = ∆yi−1 = ∆yi+1 = h Monte Carlo method


Lattice Boltzmann
(i.e. uniform mesh) the finite volume scheme reduced method

to a finite difference scheme for Poisson equation Other methods

References

fi−1j + fi+1j + fij−1 + fij+1 + S̄f ij h2


fij = . (231)
4

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


2D FVM pseudocode
Data: Read volumes data and BCs
Create nodes and ghost nodes; Contents

n ← 1; Description of fluid
at different scales
repeat Turbulence
modelling
R ← 0;
Finite difference
for i ← 2 to imax − 1 do method

for j ← 2 to jmax − 1 do Finite element


method
fijn+1 ← Finite volume
n n n n method
fi−1j ∆yi fi+1j ∆yi fij−1 ∆xi fij+1 ∆xi
∆xi−1
+ ∆xi+1
+
∆yj−1 ∆yj+1
+ +S̄f ij ∆xi ∆yi Monte Carlo method
∆yi ∆yi ∆xi ∆xi ; Lattice Boltzmann
∆xi−1
+ ∆xi+1
+ ∆yi−1
+ ∆yi+1 method

Other methods
 
R ← max |fijn+1 − fijn |, R ;
References

Update ghost nodes;


n ← n + 1;
until n ≤ nmax and R > Rmin ;

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


Nonuniform and uniform volumes and nodes

Contents
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

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


Results for nonuniform and uniform mesh

Contents
Description of fluid
at different scales
Turbulence
modelling
6 6
Finite difference
3 10 3 10 method

0 8 0 8 Finite element
0 6 0 6 method
2 4 2 4
4 4 Finite volume
6 2 6 2
8 8 method
10 0 10 0
Monte Carlo method
Lattice Boltzmann
method

Other methods

References

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


Results for nonuniform and uniform mesh

Contents
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

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element

Monte Carlo method method


Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Monte Carlo integration

1 1 Contents
Description of fluid
at different scales
0.8 0.8
Turbulence
modelling
0.6 0.6 Finite difference
method
y

y
0.4 0.4 Finite element
method
Finite volume
0.2 0.2 method

Monte Carlo method


0 0 Lattice Boltzmann
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x method

f (x) := xx Other methods

References

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


Monte Carlo integration

The simplest Monte Carlo integration is based on Contents


Description of fluid
sampling uniformly distributed points (U , U ) at different scales
Turbulence
modelling
1 n
1
Z
Finite difference
X
f (x) dx ≈ F (U , U ) (232) method
0 n i=1 Finite element
method
Finite volume
where ( method

1; if f (x) ≥ y Monte Carlo method


F (x, y) := . (233) Lattice Boltzmann
0; otherwise method

Other methods

References

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


Estimation of π

Contents
1
Description of fluid
at different scales
Turbulence
modelling
0.5
Finite difference
method
Finite element
method
0
y

Finite volume
method

Monte Carlo method


−0.5 Lattice Boltzmann
method

Other methods

References
−1
−1 −0.5 0 0.5 1
x

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


Estimation of π

Contents
The area |D| = π of an unit circle Description of fluid
at different scales
2 2

D := (x, y) : x + y ≤ 1 (234) Turbulence
modelling
Finite difference
is estimated as method
Finite element
method
n
4
ZZ X Finite volume
π= F (x) dx ≈ F (U , U ) (235) method

D n i=1 Monte Carlo method


Lattice Boltzmann
method
where Other methods
( References
2 2
1; if x + y ≤ 1
F (x, y) := . (236)
0; otherwise

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


Wiener process and random walk 1D

1 Contents
Description of fluid
at different scales
0.8
Turbulence
modelling
0.6 Finite difference
method
0.4 Finite element
method
0.2 Finite volume
method
0 Monte Carlo method
0 20 40 60 80 100 Lattice Boltzmann
method

Other methods

References

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


Poisson equation

Poisson equation subjected to the Dirichlet boundary Contents


Description of fluid
condition at different scales
Turbulence
modelling
∇2 U (x) = −f (x); ∀x ∈ Ω, (237a) Finite difference
method
U (x) = g(x); ∀x ∈ ∂Ω. (237b) Finite element
method
Finite volume
It can be solved as an expected value of random paths method

of a stochastic process Monte Carlo method


Lattice Boltzmann
 Z τ  method

U (x) = E g(Wτ ) + 21 f (Wt ) dt (238) Other methods

References
0

where t is a terminal time of a random walk

τ = inf {t : Wt ∈ ∂Ω} . (239)

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


Poisson equation

Contents
If the Dirichlet boundary condition is g(x) = 0 then Description of fluid
at different scales
Z τ 
Turbulence
U (x) = 12 E f (Wt ) dt . (240) modelling

0 Finite difference
method
Finite element
We can also estimate method
Finite volume
Z τ m m method
X X h
f (Wt ) dt ≈ fi (Wτ )∆t = fi (Wτ ) . Monte Carlo method

0 i=1 i=1
V (h) Lattice Boltzmann
method
(241) Other methods

Let us consider an ordinary differential equation References

y ′′ (x) = −20x subjected to boundary conditions


y(0) = y(1) = 0 (i.e. U := y, f (x) := 20x,
g(x) := 0).

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


Monte Carlo ODE pseudocode

Contents
Data: Read input variables Description of fluid
for i ← 1 to imax do at different scales
Turbulence
if not boundary(xi ) then modelling

S ← 0; Finite difference
method
for k ← 1 to n do Finite element
method
I ← 0; Finite volume
method
α ← i;
Monte Carlo method
while not boundary(xα ) do Lattice Boltzmann
α ← α + 2⌊U (0, 1) + 12 ⌋ − 1; method

Other methods
I ← I + 20f (xα ); References
S ← S + I;
h2 S
yi ← 2 n ;

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


Results – ODE

n = 10 Contents
Description of fluid
at different scales
Turbulence
modelling
1.5
Finite difference
method
Finite element
1 method
Finite volume
y

method

Monte Carlo method


0.5
Lattice Boltzmann
method

Other methods
0
0 0.2 0.4 0.6 0.8 1 References

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


Results – ODE

n = 100 Contents
Description of fluid
at different scales
Turbulence
modelling
1.5
Finite difference
method
Finite element
1 method
Finite volume
y

method

Monte Carlo method


0.5
Lattice Boltzmann
method

Other methods
0
0 0.2 0.4 0.6 0.8 1 References

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


Results – ODE

n = 1000 Contents
Description of fluid
at different scales
Turbulence
modelling
1.5
Finite difference
method
Finite element
1 method
Finite volume
y

method

Monte Carlo method


0.5
Lattice Boltzmann
method

Other methods
0
0 0.2 0.4 0.6 0.8 1 References

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


Monte Carlo Poisson pseudocode

Data: Read input variables and BCs


Contents
for i ← 1 to imax do Description of fluid
at different scales
for j ← 1 to jmax do Turbulence
if not boundary(Uij ) then modelling
Finite difference
τn ← 0; method

for k ← 1 to n do Finite element


method
S ← 0; Finite volume
method
α ← i; β ← j; Monte Carlo method
while not boundary(Uαβ ) do Lattice Boltzmann

α ← α + 2⌊U (0, 1) + 12 ⌋ − 1; method

Other methods
β ← β + 2⌊U (0, 1) + 12 ⌋ − 1; References
S ← S + 1;
τn ← τn + S;
a h2 τn
Uij ← − 2 n ;

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


Results – Poisson equation

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
6 method
Finite element
3 method
10 Finite volume
0 8 method
2 6 Monte Carlo method
4 4
6 Lattice Boltzmann
8 2 method
10
Other methods
n = 10 References

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


Results – Poisson equation

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
6 method
Finite element
3 method
10 Finite volume
0 8 method
2 6 Monte Carlo method
4 4
6 Lattice Boltzmann
8 2 method
10
Other methods
n = 50 References

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


Results – Poisson equation

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
6 method
Finite element
3 method
10 Finite volume
0 8 method
2 6 Monte Carlo method
4 4
6 Lattice Boltzmann
8 2 method
10
Other methods
n = 100 References

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


Results – Poisson equation

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
6 method
Finite element
3 method
10 Finite volume
0 8 method
2 6 Monte Carlo method
4 4
6 Lattice Boltzmann
8 2 method
10
Other methods
n = 500 References

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


Results – Poisson equation

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
6 method
Finite element
3 method
10 Finite volume
0 8 method
2 6 Monte Carlo method
4 4
6 Lattice Boltzmann
8 2 method
10
Other methods
n = 5000 References

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element

Lattice Boltzmann method method


Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Definitions and ideas

The kinetic theory of gases treats gas as a large Contents


Description of fluid
number of small molecules. They are in constant (and at different scales
Turbulence
random) motion and constantly collide with one modelling

another. Finite difference


method
Knowing the position and velocity of each particle at Finite element
method
some instant in time it would be possible to know the Finite volume
exact dynamical state of the whole system. The method

Monte Carlo method


motion of particles could then be described by means Lattice Boltzmann
of classical mechanics. This would allow for prediction method

of all future states of the system. Other methods

References
Due to the large number of molecules a statistical
treatment is possible and necessary.

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


Assumptions

■ The gas is compose of small molecules which Contents


means that the average distance separating Description of fluid
at different scales
particles is large in comparison with their size. Turbulence
modelling
■ Molecules are in constant and random motion
Finite difference
■ The large number of molecules make it possible to method
Finite element
apply statistical treatment method

■ Molecules have the same mass and spherical Finite volume


method
shape Monte Carlo method
■ Molecules constantly and elastically collide Lattice Boltzmann
method
■ The only interaction is due to collision (no other Other methods
forces on one another) References

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


Phase space and the distribution function

For N molecules we can think of phase space in which Contents


Description of fluid
the coordinates consist of the position xi , velocity at different scales
Turbulence
vectors (vi ) and the time t. For a three dimensional modelling

case we have 6N dimensional phase space (three Finite difference


method
coordinates + three velocities times N molecules). Finite element
method
The system can be described by a probability Finite volume
distribution function f that depends on 6N variables method

Monte Carlo method


plus time t. Lattice Boltzmann
For a single molecule this reduces to 6 dimensional method

phase space (x1 , x2 , x3 , v1 , v2 , v3 ). This can be Other methods

References
treated as a statistical approach in which a system is
represented by an ensemble of many copies.

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


Interpretation of the distribution function

The elementary volume and dV and product dv of Contents


Description of fluid
elementary velocities are defined as at different scales
Turbulence
YD D
Y modelling

dV := dxi , dv := dvi (242) Finite difference


method
i=1 i=1 Finite element
where D means the physical dimension size. The method
Finite volume
distribution f that depends on r, v, t represents the method

probability of finding a particular molecule mass with Monte Carlo method


Lattice Boltzmann
a given position and velocity per unit phase space. method
Z Z Other methods
f (r, v, t) dV dv (243) References

RD RD
The above integrate represents the total mass of
molecules.

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


Continuous Boltzmann equation

If no collisions occur then the probability of finding a Contents


Description of fluid
particular molecule mass with a given position and at different scales
Turbulence
velocity at (r, v, t) equals the probability at modelling

(r + dr, v + dv, t + dt) Finite difference


method
Finite element
f (r+ dr, v + dv, t+ dt) dV dv −f (r, v, t) dV dv = 0. method
Finite volume
method
If, however, collisions take place then Monte Carlo method
Lattice Boltzmann
method
f (r + dr, v + dv, t + dt) dV dv − f (r, v, t) dV dv = Other methods

References
Ω(f ) dV dv dt

where Ω is so called collision operator. It takes under


consideration collisions during dt interval.

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


Continuous Boltzmann equation

We can now expand the left hand side of the previous Contents
Description of fluid
equation by means of Taylor’s theorem at different scales
Turbulence
modelling

f (r + dr, v + dv, t + dt) ≈ Finite difference


method
∂f Finite element
f (r, v, t) + dr · ∇f + dv · ∇v f + dt. (244) method
∂t Finite volume
method

The two above equations give the Boltzmann equation Monte Carlo method
Lattice Boltzmann
method
∂f F
+ v · ∇f + · ∇v f = Ω(f ) (245) Other methods
∂t m References

dr
where v = dt
and m dv
dt
= F.

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


Collision operator

The simplification of the complicated collision Contents


Description of fluid
operator Ω is needed. It should, however, fulfil at least at different scales
Turbulence
two conditions: modelling
Finite difference
■ conservation of collision invariants ϕ method
Finite element
method
Z
ϕ Ω dv = 0 (246) Finite volume
method

RD Monte Carlo method


Lattice Boltzmann
method
where collision invariants are: 1 (obvious), v and Other methods
1 2
2
kvk . References

■ tendency to the Maxwell-Boltzmann distribution


(relaxation to local equilibrium)

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


BGK approximation

Contents
The BGK (Bhatnagar-Gross-Krook) approximation is Description of fluid
the most popular simplification of the collision at different scales
Turbulence
operator modelling
1 eq Finite difference
Ω = (f − f ) . (247) method
τ Finite element
method
It expresses relaxation to local equilibrium f eq with Finite volume
the relaxation time τ . Both conditions are fulfilled. method

Monte Carlo method


The Boltzmann equations without external forces F is Lattice Boltzmann
now method
∂f 1 eq Other methods
+ v · ∇f = (f − f ) . (248)
∂t τ References

Now the equation is linear! More precisely it is a linear


partial differential equation.

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


Maxwell-Boltzmann distribution

It is the basic law of the kinetic theory of gases. The Contents


Description of fluid
Maxwell-Boltzmann distribution is used for molecules at different scales
Turbulence
being not far from thermodynamic equilibrium. Other modelling

effects like quantum effects and relativistic speeds are Finite difference
method
neglected. The distribution is Finite element
method
Finite volume
kv−Uk2
−D method
f eq = ρ (2πRT ) 2 e − 2RT
= Monte Carlo method
√ −D −
kck2 Lattice Boltzmann
ρ 2πcs e 2c2
s . (249) method

Other methods

References
This distribution is valid for freely moving molecules
without interacting with one another. The exceptions
are only elastic collisions.

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


From Boltzmann eq. to conservation eqs

It is possible to derive the conservation laws from the Contents


Description of fluid
Boltzmann equation. Firstly, from the interpretation at different scales
Turbulence
of distribution function f it arises the definition of modelling

macroscopic density Finite difference


Z method
Finite element
ρ(r, t) = f (r, v, t) dv. (250) method
Finite volume
RD method

The average value of a quantity ϕ is defined as Monte Carlo method


Lattice Boltzmann
R method
ϕ f dv Other methods
1
Z
RD
hϕi = R = ϕ f dv. (251) References
f dv ρ
RD RD

The integration is carried out over velocity space.

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


Averaged Boltzmann equation

Multiplying the Boltzmann equation by ϕ and then Contents


Description of fluid
integrating over velocity space results in at different scales
Turbulence
modelling
∂f
Z Z Z
F Finite difference
ϕ dv + ϕ v · ∇f dv + ϕ · ∇v f dv = method
∂t m Finite element
RD RD RD method
Z Finite volume
method
ϕ Ω(f ) dv. (252)
Monte Carlo method
RD Lattice Boltzmann
method
Taking advantage of the average definition the Other methods

averaged Boltzmann equation may now be rewritten References

as

(ρhϕi) + ∇ · (ρhϕ vi) − ρf · h∇v ϕi = 0. (253)
∂t

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


Mass conservation equation

Substituting ϕ := 1 into the averaged Boltzmann Contents


Description of fluid
equation we have at different scales
Turbulence
modelling
∂ρ
+ ∇ · (ρhvi) = 0. (254) Finite difference
method
∂t Finite element
method
Comparing the above equation with the mass Finite volume
method
conservation equation
Monte Carlo method
Lattice Boltzmann
∂ρ method
+ ∇ · (ρU) = 0 (255)
∂t Other methods

it becomes obvious that the macroscopic velocity U References

must be
1
Z
U = hvi = v f dv. (256)
ρ
RD

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


Momentum conservation equation
Substituting ϕ ← v into the averaged Boltzmann
equation we have Contents
Description of fluid
∂ at different scales
(ρU) + ∇ · (ρhvvi) − ρf = 0. (257) Turbulence
∂t modelling

Introducing the microscopic velocity c in the mean Finite difference


method
velocity frame Finite element
method
c(r, v, t) := v − U(r, t) (258) Finite volume
method
it is possible to define the stress tensor Monte Carlo method
Z
Lattice Boltzmann
σ := −ρhcci = − ccf dv. (259) method

Other methods
RD
References
Now, the averaged Boltzmann equations becomes the
macroscopic momentum conservation equation

(ρU) + ∇ · (ρUU) = ρf + ∇ · σ. (260)
∂t

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


Energy conservation equation
Substituting ϕ := 12 kvk2 ≡ 12 v · v into the averaged
Boltzmann equation we have Contents
Description of fluid
1 1
Z
at different scales
2
e := hkck i = kck2 f dv. (261) Turbulence
2 2ρ modelling
RD Finite difference
method
Introducing the heat vector q definition Finite element
method

1 1 Finite volume
Z
2
q := ρhckck i = ckck2 f dv (262) method

2 2 Monte Carlo method


RD Lattice Boltzmann
method
we have the macroscopic energy conservation equation Other methods

       References
∂ 1 2 1
ρ e + kUk +∇· ρ e + kUk2 U =
∂t 2 2
ρf · U + ∇ · (σ · U − q) . (263)

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


Equation of state

Contents
From the definition of the stress tensor σ := −ρhcci Description of fluid
and the internal energy e := 2−1 hc · ci we have at different scales
Turbulence
modelling
trhcci = 2e. (264) Finite difference
method
Finite element
Additionally, by means of the stress tensor we have method

pressure definition p := −D−1 tr σ. Combining these Finite volume


method

results in Monte Carlo method

2ρe = pD. (265) Lattice Boltzmann


method

Other methods
The above equation together with the equipartition of
References
energy for mono-atomic gases gives the equation of
state
p = ρRT = ρc2s . (266)

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


Velocity space discretisation

The velocity space v is discretised into a finite set of Contents


Description of fluid
Q velocities {vn } where Q = |{vn }|. Discrete at different scales
Turbulence
distributions are defined by means of the discretised modelling

velocity space Finite difference


method
Finite element
fn (r, t) = Wn f (r, vn , t), (267a) method

fneq (r, t) = Wn f eq (r, vn , t). (267b) Finite volume


method

Monte Carlo method


Wn are the weights of the Gaussian quadrature rule. Lattice Boltzmann
method
The density may now be approximated as Other methods
Z References
X X
f (r, v, t) dv ≈ Wn f (r, vn , t) = fn (r, t).
RD n n

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


Discrete Boltzmann equation

The discrete distribution function fn satisfies the Contents


Description of fluid
discrete Boltzmann equation (with BGK at different scales
Turbulence
approximation) modelling
Finite difference
∂fn 1 eq method
+ vn · ∇fn = (fn − fn ) . (268) Finite element
∂t τ method
Finite volume
method
The fluid density, velocity and internal energy are now Monte Carlo method
calculated from the discrete distribution function: Lattice Boltzmann
method

Quantity Continuous discrete Other methods

References
R P
ρ R RD f dv P n fn
ρU RD
v f dv n vn fn
1 2 1 2
R P
ρe 2 R D kv − Uk f dv 2 n kv n − Uk fn

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


Quadratures
To recover correct form of the Navier-Stokes
equations the discrete velocity set has to be chosen so Contents
Description of fluid
the following quadratures hold exactly at different scales
Z m m Turbulence
Y X Y modelling


0≤m≤3
f eq v dv =
i=0
fn0 vn .
n
(269)
i=0
Finite difference
method
RD Finite element
method
The above may be reduced to Finite volume
method
kvk2 kv k2
Z
− 2 X − n2 Monte Carlo method
I := e 2cs ψ(v) dv ≈ Wn e 2cs ψ(vn ) (270) Lattice Boltzmann
n method
RD
Other methods
where √ References
kvn k2 D
Wn = e 2c2
s 2πcs wn (271)
and
D
−D
Y
wn = π 2 ωi . (272)
i=1

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


Space discretisation

The space discretisation follows the velocity space Contents


Description of fluid
discretisation. This means it is discretised into a at different scales
Turbulence
lattices (D1Q3, D2Q9, D3Q27 discussed further). modelling

From the quadratures it arises speed of the model Finite difference


method
√ Finite element
c = 3cs . (273) method
Finite volume
method
The speed c is used for space discretisation in the Monte Carlo method

following manner ∆xi = c ∆t where ∆t represents Lattice Boltzmann


method
time step (time space discretisation). Other methods

One may also introduce dimensionless lattice velocities References

vn
en := . (274)
c

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


Lattice Boltzmann equation
Introducing the substantial derivative symbol
dn ∂
dt
:= ∂t
+ vn · ∇ makes it possible to rewrite the Contents
Description of fluid
discretised Boltzmann equation at different scales
Turbulence
modelling
dn fn 1 eq
= (fn − fn ) . (275) Finite difference
dt τ method
Finite element
method
The substantial derivative is approximated by means of Finite volume
method

dn fn (r, t) fn (r + vn ∆t, t + ∆t) − fn (r, t) Monte Carlo method


= +O (∆t) . Lattice Boltzmann
dt ∆t method

Other methods
From the two above one gets the Lattice Boltzmann References

equation
1 0 
fn (r+vn ∆t, t+∆t)−fn (r, t) = fn (r, t) − fn (r, t) .
τ̂
τ
where dimensionless collision time is τ̂ := ∆t .

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


Equations
Continuous Boltzmann equation
∂f Contents
+ v · ∇f = Ω(f ) (276) Description of fluid
∂t at different scales
Turbulence
Continuous Boltzmann equation with BGK modelling

approximation Finite difference


method
∂f 1 eq Finite element
+ v · ∇f = (f − f ) (277) method
∂t τ Finite volume
method
Discrete Boltzmann equation Monte Carlo method
∂fn 1 eq Lattice Boltzmann
+ vn · ∇fn = (fn − fn ) (278) method
∂t τ Other methods

Lattice Boltzmann equation References

1 0 
fn (r+vn ∆t, t+∆t)−fn (r, t) = fn (r, t) − fn (r, t)
τ̂
(279)

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


Typical lattices

Contents
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

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


D1Q3 lattice

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element
method
Finite volume
method
(
2
3
, n = 0;
wn = 1 Monte Carlo method
6
, n ∈ {1, 2}.
Lattice Boltzmann
method

Other methods

References

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


D2Q9 lattice

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element
method

4 Finite volume
9,
 n = 0; method
wn = 91 , n ∈ {1, . . . , 4}; Monte Carlo method
1

36
, n ∈ {5, . . . , 8}. Lattice Boltzmann
method

Other methods

References

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


D3Q27 lattice

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element
8 method

 27
, n = 0; Finite volume
2,
 method
n ∈ {1, . . . , 6};
wn = 271 Monte Carlo method

 54
, n ∈ {15, . . . , 26};
 1 Lattice Boltzmann

216
, n ∈ {7, . . . , 14}; method

Other methods

References

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


D3Q19 lattice

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element
method

1 Finite volume
3,
 n = 0; method
2
wn = 18
, n ∈ {1, . . . , 6}; Monte Carlo method
1

36
, n ∈ {7, . . . , 18}; Lattice Boltzmann
method

Other methods

References

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


D3Q15 lattice

Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element
method

2 Finite volume
9,
 n = 0; method
wn = 91 , n ∈ {1, . . . , 6}; Monte Carlo method
1

72
, n ∈ {7, . . . , 14}; Lattice Boltzmann
method

Other methods

References

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


Expansion of the Maxwell-Boltzmann
distribution
The Maxwell-Boltzmann distribution can be
rearranged Contents
  Description of fluid
√ −D − kvk2 − kUk2 − v·U at different scales
2 2
f eq = ρ 2πcs e 2c2s e 2cs cs . (280) Turbulence
modelling
Finite difference
eq
Now f can be expanded into a Taylor series in terms method
Finite element
of the fluid velocity method
! Finite volume
√ −D − kvk2 2 2
v · U (v · U) kUk method

f 0 := ρ 2πcs e 2c2s 1 + 2 + 4
− 2
. Monte Carlo method
cs 2cs 2cs Lattice Boltzmann
method

Other methods
This is valid for low Mach numbers References

3
 
eq 0 kUk 0 3

f =f +O 3
= f + O Ma . (281)
cs

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


Discrete Maxwell-Boltzmann distribution
The discrete equilibrium distribution is defined by
means of the discretised velocity space Contents
Description of fluid
at different scales

fn0 (r, t) = Wn f 0 (r, vn , t) (282) Turbulence


modelling
Finite difference
where weights are method
Finite element
method
kvn k2 √ D Finite volume
Wn = e 2c2
s 2πcs wn . (283) method

Monte Carlo method


Lattice Boltzmann
Together with the Taylor expansion for low Mach method

numbers we have Other methods

References
!
2 2
vn · U (vn · U) kUk
fn0 := wn ρ 1 + 2
+ 4
− 2
.
cs 2cs 2cs

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


Streaming and collision

The Lattice Boltzmann equation Contents


Description of fluid
at different scales
1 0  Turbulence
fn (r+vn ∆t, t+∆t) = fn (r, t)+ fn (r, t) − fn (r, t) . modelling
τ̂ Finite difference
method
The collision step Finite element
method
Finite volume
1 0 method
fnt (r, t

+ ∆t) = fn (r, t) + fn (r, t) − fn (r, t) .
τ̂ Monte Carlo method
Lattice Boltzmann
method
The streaming step Other methods

References
fn (r + vn ∆t, t + ∆t) = fnt (r, t + ∆t).

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


Streaming

Contents
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

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


Streaming

Contents
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

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


Streaming

Contents
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

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


LBM pseudocode

k ← 0; Contents
repeat Description of fluid
at different scales
R ←P 0; Turbulence
ρ ← nPfn ; modelling
Finite difference
U ← ρ1 n vn fn ; method
Finite element
Calculate residue;
  method
2
kUk2 Finite volume
fn0 ← wn ρ 1 + vnc2·U + (vn2c·U)4 − 2c2 ; method
s s s
Monte Carlo method
fnt (r, t + ∆t) ← fn (r, t) + τ̂1 (fn0 (r, t) − fn (r, t)); Lattice Boltzmann
method
Apply Bounceback;
Other methods
fn (r + vn ∆t, t + ∆t) ← fnt (r, t + ∆t); References
Apply other BCs;
k ← k + 1;
until k < kmax and R > Rmin ;

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


Chapman-Enskog expansion
The Navier-Stokes equations can be recovered from
the Lattice Boltzmann equation Contents
Description of fluid
at different scales
∂ Turbulence
(ρU) + ∇ · (ρUU) = −∇p + µ∇2 U (284) modelling
∂t Finite difference
method
through the Chapman-Enskog expansion (multi-scale Finite element
method
analysis). The expansion of the discrete Finite volume
method
Maxwell-Boltzmann distribution is used
Monte Carlo method
Lattice Boltzmann
!
2
0 vn · U (vn · U) kUk2 method
fn := wn ρ 1 + 2
+ 4
− 2
. Other methods
cs 2cs 2cs
References

The first RHS term is responsible for ∇p, the second


for ∇2 U, the last two terms are related to ρUU.

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


Simplifications

Knowing the structure of the discrete Contents


Maxwell-Boltzmann distribution we can now drop the Description of fluid
at different scales
nonlinear terms Turbulence
modelling
 
0 vn · U Finite difference
fn := wn ρ 1 + 2
(285) method
cs Finite element
method
Finite volume
to recover Stokes equations method

Monte Carlo method


∂ Lattice Boltzmann
(ρU) = −∇p + µ∇2 U. (286) method
∂t Other methods

References
For both cases the dynamic viscosity is defined as
 
1 2
µ := ρ τ̂ − cs ∆t. (287)
2

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


Example - input
1 60 20
2
3 100000000012222222222222222222222222222222222222222222222222 Contents
4 100000000012222222222222222222222222222222222222222222222222 Description of fluid
5 100000000012222222222222222222222222222222222222222222222222 at different scales
6 100000000012222222222222222222222222222222222222222222222222
7 100000000012222222222222222222222222222222222222222222222222 Turbulence
8 100000000011111111111111111111111111111111111111111111111111 modelling
9 100000000000000000000000000000000000000000000000000000000001 Finite difference
10 100000000000000000000000000000000000000000000000000000000001 method
11 100000000000000000000000000000000000000000000000000000000001
12 100000000000000000000000000000000000000000000000000000000001 Finite element
13 100000000000000000000000000000000000000000000000000000000001 method
14 100000000000000000000000000000000000000000000000000000000001 Finite volume
15 100000000000000000000000000000000000000000000000000000000001 method
16 100000000000000000000000000000000000000000000000000000000001
17 100000000000000000000000000000000000000000000000000000000001 Monte Carlo method
18 100000000000000000000000000000000000000000000000000000000001
Lattice Boltzmann
19 100000000000000000000000000000000000000000000000000000000001
method
20 100000000000000000000000000000000000000000000000000000000001
21 100000000000000000000000000000000000000000000000000000000001 Other methods
22 111111111111111111111111111111111111111111111111110000000001
23 References
24 2
25
26 PT
27 0 20 10 20
28 0.4
29
30 VB
31 50 0 60 0
32 0.01

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


Advantages over conventional methods

■ Possibility of microscopic interactions Contents


Description of fluid
incorporation at different scales
Turbulence
■ Easier dealing with complex boundaries modelling

■ Parallelisation of the method (the collision and Finite difference


method
streaming processes are local) Finite element
method
Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element

Other methods method


Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Other methods

■ Boundary element method Contents


Description of fluid
■ Smoothed-particle hydrodynamics at different scales
Turbulence
modelling
Finite difference
method
Finite element
method
Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


Contents
Description of fluid
at different scales
Turbulence
modelling
Finite difference
method
Finite element

References method
Finite volume
method

Monte Carlo method


Lattice Boltzmann
method

Other methods

References

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


List of references

Contents
[1] Ferziger J.H., Perić M., Computational Methods for Fluid Dynamics, Description of fluid
Springer-Verlag, Berlin, 2002 at different scales
Turbulence
[2] Pope S. B., Turbulent Flows, Cambridge University Press, Cambridge, modelling
2000 Finite difference
method
[3] Succi S., The Lattice Boltzmann Equation for Fluid Dynamics and Finite element
method
Beyond, Oxford University Press, Oxford, 2001
Finite volume
method
[4] Tesch K., Fluid Mechanics, Wyd. PG, 2008, 2013 (in Polish)
Monte Carlo method

[5] Wilcox D. C., Turbulence Modeling for CFD, DCW Industries, Lattice Boltzmann
method
California, 1994
Other methods
[6] Zienkiewicz O. C., Taylor R. L., The Finite Element Method, References
Butterworth-Heinemann, Oxford, 2000

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

You might also like