Numerical methods for hyperbolic balance laws with discontinuous ﬂux functions and applications in radiotherapy
Numerische Verfahren f¨ur hyperbolische Bilanzgleichungen mit unstetiger Flussfunktion und Anwendungen in der Strahlentherapie
von Nadine Pawlitta
27.10.2011
Masterarbeit in Mathematik
vorgelegt der Fakult¨at f¨ur Mathematik, Informatik und Naturwissenschaften der RheinischWestf¨alischen Technischen Hochschule Aachen
Angefertigt bei Prof. Dr. Martin Frank Lehrstuhl f¨ur Mathematik CCES
Zweitgutachter Prof. Dr. Michael Herty Lehrstuhl C f¨ur Mathematik
3
Danksagung
Ich m¨ochte mich an dieser Stelle bei all denen bedanken, die mich bei der Anfertigung meiner Masterarbeit unterst¨utzt haben.
Besonderer Dank gilt Herrn Professor Martin Frank f¨ur die Betreuung dieser Arbeit und f¨ur die vielen hilfreichen Anregungen.
Zudem bedanke ich mich bei den Mitarbeitern des MathCCES und meinen Freunden und Kommilitonen f¨ur die freundliche Atmosph¨are und fachliche Unterst¨utzung.
Nicht zuletzt m¨ochte ich mich auch bei meiner Familie bedanken, ohne die dieses Studium niemals m¨oglich gewesen w¨are.
Contents
1 Introduction to hyperbolic conservation laws 
9 

1.1 Deﬁnition of conservation laws 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
9 

1.1.1 
The advection equation 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
10 

1.2 Theory of numerical methods 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
12 

1.2.1 
Convergence 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
14 

1.3 Numerical methods for linear equations 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
17 

1.3.1 The Upwind method 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
17 

1.3.2 Godunov’s method 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
21 

1.3.3 The LaxWendroﬀ method . 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
22 

2 The advection equation with non constant velocity 
27 

2.1 Theoretical analysis 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
27 

2.2 Methods . . 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
30 

2.2.1 The Upwind method on a nonuniform grid 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
30 

2.2.2 The Upwind method on a uniform grid 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
33 

2.2.3 The LaxWendroﬀ method . 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
41 

2.3 Comparison and evaluation of the derived methods 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
45 

3 Nonlinear partial diﬀerential equations 
55 

3.1 Analysis of nonlinear equations 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
55 

3.1.1 
Burgers equation 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
57 

3.2 Numerical methods for nonlinear equations 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
58 

3.2.1 
The LaxFriedrichs method 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
59 

3.3 Nonlinear equations with spatially varying, discontinuous ﬂux function 
64 

3.3.1 The LaxFriedrichs method on a nonuniform grid . 
. 
. 
. 
. 
. 
. 
. 
. 
. 
65 

3.3.2 The LaxFriedrichs method on a uniform grid . 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
68 

3.3.3 Flux functions with arbitrary, piecewise constant coeﬃcient 
71 

4 Applications in radiotherapy 
77 

4.1 
A model for dose calculation 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
77 
5
6
Contents
4.2 Solution of the 1D model 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
78 

4.3 Numerical experiments . 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
82 

4.3.1 Homogeneous test case . 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
82 

4.3.2 Onedimensional dose calculation . 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
85 

