Professional Documents
Culture Documents
Numerical Solution of The Advection Equation: 0.8 T 0 Min T 5 Min T 10 Min T 20 Min
Numerical Solution of The Advection Equation: 0.8 T 0 Min T 5 Min T 10 Min T 20 Min
Numerical Solution of The Advection Equation: 0.8 T 0 Min T 5 Min T 10 Min T 20 Min
0.8
t=0 min
0.6 t=5 min
t=10 min
C(x;t)
0.2
0
-50 0 50 100 150 200
x [m]
+ =0 0
-50 0 50 100 150 200
x [m]
The solution to this equation is extremely simple: the initial profile remains
unchanged and translates at velocity U. Indeed, the the analytical solution is
= ( − ) where ( )= ( ; )
1
Central discretisation of the advection operator
t
The most obvious choice is to approximate
the advection operator with a central
difference scheme:
−
+ =0
2Δ x1 x2 x3 x4 x5 x
−
+ =0 if >0
Δ
−
+ =0 if <0
Δ
Upwind schemes aim to do justice to the fact that for advection problems,
information travels downstream. Hence, the advection operator is skewed
towards the upstream direction to better approximate the flow of information.
2
Example advection of a shockwave
t=5s
• Consider the advection of 1.5
analytical
a scalar with initial
C(x; t) [kg/m3]
1 upwind
conditions:
central
0.5
1 if |x| < 10
( , 0) = !
0 otherwise
0
-0.5
• The analytical and the -40 -20 0 20 40
x [m]
two numerical solutions
t=10s
are shown in the figure 1.5
on the right. analytical
C(x; t) [kg/m3]
1 upwind
• Clearly, both schemes
have problems: the central
0.5
central scheme
0
oscillates unphysically,
and the upwind scheme -0.5
is too diffusive. -40 -20 0 20 40
x [m]
pde005.m
Δ ) +
+ ( + +, + -(Δ +) =0
6
CENTRAL
Δ )
+ ( − ), + -(Δ )) =0
UPWIND 2
In a way this only confirms what we already knew, namely that the central
and upwind scheme have a second and first order truncation error,
respectively.
However, if we look at the equations above slightly differently, we can
understand the behaviour of the numerical schemes.
Computing Engineering Analysis (CI3-321/MvR) Page 60
3
The modified equation
• Numerical schemes provide solutions to the governing equation in the limit
of ∆x → 0. But which equation is solved when this limit has not been
reached?
• This equation is called the modified equation, which includes the leading
error term due to the discretisation.
• The modified equation for the central scheme is
Δ ) +
+ + =0
6 +
Δ
+ −
)
) =0
2
• The extra term in the equation above is a second derivative, which is a
diffusion term.
You are not solving what you think you are solving I
You want to solve + = 0 and use a second order central scheme.
t = 60.0s
0.2
Advection equation with ∆ x = 1
Fully converged solution of modified equation
0.15
Analytical solution of advection equation
c [kg/m3]
0.1
4
You are not solving what you think you are solving II
You want to solve + = 0 and use a first order upwind scheme.
t = 60.0s
0.2
Advection equation with ∆ x = 1
Fully converged solution of modified equation
0.15
Analytical solution of advection equation
c [kg/m3]
0.1
0.05
Numerical diffusion
0
-20 0 20 40 60 80
x [m]
Godunov, Sergei K. (1959), A Difference Scheme for Numerical Solution of Discontinuous Solution of
Hydrodynamic Equations, Math. Sbornik, 47, 271-306, translated US Joint Publ. Res. Service, JPRS
7226, 1969. See Hirsch (2002), recommended reading
5
Accuracy versus monotonicity
• In order to solve this PDE using finite differences use the product rule
5 d4 5 )5
= +4 )
d
• and then discretise all derivatives in the usual manner:
d5 4 −4 5 −5 5 − 25 + 5
= +4
d 2Δ 2Δ Δ )
• Here, 4 = 4( ).
• If 4( ) is an analytical expression, the differentiation can be performed
manually rather than via numerical differentiation.
6
Take-home messages
0 0 0
-2 -2 -2
-2 0 2 -2 0 2 -2 0 2