Comparison Numerical Fluxes Notes
Comparison Numerical Fluxes Notes
Euler Equations
- Math 671 final assignment -
H. Nishikawa∗
December 1998
Abstract
In this report, eight basic numerical flux functions for 1D Euler equations are compared on Sod’s
shock tube problems. Some fundamental properties of the schemes will be discussed. Also a solution
obtained by a second-order method will be presented.
1 Introduction
In this study, we consider the 1D Euler equations for a perfect gas.
∂u ∂f
+ =0 (1)
∂t ∂x
where
T [ ]T p 1
u = [ρ, ρu, ρE] , f = ρu, ρu2+p, ρuH , ρE = ρH − p = + ρu2 , γ = 1.4. (2)
γ−1 2
We write a numerical scheme in the conservative form.
∆t ( )
Un+1
j = Unj − Fj+ 12 − Fj− 12 (3)
∆x
where Unj is a numerical approximation to the cell-average of the exact solution over the j th cell at t = tn ,
and Fj+ 12 is a numerical flux approximating the time-average of the exact flux over ∆t evaluated at xj+ 12 .
Various formulas for the numerical flux have been developed up to the present. We shall consider
eight of those in this report. Although these schemes are derived from different interpretations of the
numerical approximation; computing cell-averages(finite-volume method) or point-values(finite difference
method), it is not an important issue here since we consider only 1st/2nd order method.
2 Numerical Fluxes
In this section, we will give the formulas for the numerical flux, and describe some well-known properties
for each.
1
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
n+ 1 1[ n ] ∆t [ ]
Uj+ 12 = Uj + Unj+1 − f (Unj+1 ) − f (Unj ) (5)
2 2 2∆x
∆t [ ]
n+ 12 n+ 12
Un+1
j = U n
j − f (U 1
j+ 2
) − f (U 1
j− 2
) . (6)
∆x
This is in the conservative form, and therefore we identify Richtmyer’s flux function as
n+ 1
Fj+ 12 = f (Uj+ 12 ) (7)
2
with (5).
The first step is the Lax-Friedrichs scheme, and the second is a leapfrog scheme. This scheme becomes
identical to the Lax-wendroff scheme in the linear case. The Lax-wendroff scheme is known as dispersive,
i.e. high frequency components lag behind. And due to the small dissipation they remain to be high
frequency. A linear analysis tells us that this behavior becomes more conspicuous as the CFL number
goes down.
⃝1998
c by Hiroaki Nishikawa 2
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
In Steger-Warming splitting, we project the flux onto the space of eigenvectors using the homogeneity
property, and split the flux. This results
1 1 1
ρ ρ (γ − 1) ρ
f ± (U) = λ(1)± u − c + λ(2)± u + λ(3)± u+c (12)
2γ γ 2γ
H − uc 1 2
2 u H + uc
where
λ(k) ± |λ(k) |
λ(k)± = , k = 1, 2, 3. (13)
2
and λ(k) are defined by
λ(1) = u − c, λ(2) = u, λ(3) = u + c. (14)
The vectors are, as mentioned, associated eigenvectors, r(1) , r(2) , and r(3) respectively. This is however
not a unique splitting of the flux. It is a disadvantage of this splitting that it is not differentiable at a
sonic and stagnation points. Later Van Leer designed a splitting that is differentiable.
where M is the Mach number. This is differentiable at a sonic and a stagnation points.
∂f
where A is the Jacobian matrix ∂u . The integral is to be broken into three parts,
∫ j+1 ∫ Lm ∫ Rm ∫ j+1
|A(U)| dU = |A(U)| dU + |A(U)| dU + |A(U)| dU (18)
j j Lm Rm
⃝1998
c by Hiroaki Nishikawa 3
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
where the integrals are carried out along right eigenvectors, r(3) , r(2) , and r(1) respectively. After some
analysis, we arrive at the following practical(ready-to-use) formula.
1[ ] 1[ ]
Fj+ 12 = f (Unj ) + f (Unj+1 ) − F + F3-sonic + F1-sonic (19)
2 2
where
(3) (1)
F = sgn(λj ) f (Uj ) + sgn(λj+1 ) f (Uj+1 ) (20)
[ ]
(3) (2)
+ sgn(λj ) − sgn(λLm ) f (ULm ) (21)
[ ]
(2) (1)
+ sgn(λLm ) − sgn(λj+1 ) f (URm ) (22)
and
{
2sgn(λj ) [f (U∗ ) − f (ULm )] λj · λLm < 0
(3) (3) (3)
F3-sonic = (23)
0 otherwise
{
2sgn(λj+1 ) [f (URm ) − f (U∗ )] λj+1 · λRm < 0
(1) (1) (1)
F1-sonic = (24)
0 otherwise
The intermediate states, Lm and Rm, can be found easily. And U∗ is the state of the sonic point at
which λ(k) = 0, k = 1 or 3, which can also be determined easily.
Clearly, the approximate Riemann solution does not contain discontinuous transition(integrations
along r(k) , not the Hugoniot curve.). According to Van Leer’s analysis, the integration can be interpreted
as along an overturned shock in phase space whenever there exists a discontinuity in reality. The resulting
solution however will be sharp with at most two interior cells.
1[ ] 1 ∑ (k) 3
Fj+ 12 = f (Unj ) + f (Unj+1 ) − |λ̂ |∆V̂ (k) r̂(k) (25)
2 2
k=1
where ∆V (k) is the discretized kth component of the differential of the characteristic vector,
[ ]
∆p − ρ̂ĉ∆u ∆p − ĉ2 ∆ρ ∆p + ρ̂ĉ∆u
∆V̂ (k) = , − , (26)
2ĉ2 ĉ2 2ĉ2
where ∆p = pR − pL = pj+1 − pj , and similarly for others. And r̂(k) are right eigenvectors
[ ]T [ ]T [ ]T
û2
r̂ (1)
= 1, û − ĉ, Ĥ − ûĉ , r̂ = 1, û,
(2)
, r̂(3) = 1, û + ĉ, Ĥ + ûĉ . (27)
2
with the eigenvalues
λ̂(1) = û − ĉ, λ̂(2) = û, λ̂(3) = û + ĉ. (28)
All the quantities with a hat are evaluated by the Roe-averages,
( )
√ uL + R uR HL + R HR û2
ρ̂ = ρL ρR = R ρL , û = , Ĥ = , ĉ2 = (γ − 1) Ĥ − . (29)
1+R 1+R 2
In Roe’s method, all the waves are replaced by linear waves, and therefore no rarefaction waves(nonlinear
waves) are contained in the scheme. This results in the failure of detecting the sonic point, and it needs
to be modified in such a case.
⃝1998
c by Hiroaki Nishikawa 4
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
From the above observations, we see that the properties of the schemes well-known in the linear case
are indeed carried over to the nonlinear case. We then could conclude that we obtain the best results by
the upwind schemes. Next we compare the upwind schemes.
Steger-Warming, Van Leer, Godunov, Osher, Roe (Figures 7, 9, 11, 13, and 15)
As can be seen in figure 7 and 9, Van Leer’s scheme improves the solution at the contact discontinuity
and at both ends of the expansion fan, compared with those by Steger-Warming’s scheme in which the
solution is strongly smeared out at these regions. For Godunov-type methods, Godunov, Osher, and
Roe, the solutions are almost indistinguishable. This leads us to conclude that Roe’s method be the
practical choice since it requires the least computational work among the three. Now, we compare Van
Leer and Roe, Figures 7 and 15. There is no significant differences except for a minor difference in the
expansion fan. It is hard to tell at this point which is superior in a general sense. Finally note that the
contact discontinuity is smeared significantly in all the schemes, which can be seen clearly in the entropy
plot. On the other hand, the shock has been resolved quite sharply by most of the schemes. This is
⃝1998
c by Hiroaki Nishikawa 5
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
a typical result for a nonlinear discontinuity because of its self-sharpening nature (combination of the
characteristics merging into the shock and the upwind method) while there is no such mechanism in the
linearly degenerate field (combination of the characteristics running parallel to the discontinuity and the
upwind method, i.e. upwind in the same direction across the discontinuity).
In the sense of extending the first-order method to the second-order, it would be reasonable to choose
Roe’s method because of its linearization property. A second-order method developed for a linear system
can be applied directly to the Euler equations linearized by the method of Roe.
where Fupwind is the upwind flux given by (25), ν̂ (p) = λ̂(p) dt/dx, and
{
j if λ̂(p) > 0
ip = (34)
j+1 if λ̂(p) < 0
Note that all the quantities with a hat are evaluated by the Roe-averages between jth and (j + 1)th cells
(p) (p)
except for dV̂j− 1 and dV̂j+ 3 which must be evaluated by the Roe-averages between their corresponding
2 2
two neighboring cells.
As shown in figures 17 and 18, a noticeable improvement can be seen especially at the contact
discontinuity. The oscillations typical to second-order schemes have been successfully removed by the
minmod limiter.
⃝1998
c by Hiroaki Nishikawa 6
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
4 Concluding Remarks
The eight basic schemes for the Euler equations were compared for two shock tube problems. From this
study, the following conclusions may be drawn. First, the upwind schemes would be the best choice
for the Euler equations. Second, the flux-vector splitting methods are not as robust as Godunov-type
methods as shown in the case of the sonic rarefaction. But Godunov-type methods can produce a spurious
solution in some cases.
References
[1] Hirsch, C., Numerical Computation of Internal and External Flows, Volume 2, John Wiley & Sons,
1990.
[2] LeVeque, R. J., Numerical Methods for Conservation Laws, Birkhäuser, 1992.
[3] Huynh, H. T., Accurate Upwind Methods for the Euler Equations, SIAM J. Num. Anal., Vol. 32,
No. 5, pp. 1565-1619, October 1995.
⃝1998
c by Hiroaki Nishikawa 7
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
Velocity u
Velocity u
Density ρ
Density ρ
0.6 0.6 0.6 0.6
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
0.8 0.8
1.5 1.5
Entropy/Rgas
Entropy/Rgas
Pressure P
Pressure P
0.6 0.6
1 1
0.4 0.4
0.5 0.5
0.2 0.2
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Velocity u
Density ρ
Density ρ
0.4 0.4
0.2 0.2
0.2 0.2
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Entropy/Rgas
Pressure P
Pressure P
0.6 1 0.6 1
0.2 0 0.2 0
0 −0.5 0 −0.5
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
⃝1998
c by Hiroaki Nishikawa 8
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
Velocity u
Velocity u
Density ρ
Density ρ
0.6 0.6
1
0.4 0.4
0.5
0.5
0.2 0.2
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
1
Entropy/Rgas
Entropy/Rgas
Pressure P
Pressure P
0.6 1 0.6
0.5
0.4 0.5 0.4
0
0.2 0 0.2 −0.5
0 −0.5 0 −1
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Velocity u
Density ρ
Density ρ
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Entropy/Rgas
Pressure P
Pressure P
0.6 1 0.6 1
0.2 0 0.2 0
0 −0.5 0 −0.5
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
⃝1998
c by Hiroaki Nishikawa 9
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
Velocity u
Velocity u
Density ρ
Density ρ
0.6 0.6 0.6 0.6
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
0.8 0.8
1.5 1.5
Entropy/Rgas
Entropy/Rgas
Pressure P
Pressure P
0.6 0.6
1 1
0.4 0.4
0.5 0.5
0.2 0.2
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Figure 9: The solutions by Van Leer’s scheme Figure 10: The solutions by Van Leer’s scheme
with CFL= 0.95, t = 1.74534. with CFL= 0.1, t = 1.70217.
Velocity u
Density ρ
Density ρ
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
0.8 0.8
1.5 1.5
Entropy/Rgas
Entropy/Rgas
Pressure P
Pressure P
0.6 0.6
1 1
0.4 0.4
0.5 0.5
0.2 0.2
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Figure 11: The solutions by Godunov’s Figure 12: The solutions by Godunov’s
scheme with CFL= 0.95, t = 1.73846. scheme with CFL= 0.1, t = 1.70409.
⃝1998
c by Hiroaki Nishikawa 10
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
Velocity u
Density ρ
0.6 0.6
Velocity u
Density ρ
0.6 0.6
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
0.8 0.8
1.5 1.5
Entropy/Rgas
Entropy/Rgas
Pressure P
Pressure P
0.6 0.6
1 1
0.4 0.4
0.5 0.5
0.2 0.2
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Figure 13: The solutions by Osher’s scheme Figure 14: The solutions by Osher’s scheme
with CFL= 0.95 at t = 1.73402. with CFL= 0.1, t = 1.70201.
Velocity u
Density ρ
Density ρ
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
0.8 0.8
1.5 1.5
Entropy/Rgas
Entropy/Rgas
Pressure P
Pressure P
0.6 0.6
1 1
0.4 0.4
0.5 0.5
0.2 0.2
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Figure 15: The solutions Roe’s scheme with Figure 16: The solutions by Roe’s scheme with
CFL= 0.95, t = 1.73448. CFL= 0.1, t = 1.70268.
⃝1998
c by Hiroaki Nishikawa 11
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
Velocity u
Velocity u
Density ρ
Density ρ
0.6 0.6 0.6 0.6
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
0.8 0.8
1.5 1.5
Entropy/Rgas
Entropy/Rgas
Pressure P
Pressure P
0.6 0.6
1 1
0.4 0.4
0.5 0.5
0.2 0.2
0 0 0 0
−5 0 5 −5 0 5 −5 0 5 −5 0 5
x x x x
Figure 17: Second-order solution by MUSCL Figure 18: Second-order solution by MUSCL
with CFL= 0.95, t = 1.72672. with CFL= 0.1, t = 1.70463.
Density Velocity
4 4 Density Velocity
4 4
3.5 3.5
3.5 3.5
3 3
3 3
Velocity u
Density ρ
2.5 2.5
Velocity u
Density ρ
2.5 2.5
2 2
2 2
1.5 1.5
1.5 1.5
1 1
1 1
0.5 0.5
−5 0 5 −5 0 5 0.5 0.5
x x −5 0 5 −5 0 5
x x
Pressure Entropy/Rgas
Pressure Entropy/Rgas
12 2
12 2
10
1.5 10
8 1.5
Entropy/Rgas
Pressure P
8
Entropy/Rgas
Pressure P
6 1
6 1
4
0.5 4
2 0.5
2
0 0
−5 0 5 −5 0 5 0 0
x x −5 0 5 −5 0 5
x x
⃝1998
c by Hiroaki Nishikawa 12
CFD Notes by Hiroaki Nishikawa www.cfdnotes.com
Density Velocity
4 4 Density Velocity
4 4
3.5 3.5
3.5 3.5
3 3
3 3
Velocity u
Density ρ
2.5 2.5
Velocity u
Density ρ
2.5 2.5
2 2
2 2
1.5 1.5
1.5 1.5
1 1
1 1
0.5 0.5
−5 0 5 −5 0 5 0.5 0.5
x x −5 0 5 −5 0 5
x x
Pressure Entropy/R
gas
Pressure Entropy/R
12 1.5 gas
12 1.4
10
10 1.2
1
8 1
Entropy/Rgas
Pressure P
Entropy/Rgas
Pressure P
6 0.5 0.8
6
0.6
4
0 4
0.4
2
2 0.2
0 −0.5
−5 0 5 −5 0 5 0 0
x x −5 0 5 −5 0 5
x x
Density Velocity
Density Velocity 4 4
4 4
3.5 3.5
3.5 3.5
3 3
3 3
Velocity u
Density ρ
2.5 2.5
Velocity u
Density ρ
2.5 2.5
2 2
2 2
1.5 1.5
1.5 1.5
1 1
1 1
0.5 0.5
0.5 0.5 −5 0 5 −5 0 5
−5 0 5 −5 0 5 x x
x x
Pressure Entropy/Rgas
Pressure Entropy/Rgas
12 1.5
12 1.4
10
10 1.2
8 1
Entropy/Rgas
1
Pressure P
8
Entropy/Rgas
Pressure P
0.8 6
6
0.6 4 0.5
4
0.4
2
2 0.2
0 0
0 0 −5 0 5 −5 0 5
−5 0 5 −5 0 5 x x
x x
⃝1998
c by Hiroaki Nishikawa 13