NASA/CR-97-206253
ICASE Report No. 97-65
Essentially Non-Oscillatory and Weighted Essentially
Non-Oscillatory Schemes for Hyperbolic
Conservation Laws
Chi-Wang Shu
Brown University
Institute for Computer Applications in Science and Engineering
NASA Langley Research Center
Hampton, VA
Operated by Universities Space Research Association
National Aeronautics and
Space Administration
Langley Research Center
Hampton, Virginia 23681-2199
November 1997
Prepared for Langley Research Center
under Contract NAS1-19480
ESSENTIALLY NON-OSCILLATORY AND WEIGHTED ESSENTIALLY
NON-OSCILLATORY SCHEMES FOR HYPERBOLIC CONSERVATION LAWS
CHI-WANG SHU
∗
Abstract. In these lecture notes we describe the construction, analysis, and application of ENO (Essentially Non-Oscillatory) and WENO (Weighted Essentially Non-Oscillatory) schemes for hyperbolic conservation laws and related Hamilton-Jacobi equations. ENO and WENO schemes are high order accurate
finite difference schemes designed for problems with piecewise smooth solutions containing discontinuities.
The key idea lies at the approximation level, where a nonlinear adaptive procedure is used to automatically
choose the locally smoothest stencil, hence avoiding crossing discontinuities in the interpolation procedure as
much as possible. ENO and WENO schemes have been quite successful in applications, especially for problems containing both shocks and complicated smooth solution structures, such as compressible turbulence
simulations and aeroacoustics.
These lecture notes are basically self-contained. It is our hope that with these notes and with the help of
the quoted references, the reader can understand the algorithms and code them up for applications. Sample
codes are also available from the author.
Key words. essentially non-oscillatory, conservation laws, high order accuracy
Subject classification. Applied and Numerical Mathematics
1. Introduction. ENO (Essentially Non-Oscillatory) schemes started with the classic paper of Harten,
Engquist, Osher and Chakravarthy in 1987 [38]. This paper has been cited at least 144 times by early 1997,
according to the ISI database. The Journal of Computational Physics decided to republish this classic paper
as part of the celebration of the journal’s 30th birthday [68].
Finite difference and related finite volume schemes are based on interpolations of discrete data using
polynomials or other simple functions. In the approximation theory, it is well known that the wider the
stencil, the higher the order of accuracy of the interpolation, provided the function being interpolated is
smooth inside the stencil. Traditional finite difference methods are based on fixed stencil interpolations. For
example, to obtain an interpolation for cell i to third order accuracy, the information of the three cells i − 1,
i and i + 1 can be used to build a second order interpolation polynomial. In other words, one always looks
one cell to the left, one cell to the right, plus the center cell itself, regardless of where in the domain one
is situated. This works well for globally smooth problems. The resulting scheme is linear for linear PDEs,
hence stability can be easily analyzed by Fourier transforms (for the uniform grid case). However, fixed
stencil interpolation of second or higher order accuracy is necessarily oscillatory near a discontinuity, see
Fig. 2.1, left, in Sect. 2.2. Such oscillations, which are called the Gibbs phenomena in spectral methods, do
not decay in magnitude when the mesh is refined. It is a nuisance to say the least for practical calculations,
and often leads to numerical instabilities in nonlinear problems containing discontinuities.
Before 1987, there were mainly two common ways to eliminate or reduce such spurious oscillations near
discontinuities. One way was to add an artificial viscosity. This could be tuned so that it was large enough
∗
Division of Applied Mathematics, Brown University, Providence, RI 02912 (e-mail: ). Research of
the author was partially supported by NSF grants DMS-9500814, ECS-9214488, ECS-9627849 and INT-9601084, ARO grants
DAAH04-94-G-0205 and DAAG55-97-1-0318, NASA Langley grant NAG-1-1145 and Contract NAS1-19480 while in residence
at ICASE, NASA Langley Research Center, Hampton, VA 23681-0001, and AFOSR grant F49620-96-1-0150.
1
near the discontinuity to suppress, or at least to reduce the oscillations, but was small elsewhere to maintain
high-order accuracy. One disadvantage of this approach is that fine tuning of the parameter controlling
the size of the artificial viscosity is problem dependent. Another way was to apply limiters to eliminate
the oscillations. In effect, one reduced the order of accuracy of the interpolation near the discontinuity
(e.g. reducing the slope of a linear interpolant, or using a linear rather than a quadratic interpolant near
the shock). By carefully designing such limiters, the TVD (total variation diminishing) property could be
achieved for nonlinear scalar one dimensional problems. One disadvantage of this approach is that accuracy
necessarily degenerates to first order near smooth extrema. We will not discuss the method of adding explicit
artificial viscosity or the TVD method in these lecture notes. We refer to the books by Sod [75] and by
LeVeque [52], and the references listed therein, for details.
The ENO idea proposed in [38] seems to be the first successful attempt to obtain a self similar (i.e. no
mesh size dependent parameter), uniformly high order accurate, yet essentially non-oscillatory interpolation
(i.e. the magnitude of the oscillations decays as O(∆xk ) where k is the order of accuracy) for piecewise
smooth functions. The generic solution for hyperbolic conservation laws is in the class of piecewise smooth
functions. The reconstruction in [38] is a natural extension of an earlier second order version of Harten and
Osher [37]. In [38], Harten, Engquist, Osher and Chakravarthy investigated different ways of measuring local
smoothness to determine the local stencil, and developed a hierarchy that begins with one or two cells, then
adds one cell at a time to the stencil from the two candidates on the left and right, based on the size of
the two relevant Newton divided differences. Although there are other reasonable strategies to choose the
stencil based on local smoothness, such as comparing the magnitudes of the highest degree divided differences
among all candidate stencils and picking the one with the least absolute value, experience seems to show
that the hierarchy proposed in [38] is the most robust for a wide range of grid sizes, ∆x, both before and
inside the asymptotic regime.
As one can see from the numerical examples in [38] and in later papers, many of which being mentioned
in these lecture notes or in the references listed, ENO schemes are indeed uniformly high order accurate and
resolve shocks with sharp and monotone (to the eye) transitions. ENO schemes are especially suitable for
problems containing both shocks and complicated smooth flow structures, such as those occurring in shock
interactions with a turbulent flow and shock interaction with vortices.
Since the publication of the original paper of Harten, Engquist, Osher and Chakravarthy [38], the
original authors and many other researchers have followed the pioneer work, improving the methodology and
expanding the area of its applications. ENO schemes based on point values and TVD Runge-Kutta time
discretizations, which can save computational costs significantly for multi space dimensions, were developed in
[69] and [70]. Later biasing in the stencil choosing process to enhance stability and accuracy were developed
in [28] and [67]. Weighted ENO (WENO) schemes were developed, using a convex combination of all
candidate stencils instead of just one as in the original ENO, [53], [43]. ENO schemes based on other than
polynomial building blocks were constructed in [40], [16]. Sub-cell resolution and artificial compression to
sharpen contact discontinuities were studied in [35], [83], [70] and [43]. Multidimensional ENO schemes
based on general triangulation were developed in [1]. ENO and WENO schemes for Hamilton-Jacobi type
equations were designed and applied in [59], [60], [50] and [45]. ENO schemes using one-sided Jocobians for
field by field decomposition, which improves the robustness for calculations of systems, were discussed in
[25]. Combination of ENO with multiresolution ideas was pursued in [7]. Combination of ENO with spectral
method using a domain decomposition approach was carried out in [8]. On the application side, ENO and
WENO have been successfully used to simulate shock turbulence interactions [70], [71], [2]; to the direct
2
simulation of compressible turbulence [71], [80], [49]; to relativistic hydrodynamics equations [24]; to shock
vortex interactions and other gas dynamics problems [12], [27], [43]; to incompressible flow problems [26],
[31]; to viscoelasticity equations with fading memory [72]; to semi-conductor device simulation [28], [41], [42];
to image processing [59], [64], [73]; etc. This list is definitely incomplete and may be biased by the author’s
own research experience, but one can already see that ENO and WENO have been applied quite extensively
in many different fields. Most of the problems solved by ENO and WENO schemes are of the type in which
solutions contain both strong shocks and rich smooth region structures. Lower order methods usually have
difficulties for such problems and it is thus attractive and efficient to use high order stable methods such as
ENO and WENO to handle them.
Today the study and application of ENO and WENO schemes are still very active. We expect the
schemes and the basic methodology to be developed further and to become even more successful in the
future.
In these lecture notes we describe the construction, analysis, and application of ENO and WENO schemes
for hyperbolic conservation laws and related Hamilton-Jacobi equations. They are basically self-contained.
Our hope is that with these notes and with the help of the quoted references, the readers can understand
the algorithms and code them up for applications. Sample codes are also available from the author.
2. One Space Dimension.
2.1. Reconstruction and Approximation in 1D. In this section we concentrate on the problems
of interpolation and approximation in one space dimension.
Given a grid
(2.1)
a = x 1 < x 3 < ... < xN − 1 < xN + 1 = b,
2
2
2
2
We define cells, cell centers, and cell sizes by
Ii ≡ xi− 1 , xi+ 1 ,xi ≡
2
2
(2.2)
∆xi ≡ xi+ 1 − xi− 1 ,
2
2
1
x 1 + xi+ 1 ,
2
2 i− 2
i = 1, 2, ..., N .
We denote the maximum cell size by
∆x ≡ max ∆xi .
(2.3)
1≤i≤N
2.1.1. Reconstruction from cell averages. The first approximation problem we will face, in solving
hyperbolic conservation laws using cell averages (finite volume schemes, see Sect. 2.3.1), is the following
reconstruction problem [38].
Problem 2.1. One dimensional reconstruction.
Given the cell averages of a function v(x):
(2.4)
vi ≡
1
∆xi
xi+ 1
2
v(ξ) dξ,
i = 1, 2, ..., N ,
xi− 1
2
find a polynomial pi (x), of degree at most k − 1, for each cell Ii , such that it is a k-th order accurate
approximation to the function v(x) inside Ii :
(2.5)
x ∈ Ii , i = 1, ..., N .
pi (x) = v(x) + O(∆xk ),
3
In particular, this gives approximations to the function v(x) at the cell boundaries
−
vi+ 1 = pi (xi+ 1 ),
2
(2.6)
2
+
vi− 1 = pi (xi− 1 ),
2
2
i = 1, ..., N ,
which are k-th order accurate:
(2.7)
−
vi+ 1 = v(xi+ 1 ) + O(∆xk ),
2
2
+
vi− 1 = v(xi− 1 ) + O(∆xk ),
2
2
i = 1, ..., N .
The polynomial pi (x) in Problem 2.1 can be replaced by other simple functions, such as trigonometric
polynomials. See Sect. 4.1.3.
We will not discuss boundary conditions in this section. We thus assume that v i is also available for
i ≤ 0 and i > N if needed.
In the following we describe a procedure to solve Problem 2.1.
Given the location Ii and the order of accuracy k, we first choose a “stencil”, based on r cells to the
left, s cells to the right, and Ii itself if r, s ≥ 0, with r + s + 1 = k:
S(i) ≡ {Ii−r , ..., Ii+s } .
(2.8)
There is a unique polynomial of degree at most k − 1 = r + s, denoted by p(x) (we will drop the subscript
i when it does not cause confusion), whose cell average in each of the cells in S(i) agrees with that of v(x):
(2.9)
1
∆xj
xj+ 1
2
j = i − r, ..., i + s.
p(ξ) dξ = v j ,
xj− 1
2
This polynomial p(x) is the k-th order approximation we are looking for, as it is easy to prove (2.5), see the
discussion below, as long as the function v(x) is smooth in the region covered by the stencil S(i).
For solving Problem 2.1, we also need the approximations to the values of v(x) at the cell boundaries,
−
+
(2.6). Since the mappings from the given cell averages v j in the stencil S(i) to the values vi+ 1 and vi− 1 in
2
2
˜
(2.6) are linear, there exist constants crj and crj , which depend on the left shift of the stencil r of the stencil
S(i) in (2.8), on the order of accuracy k, and on the cell sizes ∆xj in the stencil Si , but not on the function
v itself, such that
(2.10)
−
vi+ 1 =
2
k−1
+
vi− 1 =
crj v i−r+j ,
2
j=0
k−1
crj v i−r+j .
˜
j=0
We note that the difference between the values with superscripts ± at the same location xi+ 1 is due to the
2
possibility of different stencils for cell Ii and for cell Ii+1 . If we identify the left shift r not with the cell Ii
but with the point of reconstruction xi+ 1 , i.e. using the stencil (2.8) to approximate xi+ 1 , then we can drop
2
2
the superscripts ± and also eliminate the need to consider crj in (2.10), as it is clear that
˜
crj = cr−1,j .
˜
We summarize this as follows: given the k cell averages
v i−r , ..., v i−r+k−1 ,
there are constants crj such that the reconstructed value at the cell boundary xi+ 1 :
2
k−1
(2.11)
vi+ 1 =
2
crj v i−r+j ,
j=0
4
is k-th order accurate:
vi+ 1 = v(xi+ 1 ) + O(∆xk ).
2
2
(2.12)
To understand how the constants {crj } are obtained, as well as how the accuracy property (2.5) is
proven, we look at the primitive function of v(x):
V (x) ≡
(2.13)
x
v(ξ) dξ ,
−∞
where the lower limit −∞ is not important and can be replaced by any fixed number. Clearly, V (xi+ 1 ) can
2
be expressed by the cell averages of v(x) using (2.4):
i
(2.14)
xj+ 1
2
V (xi+ 1 ) =
2
j=−∞
i
v(ξ) dξ =
xj− 1
v j ∆xj ,
j=−∞
2
thus with the knowledge of the cell averages {v j } we also know the primitive function V (x) at the cell
boundaries exactly. If we denote the unique polynomial of degree at most k, which interpolates V (xj+ 1 ) at
2
the following k + 1 points:
(2.15)
xi−r− 1 , ..., xi+s+ 1 ,
2
2
by P (x), and denote its derivative by p(x):
p(x) ≡ P (x) ,
(2.16)
then it is easy to verify (2.9):
1
∆xj
xj+ 1
2
p(ξ) dξ =
xj− 1
2
1
∆xj
xj+ 1
2
P (ξ) dξ =
xj− 1
2
1
P (xj+ 1 ) − P (xj− 1 )
2
2
∆xj
1
V (xj+ 1 ) − V (xj− 1 )
=
2
2
∆xj
xj+ 1
xj− 1
1
2
2
v(ξ) dξ −
v(ξ) dξ
=
∆xj
−∞
−∞
xj+ 1
1
2
v(ξ) dξ = v j ,
j = i − r, ..., i + s,
=
∆xj x 1
j−
2
where the third equality holds because P (x) interpolates V (x) at the points xj− 1 and xj+ 1 whenever
2
2
j = i − r, ..., i + s. This implies that p(x) is the polynomial we are looking for. Standard approximation
theory (see an elementary numerical analysis book) tells us that
P (x) = V (x) + O(∆xk ),
x ∈ Ii .
This is the accuracy requirement (2.5).
Now let us look at the practical issue of how to obtain the constants {crj } in (2.11). For this we could
use the Lagrange form of the interpolation polynomial:
k
(2.17)
k
V (xi−r+m− 1 )
2
P (x) =
m=0
l=0
l=m
5
x − xi−r+l− 1
2
xi−r+m− 1 − xi−r+l− 1
2
2
.
For easier manipulation we subtract a constant V (xi−r− 1 ) from (2.17), and use the fact that
2
x − xi−r+l− 1
2
k
k
m=0
l=0
l=m
xi−r+m− 1 − xi−r+l− 1
2
2
= 1,
to obtain:
P (x) − V (xi−r− 1 )
2
(2.18)
k
x − xi−r+l− 1
2
k
V (xi−r+m− 1 ) − V (xi−r− 1 )
2
2
=
m=0
xi−r+m− 1 − xi−r+l− 1
2
2
l=0
.
l=m
Taking derivative on both sides of (2.18), and noticing that
m−1
V (xi−r+m− 1 ) − V (xi−r− 1 ) =
2
2
v i−r+j ∆xi−r+j
j=0
because of (2.14), we obtain
k
(2.19)
m−1
p(x) =
m=0 j=0
k
v i−r+j ∆xi−r+j
k
l=0
l=m
q=0
q = m, l
k
l=0
l=m
x − xi−r+q− 1
2
xi−r+m− 1 − xi−r+l− 1
2
2
.
Evaluating the expression (2.19) at x = xi+ 1 , we finally obtain
2
vi+ 1 = p(xi+ 1 )
2
2
k
=
j=0 m=j+1
k−1
k
k
l=0
q=0
l=m
xi+ 1 − xi−r+q− 1
2
2
q = m, l
k
l=0
xi−r+m− 1 − xi−r+l− 1
2
2
∆xi−r+j v i−r+j ,
l=m
i.e. the constants crj in (2.11) are given by
(2.20)
crj
k
=
m=j+1
k
k
l=0
q=0
l=m
xi+ 1 − xi−r+q− 1
2
2
q = m, l
k
l=0
l=m
xi−r+m− 1 − xi−r+l− 1
2
2
∆xi−r+j .
Although there are many zero terms in the inner sum of (2.20) when xi+ 1 is a node in the interpolation,
2
we will keep this general form so that it applies also to the case where xi+ 1 is not an interpolation point.
2
6
For a nonuniform grid, one would want to pre-compute the constants {crj } as in (2.20), for 0 ≤ i ≤ N ,
−1 ≤ r ≤ k − 1, and 0 ≤ j ≤ k − 1, and store them before solving the PDE.
For a uniform grid, ∆xi = ∆x, the expression for crj does not depend on i or ∆x any more:
k
k
(2.21)
k
l=0
l=m
crj =
q=0
q = m, l
k
m=j+1
l=0
l=m
(r − q + 1)
.
(m − l)
We list in Table 2.1 the constants crj in this uniform grid case (2.21), for order of accuracy between
k = 1 and k = 7.
From Table 2.1, we would know, for example, that
1
5
1
vi+ 1 = − v i−1 + v i + v i+1 + O(∆x3 ) .
2
6
6
3
2.1.2. Conservative approximation to the derivative from point values. The second approximation problem we will face, in solving hyperbolic conservation laws using point values (finite difference
schemes, see Sect. 2.3.2), is the following problem in obtaining high order conservative approximation to the
derivative from point values [69, 70].
Problem 2.2. One dimensional conservative approximation.
Given the point values of a function v(x):
vi ≡ v(xi ),
(2.22)
i = 1, 2, ..., N ,
find a numerical flux function
(2.23)
ˆ
vi+ 1 ≡ v (vi−r , ..., vi+s ),
ˆ 2
i = 0, 1, ..., N ,
such that the flux difference approximates the derivative v (x) to k-th order accuracy:
(2.24)
1
ˆ 2
v 1 − vi− 1
ˆ
∆xi i+ 2
= v (xi ) + O(∆xk ),
i = 0, 1, ..., N.
We again ignore the boundary conditions here and assume that vi is available for i ≤ 0 and i > N if
needed.
The solution of this problem is essential for the high order conservative schemes based on point values
(finite difference) rather than on cell averages (finite volume).
This problem looks quite different from Problem 2.1. However, we will see that there is a close relationship
between these two. We assume that the grid is uniform, ∆xi = ∆x. This assumption is, unfortunately,
essential in the following development.
If we can find a function h(x), which may depend on the grid size ∆x, such that
(2.25)
v(x) =
1
∆x
x+ ∆x
2
x− ∆x
2
7
h(ξ)dξ ,
Table 2.1
The constants crj in (2.21).
k
r
j=0
1
-1
0
1
1
-1
0
3/2
1/2
-1/2
1/2
1
-1/2
3/2
-1
11/6
-7/6
1/3
0
1
1/3
-1/6
5/6
5/6
-1/6
1/3
2
1/3
-7/6
11/6
-1
25/12
-23/12
13/12
-1/4
0
1/4
13/12
-5/12
1/12
1
2
-1/12
1/12
7/12
-5/12
7/12
13/12
-1/12
1/4
3
-1/4
13/12
-23/12
25/12
-1
137/60
-163/60
137/60
-21/20
1/5
0
1
1/5
-1/20
77/60
9/20
-43/60
47/60
17/60
-13/60
-1/20
1/30
2
3
1/30
-1/20
-13/60
17/60
47/60
-43/60
9/20
77/60
-1/20
1/5
4
1/5
-21/20
137/60
-163/60
137/60
-1
49/20
-71/20
79/20
-163/60
31/30
-1/6
0
1
1/6
-1/30
29/20
11/30
-21/20
19/20
37/60
-23/60
-13/60
7/60
1/30
-1/60
2
3
1/60
-1/60
-2/15
7/60
37/60
-23/60
37/60
19/20
-2/15
11/30
1/60
-1/30
4
5
1/30
-1/6
-13/60
31/30
37/60
-163/60
-21/20
79/20
29/20
-71/20
1/6
49/20
-1
0
363/140
1/7
-617/140
223/140
853/140
-197/140
-2341/420
153/140
667/210
-241/420
-43/42
37/210
1/7
-1/42
1
2
-1/42
1/105
13/42
-19/210
153/140
107/210
-241/420
319/420
109/420
-101/420
-31/420
5/84
1/105
-1/140
3
4
-1/140
1/105
5/84
-31/420
-101/420
109/420
319/420
-241/420
107/210
153/140
-19/210
13/42
1/105
-1/42
5
-1/42
37/210
-241/420
153/140
-197/140
223/140
1/7
6
1/7
-43/42
667/210
-2341/420
853/140
-617/140
363/140
2
3
4
5
6
7
j=1
j=2
j=3
8
j=4
j=5
j=6
then clearly
v (x) =
1
∆x
h x+
∆x
2
−h x−
∆x
2
,
hence all we need to do is to use
(2.26)
vi+ 1 = h(xi+ 1 ) + O(∆xk )
ˆ 2
2
to achieve (2.24). We note here that it would look like an O(∆xk+1 ) term in (2.26) is needed in order to get
(2.24), due to the ∆x term in the denominator. However, in practice, the O(∆xk ) term in (2.26) is usually
smooth, hence the difference in (2.24) would give an extra O(∆x), just to cancel the one in the denominator.
It is not easy to approximate h(x) via (2.25), as it is only implicitly defined there. However, we notice
that the known function v(x) is the cell average of the unknown function h(x), so to find h(x) we just need
to use the reconstruction procedure described in Sect. 2.1.1. If we take the primitive of h(x):
x
(2.27)
h(ξ)dξ ,
H(x) =
−∞
then (2.25) clearly implies
i
(2.28)
i
xj+ 1
2
H(xi+ 1 ) =
2
j=−∞
h(ξ)dξ = ∆x
xj− 1
vj .
j=−∞
2
Thus, given the point values {vj }, we “identify” them as cell averages of another function h(x) in (2.25),
then the primitive function H(x) is exactly known at the cell interfaces x = xi+ 1 . We thus use the same
2
reconstruction procedure described in Sect. 2.1.1, to get a k-th order approximation to h(xi+ 1 ), which is
2
then taken as the numerical flux vi+ 1 in (2.23).
ˆ 2
In other words, if the “stencil” for the flux vi+ 1 in (2.23) is the following k points:
ˆ 2
(2.29)
xi−r , ..., xi+s ,
where r + s = k − 1, then the flux vi+ 1 is expressed as
ˆ 2
k−1
(2.30)
vi+ 1 =
ˆ 2
crj vi−r+j ,
j=0
where the constants {crj } are given by (2.21) and Table 2.1.
From Table 2.1 we would know, for example, that if
1
5
1
vi+ 1 = − vi−1 + vi + vi+1 ,
ˆ 2
6
6
3
then
1
v 1 − vi− 1
ˆ
ˆ 2
∆x i+ 2
= v (xi ) + O(∆x3 ).
We emphasize again that, unlike in the reconstruction procedure in Sect. 2.1.1, here the grid must be
uniform: ∆xj = ∆x. Otherwise, it can be proven that no choice of constants crj in (2.30) (which may
depend on the local grid sizes but not on the function v(x)) could make the conservative approximation to
the derivative (2.24) higher than second order accurate (k > 2). The proof is a simple exercise of Taylor
9
expansions. Thus, the high order finite difference (third order and higher) discussed in these lecture notes
can apply only to uniform or smoothly varying grids.
Because of this equivalence of obtaining a conservative approximation to the derivative (2.23)-(2.24) and
the reconstruction problem discussed in Sect. 2.1.1, we will only need to consider the reconstruction problem
in the following sections.
2.1.3. Fixed stencil approximation. By fixed stencil, we mean that the left shift r in (2.8) or (2.29)
is the same for all locations i. Usually, for a globally smooth function v(x), the best approximation is
obtained either by a central approximation r = s − 1 for even k (here central is relative to the location xi+ 1 ),
2
or by a one point upwind biased approximation r = s or r = s − 2 for odd k. For example, if the grid is
uniform ∆xi = ∆x, then a central 4th order reconstruction for vi+ 1 , in (2.11), is given by
2
vi+ 1 = −
2
1
7
7
1
v i−1 + v i + v i+1 − v i+2 + O(∆x4 ) ,
12
12
12
12
and the two one point upwind biased 3rd order reconstructions for vi+ 1 in (2.11), are given by
2
or
1
5
1
vi+ 1 = − v i−1 + v i + v i+1 + O(∆x3 )
2
6
6
3
1
5
1
vi+ 1 = v i + v i+1 − v i+2 + O(∆x3 ) .
2
3
6
6
Similarly, a central 4th order flux (2.30) is
vi+ 1 = −
ˆ 2
1
7
7
1
vi−1 + vi + vi+1 − vi+2 ,
12
12
12
12
which gives
1
v 1 − vi− 1
ˆ
ˆ 2
∆x i+ 2
= v (xi ) + O(∆x4 ),
and the two one point upwind biased 3rd order fluxes (2.30) are given by
or
1
5
1
vi+ 1 = − vi−1 + vi + vi+1
ˆ 2
6
6
3
1
5
1
vi+ 1 = vi + vi+1 − vi+2 ,
ˆ 2
3
6
6
which gives
1
v 1 − vi− 1
ˆ
ˆ 2
∆x i+ 2
= v (xi ) + O(∆x3 ).
Traditional central and upwind schemes, either finite volume or finite difference, can be derived by these
fixed stencil reconstructions or flux differenced approximations to the derivatives.
2.2. ENO and WENO Approximations in 1D. For solving hyperbolic conservation laws, we are
interested in the class of piecewise smooth functions. A piecewise smooth function v(x) is smooth (i.e. it
has as many derivatives as the scheme calls for) except for at finitely many isolated points. At these points,
v(x) and its derivatives are assumed to have finite left and right limits. Such functions are “generic” for
solutions to hyperbolic conservation laws.
For such piecewise smooth functions, the order of accuracy we refer to in these lecture notes are formal,
that is, it is defined as whatever accuracy determined by the local truncation error in the smooth regions of
the function.
10
1
1
0.75
0.5
0.5
0.25
0
0
-0.25
-0.5
-0.5
-0.75
-1
-1
-1
-0.75
-0.5
-0.25
0
0.25
0.5
0.75
-1
1
-0.75
-0.5
-0.25
0
0.25
0.5
0.75
1
Fig. 2.1. Fixed central stencil cubic interpolation (left) and ENO cubic interpolation (right) for the step function. Solid:
exact function; Dashed: interpolant piecewise cubic polynomials.
If the function v(x) is only piecewise smooth, a fixed stencil approximation described in Sect. 2.1.3
may not be adequate near discontinuities. Fig. 2.1 (left) gives the 4-th order (piecewise cubic) interpolation
with a central stencil for the step function, i.e. the polynomial approximation inside the interval [xi− 1 , xi+ 1 ]
2
2
interpolates the step function at the four points xi− 3 , xi− 1 , xi+ 1 , xi+ 3 . Notice the obvious over/undershoots
2
2
2
2
for the cells near the discontinuity.
These oscillations (termed the Gibbs Phenomena in spectral methods) happen because the stencils, as
defined by (2.15), actually contain the discontinuous cell for xi close enough to the discontinuity. As a result,
the approximation property (2.5) is no longer valid in such stencils.
2.2.1. ENO approximation. A closer look at Fig. 2.1 (left) motivates the idea of “adaptive stencil”,
namely, the left shift r changes with the location xi . The basic idea is to avoid including the discontinuous
cell in the stencil, if possible.
To achieve this effect, we need to look at the Newton formulation of the interpolation polynomial.
We first review the definition of the Newton divided differences. The 0-th degree divided differences of
the function V (x) in (2.13)-(2.14) are defined by:
V [xi− 1 ] ≡ V (xi− 1 );
2
2
(2.31)
and in general the j-th degree divided differences, for j ≥ 1, are defined inductively by
(2.32)
V [xi− 1 , ..., xi+j− 1 ] ≡
2
2
V [xi+ 1 , ..., xi+j− 1 ] − V [xi− 1 , ..., xi+j− 3 ]
2
2
2
2
xi+j− 1 − xi− 1
2
2
Similarly, the divided differences of the cell averages v in (2.4) are defined by
v[xi ] ≡ v i ;
(2.33)
and in general
(2.34)
v[xi , ..., xi+j ] ≡
v[xi+1 , ..., xi+j ] − v[xi , ..., xi+j−1 ]
.
xi+j − xi
We note that, by (2.14),
(2.35)
V [xi− 1 , xi+ 1 ] =
2
2
V (xi+ 1 ) − V (xi− 1 )
2
2
xi+ 1 − xi− 1
2
2
11
= vi ,
.
i.e. the 0-th degree divided differences of v are the first degree divided differences of V (x). We can thus
write the divided differences of V (x) of first degree and higher by those of v of 0-th degree and higher, using
(2.35) and (2.32).
The Newton form of the k-th degree interpolation polynomial P (x), which interpolates V (x) at the k + 1
points (2.15), can be expressed using the divided differences (2.31)-(2.32) by
j−1
k
(2.36)
x − xi−r+m− 1
2
V [xi−r− 1 , ..., xi−r+j− 1 ]
2
2
P (x) =
.
m=0
j=0
We can take the derivative of (2.36) to get p(x) in (2.16):
j−1
k
(2.37)
j−1
x − xi−r+l− 1
2
V [xi−r− 1 , ..., xi−r+j− 1 ]
2
2
p(x) =
m=0
j=1
.
l=0
l=m
Notice that only first and higher degree divided differences of V (x) appear in (2.37). Hence by (2.35), we
can express p(x) completely by the divided differences of v, without any need to reference V (x).
Let us now recall an important property of divided differences:
(2.38)
V [xi− 1 , ..., xi+j− 1 ] =
2
2
V (j) (ξ)
,
j!
for some ξ inside the stencil: xi− 1 < ξ < xi+j− 1 , as long as the function V (x) is smooth in this stencil. If
2
2
V (x) is discontinuous at some point inside the stencil, then it is easy to verify that
(2.39)
V [xi− 1 , ..., xi+j− 1 ] = O
2
2
1
∆xj
.
Thus the divided difference is a measurement of the smoothness of the function inside the stencil.
We now describe the ENO idea by using (2.36). Suppose our job is to find a stencil of k + 1 consecutive
points, which must include xi− 1 and xi+ 1 , such that V (x) is “the smoothest” in this stencil comparing with
2
2
other possible stencils. We perform this job by breaking it into steps, in each step we only add one point to
the stencil. We thus start with the two point stencil
(2.40)
˜
S2 (i) = {xi− 1 , xi+ 1 },
2
2
˜
˜
where we have used S to denote a stencil for the primitive function V . Notice that the stencil S for V has
a corresponding stencil S for v through (2.35), for example (2.40) corresponds to a single cell stencil
S(i) = {Ii }
˜
for v. The linear interpolation on the stencil S2 (i) in (2.40) can be written in the Newton form as
P 1 (x) = V [xi− 1 ] + V [xi− 1 , xi+ 1 ] x − xi− 1 .
2
2
2
2
At the next step, we have only two choices to expand the stencil by adding one point: we can either add the
left neighbor xi− 3 , resulting in the following quadratic interpolation
2
(2.41)
R(x) = P 1 (x) + V [xi− 3 , xi− 1 , xi+ 1 ] x − xi− 1
2
2
2
2
12
x − xi+ 1 ,
2
or add the right neighbor xi+ 3 , resulting in the following quadratic interpolation
2
S(x) = P 1 (x) + V [xi− 1 , xi+ 1 , xi+ 3 ] x − xi− 1
2
2
2
2
(2.42)
x − xi+ 1 .
2
We note that the deviations from P 1 (x) in (2.41) and (2.42), are the same function
x − xi+ 1
2
x − xi− 1
2
multiplied by two different constants
(2.43)
V [xi− 3 , xi− 1 , xi+ 1 ],
2
2
2
and
V [xi− 1 , xi+ 1 , xi+ 3 ].
2
2
2
These two constants are the two second degree divided differences of V (x) in two different stencils. We
have already noticed before, in (2.38) and (2.39), that a smaller divided difference implies the function is
“smoother” in that stencil. We thus decide upon which point to add to the stencil, by comparing the two
relevant divided differences (2.43), and picking the one with a smaller absolute value. Thus, if
V [xi− 3 , xi− 1 , xi+ 1 ] < V [xi− 1 , xi+ 1 , xi+ 3 ] ,
2
2
2
2
2
2
(2.44)
we will take the 3 point stencil as
˜
S3 (i) = {xi− 3 , xi− 1 , xi+ 1 };
2
2
2
otherwise, we will take
˜
S3 (i) = {xi− 1 , xi+ 1 , xi+ 3 }.
2
2
2
This procedure can be continued, with one point added to the stencil at each step, according to the
smaller of the absolute values of the two relevant divided differences, until the desired number of points in
the stencil is reached.
We note that, for the uniform grid case ∆xi = ∆x, there is no need to compute the divided differences
as in (2.32). We should use undivided differences instead:
(2.45)
V < xi− 1 , xi+ 1 >= V [xi− 1 , xi+ 1 ] = v i
2
2
2
2
(see (2.35)), and
V < xi− 1 , ..., xi+j+ 1 > ≡ V < xi+ 1 , ..., xi+j+ 1 > −V < xi− 1 , ..., xi+j− 1 >,
2
2
2
2
2
2
(2.46)
j ≥ 1.
The Newton interpolation formulae (2.36)-(2.37) should also be adjusted accordingly. This both saves computational time and reduces round-off effects.
The FORTRAN program for this ENO choosing process is very simple:
* assuming the m-th degree divided (or undivided) differences
* of V(x), with x_i as the left-most point in the arguments,
* are stored in V(i,m), also assuming that "is" is the
* left-most point in the stencil for cell i for a k-th
* degree polynomial
13
is=i
do m=2,k
if(abs(V(is-1,m)).lt.abs(V(is,m))) is=is-1
enddo
˜
Once the stencil S(i), hence S(i), in (2.8) is found, one could use (2.11), with the prestored values of
the constants crj , (2.20) or (2.21), to compute the reconstructed values at the cell boundary. Or, one could
use (2.30) to compute the fluxes. An alternative way is to compute the values or fluxes using the Newton
form (2.37) directly. The computational cost is about the same.
We summarize the ENO reconstruction procedure in the following
Procedure 2.1. 1D ENO reconstruction.
Given the cell averages {v i } of a function v(x), we obtain a piecewise polynomial reconstruction, of
degree at most k − 1, using ENO, in the following way:
1. Compute the divided differences of the primitive function V (x), for degrees 1 to k, using v, (2.35)
and (2.32).
If the grid is uniform ∆xi = ∆x, at this stage, undivided differences (2.45)-(2.46) should be computed
instead.
2. In cell Ii , start with a two point stencil
˜
S2 (i) = {xi− 1 , xi+ 1 }
2
2
for V (x), which is equivalent to a one point stencil,
S1 (i) = {Ii }
for v.
3. For l = 2, ..., k, assuming
˜
Sl (i) = {xj+ 1 , ..., xj+l− 1 }
2
2
is known, add one of the two neighboring points, xj− 1 or xj+l+ 1 , to the stencil, following the ENO
2
2
procedure:
• If
(2.47)
V [xj− 1 , ..., xj+l− 1 ] < V [xj+ 1 , ..., xj+l+ 1 ] ,
2
2
2
2
˜
add xj− 1 to the stencil Sl (i) to obtain
2
˜
Sl+1 (i) = {xj− 1 , ..., xj+l− 1 };
2
2
˜
• Otherwise, add xj+l+ 1 to the stencil Sl (i) to obtain
2
˜
Sl+1 (i) = {xj+ 1 , ..., xj+l+ 1 }.
2
2
4. Use the Lagrange form (2.19) or the Newton form (2.37) to obtain pi (x), which is a polynomial of
degree at most k − 1 in Ii , satisfying the accuracy condition (2.5), as long as v(x) is smooth in Ii .
We could use pi (x) to get the approximations at the cell boundaries:
−
vi+ 1 = pi (xi+ 1 ),
2
2
14
+
vi− 1 = pi (xi− 1 ).
2
2
However, it is usually more convenient, when the stencil is known, to use (2.10), with crj defined
by (2.20) for a nonuniform grid, or by (2.21) and Table 2.1 for a uniform grid, to compute an
approximation to v(x) at the cell boundaries.
For the same piecewise cubic interpolation to the step function, but this time using the ENO procedure
˜
with a two point stencil S2 (i) = {xi− 1 , xi+ 1 } in the Step 2 of Procedure 2.1, we obtain a non-oscillatory
2
2
interpolation, in Fig. 2.1 (right).
˜
For a piecewise smooth function V (x), ENO interpolation starting with a two point stencil S2 (i) =
{xi− 1 , xi+ 1 } in the Step 2 of Procedure 2.1, as was shown in Fig. 2.1 (right), has the following properties
2
2
[39]:
1. The accuracy condition
Pi (x) = V (x) + O(∆xk+1 ),
x ∈ Ii
is valid for any cell Ii which does not contain a discontinuity.
This implies that the ENO interpolation procedure can recover the full high order accuracy right up
to the discontinuity.
2. Pi (x) is monotone in any cell Ii which does contain a discontinuity of V (x).
3. The reconstruction is TVB (total variation bounded). That is, there exists a function z(x), satisfying
z(x) = Pi (x) + O(∆xk+1 ),
x ∈ Ii
for any cell Ii , including those cells which contain discontinuities, such that
T V (z) ≤ T V (V ).
Property 3 is clearly a consequence of Properties 1 and 2 (just take z(x) to be V (x) in the smooth cells
and take z(x) to be Pi (x) in the cells containing discontinuities). It is quite interesting that Property 2 holds.
One would have expected trouble in those “shocked cells”, i.e. cells Ii which contain discontinuities, for ENO
would not help for such cases as the stencil starts with two points already containing a discontinuity. We
will give a proof of Property 2 for a simple but illustrative case, i.e. when V (x) is a step function
V (x) =
0, x ≤ 0;
1, x > 0.
and the k-th degree polynomial P (x) interpolates V (x) at k + 1 points
x 1 < x 3 < ... < xk+ 1
2
2
2
containing the discontinuity
xj0 − 1 < 0 < xj0 + 1
2
2
for some j0 between 1 and k. For any interval which does not contain the discontinuity 0:
(2.48)
[xj− 1 , xj+ 1 ],
2
2
j = j0 ,
we have
P (xj− 1 ) = V (xj− 1 ) = V (xj+ 1 ) = P (xj+ 1 ),
2
2
2
2
15
hence there is at least one point ξj in between, xj− 1 < ξj < xj+ 1 , such that P (ξj ) = 0. This way we can
2
2
find k − 1 distinct zeroes for P (x), as there are k − 1 intervals (2.48) which do not contain the discontinuity
0. However, P (x) is a non-zero polynomial of degree at most k − 1, hence can have at most k − 1 distinct
zeroes. This implies that P (x) does not have any zero inside the shocked interval [xj0 − 1 , xj0 + 1 ], i.e. P (x)
2
2
is monotone in this shocked interval. This proof can be generalized to a proof for Property 2 [39].
2.2.2. WENO approximation. In this subsection we describe the recently developed WENO (weighted
ENO) reconstruction procedure [53, 43]. WENO is based on ENO, of course. For simplicity of presentation,
in this subsection we assume the grid is uniform, i.e. ∆xi = ∆x.
As we can see from Sect. 2.2.1, ENO reconstruction is uniformly high order accurate right up to the
discontinuity. It achieves this effect by adaptively choosing the stencil based on the absolute values of divided
differences. However, one could make the following remarks about ENO reconstruction, indicating rooms
for improvements:
1. The stencil might change even by a round-off error perturbation near zeroes of the solution and its
derivatives. That is, when both sides of (2.47) are near 0, a small change at the round off level
would change the direction of the inequality and hence the stencil. In smooth regions, this “free
adaptation” of stencils is clearly not necessary. Moreover, this may cause loss of accuracy when
applied to a hyperbolic PDE [63, 67].
2. The resulting numerical flux (2.23) is not smooth, as the stencil pattern may change at neighboring
points.
3. In the stencil choosing process, k candidate stencils are considered, covering 2k − 1 cells, but only
one of the stencils is actually used in forming the reconstruction (2.10) or the flux (2.30), resulting in
k-th order accuracy. If all the 2k − 1 cells in the potential stencils are used, one could get (2k − 1)-th
order accuracy in smooth regions.
4. ENO stencil choosing procedure involves many logical “if” structures, or equivalent mathematical
formulae, which are not very efficient on certain vector computers such as CRAYs (however they are
friendly to parallel computers).
There have been attempts in the literature to remedy the first problem, the “free adaptation” of stencils.
In [28] and [67], the following “biasing” strategy was proposed. One first identity a “preferred” stencil
(2.49)
˜
Spref (i) = {xi−r+ 1 , ..., xi−r+k+ 1 } ,
2
2
which might be central or one-point upwind. One then replaces (2.47) by
V [xj− 1 , ..., xj+l− 1 ] < b V [xj+ 1 , ..., xj+l+ 1 ] ,
2
2
2
2
if
xj+ 1 > xi−r+ 1 ,
2
2
˜
i.e. if the left-most point xj+ 1 in the current stencil Sl (i) has not reached the left-most point xi−r+ 1 of the
2
2
preferred stencil Spref (i) in (2.49) yet; otherwise, if
xj+ 1 ≤ xi−r+ 1 ,
2
2
one replaces (2.47) by
b V [xj− 1 , ..., xj+l− 1 ] < V [xj+ 1 , ..., xj+l+ 1 ] .
2
2
2
2
16
Here, b > 1 is the so-called biasing parameter. Analysis in [67] indicates a good choice of the parameter
b = 2. The philosophy is to stay as close as possible to the preferred stencil, unless the alternative candidate
is, roughly speaking, a factor b > 1 better in smoothness.
WENO is a more recent attempt to improve upon ENO in these four points. The basic idea is the
following: instead of using only one of the candidate stencils to form the reconstruction, one uses a convex
combination of all of them. To be more precise, suppose the k candidate stencils
(2.50)
Sr (i) = {xi−r , ..., xi−r+k−1 },
r = 0, ..., k − 1
produce k different reconstructions to the value vi+ 1 , according to (2.11),
2
(2.51)
(r)
k−1
vi+ 1 =
2
r = 0, ..., k − 1 ,
crj v i−r+j ,
j=0
(r)
WENO reconstruction would take a convex combination of all vi+ 1 defined in (2.51) as a new approximation
2
to the cell boundary value v(xi+ 1 ):
2
k−1
(2.52)
=
v
i+ 1
2
(r)
ωr vi+ 1 .
2
r=0
Apparently, the key to the success of WENO would be the choice of the weights ωr . We require
k−1
ωr ≥ 0,
(2.53)
ωr = 1
r=0
for stability and consistency.
If the function v(x) is smooth in all of the candidate stencils (2.50), there are constants dr such that
k−1
(2.54)
vi+ 1 =
2
(r)
dr vi+ 1 = v(xi+ 1 ) + O(∆x2k−1 ) .
2
2
r=0
For example, dr for 1 ≤ k ≤ 3 are given by
k = 1;
d0 = 1,
2
1
k = 2;
d0 = , d1 = ,
3
3
3
3
1
, d1 = , d2 =
,
d0 =
10
5
10
k = 3.
We can see that dr is always positive and, due to consistency,
k−1
(2.55)
dr = 1 .
r=0
In this smooth case, we would like to have
(2.56)
ωr = dr + O(∆xk−1 ),
r = 0, ..., k − 1 ,
which would imply (2k − 1)-th order accuracy:
k−1
(2.57)
vi+ 1 =
2
r=0
(r)
ωr vi+ 1 = v(xi+ 1 ) + O(∆x2k−1 )
2
2
17
because
k−1
r=0
(r)
ωr vi+ 1
2
k−1
−
r=0
(r)
dr vi+ 1
2
k−1
(r)
(ωr − dr ) vi+ 1 − v(xi+ 1 )
2
=
2
r=0
k−1
=
O(∆xk−1 ) O(∆xk ) = O(∆x2k−1 )
r=0
where in the first equality we used (2.53) and (2.55).
When the function v(x) has a discontinuity in one or more of the stencils (2.50), we would hope the
corresponding weight(s) ωr to be essentially 0, to emulate the successful ENO idea.
Another consideration is that the weights should be smooth functions of the cell averages involved. In
fact, the weights designed in [43] and described below are C ∞ .
Finally, we would like to have weights which are computationally efficient. Thus, polynomials or rational
functions are preferred over exponential type functions.
All these considerations lead to the following form of weights:
(2.58)
ωr =
αr
k−1
s=0
αs
r = 0, ..., k − 1
,
with
(2.59)
αr =
dr
.
( + βr )2
Here > 0 is introduced to avoid the denominator to become 0. We take = 10−6 in all our numerical
tests [43]. βr are the so-called “smooth indicators” of the stencil Sr (i): if the function v(x) is smooth in the
stencil Sr (i), then
βr = O(∆x2 ) ,
but if v(x) has a discontinuity inside the stencil Sr (i), then
βr = O(1).
Translating into the weights ωr in (2.58), we will have
ωr = O(1)
when the function v(x) is smooth in the stencil Sr (i), and
ωr = O(∆x4 )
if v(x) has a discontinuity inside the stencil Sr (i). Emulation of ENO near a discontinuity is thus achieved.
One also has to worry about the accuracy requirement (2.56), which must be checked when the specific
form of the smooth indicator βr is given. For any smooth indicator βr , it is easy to see that the weights
defined by (2.58) satisfies (2.53). To satisfy (2.56), it suffices to have, through a Taylor expansion analysis:
(2.60)
βr = D (1 + O(∆xk−1 )),
r = 0, ..., k − 1,
where D is a nonzero quantity independent of r (but may depend on ∆x).
18
As we have seen in Sect. 2.2.1, the ENO reconstruction procedure chooses the “smoothest” stencil by
comparing a hierarchy of divided or undivided differences. This is because these differences can be used
to measure the smoothness of the function on a stencil, (2.38)-(2.39). In [43], after extensive experiments,
a robust (for third and fifth order at least) choice of smooth indicators βr is given. As we know, on each
stencil Sr (i), we can construct a (k − 1)-th degree reconstruction polynomial, which if evaluated at x = xi+ 1 ,
2
renders the approximation to the value v(xi+ 1 ) in (2.51). Since the total variation is a good measurement for
2
smoothness, it would be desirable to minimize the total variation for this reconstruction polynomial inside
Ii . Consideration for a smooth flux and for the role of higher order variations leads us to the following
measurement for smoothness: let the reconstruction polynomial on the stencil Sr (i) be denoted by pr (x), we
define
k−1
(2.61)
βr =
l=1
xi+ 1
2
∆x2l−1
xi− 1
∂ l pr (x)
∂lx
2
dx .
2
The right hand side of (2.61) is just a sum of the squares of scaled L2 norms for all the derivatives of the
interpolation polynomial pr (x) over the interval (xi− 1 , xi+ 1 ). The factor ∆x2l−1 is introduced to remove
2
2
any ∆x dependency in the derivatives, in order to preserve self-similarity when used to hyperbolic PDEs
(Sect. 2.3).
We remark that (2.61) is similar to but smoother than the total variation measurement based on the L1
norm. It also renders a more accurate WENO scheme for the case k = 2 and 3.
When k = 2, (2.61) gives the following smoothness measurement [53, 43]:
β0 = (v i+1 − v i )2 ,
β1 = (v i − v i−1 )2 .
(2.62)
For k = 3, (2.61) gives [43]:
13
1
(v i − 2v i+1 + v i+2 )2 + (3v i − 4v i+1 + v i+2 )2 ,
12
4
13
1
2
(v i−1 − 2v i + v i+1 ) + (v i−1 − v i+1 )2 ,
(2.63)
β1 =
12
4
13
1
2
(v i−2 − 2v i−1 + v i ) + (v i−2 − 4vi−1 + 3vi )2 .
β2 =
12
4
We can easily verify that the accuracy condition (2.60) is satisfied, even near smooth extrema [43]. This
indicates that (2.62) gives a third order WENO scheme, and (2.63) gives a fifth order one.
β0 =
Notice that the discussion here has a one point upwind bias in the optimal linear stencil, suitable for
a problem with wind blowing from left to right. If the wind blows the other way, the procedure should be
modified symmetrically with respect to xi+ 1 .
2
In summary, we have the following WENO reconstruction procedure:
Procedure 2.2. 1D WENO reconstruction.
Given the cell averages {v i } of a function v(x), for each cell Ii , we obtain upwind biased (2k − 1)-th
+
−
order approximations to the function v(x) at the cell boundaries, denoted by vi− 1 and vi+ 1 , in the following
2
way:
2
(r)
1. Obtain the k reconstructed values vi+ 1 , of k-th order accuracy, in (2.51), based on the stencils
2
(2.50), for r = 0, ..., k − 1;
(r)
Also obtain the k reconstructed values vi− 1 , of k-th order accuracy, using (2.10), again based on
the stencils (2.50), for r = 0, ..., k − 1;
2
19
˜
2. Find the constants dr and dr , such that (2.54) and
k−1
vi− 1 =
2
˜ (r)
dr vi− 1 = v(xi− 1 ) + O(∆x2k−1 )
2
2
r=0
are valid. By symmetry,
˜
dr = dk−1−r .
3. Find the smooth indicators βr in (2.61), for all r = 0, ..., k − 1. Explicit formulae for k = 2 and
k = 3 are given in (2.62) and (2.63) respectively.
˜
4. Form the weights ωr and ωr using (2.58)-(2.59) and
αr
˜
k−1
s=0
ωr =
˜
αs
˜
,
˜
dr
,
( + βr )2
αr =
˜
r = 0, ..., k − 1.
5. Find the (2k − 1)-th order reconstruction
(2.64)
−
vi+ 1 =
2
k−1
(r)
+
vi− 1 =
ωr vi+ 1 ,
r=0
2
2
k−1
(r)
ωr vi− 1 .
˜
r=0
2
We can obtain weights for higher orders of k (corresponding to seventh and higher order WENO schemes)
using the same recipe. However, these schemes of seventh and higher order have not been extensively tested
yet.
2.3. ENO and WENO Schemes for 1D Conservation Laws. In this section we describe the ENO
and WENO schemes for 1D conservation laws:
(2.65)
ut (x, t) + fx (u(x, t)) = 0
equipped with suitable initial and boundary conditions.
We will concentrate on the discussion of spatial discretization, and will leave the time variable t continuous (the method-of-lines approach). Time discretizations will be discussed in Sect. 4.2.
Our computational domain is a ≤ x ≤ b. We have a grid defined by (2.1), with the notations (2.2)-(2.3).
Except for in Sect. 2.3.3, we do not consider boundary conditions. We thus assume that the values of the
numerical solution are also available outside the computational domain whenever they are needed. This
would be the case for periodic or compactly supported problems.
2.3.1. Finite volume formulation in the scalar case. For finite volume schemes, or schemes based
on cell averages, we do not solve (2.65) directly, but its integrated version. We integrate (2.65) over the
interval Ii to obtain
(2.66)
1
du(xi , t)
= −
f (u(xi+ 1 , t) − f (u(xi− 1 , t)) ,
2
2
dt
∆xi
where
(2.67)
u(xi , t) ≡
1
∆xi
xi+ 1
2
u(ξ, t) dξ
xi− 1
2
is the cell average. We approximate (2.66) by the following conservative scheme
(2.68)
1
dui (t)
ˆ
ˆ
= −
f 1 − fi− 1 ,
2
dt
∆xi i+ 2
20
ˆ
where ui (t) is the numerical approximation to the cell average u(xi , t), and the numerical flux fi+ 1 is defined
2
by
ˆ
fi+ 1 = h u− 1 , u+ 1
i+
i+
2
(2.69)
2
2
with the values u± 1 obtained by the ENO reconstruction Procedure 2.1, or by the WENO reconstruction
i+ 2
Procedure 2.2.
The two argument function h in (2.69) is a monotone flux. It satisfies:
• h(a, b) is a Lipschitz continuous function in both arguments;
• h(a, b) is a nondecreasing function in a and a nonincreasing function in b. Symbolically h(↑, ↓);
• h(a, b) is consistent with the physical flux f , that is, h(a, a) = f (a).
Examples of monotone fluxes include:
1. Godunov flux:
(2.70)
h(a, b) =
mina≤u≤b f (u)
maxb≤u≤a f (u)
if a ≤ b
,
if a > b
2. Engquist-Osher flux:
a
(2.71)
b
max(f (u), 0)du +
h(a, b) =
0
min(f (u), 0)du + f (0).
0
3. Lax-Friedrichs flux:
(2.72)
h(a, b) =
1
[f (a) + f (b) − α(b − a)]
2
where α = maxu |f (u)| is a constant. The maximum is taken over the relevant range of u.
We have listed the monotone fluxes from the least dissipative (less smearing of discontinuities) to the most.
For lower order methods (order of reconstruction is 1 or 2), there is a big difference between results obtained
by different monotone fluxes. However, this difference becomes much smaller for higher order reconstructions.
2
In Fig. 2.2, we plot the results of a right moving shock for the Burgers’ equation (f (u) = u in (2.65)),
2
with first order reconstruction using Godunov and Lax-Friedrichs monotone fluxes (top), and with fourth
order ENO reconstruction using Godunov and Lax-Friedrichs monotone fluxes (bottom). We can clearly see
that, while the Godunov flux behaves much better for the first order scheme, the two fourth order ENO
schemes behave similarly. We thus use the simple and inexpensive Lax-Friedrichs flux in most of our high
order calculations.
We remark that, by the classic Lax-Wendroff theorem [51], the solution to the conservative scheme
(2.68), if converges, will converge to a weak solution of (2.65).
In summary, to build a finite volume ENO scheme (2.68), given the cell averages {ui } (we will often
drop the explicit reference to the time variable t), we proceed as follows:
Procedure 2.3. Finite volume 1D scalar ENO and WENO.
1. Follow the Procedure 2.1 in Sect. 2.2.1 for ENO, or the Procedure 2.2 in Sect. 2.2.2 for WENO, to
obtain the k-th order reconstructed values u− 1 and u+ 1 for all i;
i+
i+
2
2
ˆ
2. Choose a monotone flux (e.g., one of (2.70) to (2.72)), and use (2.69) to compute the flux fi+ 1 for
2
all i;
3. Form the scheme (2.68).
Notice that the finite volume scheme can be applied to arbitrary nonuniform grids.
21
First order Godunov
First order Lax-Friedrichs
1.2
1.2
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0
-0.2
-0.2
-0.4
-0.4
-0.6
-0.6
-1
-0.5
0
0.5
1
-1
Fourth order ENO, Godunov flux
-0.5
0
0.5
1
Fourth order ENO, Lax-Friedrichs flux
1.2
1.2
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0
-0.2
-0.2
-0.4
-0.4
-0.6
-0.6
-1
-0.5
0
0.5
1
-1
-0.5
0
0.5
1
Fig. 2.2. First order (top) and fourth order (bottom) ENO schemes for the Burgers equation, with the Godunov flux (left)
and the Lax-Friedrichs flux (right). Solid lines: exact solution; Circles: the computed solution at t = 4.
2.3.2. Finite difference formulation in the scalar case. We first assume the grid is uniform and
solve (2.65) directly using a conservative approximation to the spatial derivative:
(2.73)
1
dui (t)
ˆ
ˆ
= −
f 1 − fi− 1
2
dt
∆x i+ 2
where ui (t) is the numerical approximation to the point value u(xi , t), and the numerical flux
ˆ
ˆ
fi+ 1 = f (ui−r , ..., ui+s )
2
satisfies the following conditions:
ˆ
• f is a Lipschitz continuous function in all the arguments;
ˆ
ˆ
• f is consistent with the physical flux f , that is, f (u, ..., u) = f (u).
Again the Lax-Wendroff theorem [51] applies. The solution to the conservative scheme (2.73), if converges, will converge to a weak solution of (2.65).
ˆ
The numerical flux fi+ 1 is obtained by the ENO or WENO reconstruction procedures, Procedure 2.1
2
or 2.2, with v(x) = f (u(x, t)). For stability, it is important that upwinding is used in constructing the flux.
The easiest and the most inexpensive way to achieve upwinding is the following: compute the Roe speed
(2.74)
ai+ 1 ≡
2
f (ui+1 ) − f (ui )
,
ui+1 − ui
and
−
• if ai+ 1 ≥ 0, then the the wind blows from the left to the right. We would use vi+ 1 for the numerical
2
2
ˆ
flux fi+ 1 ;
2
22
+
• if ai+ 1 < 0, then the wind blows from the right to the left. We would use vi+ 1 for the numerical
2
2
ˆ
flux fi+ 1 .
2
This produces the Roe scheme [62] at the first order level. For this reason, the ENO scheme based on this
approach was termed “ENO-Roe” in [70].
In summary, to build a finite difference ENO scheme (2.73) using the ENO-Roe approach, given the point
values {ui } (we again drop the explicit reference to the time variable t), we proceed as follows:
Procedure 2.4. Finite difference 1D scalar ENO- and WENO-Roe.
1. Compute the Roe speed ai+ 1 for all i using (2.74);
2
2. Identify v i = f (ui ) and use the ENO reconstruction Procedure 2.1 or the WENO reconstruction
−
+
Procedure 2.2, to obtain the cell boundary values vi+ 1 if ai+ 1 ≥ 0, or vi+ 1 if ai+ 1 < 0;
2
2
2
2
3. If the Roe speed at xi+ 1 is positive
2
ai+ 1 ≥ 0,
2
then take the numerical flux as:
−
ˆ
fi+ 1 = vi+ 1 ;
2
2
otherwise, take the the numerical flux as:
+
ˆ
fi+ 1 = vi+ 1 ;
2
2
4. Form the scheme (2.73).
One disadvantage of the ENO-Roe approach is that entropy violating solutions may be obtained, just
like in the first order Roe scheme case. For example, if ENO-Roe is applied to the Burgers equation
ut +
u2
2
=0
x
with the following initial condition
u(x, 0) =
−1, if x < 0,
1,
if x ≥ 0,
it will converge to the entropy violating expansion shock:
u(x, t) =
−1, if x < 0,
1,
if x ≥ 0.
Local entropy correction could be used to remedy this [70]. However, it is usually more robust to use a
global “flux splitting”:
(2.75)
f (u) = f + (u) + f − (u)
where
(2.76)
df + (u)
≥ 0,
du
df − (u)
≤ 0.
du
We would need the positive and negative fluxes f ± (u) to have as many derivatives as the order of the scheme.
This unfortunately rules out many popular fluxes (such as those of van Leer [79] and Osher [58]) for high
order methods in this framework.
23
The simplest smooth splitting is the Lax-Friedrichs splitting:
1
(f (u) ± αu)
2
f ± (u) =
(2.77)
where α is again taken as α = maxu |f (u)| over the relevant range of u.
We note that there is a close relationship between a flux splitting (2.75) and a monotone flux (2.69). In
fact, for any flux splitting (2.75) satisfying (2.76),
h(a, b) = f + (a) + f − (b)
(2.78)
is clearly a monotone flux. However, not every monotone flux can be written in the flux split form (2.75).
For example, the Godunov flux (2.70) cannot.
With the flux splitting (2.75), we apply the the ENO or WENO reconstruction procedures, Procedure
ˆ+
2.1 or 2.2, with v(x) = f + (u(x, t)) and v(x) = f − (u(x, t)) separately, to obtain two numerical fluxes fi+ 1
2
ˆ
ˆ
and f − 1 , and then sum them to get the numerical flux f 1 .
i+ 2
i+ 2
In summary, to build a finite difference (FD) ENO or WENO scheme (2.73) using the flux splitting
approach, given the point values {ui }, we proceed as follows:
Procedure 2.5. FD 1D scalar flux splitting ENO and WENO.
1. Find a smooth flux splitting (2.75), satisfying (2.76);
2. Identify v i = f + (ui ) and use the ENO or WENO reconstruction procedure, Procedure 2.1 or 2.2, to
−
obtain the cell boundary values vi+ 1 for all i;
2
3. Take the positive numerical flux as
−
ˆ+
fi+ 1 = vi+ 1 ;
2
2
−
4. Identify v i = f (ui ) and use the ENO or WENO reconstruction procedures, Procedure 2.1 or 2.2,
+
to obtain the cell boundary values vi+ 1 for all i;
5. Take the negative numerical flux as
2
+
ˆ−
fi+ 1 = vi+ 1 ;
2
2
6. Form the numerical flux as
ˆ+
ˆ−
ˆ
fi+ 1 = fi+ 1 + fi+ 1 ;
2
2
2
7. Form the scheme (2.73).
We remark that the finite difference scheme in this section and the finite volume scheme in Sect. 2.3.1
are equivalent for one dimensional, linear PDE with constant coefficients: the only difference is in the initial
conditions (one uses point values and the other uses cell averages of the exact initial condition). Notice
that the schemes are still nonlinear in this case. However, this equivalence does not hold for a nonlinear
PDE. Moreover, we will see later that there are significant differences in efficiency of the two approaches for
multidimensional problems.
In the following we test the accuracy of the fifth order finite difference WENO schemes on the linear
equation:
−1 ≤ x ≤ 1
ut + ux = 0,
u(x, 0) = u0 (x)
24
periodic.