2. Introduction
The Navier–Stokes equations
Conservation of mass
Conservation of momentum
Constitutive & kinematic relations
Conservation of energy
Equations of state & compressible Navier–Stokes equations
Incompressible Navier–Stokes equations
Discretization
Overview of spatial discretizations
The Finite Volume Method
Time discretization
Spatial discretization
Turbulence and its modeling
3. Introduction
What is CFD?
I Fluid mechanics deals with the motion of fluids (liquids and gases),
induced by external forces.
I Fluid flow is modeled by partial differential equations (PDE),
describing the conservation of mass, momentum, and energy.
I Computational Fluid Dynamics (CFD) is the discipline of
discretizing these PDE and solving them using computers.
4. Introduction
In which application fields is CFD used?
I Aerospace and aeronautical applications (airplanes, water and space
vehicles)
I Mechanical applications (gas turbines, heat exchange, explosions,
combustion, architecture)
I Biological applications (blood flow, breathing, drinking)
I Meteorological applications (weather prediction)
I Environmental applications (air and water pollution)
I and many more . . .
6. Introduction
Why to use CFD?
I Pre-design of components: simulation vs. experiment (simulations
are cheaper, faster, and safer, but not always reliable)
I vehicles with lower fuel consumption, quieter, heavier loads
I combustion engines
I oil recovery
I water and gas turbines (effectiveness)
I stress minimization
7. Introduction
Why to use CFD?
I Pre-design of components: simulation vs. experiment (simulations
are cheaper, faster, and safer, but not always reliable)
I vehicles with lower fuel consumption, quieter, heavier loads
I combustion engines
I oil recovery
I water and gas turbines (effectiveness)
I stress minimization
I Detection and prediction
I hurricanes, storms, tsunamis
I pollution transport
I diseases
I forces, stresses
10. Introduction
Requirements for industrial CFD
I Robustness — give a solution (for as many input cases as possible)
I Reliability — give a good solution
I Performance — give a good solution fast
I Geometries — give a good solution fast for real problems
I Automatic tool chain — reduce requirements of user interaction
Knowledgeable user controls and evaluates simulation outcomes!
12. Introduction
CFD Solution Tool Chain
I CAD description of geometry
I Grid generation from CAD model (usually the most time consuming
part)
13. Introduction
CFD Solution Tool Chain
I CAD description of geometry
I Grid generation from CAD model (usually the most time consuming
part)
I Problem set up - knowledgeable user needed
I Mathematical model to use
I Spatial and temporal discretization
I Available resources
I Much more . . .
14. Introduction
CFD Solution Tool Chain
I CAD description of geometry
I Grid generation from CAD model (usually the most time consuming
part)
I Problem set up - knowledgeable user needed
I Mathematical model to use
I Spatial and temporal discretization
I Available resources
I Much more . . .
I Preprocessing - parse configuration and prepare solver
Martin Kronbichler (TDB) FVM for CFD February 11, 2010 9 / 72
15. Introduction
CFD Solution Tool Chain
I CAD description of geometry
I Grid generation from CAD model (usually the most time consuming
part)
I Problem set up - knowledgeable user needed
I Mathematical model to use
I Spatial and temporal discretization
I Available resources
I Much more . . .
I Preprocessing - parse configuration and prepare solver
I Solving - run the solver
16. Introduction
CFD Solution Tool Chain
I CAD description of geometry
I Grid generation from CAD model (usually the most time consuming
part)
I Problem set up - knowledgeable user needed
I Mathematical model to use
I Spatial and temporal discretization
I Available resources
I Much more . . .
I Preprocessing - parse configuration and prepare solver
I Solving - run the solver
I Post processing - extract and compute information of interest
17. Introduction
CFD Solution Tool Chain
I CAD description of geometry
I Grid generation from CAD model (usually the most time consuming
part)
I Problem set up - knowledgeable user needed
I Mathematical model to use
I Spatial and temporal discretization
I Available resources
I Much more . . .
I Preprocessing - parse configuration and prepare solver
I Solving - run the solver
I Post processing - extract and compute information of interest
I Visualization - often most important
18. Introduction
CFD Solution Tool Chain
I CAD description of geometry
I Grid generation from CAD model (usually the most time consuming
part)
I Problem set up - knowledgeable user needed
I Mathematical model to use
I Spatial and temporal discretization
I Available resources
I Much more . . .
I Preprocessing - parse configuration and prepare solver
I Solving - run the solver
I Post processing - extract and compute information of interest
I Visualization - often most important
I Interpretation - physics, mathematics, numerics, experiments
19. Introduction
CFD software
I Commercial: Fluent, Comsol, CFX, Star-CD
I In-house codes: Edge (FOI), DLR-Tau (German Aerospace Center),
Fun3D (NASA), Sierra/Premo (American Aerospace)
I Open Source: OpenFOAM, FEniCS, OpenFlower
22. The Navier–Stokes equations
Navier–Stokes equations — an overview
I The governing equations of fluid dynamics are the conservation laws
of mass, momentum, and energy.
I In CFD, this set of conservation laws are called the
Navier–Stokes equations.
I Derive compressible Navier–Stokes equations first
I Simplify these equations to get the incompressible Navier–Stokes
equations
23. The Navier–Stokes equations
Notation
ρ density
u velocity, u = (u1, u2, u3)
p pressure
T temperature
µ dynamic viscosity
ν kinematic viscosity, ν = µ/ρ
∇ nabla operator, ∇ =
∂
∂x1
, ∂
∂x2
, ∂
∂x3
· inner product, a · b = a1b1 + a2b2 + a3b3
24. The Navier–Stokes equations
General form of conservation laws
I Monitor the flow characteristics of a fixed control volume Ω.
I Rate of total change in the control volume:
I change in the interior,
I flow over boundary of control volume,
25. The Navier–Stokes equations
General form of conservation laws
I Monitor the flow characteristics of a fixed control volume Ω.
I Rate of total change in the control volume:
I change in the interior,
I flow over boundary of control volume,
expressed as
D
Dt
Z
Ω(t)
q dΩ =
Z
Ω
∂q
∂t
dΩ +
Z
∂Ω
qu · n ds =
Z
Ω(t)
S dΩ
for some quantity q and a source term S (generation or elimination).
n denotes the outer normal on Ω. This is the Reynolds transport
theorem.
Note: Ω(t) is an ensemble of molecules, Ω is a fixed control volume.
26. The Navier–Stokes equations
General form of conservation laws
I Monitor the flow characteristics of a fixed control volume Ω.
I Rate of total change in the control volume:
I change in the interior,
I flow over boundary of control volume,
expressed as
D
Dt
Z
Ω(t)
q dΩ =
Z
Ω
∂q
∂t
dΩ +
Z
∂Ω
qu · n ds =
Z
Ω(t)
S dΩ
for some quantity q and a source term S (generation or elimination).
n denotes the outer normal on Ω. This is the Reynolds transport
theorem.
Note: Ω(t) is an ensemble of molecules, Ω is a fixed control volume.
I Differential form:
Dq
Dt
=
∂q
∂t
+ u · ∇q = S.
27. The Navier–Stokes equations Conservation of mass
Continuity equation I
The continuity equation describes the conservation of mass .
The mass M of the material in Ω(t) is constant (molecules cannot be
created/destroyed), that is M(t) = M(t + ∆t).
DM
Dt
=
D
Dt
Z
Ω(t)
ρ dΩ
| {z }
M
= 0
ρ(t) denotes the fluid density.
28. The Navier–Stokes equations Conservation of mass
Continuity equation II
Rewritten for a stationary control volume by using the Reynolds transport
theorem:
rate of mass change in Ω + mass flow over ∂Ω = 0,
Z
Ω
∂ρ
∂t
dΩ +
Z
∂Ω
ρu · n ds = 0.
29. The Navier–Stokes equations Conservation of momentum
Momentum equation I
The momentum equation describes the conservation of momentum .
Newton’s second law of motion: the total rate of momentum m change in
Ω(t) is equal to the sum of acting forces K, i.e.,
Dm
Dt
=
D
Dt
Z
Ω(t)
ρu dΩ = K,
(interpretation: mass × acceleration = force).
30. The Navier–Stokes equations Conservation of momentum
Momentum equation II
Rewritten for a stationary control volume Ω:
Z
Ω
∂ρu
∂t
+
Z
∂Ω
ρ(u ⊗ u) · n ds = K,
where u ⊗ u is a rank-2 tensor with entries ui uj .
31. The Navier–Stokes equations Conservation of momentum
Momentum equation II
Rewritten for a stationary control volume Ω:
Z
Ω
∂ρu
∂t
+
Z
∂Ω
ρ(u ⊗ u) · n ds = K,
where u ⊗ u is a rank-2 tensor with entries ui uj .
Decompose force into surface forces and volume forces:
rate of momentum change in Ω + momentum flow over ∂Ω
= surface forces on ∂Ω + volume forces on Ω ,
Z
Ω
∂ρu
∂t
dV +
Z
∂Ω
ρ(u⊗u)·n ds = −
Z
∂Ω
pn ds +
Z
∂Ω
τ · n ds
| {z }
surface forces
+
Z
Ω
ρf dΩ.
32. The Navier–Stokes equations Conservation of momentum
Momentum equation III
I Surface forces acting on ds of ∂Ω:
I Pressure force p(−n) ds (analog to isotropic stress in structural
mechanics),
I Viscous force τ · n ds, τ is the Cauchy stress tensor (analog to
deviatoric stress in structural mechanics).
33. The Navier–Stokes equations Conservation of momentum
Momentum equation III
I Surface forces acting on ds of ∂Ω:
I Pressure force p(−n) ds (analog to isotropic stress in structural
mechanics),
I Viscous force τ · n ds, τ is the Cauchy stress tensor (analog to
deviatoric stress in structural mechanics).
I Volume forces ρf dΩ acting on small interior volume dΩ:
I Gravity force ρg dΩ, e.g., f = g,
I Other types of forces: Coriolis, centrifugal, electromagnetic, buoyancy
34. The Navier–Stokes equations Conservation of momentum
Newtonian fluid
Model that relates the stress tensor τ to the velocity u:
We consider so-called Newtonian fluids, where the viscous stress is
linearly related to strain rate, that is,
τ = 2µε(u) −
2
3
µI tr ε(u) = µ
∇u + (∇u)T
−
2
3
µ(∇ · u)I,
(compare with constitutive and kinematic relations in elasticity theory).
35. The Navier–Stokes equations Conservation of momentum
Newtonian fluid
Model that relates the stress tensor τ to the velocity u:
We consider so-called Newtonian fluids, where the viscous stress is
linearly related to strain rate, that is,
τ = 2µε(u) −
2
3
µI tr ε(u) = µ
∇u + (∇u)T
−
2
3
µ(∇ · u)I,
(compare with constitutive and kinematic relations in elasticity theory).
For Cartesian coordinates
τij = µ
∂uj
∂xi
+
∂ui
∂xj
−
2
3
µ
3
X
k=1
∂uk
∂xk
.
The dynamic viscosity is assumed constant
µ = µ(T, p) ≈ constant.
36. The Navier–Stokes equations Conservation of energy
Energy equation I
The energy equation describes the conservation of energy .
The first law of thermodynamics:
The total rate of total energy E changes in Ω(t) is equal to the rate of
work L done on the fluid by the acting forces K plus the rate of heat added
W , that is
DE
Dt
=
D
Dt
Z
Ω(t)
ρE dΩ = L + W
where ρE is the total energy per unit volume.
37. The Navier–Stokes equations Conservation of energy
Energy Equation II
Rewritten for a stationary control volume Ω, explicitly specifying the source
terms:
Rate of total energy change in Ω + Total energy flow over ∂Ω =
Rate of work of pressure and viscous forces on ∂Ω +
Rate of work of forces on Ω + Rate of heat added over ∂Ω
Z
Ω
∂ρE
∂t
dΩ +
Z
∂Ω
ρEu · n ds = −
Z
∂Ω
pu · n ds +
Z
∂Ω
(τ · u) · n ds
+
Z
Ω
ρf · u dΩ +
Z
∂Ω
k∇T · n ds
for the fluid temperature T and thermal conductivity k.
38. The Navier–Stokes equations Conservation of energy
Involved variables and equations
We have
I seven variables (ρ, u1, u2, u3, p, T, E)
I five equations (continuity, 3×momentum, energy)
We need two more equations to close the system, the so-called equations
of state.
39. The Navier–Stokes equations Equations of state compressible Navier–Stokes equations
Equations of state
Properties of a perfect gas:
p =(γ − 1)ρ
internal energy
z }| {
E −
1
2
|u|2
T =
1
cv
E −
1
2
|u|2
where γ =
cp
cv
is the ratio of specific heats, and cp and cv are the specific
heats at constant pressure and volume.
A typical value for air at sea level pressure is γ = 1.4.
40. The Navier–Stokes equations Equations of state compressible Navier–Stokes equations
The compressible Navier–Stokes equations in integral form
The equations of continuity, momentum, and energy can be combined into
one system of equations.
I Define compound variable U = (ρ, ρu1, ρu2, ρu3, ρE) (called
conservative variables)
I Define flux vectors
F · n =
ρu · n
ρ(u ⊗ u) · n + pI · n
(ρE + p)u · n
| {z }
inviscid/convective
−
0
τ · n
(τ · u) · n + k(∇T) · n
| {z }
viscous
and an external strength vector Fe = (0, f, f · u)T
41. The Navier–Stokes equations Equations of state compressible Navier–Stokes equations
The compressible Navier–Stokes equations in integral form
The equations of continuity, momentum, and energy can be combined into
one system of equations.
I Define compound variable U = (ρ, ρu1, ρu2, ρu3, ρE) (called
conservative variables)
I Define flux vectors
F · n =
ρu · n
ρ(u ⊗ u) · n + pI · n
(ρE + p)u · n
| {z }
inviscid/convective
−
0
τ · n
(τ · u) · n + k(∇T) · n
| {z }
viscous
and an external strength vector Fe = (0, f, f · u)T
Compressible Navier–Stokes equations in integral form
Z
Ω
∂U
∂t
dΩ +
Z
∂Ω
F · n ds =
Z
Ω
ρFe dΩ
42. The Navier–Stokes equations Equations of state compressible Navier–Stokes equations
Compressible Navier–Stokes equations, differential form
Assume: flux tensor F is differentiable
Apply the Gauss theorem to the integral form and get
Z
Ω
∂U
∂t
+ ∇ · F − ρFe
dΩ = 0.
43. The Navier–Stokes equations Equations of state compressible Navier–Stokes equations
Compressible Navier–Stokes equations, differential form
Assume: flux tensor F is differentiable
Apply the Gauss theorem to the integral form and get
Z
Ω
∂U
∂t
+ ∇ · F − ρFe
dΩ = 0.
Since the integral is zero for an arbitrary control volume Ω, we obtain the
differential form of the
Compressible Navier–Stokes equations
∂U
∂t
+ ∇ · F = ρFe.
44. The Navier–Stokes equations Incompressible Navier–Stokes equations
The incompressible Navier–Stokes equations
Motivation: we can use simpler equations if we have more information
I Incompressible fluid: density does not change with pressure, i.e.,
ρ = const.
I Energy equation decouples from the rest of the system; continuity and
momentum equations can be simplified.
I Many practically relevant flows are incompressible (e.g. air at speeds
up to 100 m/s) — predominant CFD model
45. The Navier–Stokes equations Incompressible Navier–Stokes equations
Continuity equation
The continuity equation,
∂ρ
∂t
+ ∇ · (ρu) = 0,
becomes for constant ρ simply
∇ · u = 0, i.e.,
3
X
i=1
∂ui
∂xi
= 0.
46. The Navier–Stokes equations Incompressible Navier–Stokes equations
Momentum equation
The momentum equation,
∂ρu
∂t
+ ∇ · (ρu ⊗ u) = −∇p + ∇ · τ + ρf,
can be simplified by using ∇ · u = 0,
∇ · (u ⊗ u) = (u · ∇)u + (∇ · u)u = (u · ∇)u
τ = µ
∇u + (∇u)T
−
2
3
µ(∇ · u)I =
∇u + (∇u)T
47. The Navier–Stokes equations Incompressible Navier–Stokes equations
Momentum equation
The momentum equation,
∂ρu
∂t
+ ∇ · (ρu ⊗ u) = −∇p + ∇ · τ + ρf,
can be simplified by using ∇ · u = 0,
∇ · (u ⊗ u) = (u · ∇)u + (∇ · u)u = (u · ∇)u
τ = µ
∇u + (∇u)T
−
2
3
µ(∇ · u)I =
∇u + (∇u)T
∇ · τ = µ∇ ·
∇u + (∇u)T
= µ ∇2
u + ∇(∇ · u)
= µ∇2
u.
48. The Navier–Stokes equations Incompressible Navier–Stokes equations
Momentum equation
The momentum equation,
∂ρu
∂t
+ ∇ · (ρu ⊗ u) = −∇p + ∇ · τ + ρf,
can be simplified by using ∇ · u = 0,
∇ · (u ⊗ u) = (u · ∇)u + (∇ · u)u = (u · ∇)u
τ = µ
∇u + (∇u)T
−
2
3
µ(∇ · u)I =
∇u + (∇u)T
∇ · τ = µ∇ ·
∇u + (∇u)T
= µ ∇2
u + ∇(∇ · u)
= µ∇2
u.
This gives the incompressible version of the momentum equation
∂u
∂t
+ (u · ∇)u = −
1
ρ
∇p +
µ
ρ
∇2
u + f
49. The Navier–Stokes equations Incompressible Navier–Stokes equations
The incompressible Navier–Stokes equations II
Since the energy equation does not enter the momentum and continuity
equation, we have a closed system of four equations:
Incompressible Navier–Stokes equations
∇ · u = 0,
∂u
∂t
+ (u · ∇)u = −
1
ρ
∇p + ν∇2
u + f,
where ν = µ
ρ is the fluid kinematic viscosity.
50. The Navier–Stokes equations Incompressible Navier–Stokes equations
Equation in temperature
The energy equation can be expressed in terms of temperature by using the
equation of state. Transforming the integral form into differential form as
done before1 yields
ρcp
∂T
∂t
+ ∇ · (Tu)
= ∇ · (k∇T) + τ : ∇u,
where
τ : ∇u =
3
X
i,j=1
τij
∂uj
∂xi
= µ
3
X
i,j=1
1
2
∂ui
∂xj
+
∂uj
∂xi
2
,
and is called a dissipative function.
1
for further reading, see e.g. J. Blazek: Computational Fluid Dynamics, Elsevier,
Amsterdam
51. The Navier–Stokes equations Incompressible Navier–Stokes equations
Incompressible Navier–Stokes equations III
I Energy equation is decoupled from the continuity and momentum
equations ⇒
I first solve the continuity and momentum equations to get the velocity
and pressure.
I temperature (energy) equation can be solved for temperature using the
already computed velocity.
52. The Navier–Stokes equations Incompressible Navier–Stokes equations
Incompressible Navier–Stokes equations III
I Energy equation is decoupled from the continuity and momentum
equations ⇒
I first solve the continuity and momentum equations to get the velocity
and pressure.
I temperature (energy) equation can be solved for temperature using the
already computed velocity.
I Pressure level only defined up to a constant for incompressible
flow ⇒
I pressure level has to be fixed at one point in the flow.
I p yields then the relative pressure difference with respect to that
pressure level.
53. The Navier–Stokes equations Incompressible Navier–Stokes equations
Incompressible Navier–Stokes equations III
I Energy equation is decoupled from the continuity and momentum
equations ⇒
I first solve the continuity and momentum equations to get the velocity
and pressure.
I temperature (energy) equation can be solved for temperature using the
already computed velocity.
I Pressure level only defined up to a constant for incompressible
flow ⇒
I pressure level has to be fixed at one point in the flow.
I p yields then the relative pressure difference with respect to that
pressure level.
I No time derivative for the pressure ⇒
I mathematical difficulty of the incompressible Navier–Stokes equations.
I p is indirectly determined by the condition ∇ · u = 0 (p has to be such
that the resulting velocity is divergence free, Lagrange multiplier).
54. The Navier–Stokes equations Incompressible Navier–Stokes equations
Additional conditions
To complete the physical problem setup after having derived the
appropriate PDE, we have to define the
I domain
I initial conditions (velocity, temperature, etc at t = 0)
I boundary conditions (inflow, outflow, wall, interface, . . .)
I material properties
Martin Kronbichler (TDB) FVM for CFD February 11, 2010 34 / 72
56. Discretization
Solution Strategies Outline
Some points we will cover regarding solver strategies of CFD
I Pros and cons of various discretization methods
I Finite Volume Method (FVM)
I Turbulence and its modeling
57. Discretization Overview of spatial discretizations
Overview of Methods
Discretization methods for the CFD equations:
I Finite Difference Method (FDM)
+ efficiency, + theory, − geometries
I Finite Element Method (FEM)
+ theory, + geometries, − shocks, − uses no directional information
I Spectral Methods (Collocation, Galerkin, . . .)
+ accuracy, + theory, − geometries
58. Discretization Overview of spatial discretizations
Overview of Methods
Discretization methods for the CFD equations:
I Finite Difference Method (FDM)
+ efficiency, + theory, − geometries
I Finite Element Method (FEM)
+ theory, + geometries, − shocks, − uses no directional information
I Spectral Methods (Collocation, Galerkin, . . .)
+ accuracy, + theory, − geometries
I Finite Volume Methods (FVM)
+ robustness, + geometries, − accuracy
I Discontinuous Galerkin Methods (DGM)
+ geometries, + shocks, − efficiency (e.g. smooth solutions)
59. Discretization Overview of spatial discretizations
Overview of Methods
Discretization methods for the CFD equations:
I Finite Difference Method (FDM)
+ efficiency, + theory, − geometries
I Finite Element Method (FEM)
+ theory, + geometries, − shocks, − uses no directional information
I Spectral Methods (Collocation, Galerkin, . . .)
+ accuracy, + theory, − geometries
I Finite Volume Methods (FVM)
+ robustness, + geometries, − accuracy
I Discontinuous Galerkin Methods (DGM)
+ geometries, + shocks, − efficiency (e.g. smooth solutions)
I Hybrid Methods
+ versatile, − complex (not automatable)
60. Discretization The Finite Volume Method
Introduction
The Finite Volume Method (FVM) is based on the integral form of the
governing equations.
The integral conservation is enforced in so-called control volumes
( dΩ → ∆Ω) defined by the computational mesh.
The type of FVM is specified by
I the type of control volume
I the type of evaluation of integrals and fluxes
61. Discretization The Finite Volume Method
FVM derivation, introduction
Consider a general scalar hyperbolic conservation law:
∂u
∂t
+ ∇ · F(u) = 0 in Ω, (1)
with appropriate boundary and initial conditions.
62. Discretization The Finite Volume Method
FVM derivation, introduction
Consider a general scalar hyperbolic conservation law:
∂u
∂t
+ ∇ · F(u) = 0 in Ω, (1)
with appropriate boundary and initial conditions.
Compared to the compressible Navier–Stokes equations, we use a problem
where
I u replaces the vector of conservative variables (ρ, ρu, ρE),
I F replaces the flux tensor as defined earlier,
I we have a scalar problem instead of a system.
63. Discretization The Finite Volume Method
FVM derivation, control volumes
Consider the equation in two dimensions, and we divide the domain Ω into
M non-overlapping control volumes Km ⊂ Ω.
Km
vertex-centered finite volume method
64. Discretization The Finite Volume Method
FVM derivation, discretized solution
In each control volume, Km, we store one value um, which is the average
of u in Km.
um =
1
|Km|
Z
Km
u dΩ
65. Discretization The Finite Volume Method
FVM derivation, integral form I
The FVM is based on the integral formulation of the equations.
We start by integrating (1) over one of the control volumes,
Z
Km
∂u
∂t
dΩ +
Z
Km
∇ · F(u) dΩ = 0. (2)
66. Discretization The Finite Volume Method
FVM derivation, integral form I
The FVM is based on the integral formulation of the equations.
We start by integrating (1) over one of the control volumes,
Z
Km
∂u
∂t
dΩ +
Z
Km
∇ · F(u) dΩ = 0. (2)
The first integral can be simplified by changing order of time derivative and
integration to get
Z
Km
∂u
∂t
dΩ =
d
dt
Z
Km
u dΩ = |Km|
dum
dt
. (3)
Inserting (3) back into (2) yields
dum
dt
= −
1
|Km|
Z
Km
∇ · F(u) dΩ.
67. Discretization The Finite Volume Method
FVM derivation, time evolution
We need to propagate the solution um in time.
There are many possibilities for choosing a time integration method, for
example Runge–Kutta, multistep methods etc.
See some Ordinary Differential Equation (ODE) textbook for more
information.2
2
e.g., E. Hairer, S.P. Nørsett, G. Wanner: Solving Ordinary Differential Equations. I:
Nonstiff Problems. Springer-Verlag, Berlin, 1993.
68. Discretization The Finite Volume Method
FVM derivation, time evolution
We need to propagate the solution um in time.
There are many possibilities for choosing a time integration method, for
example Runge–Kutta, multistep methods etc.
See some Ordinary Differential Equation (ODE) textbook for more
information.2
We will use forward Euler in all our examples, i.e.,
dum
dt
=
un+1
m − un
m
∆t
,
where un
m = um(tn).
2
e.g., E. Hairer, S.P. Nørsett, G. Wanner: Solving Ordinary Differential Equations. I:
Nonstiff Problems. Springer-Verlag, Berlin, 1993.
69. Discretization The Finite Volume Method
FVM derivation, time evolution
Inserting the forward Euler time discretization into our system gives
un+1
m = un
m −
∆t
|Km|
Z
Km
∇ · F(u) dΩ.
70. Discretization The Finite Volume Method
FVM derivation, integral form II
By integration by parts (Gauss divergence theorem) of the flux integral we
get the basic FVM formulation
un+1
m = un
m −
∆t
|Km|
Z
∂Km
F(u) · n ds. (4)
The boundary integral describes the flux of u over the boundary ∂Km of
the control volume.
Note: Transforming the volume to a surface integral gets us back to the
form used for the derivation of the Navier–Stokes equations.
71. Discretization The Finite Volume Method
FVM derivation, integral form II
By integration by parts (Gauss divergence theorem) of the flux integral we
get the basic FVM formulation
un+1
m = un
m −
∆t
|Km|
Z
∂Km
F(u) · n ds. (4)
The boundary integral describes the flux of u over the boundary ∂Km of
the control volume.
Note: Transforming the volume to a surface integral gets us back to the
form used for the derivation of the Navier–Stokes equations.
Different ways of evaluating the flux integral specify the type of FVM
(together with the control volume type).
72. Discretization The Finite Volume Method
FVM derivation, numerical flux
The integral in (4) is evaluated using a so-called numerical flux function.
I There are a lot of different numerical fluxes available for the integral
evaluation, each of them having its pros and cons.
Terminology: Riemann solvers (they are usually designed to solve the
Riemann problem which is a conservation law with constant data and
a discontinuity).
3
Contains only the inviscid terms from the compressible Navier–Stokes equations
73. Discretization The Finite Volume Method
FVM derivation, numerical flux
The integral in (4) is evaluated using a so-called numerical flux function.
I There are a lot of different numerical fluxes available for the integral
evaluation, each of them having its pros and cons.
Terminology: Riemann solvers (they are usually designed to solve the
Riemann problem which is a conservation law with constant data and
a discontinuity).
I Both exact and approximate solvers (i.e., ways to evaluate the flux
integral (4)) have been developed, usually the latter class is used.
I E.g. exact solver for Euler3
equations developed by Godunov.
I Widely used approximate solvers: Roe, HLLC, central flux.
3
Contains only the inviscid terms from the compressible Navier–Stokes equations
74. Discretization The Finite Volume Method
FVM derivation, numerical flux II
The numerical flux functions are usually denoted by F∗(uL, uR, n) where uL
is the left (local) state and uR is the right (remote) state of u at the
boundary ∂Km,
Z
∂Km
F(u) · n ds =
X
j
Z
∂Kj
m
F(u) · nj ds
75. Discretization The Finite Volume Method
FVM derivation, numerical flux II
The numerical flux functions are usually denoted by F∗(uL, uR, n) where uL
is the left (local) state and uR is the right (remote) state of u at the
boundary ∂Km,
Z
∂Km
F(u) · n ds =
X
j
Z
∂Kj
m
F(u) · nj ds
≈
X
j
|∂Kj
m|F∗
(uL, uR, nj )
and j denotes the index of each subboundary of ∂Km with a given normal
nj .
76. Discretization The Finite Volume Method
FVM derivation, full discretization
The full discretization for control volume Km is hence
un+1
m = un
m −
∆t
|Km|
X
j
|∂Kj
m|F∗
(uL, uR, nj )
77. Discretization The Finite Volume Method
FVM derivation, full discretization
The full discretization for control volume Km is hence
un+1
m = un
m −
∆t
|Km|
X
j
|∂Kj
m|F∗
(uL, uR, nj )
In one dimension, we have
un+1
m = un
m −
∆t
∆x
Z
∂Km
F(u) · n ds
= un
m −
∆t
∆x
F(un
m+1/2) − F(un
m−1/2)
78. Discretization The Finite Volume Method
FVM derivation, full discretization
The full discretization for control volume Km is hence
un+1
m = un
m −
∆t
|Km|
X
j
|∂Kj
m|F∗
(uL, uR, nj )
In one dimension, we have
un+1
m = un
m −
∆t
∆x
Z
∂Km
F(u) · n ds
= un
m −
∆t
∆x
F(un
m+1/2) − F(un
m−1/2)
= un
m −
∆t
∆x
F∗
(un
m, un
m−1, −1) + F∗
(un
m, un
m+1, 1)
79. Discretization The Finite Volume Method
FVM derivation, upwind scheme I
Get the information upwind, where the information comes from.
Image from http://en.wikipedia.org
80. Discretization The Finite Volume Method
FVM derivation, upwind scheme II
Example in one dimension
F(u) = βu,
where β is the direction of the flow. So in each control volume we compute
Z
∂Km
βun ds.
81. Discretization The Finite Volume Method
FVM derivation, upwind scheme II
Example in one dimension
F(u) = βu,
where β is the direction of the flow. So in each control volume we compute
Z
∂Km
βun ds.
Case β 0 (information flows from left to right), equidistant mesh:
um−1/2 = um−1, um+1/2 = um.
82. Discretization The Finite Volume Method
FVM derivation, upwind scheme II
Example in one dimension
F(u) = βu,
where β is the direction of the flow. So in each control volume we compute
Z
∂Km
βun ds.
Case β 0 (information flows from left to right), equidistant mesh:
um−1/2 = um−1, um+1/2 = um.
Hence, we get
un+1
m = un
m −
∆t
∆x
F(un
m+1/2)nm+1/2 + F(un
m−1/2)nm−1/2
= un
m −
∆t
∆x
β
un
m+1/2 − un
m−1/2
= un
m −
∆t
∆x
β un
m − un
m−1
.
83. Discretization The Finite Volume Method
FVM derivation, upwind scheme (Roe flux)
Practical implementation of upwinding: construct it by the Roe Flux
F∗
(uL, uR, n) =
n · F(uL) + n · F(uR)
2
+ n · F0
(ū)
uL − uR
2
.
Here, ū satisfies the mean value theorem,
n · F(uL) = n · F(uR) + n · F0
(ū) (uL − uR) .
and is called the Roe average (problem dependent).
84. Discretization The Finite Volume Method
FVM derivation, upwind scheme (Roe flux)
Practical implementation of upwinding: construct it by the Roe Flux
F∗
(uL, uR, n) =
n · F(uL) + n · F(uR)
2
+ n · F0
(ū)
uL − uR
2
.
Here, ū satisfies the mean value theorem,
n · F(uL) = n · F(uR) + n · F0
(ū) (uL − uR) .
and is called the Roe average (problem dependent).
Upwinding is first order accurate.
85. Discretization The Finite Volume Method
FVM derivation, central scheme I
For F(u) = βu on a equidistant mesh, the central scheme approximation is
um−1/2 =
um−1 + um
2
, um−1/2 =
um + um+1
2
.
86. Discretization The Finite Volume Method
FVM derivation, central scheme I
For F(u) = βu on a equidistant mesh, the central scheme approximation is
um−1/2 =
um−1 + um
2
, um−1/2 =
um + um+1
2
.
Hence,
un+1
m = un
m −
∆t
∆x
F(un
m+1/2)nm+1/2 + F(un
m−1/2)nm−1/2
= un
m −
∆t
∆x
β
un
m+1/2 − un
m−1/2
= un
m −
∆t
∆x
β
un
m + un
m+1
2
−
un
m−1 + un
m
2
= un
m −
∆t
∆x
β
un
m+1 − un
m−1
2
.
87. Discretization The Finite Volume Method
FVM derivation, central scheme II
Possibilities for evaluating the central flux:
1. F∗(uL, uR, n) = n · F
uL + uR
2
− d,
2. F∗(uL, uR, n) =
n · F(uL) + n · F(uR)
2 − d.
88. Discretization The Finite Volume Method
FVM derivation, central scheme II
Possibilities for evaluating the central flux:
1. F∗(uL, uR, n) = n · F
uL + uR
2
− d,
2. F∗(uL, uR, n) =
n · F(uL) + n · F(uR)
2 − d.
The central scheme is second order accurate.
But:
I the central scheme gives rise to unphysical oscillations around steep
gradients (shocks)
I the central scheme ignores the direction of the flow
I choice of artificial dissipation d can reduce accuracy
89. Discretization The Finite Volume Method
FVM derivation, second derivatives
Flux tensor F contains terms with first derivatives in u for the
Navier–Stokes equations (corresponding to second derivatives in the
differential form of the equations).
Need to approximate these terms before evaluating the flux function.
90. Discretization The Finite Volume Method
FVM derivation, second derivatives
Flux tensor F contains terms with first derivatives in u for the
Navier–Stokes equations (corresponding to second derivatives in the
differential form of the equations).
Need to approximate these terms before evaluating the flux function.
Usually, apply central differences of the kind
∂u
∂x
m−1/2
=
um − um−1
∆x
.
91. Discretization The Finite Volume Method
Higher order discretization schemes for FVM
There are a number of higher order schemes for orders of accuracy ≥ 2,
like
I MUSCL (Monotone Upstream-centered Schemes for Conservation
Laws)
I ENO (Essentially Non-Oscillatory)
I WENO (Weighted ENO)
I RDS (Residual Distribution Scheme)
92. Discretization The Finite Volume Method
Higher order discretization schemes for FVM
There are a number of higher order schemes for orders of accuracy ≥ 2,
like
I MUSCL (Monotone Upstream-centered Schemes for Conservation
Laws)
I ENO (Essentially Non-Oscillatory)
I WENO (Weighted ENO)
I RDS (Residual Distribution Scheme)
They combine different techniques to attain a high-order solution without
excessive oscillations, for example so called flux limiters (reducing artificial
oscillations), wider stencils over several control volumes, different
weightings, reconstruction, and adding degrees of freedom in each control
volume.
93. Discretization The Finite Volume Method
Choosing the discretization parameters
A necessary condition for stability of the time discretization is the CFL
condition (depends on the combination of space and time discretization).
For the one dimensional upwind discretization
un+1
m = un
m −
∆t
∆x
β un
m − un
m−1
,
we require
∆t
∆x
β ≤ 1.
Interpretation: The difference approximation (which only uses information
from one grid point to the left/right) can only represent variations in the
solution up to β/∆x from one time step to the next → time step size has
to be smaller than that limit
94. Discretization The Finite Volume Method
Steady state calculations
For certain computations, the time-dependance is of no importance.
Sought: steady state solution. when the solution has stabilized, the
change in time will go to zero,
un+1
m = un
m −
∆t
|Km|
X
j
|∂Kj
m|F∗
(uL, uR, nj )
| {z }
residual
= un
m, ∀m.
95. Discretization The Finite Volume Method
Steady state calculations
For certain computations, the time-dependance is of no importance.
Sought: steady state solution. when the solution has stabilized, the
change in time will go to zero,
un+1
m = un
m −
∆t
|Km|
X
j
|∂Kj
m|F∗
(uL, uR, nj )
| {z }
residual
= un
m, ∀m.
Measure whether steady state has been achieved: residual gets small.
To reach steady state, many different acceleration techniques can be used,
for example local time stepping and multigrid.
96. Discretization The Finite Volume Method
Steady state calculations
For certain computations, the time-dependance is of no importance.
Sought: steady state solution. when the solution has stabilized, the
change in time will go to zero,
un+1
m = un
m −
∆t
|Km|
X
j
|∂Kj
m|F∗
(uL, uR, nj )
| {z }
residual
= un
m, ∀m.
Measure whether steady state has been achieved: residual gets small.
To reach steady state, many different acceleration techniques can be used,
for example local time stepping and multigrid.
Two examples of steady state:
I computation of the drag and lift around an airfoil,
I mixing problem considered in the computer lab.
97. Discretization The Finite Volume Method
FVM for the incompressible Navier–Stokes equations
I The incompressible Navier–Stokes equations are a system in five
equations (u, p, T), so go through them one by one according to the
above procedure
I Need to take special care of p, since it does not involve a time
derivative
I Computational domain Ω and material parameters ρ, ν specified from
application
I Initial and boundary conditions complete the formulation
98. Discretization The Finite Volume Method
Initial condition
The state of all variables at time t0 has to be defined in order to initiate
the solution process.
For example
u|t=0 = u0.
99. Discretization The Finite Volume Method
Boundary conditions, inflow
The inflow is the part of the domain ∂Ω where u · n 0.
100. Discretization The Finite Volume Method
Boundary conditions, inflow
The inflow is the part of the domain ∂Ω where u · n 0.
Setting an inflow Dirichlet boundary condition, that is u = uin on ∂Kin:
I strongly imposed, set the inflow boundary node values to the
respective value
Um = Uin for all faces ∂Km on ∂Kin.
101. Discretization The Finite Volume Method
Boundary conditions, inflow
The inflow is the part of the domain ∂Ω where u · n 0.
Setting an inflow Dirichlet boundary condition, that is u = uin on ∂Kin:
I strongly imposed, set the inflow boundary node values to the
respective value
Um = Uin for all faces ∂Km on ∂Kin.
I weakly imposed, use the numerical flux,
F∗
(Um, Uin, n).
The inflow data can be viewed as given in a ghost point; boundary
treated as the interior.
102. Discretization The Finite Volume Method
Boundary conditions, outflow
The outflow is the part of the domain ∂Ω where u · n 0.
Treating outflow boundaries is more complicated than inflow parts.
Usually one does a weak formulation such that
1. F∗(UL, UL, n) is used as flux function,
2. F∗(UL, U∞, n) is used as flux function with U∞ a far-field
velocity/pressure/temperature.
There are also strong formulations.
103. Discretization The Finite Volume Method
Boundary conditions, outflow
The outflow is the part of the domain ∂Ω where u · n 0.
Treating outflow boundaries is more complicated than inflow parts.
Usually one does a weak formulation such that
1. F∗(UL, UL, n) is used as flux function,
2. F∗(UL, U∞, n) is used as flux function with U∞ a far-field
velocity/pressure/temperature.
There are also strong formulations.
Beware of artificial back flows!
A common trick is to make the domain big enough to avoid distorting the
solution in the domain of interest.
104. Discretization The Finite Volume Method
Boundary conditions, solid walls
The solid wall is the part of the domain ∂Ω where u · n = 0.
For viscous (Navier–Stokes) flow we apply a no-slip condition
u = 0.
These boundary conditions are usually imposed strongly.
105. Discretization The Finite Volume Method
Heat transfer
When considering heat transfer for the incompressible Navier–Stokes
equations, we also need to assign a BC for the temperature T. Two
mechanisms can be applied:
I specify temperature with a Dirichlet BC, T = Tw , or
I specify heat flux with a Neumann BC, ∂T/∂n = −fq/κ.
107. Turbulence and its modeling
Introduction, dimensionless form
In CFD, a scaled dimensionless form of the Navier–Stokes equation is often
used.
We introduce new variables
x∗
i =
xi
L
, u∗
i =
ui
U
, p∗
=
p
U2ρ
,
∂
∂xi
=
1
L
∂
∂x∗
i
,
∂
∂t
=
U
L
∂
∂t∗
,
in which the incompressible Navier–Stokes equations read
∇∗
· u∗
= 0,
∂u∗
∂t∗
+ (u∗
· ∇∗
)u∗
= −∇∗
p∗
+
ν
UL
|{z}
Re−1
∇2
u∗
.
108. Turbulence and its modeling
Reynolds number and turbulence
The Reynolds number is defined as
Re =
UL
ν
=
Inertial forces
Viscous forces
,
where U, L, ν are the characteristic velocity, characteristic length, and the
kinematic viscosity, respectively.
Fluids with the same Reynolds number behave the same way.
109. Turbulence and its modeling
Reynolds number and turbulence
The Reynolds number is defined as
Re =
UL
ν
=
Inertial forces
Viscous forces
,
where U, L, ν are the characteristic velocity, characteristic length, and the
kinematic viscosity, respectively.
Fluids with the same Reynolds number behave the same way.
When the Reynolds number becomes larger than a critical value, the
formerly laminar flow changes into turbulent flow, for example at
Re ≈ 2300 for pipe flows.
110. Turbulence and its modeling
Characterization of turbulence
Turbulent flows are
I time dependent
I three dimensional
I irregular
I vortical (ω = ∇ × u)
Image from http://en.wikipedia.org
Describing the turbulence can be done in many ways, and the choice of the
method depends on the application at hand and on computational
resources.
111. Turbulence and its modeling
Direct Numerical Simulation (DNS)
I All scales in space and time are resolved.
I No modeling of the turbulence.
I Limited to small Reynolds numbers, because extremely fine grids and
time steps are required, O(Re3
) spatial and temporal degrees of
freedom.
Applications of DNS:
I Turbulence research.
I Reference results to verify other turbulence models.
112. Turbulence and its modeling
Large Eddie Simulation (LES)
Only the large scales are resolved, and small scales are modeled.
Active research.
LES quite popular in certain industries, but still very costly.
113. Turbulence and its modeling
Reynolds-Averaged Navier–Stokes (RANS) I
Concept introduced by Reynolds in 1895. The most commonly used
approach in industry. Only time averages are considered, nonlinear effects
of the fluctuations are modeled.
Use the decomposition
u(x, t) = ū(x, t)
| {z }
time average
+ u0
(x, t)
| {z }
fluctuation
,
where the time average is
ū(x, t) =
1
δ
Z t+δ
t
u(x, τ) dτ,
(spatial averaging or ensemble averaging can otherwise be used).
114. Turbulence and its modeling
Reynolds-Averaged Navier–Stokes (RANS) II
Continuity equation for averaged quantities:
∇ · u = 0.
Momentum equations:
∂u
∂t
+ (u · ∇)u + (u0 · ∇)u0 = −
1
ρ
∇p + ν∇2
u + f,
or, equivalently,
∂u
∂t
+ (u · ∇)u = ∇ ·
−
1
ρ
pI + ν∇u − u0 ⊗ u0
+ f,
115. Turbulence and its modeling
Reynolds-Averaged Navier–Stokes (RANS) III
∂u
∂t
+ (u · ∇)u = ∇ ·
−
1
ρ
pI + ν∇u − u0 ⊗ u0
+ f,
∇ · u = 0.
The Reynolds stress term −u0 ⊗ u0 contains fluctuations, and its effect
needs to be modeled.
Examples are Spalart-Allmaras, K − ε, K − ω, and SST.