5 
Conclusions and outlook 
91 
Introduction
Radiotherapy is a way of treating diseases like cancer by using ionizing radiation that destroys the cells in the treated area. At the same time, the damage to the surrounding tissue should be as small as possible. For this reason, the needed dose of radiation has to be determined accurately. The diﬃculty that gave rise to this thesis is that the radiation has to pass tissues of diﬀerent density. For example, a particle that travels through air looses much less energy than one that travels through bone. The density can be described by a function ρ that is space dependent and can obtain values from approximately 1, which corresponds to water, to 10 ^{−}^{3} , which is air. In this situation, the change between the diﬀerent areas and therefore densities is abrupt, so ρ is a piecewise constant function. It can be ascertained with the data of a Computer Tomography scan which is performed before the treatment.
The dose of radiation can then be computed by analyzing the transport of the radiation particles. This transport can be described by a hyperbolic balance law, which is a system of partial diﬀerential equations with a source term. In this thesis, a system of two ﬁrst order equations of the form
∂ ˜
∂ ˜
Ψ ^{0} (x, ˜) −
¯
Ψ ^{1} (x, ˜) −
¯
1
ρ(x) ^{∂} ^{x}
Ψ ^{1} (x, ˜) = 0,
¯
ρ(x) ^{∂} ^{x}
1
Ψ ^{0} (x, ˜) χ
¯
Ψ ^{1} (x,
¯
˜)
_{} _{˜}_{)} = T (˜ ) Ψ ^{1} (x, ˜)
¯
¯
Ψ ^{0} (x,
is considered as a model for the radiative transport.
Usually, there exist several diﬀerent numerical methods to solve such equations with high accuracy, but the diﬀerence in the velocity makes them computationally too expensive and therefore infeasible. The reason for this is the socalled CFL condition which is a necessary condition for stability of the numerical methods. It establishes a connection between the time step size and the spatial step size that depends on the density ρ. For small values of ρ, as is the case when modeling air, the CFL condition demands a much smaller time step size than spatial step size. Therefore, the existing standard methods would solve the equation with a time step size that is only needed for particles that travel through air and is much smaller than necessary for particles that travel through
7
8
Introduction
water.
The aim of this thesis is to ﬁnd a numerical method that is better suited for this problem by adjusting existing methods so that they no longer require such a small time step size. Note that there does not exist suﬃcient theoretical knowledge of such situations. While
it will be possible to derive methods that solve the given equations, there is no theory
that provides the means to evaluate the methods analytically.
In the following, numerical methods are derived for onedimensional systems of equations by gradually extending methods for more simple problems. The ﬁrst chapter gives a
general introduction to ﬁrstorder, hyperbolic partial diﬀerential equations without such
a discontinuous coeﬃcient and introduces basic numerical methods for the special case
of linear equations. In the second chapter, these methods are modiﬁed to solve linear equations with the addition of a piecewise constant coeﬃcient which will later on be the density ρ. The results of these two chapters will be used in the third to solve nonlinear equations, ﬁrst without and then with the discontinuous coeﬃcient. This yields the basis
for the fourth chapter. There, the numerical methods are validated and applied to dose calculation in radiotherapy.
1 Introduction to hyperbolic conservation laws
This chapter introduces the basics of hyperbolic partial diﬀerential equations and their solutions and is mostly based on [11] and [12]. After establishing some theoretical facts about such equations, the ﬁnite volume method for solving them is derived and analyzed for convergence to the true solution. Following this, two basic methods for the special case of a linear equation are presented.
1.1 Deﬁnition of conservation laws
Consider the initial value problem or Cauchy problem
∂
∂
_{∂}_{t} u(x, t) + _{∂}_{x} f (u(x, t)) =
0,
x ∈ R, t > 0
u(x, 0) = u _{0} (x),
x ∈ R
(1.1)
where f ∈ C ^{1} (R) and u _{0}
The equation u _{t} + (f (u)) _{x} = 0 is the diﬀerential form of a conservation law. In order to derive it, examine the onedimensional example of the ﬂow of a substance with density u through a pipe. The mass between two points x _{1} and x _{2} at time t can be described by
∈ L _{∞} (R).
x
x 2
1
u(x, t)dx.
Conservation of mass then means that the mass of the substance does not change within the pipe but rather through ﬂux at the boundaries of the pipe. In case this ﬂux can be described by the function f , it gives the integral form of the conservation law
∂
∂t
x
x
1
2
u(x, t)dx = f (u(x _{1} , t)) − f (u(x _{2} , t)) .
(1.2)
Assuming that u and f are smooth, this results in
∂
∂t
x
x
1
2
u(x, t)dx = −
x
x
1
2
∂
_{∂}_{x} f (u(x, t)) dx
9
10
1 Introduction to hyperbolic conservation laws
which can be written as
x
x
1
2
_{∂}_{t} u(x, t) + _{∂}_{x} f (u(x, t)) dx = 0.
^{} ∂
∂
This yields the ﬁrst introduced diﬀerential form of the conservation law.
1.1.1 The advection equation
The advection equation
∂
∂
_{∂}_{t} u(x, t) + a _{∂}_{x} u(x, t) = 0
(1.3)
is a special case of (1.1) with a = f ^{} (u) since (f (u)) _{x} = f ^{} (u)u _{x} = au _{x} . It models the advection of a substance in a ﬂuid with velocity a. It is easy to verify that, given an initial condition u(x, 0) = u _{0} (x), the solution of this equation is given by u(x, t) = u _{0} (x − at) as
∂
∂
_{∂}_{t} u _{0} (x − at) + a _{∂}_{x} u _{0} (x − at) = −au ^{} _{0} (x − at) + au _{0} ^{} (x − at) = 0.
Therefore, for arbitrary x _{0} , the solution u(x, t) is constant along the socalled character istics X(t) = x _{0} + at of the equation because
x
Figure 1.1: Characteristics for the advection equation.
Figure 1.1 shows for example some characteristics for an advection equation with positive
1 Introduction to hyperbolic conservation laws
11
velocity. The value of the solution u is the same on each point of one characteristic, this means that in practice, the initial value u _{0} simply shifts to the right in time, as can be seen in ﬁgure 1.2.
initial condition, time t=0
time t=300
time t=150
time t=450
Figure 1.2: Solution of the advection equation at diﬀerent time steps.
In higher dimensions, a linear, constantcoeﬃcient equation like the advection equation becomes a linear system
since the system
can be written as
u _{t} + Au _{x} = 0
u _{t} +
(f (u)) _{x}
= 0
u _{t} +
f ^{} (u)u _{x} = 0
if f is smooth and f ^{} (u) = A ∈ R ^{m}^{×}^{m} is the Jacobian of f . Such a system is called
hyperbolic if the matrix A is diagonalizable with real eigenvalues λ ^{1} ,
, λ ^{m} , that is
A = R diag(λ ^{1} ,
,
λ ^{m} )R ^{−}^{1}
12
1 Introduction to hyperbolic conservation laws
where R is the matrix that is composed of the corresponding eigenvectors. As a result
u _{t} + Au _{x} = 0
⇔
⇔ v _{t} + diag(λ ^{1} ,
⇔
R ^{−}^{1} u _{t} + R ^{−}^{1} ARR ^{−}^{1} u _{x} = 0
, λ ^{m} )v _{x} = 0
v
p
t
+ λ ^{p} v ^{p} = 0,
x
for p = 1
m
with R ^{−}^{1} u =: v and therefore, the original system is equivalent to a system of m in
dependent advection equations. always hyperbolic.
Note that a scalar, ﬁrstorder diﬀerential equation is
1.2 Theory of numerical methods
The basic idea of the socalled ﬁnite volume methods is to divide the spatial domain into a mesh and to approximate the integral of u over each cell in the mesh. In the onedimensional case, one of those cells is an interval
^{C} i ^{=} ^{(}^{x} i−1/2 ^{,} ^{x} i+1/2 ^{)}
with size ∆x _{i} = x _{i}_{+}_{1}_{/}_{2} − x _{i}_{−}_{1}_{/}_{2} and ∆x _{i} = ∆x in the case of a uniform grid as pictured in ﬁgure 1.3.
t n+1
t n
x
i1
x
i
x
i+1
t
Figure 1.3: Example for a uniform grid.
The approximation u ^{n} be expressed as
i
to the average value of the solution over C _{i} at time t _{n} can then
u ^{n} ≈
i
∆x _{C} _{i}
1
u(x, t _{n} )dx.
1 Introduction to hyperbolic conservation laws
13
This can be used to construct a numerical method for the solution of the PDE. The starting point is the integral form (1.2) of the conservation law
∂
∂t _{C} _{i}
u(x, t)dx = f ^{} u(x _{i}_{−}_{1}_{/}_{2} , t) ^{} − f ^{} u(x _{i}_{+}_{1}_{/}_{2} , t) ^{} .
Integration over time and rearrangement gives
t
C i u(x, t _{n}_{+}_{1} )dx − C i u(x, t _{n} )dx =
t
n
n+1
t
f ^{} u(x _{i}_{−}_{1}_{/}_{2} , t) ^{} dt −
t
n
n+1
f ^{} u(x _{i}_{+}_{1}_{/}_{2} , t) ^{} dt
⇔
∆x _{C} _{i}
1
u(x, t _{n}_{+}_{1} )dx =
∆x _{C} _{i}
1
u(x, t _{n} )dx
−
t
∆x ∆t
∆t
1
t
n
n+1
f ^{} u(x _{i}_{+}_{1}_{/}_{2} , t) ^{} dt −
t
∆t
1
t
n
n+1
f ^{} u(x _{i}_{−}_{1}_{/}_{2} , t) ^{} dt
where ∆t = t _{n}_{+}_{1} − t _{n} is one time step. The method should therefore have the form
∆t
n+1
i
_{u}
= u ^{n} i −
∆x ^{(}^{F}
n
i+1/2 ^{−} ^{F}
_{i}_{−}_{1}_{/}_{2} )
n
(1.4)
with u ^{n} approximated as before and the average ﬂux F
i
n i−1/2 ^{a}^{s}
F
n
i−1/2 ^{≈}
∆t
1
t
n
t n+1
f ^{} u(x _{i}_{−}_{1}_{/}_{2} , t) ^{} dt.
This can be computed by means of a numerical ﬂux function F where it is assumed for now that the ﬂux F _{i}_{−}_{1}_{/}_{2} depends only on the values u ^{n} _{i}_{−}_{1} and u ^{n} so that
n
i
i−1/2 ^{=} ^{F}^{(}^{u} ^{n} i−1 ^{,} ^{u} ^{n}
F
n
i
).
(1.5)
Thus, the method is deﬁned by the ﬂux and approximates the value u ^{n}^{+}^{1}
i
_{u}
n+1
i
= u ^{n} i −
_{∆}_{x} ∆t ^{} F(u ^{n} , u _{i}_{+}_{1} ^{n} ) − F(u ^{n}
i
i−1 ^{,} ^{u} ^{n}
i
) ^{} ,
by
(1.6)
which is the standard formulation of a ﬁnite volume method. More generally, if the ﬂux F _{i}_{−}_{1}_{/}_{2} depends on u ^{n} _{i}_{−}_{m} up to u _{i}_{+}_{m}_{−}_{1} by
n
^{n}
, the method is given
_{u}
n+1
i
= u ^{n} i −
∆t
_{∆}_{x} ^{} F(u ^{n}
_{i}_{−}_{m}_{+}_{1} ^{,}
, u ^{n} _{i}_{+}_{m} ) − F(u _{i}_{−}_{m}
^{n}
,
.
.
. , u ^{n}
i+m−1 ^{)} ^{.}
Let N then describe the numerical method as
N(u ^{n}
_{i}_{−}_{m} ^{,}
, u ^{n}
i+m ^{)} ^{=} ^{u} ^{n}
i −
∆t _{∆}_{x} ^{} F(u _{i}_{−}_{m}_{+}_{1}
^{n}
,
, u ^{n} _{i}_{+}_{m} ) − F(u _{i}_{−}_{m}
^{n}
,
.
.
. , u ^{n}
i+m−1 ^{)} ^{.}
A method that can be written thusly is called conservative or in conservation form. The following sections examine this condition for ∆t before specifying a method by choosing a numerical ﬂux function.
14
1 Introduction to hyperbolic conservation laws
1.2.1 Convergence
An obvious property of the numerical method should be that the computed solution converges to the exact one if the grid is reﬁned, that is for ∆x, ∆t → 0. The Equivalence Theorem of Lax and Richtmyer (see [9]) states that stability is necessary and suﬃcient for convergence of a linear, consistent method. Therefore, there are two conditions that have to be fulﬁlled to achieve convergence.
• Consistency deals with the error in one time step, it is given when the diﬀerential equation is locally well approximated. For the numerical ﬂux function F this means that in the special case where u is constant and F _{i}_{−}_{1}_{/}_{2} = f (u), F must
n
satisfy F (u, u) = f (u).
• Stability is the property that the error of a time step does not increase too much.
In the following, both attributes will be examined in more detail.
Consistency Consider the error caused by the application of the numerical method after one time step. This error is called the local truncation error, it compares the true solution at a time t + ∆t with the true solution at time t after one step of the method and is given as
L(x, t) =
1
_{∆}_{t} (N (u(x − m∆x, t),
, u(x + m∆x, t)) − u(x, t + ∆t)) .
(1.7)
The numerical method is now said to be consistent if
_{∆}_{t}_{→}_{0} L(., t) = 0.
lim
Furthermore, if the error can be written as
L(., t) ≤ c∆t ^{p}
(1.8)
for a constant c and arbitrary, smooth initial data, the method is of order p. In this thesis, the discrete 1norm x _{1} = ^{} _{i} x _{i}  is used, though other norms can be used as well, but they might give diﬀerent results. Instead of determining the order analytically, it can be estimated graphically as well. If the ratio of ∆x and ∆t is set to be constant,
L(., t) ≤ c∆t ^{p}
⇔
L(., t) ≤ c˜∆x ^{p}
1 Introduction to hyperbolic conservation laws
15
for some other constant c˜. Since it will later on be important to observe the error at every time step, consider in this thesis from now on the error
:=
^{1}
T
T
t=1
^{} ∆x(u(., t∆t) − N ^{t} (u _{0} (.)) ^{} ^{} 1
where N ^{t} means that N has been applied t times. Therefore, the error is the weighted sum of the diﬀerence of the exact solution and the computed one at each point in space and time. If the method is now of order p, then can be estimated by ∆x ^{p} as well. For a constant C it then holds that
= C∆x ^{p}
⇔
log
= log C + p log ∆x.
For this reason, the logarithm of the error can be interpreted as a straight line with slope p. To assess the order p simply compute the error for diﬀerent values of ∆ x and plot them as a function of log ∆x.
Stability A necessary condition for stability is the socalled CFL condition, named after Courant, Friedrichs and Lewy [4]. For the advection equation (1.3) it was shown above
that the solution is constant along the characteristics and u(x, t) = u _{0} (x − at) for arbi trary x and t. In other words, the solution at a point (x, t) depends on the initial data only at one point x − at. Because of this, the numerical solution should as well depend on at least this point, or rather on the point on the respective characteristic that was computed one time step before. This set of points is called the domain of dependence D(x, t) of the PDE at the point (x, t) and simply takes the form D(x, t) = {x − at} for the advection equation. The CFL condition now states for the general case that a numerical method can only be convergent if the domain of dependence of the PDE is a subset of the numerical domain of dependence.
For a method of the form (1.6), which computes u ^{n}^{+}^{1}
using a three point stencil con
sisting of u ^{n}
i
i−1 ^{,}^{u} ^{n}
i
and u ^{n}
_{i}_{+}_{1}
, the domain of dependence is the set
D(x, t) = x˜ _{} x − ^{∆}^{x} t ≤ x˜ ≤ x + ^{∆}^{x} t
∆t
∆t
as can be seen in ﬁgure 1.4. There the value at the point (x _{i} , t _{n}_{+}_{1} ) depends on (x _{i}_{−}_{1} , t _{n} ),
(x _{i} , t _{n} ) and (x _{i}_{+}_{1} , t _{n} ) and these in turn on (x _{i}_{−}_{2} , t _{n}_{−}_{1} ) up to (x _{i}_{+}_{2} , t _{n}_{−}_{1} ) and so on, so that the edges of the resulting triangle can be described by t → x − ^{∆}^{x} t and t → x+ ^{∆}^{x} t.
∆t
∆t
Hence, for the CFL condition to be fulﬁlled, the domain of dependence of the given PDE has to be situated inside this triangle.
16
1 Introduction to hyperbolic conservation laws
t n+1
t n
t n1
Figure 1.4: Three point stencil.
For the advection equation, the domain of dependence is the set D(x, t) = {x − at} and therefore
which can be reduced to
where the number ν = ^{}
_{} a∆t
∆x
x − ^{∆}^{x} t ≤ x − at ≤ x + ^{∆}^{x}
∆t
∆t ^{t}^{,}
a∆t
∆x
_{} ≤ 1
is called the courant number.
(1.9)
Monotonicity and Total Variation There are other properties that are connected to the convergence of a method and will be analyzed further here. The ﬁrst is the concept of monotonicity. It is reasonable to demand that if the solution is monotone on an interval, the numerical solution should be monotone as well. Based on this notion, a numerical method N is called monotone if
u ^{n} ≥ u
i
n
j
⇒
N(u ^{n} ) ≥ N(u
i
n
j
)
and it is called monotonicitypreserving if
u
0
i
≥ u
0
j
⇒
u ^{n} ≥ u
i
n
j .
Another requirement deals with the total variation of a function. For an arbitrary function g the total variation is deﬁned as
T V (g) = lim sup
→0
1
∞
−∞
g(x) − g(x − )dx.
1 Introduction to hyperbolic conservation laws
17
For the special case of the piecewise constant function or rather grid function u ^{n} this simpliﬁes to
TV (u ^{n} ) =
∞
i=−∞
u ^{n} − u ^{n}
i
i−1 ^{}^{.}
The total variation can be used to measure oscillations in a function. To avoid the appearance of oscillations which are only the result of the computations and have no physical meaning, the total variation of the solution should not increase. A numerical method is therefore called total variation diminishing (TVD) or more appropriately total variation nonincreasing if
TV (u ^{n}^{+}^{1} ) ≤ TV (u ^{n} )
for u ^{n}^{+}^{1} = N(u ^{n} ). Furthermore, monotonicity implies TVD and TVD implies mono tonicity preserving, so it suﬃces to proof monotonicity when testing a numerical method for all three properties.
1.3 Numerical methods for linear equations
Derive now the basic numerical methods for the solution of the advection equation and analyze them for convergence as described above.
1.3.1 The Upwind method
It is reasonable to choose the ﬂux function F _{i}_{−}_{1}_{/}_{2} according to the structure of the solution in order to achieve better results. For the constantcoeﬃcient advection equation u _{t} + au _{x} = 0 it was shown that the solution is constant along the characteristics, that
= u(x _{i} + a∆t, t _{n}_{+}_{1} ). Hence, if a is positive, u(x _{i} , t _{n}_{+}_{1} ) depends only on the
values of u at time t _{n} to the left of x _{i} and the same should hold for u ^{n}^{+}^{1} . In other words,
the ﬂux F _{i}_{−}_{1}_{/}_{2} should be determined by u _{i}_{−}_{1}
is u(x _{i} , t _{n} )
n
i
n
^{n}
. Choosing
i−1/2 ^{=} ^{F}^{(}^{u} ^{n} i−1 ^{,} ^{u} ^{n}
F
n
i
) = au ^{n}
i−1
in (1.4) yields the ﬁrstorder upwind method for the advection equation as
_{u}
n+1
i
= u ^{n}
i
_{−} a∆t
∆x
(u ^{n} − u _{i}_{−}_{1} ^{n} ).
i
(1.10)
It is important to observe that this ansatz is only correct if u(x _{i} , t _{n}_{+}_{1} ) depends solely on u(x _{i}_{−}_{1} , t _{n} ), which makes the above choice of the ﬂux sensible. This is given by the
18
1 Introduction to hyperbolic conservation laws
CFL condition for the advection equation (1.9) because u(x _{i} , t _{n}_{+}_{1} ) = u(x _{i} − a∆t, t _{n} ) and therefore x _{i} − a∆t ≥ x _{i} − ∆x = x _{i}_{−}_{1} . Figure 1.5 ﬁrst depicts the case where the CFL condition is fulﬁlled because it takes more than one time step for the characteristics to cross one spatial interval C _{i} . In the second part this is no longer the case and the CFL condition is breached.
t n+1
t n
t n+1
t n
Figure 1.5: Two examples where the CFL condition is fulﬁlled and breached.
It should be noted that the upwind method for the advection equation is exact if ν =
a∆t
∆x
= 1 because then
which complies with
_{u}
n+1
i
= u ^{n} − (u ^{n} − u ^{n}
i
i
i−1 ^{)} ^{=} ^{u} i−1
^{n}
^{,}
u(x _{i} , t _{n}_{+}_{1} ) = u(x _{i} − a∆t, t _{n} ) = u(x _{i} − ∆x, t _{n} ) = u(x _{i}_{−}_{1} , t _{n} ).
The latter is a property of the exact solution of the PDE and is given by following the
characteristics. In most cases though, ν is strictly smaller than 1, which leads to the situation in ﬁgure 1.6. Another possibility to derive the upwind method is to take the convex combination
of u(x _{i}_{−}_{1} , t _{n} ) and u(x _{i} , t _{n} ) to compute u(x _{i} , t _{n}_{+}_{1} )
since u(x _{i} , t _{n}_{+}_{1} ) = u(x _{i} − a∆t, t _{n} ) =
u(x _{i} −ν∆x, t _{n} ). This is the result of the evaluation of the linear interpolation polynomial through x _{i}_{−}_{1} and x _{i} at the point x _{i} − a∆t. The polynomial has the form
which simpliﬁes to
u ^{n} + ^{u} n
i
i−1 ^{−} ^{u} ^{n}
x i−1 − x
i (x − x _{i} ) = u ^{n} − ^{u} n
i
i
i−1 ^{−} ^{u} ^{n}
i
∆x
(x − x _{i} ),
u ^{n} + ν(u ^{n}
i
i−1 ^{−} ^{u} ^{n}
i
when inserting x = x _{i} − a∆t.
) = u ^{n} − ν(u ^{n} − u ^{n}
i
i
i−1 ^{)}
1 Introduction to hyperbolic conservation laws
19
t n+1
t n
^{x} i1
Figure 1.6: The upwind method for ν < 1.
Properties of the upwind method
examining the local truncation error (1.7) that is given as
The method is of ﬁrst order as can be shown by
L(x _{i} , t _{n} ) =
1
_{∆}_{t} (u(x _{i} , t _{n} ) − ν(u(x _{i} , t _{n} ) − u(x _{i}_{−}_{1} , t _{n} )) − u(x _{i} , t _{n}_{+}_{1} )) .
Replace u(x _{i}_{−}_{1} , t _{n} ) and u(x _{i} , t _{n}_{+}_{1} ) by their Taylor series expansion
u(x _{i}_{−}_{1} , t _{n} ) = u(x _{i} , t _{n} ) −
u(x _{i} , t _{n}_{+}_{1} ) = u(x _{i} , t _{n} ) +
∆x u _{x} (x _{i} , t _{n} ) + ^{1} _{2} ∆x ^{2} u _{x}_{x} (x _{i} , t _{n} ) + O(∆x ^{3} ),
∆t u _{t} (x _{i} , t _{n} ) + ^{1} _{2} ∆t ^{2} u _{t}_{t} (x _{i} , t _{n} ) + O(∆t ^{3} ),
which yields
L(x _{i} , t _{n} ) =
=
=
_{∆}_{t} u(x _{i} , t _{n} ) − ν u(x _{i} , t _{n} ) − u(x _{i} , t _{n} ) + ∆x
1
u _{x} (x _{i} , t _{n} ) − ^{1} _{2} ∆x ^{2} u _{x}_{x} (x _{i} , t _{n} ) − O(∆x ^{3} )
−u(x _{i} , t _{n} ) − ∆t
u _{t} (x _{i} , t _{n} ) − ^{1} _{2} ∆t ^{2} u _{t}_{t} (x _{i} , t _{n} ) − O(∆t ^{3} )
_{∆}_{t} −ν∆x u _{x} (
Viel mehr als nur Dokumente.
Entdecken, was Scribd alles zu bieten hat, inklusive Bücher und Hörbücher von großen Verlagen.
Jederzeit kündbar.