2.3 Analytic test problems
2.3.1 Shock tube solution
One simple way to study the evolution of non-linear waves in ideal hydrodynamics consists of evolving initial conditions in the form of two constant states. This one- dimensional initial value problem is known as the Riemann problem. It is given by a left state WLwith the gas properties (ρL, vL, pL), a right state WRwith (ρR, vR, pR), and a discontinuity at x = 0 separating these states.
Mathematical and numerical schemes designed for solving this problem are called Riemann solvers, and the first exact Riemann solver for non-linear hyperbolic systems has been introduced by Godunov [1959].
The Riemann problem is of great relevance in computational hydrodynamics. It can be used as a hydrodynamic test for assessing the correctness and quality of a hydrodynamic code, and moreover, a Riemann solver is an important building block of many state-of-the-art hydrodynamic solvers for the Euler equations.
In this section we follow Toro [2009] and outline the general strategy for obtaining a solution for the Riemann problem. Moreover, we discuss exemplarily the result obtained for the classical shock tube problem [Sod, 1978]. A Sod shock tube problem is a special Riemann problem with vanishing velocities in the initial conditions.
When the discontinuous initial conditions of the Riemann problem are evolved, three different waves emerge instantly, corresponding to the three eigenvalues{λ1, λ2, λ3} = {v − c, v, v + c} of the one-dimensional system. The eigenvalues indicate the wave speeds, and since the waves originate from x = t = 0, which is a point in space-time, the solution of the problem has to be self-similar, u = u(x/t).
By analysing the eigenvectors and characteristics of the middle wave with speed λ2 = v, one finds that the characteristics are parallel to dxdt = v. This corresponds to the pure advection of a hydrodynamic profile, and the gas velocity is constant across the wave. Hence, the wave can be characterized as a contact discontinuity. For each of the outer waves, the characteristics can either diverge, corresponding to a rarefaction wave, or converge, corresponding to a shock wave.
In Fig. 2.6 we show a typical wave structure for a shock tube problem, where the left wave is a rarefaction, and the right wave a shock. The three waves separate four different and constant states. The states beyond the outer waves correspond to the states of the initial conditions and are denoted by WL and WR. The region between the outer waves is referred to as the star region, which is divided by the
Figure 2.6: A typical wave structure for a shock tube problem. Four different hydrodynamic states are separated by, from left to right, a rarefaction wave (orange), a contact discontinuity (green), and a shock (blue).
contact into W∗L and W∗R. The pressure and the velocity of the gas is continuous across the contact discontinuity, p∗L = p∗R =: p∗ and vL∗ = vR∗ =: v∗.
In order to solve the Riemann problem, we have to consider the different occurring cases. To begin with, if the pressure in the star region is larger than the pressure in the left initial state, the left wave is compressive, that is to say a shock wave. In this case we can straight-forwardly connect the states WLand WL∗ by the flux continuity equations (2.75), (2.76), and (2.77), and the Rankine-Hugoniot jump conditions as follows.
According to (2.78) the mass flux between the states is jL2 = p∗− pL
1/ρL− 1/ρ∗L
. (2.95)
In this equation the unknown quantities are p∗ and ρ∗L. An expression for the latter is given by (2.80), viz.
ρ∗L= ρL
[(γ− 1)/(γ + 1) + p∗/pL]
(γ− 1)/(γ + 1)p∗/pL+ 1. (2.96)
Hence, ρ∗L can be eliminated in the mass flux, yielding jl= p∗+ B L AL 1/2 , (2.97)
with the symbols AL= 2 (γ + 1)ρL , and BL= (γ− 1) (γ + 1)pL. (2.98)
The pressure in the star region p∗ depends also on the right state WR, and can therefore not simply be calculated from the jump across the left wave. For this reason, we first derive equations connecting the unknown velocity v∗ to the left and right state, respectively. In a second step, these equations can be combined yielding an equation for the pressure in the star region.
The velocity in the star region can be calculated from the flux continuity equations across the shock. The continuity of the mass flux for a left shock wave reads
jL= ρLvˆL = ρ∗Lvˆ∗. (2.99)
Here the hats indicate that the velocities in this equation are the velocities relative to the moving shock surface, that is in the frame of the shock. They are connected to the velocities in the laboratory frame of reference by
ˆ
vL= vL− SL, and vˆ∗= v∗− SL, (2.100)
where SLdenotes the speed of the shock. Inserting equation (2.99) into the momentum continuity equation ρLvˆL2+ pL= ρ∗L(ˆv∗)2+ p∗ (2.101) yields ˆ v∗= ˆvL− p∗− pL jL ⇔ v∗= vL− p∗− pL jL . (2.102)
By inserting the expression (2.97) for the mass flux one obtains
v∗= vL− fLs(p∗, WL), (2.103)
with the function
fLs(p∗, WL) = (p∗− pL) AL p∗+ BL 1/2 . (2.104)
If the pressure in the star region is smaller than the pressure in the left initial state, the left wave is a rarefaction wave. This wave does not represent a discontinuity like a contact or a shock wave, but it consists of a spatially extended continuous structure. In what follows, we will give a shortened derivation of this wave type.
While the characteristic variables are constant along the characteristics, there are also quantities which are constant across the wave structure. These quantities
are called Riemann invariants. For details the interested reader may be referred to Jeffrey [1976].
Across a rarefaction wave the Riemann invariants are the entropy s, and the quantity v + 2c/(γ− 1). Constant entropy implies p ∝ ργ, and hence
ρ∗L= ρL p ∗ pL
(1/γ)
. (2.105)
This equation can be rewritten in terms of the sound speed, yielding c∗L= cL p
∗ pL
γ2γ−1
. (2.106)
The equation for the second generalized Riemann invariant reads vL+
2cL
γ− 1 = v
∗+ 2c∗L
γ− 1. (2.107)
Solving for the velocity in the star region and substituting the sound speed via equation (2.106) leads to the result
v∗ = vL− fLr(p∗, WL), (2.108) where fLr(p∗, WL) = 2cL (γ− 1) p∗ pL γ2γ−1 − 1 . (2.109)
Analogous to the calculations above, the right wave can be connected to the velocity and pressure of the star region. For a right shock wave one obtains
v∗ = vR+ fRs(p∗, WR), (2.110)
and a right rarefaction wave results in
v∗ = vR+ fRr(p∗, WR). (2.111)
Finally, by equating the velocities in the star region we can connect the left and right state of the initial conditions, viz.
f (p∗, WL, WR)≡ fL(p∗, WL) + fR(p∗, WR) + vR− vL= 0, (2.112) with
fL(p∗, WL) =
fLs(p∗, WL) if p∗ > pL (left shock wave), fLr(p∗, WL) if p∗ ≤ pL (left rarefaction wave),
and
fR(p∗, WR) =
fRs(p∗, WR) if p∗> pR (right shock wave), fRr(p∗, WR) if p∗≤ pR (right rarefaction wave).
(2.114) With this algebraic equation we can calculate the pressure in the star region, and subsequently v∗ with (2.110) or (2.111). However, no closed analytic solution exists for (2.112), and we have to adopt numerical tools. The derivative f′(p) can be calculated analytically, such that the Newton-Raphson root finding scheme proves to be suitable. It reads
pn= pn−1−
f (pn−1)
f′(pn−1), (2.115)
and requires a starting value p0. This initial guess is however not very critical, since f in our problem is monotone and concave, and has only one root. The iteration is stopped when the relative pressure change is sufficiently small. In most of the cases this approach is successful. However, there are situations with very low density and pressure values, which require a different solution strategy. For inferring these so-called vacuum solutions, a detailed outline may be found in Toro [2009].
Once the pressure and the velocity of the star region is known, it is straight forward to calculate the full solution. For a shock wave, the density in the adjacent star region can be computed from equation (2.96). Lastly, the speed of the left shock wave is
SL= vL− jL ρL
, (2.116)
with the mass flux jL given by (2.97).
The solution in the case of a left rarefaction consists of a continuous change of the hydrodynamic quantities between the characteristics with speeds Shead = vL− cL and Stail = v∗− c∗L. The solution for a characteristic within the rarefaction fan can be calculated by combining its velocity dxdt = v− c with the equations (2.105) and (2.107) of the Riemann invariants. One obtains
WfanL = ρ = ρL 2 (γ+1)+(γ+1)cγ−1LvL− x t 2 γ−1 , v = γ+12 cL+γ−12 vL+xt , p = pL 2 γ+1 + γ−1 (γ+1)cLvL− x t 2γ γ−1 . (2.117)
The results for a right shock wave and a right rarefaction wave are calculated analogously.
In order to obtain the solution of the Riemann problem at location x and time t, we can take advantage of its self-similar nature. The solution depends only on the speed S = xt, and if we can infer the position of the corresponding line in space-time
with respect to the three different waves, the solution is known immediately. This task can be accomplished simply by comparing S to the speeds of the different waves, and is called sampling of the solution.
In Fig. 2.7 we show the solution for the classical Sod shock tube problem [Sod, 1978]. The initial conditions consist of the two constant states WL= (ρL= 1, vL= 0, pL= 1) and WR = (ρR= 0.125, vR = 0, pR= 0.1). We have computed the solution of this shock tube problem with an exact Riemann solver at different times, and show the result in space-time in the upper panels. This is a direct visualization of the wave structure, which consists of a left rarefaction wave, a contact discontinuity, and a right shock wave. Hence, the wave structure at hand is the same as shown in the sketch of Fig. 2.6. The three waves separate four constant states, which are clearly visible in the density plot. On the other hand, in the pressure plot only three different states can be seen, since the pressure across the contact discontinuity is constant. The bottom panels present the solution at t = 0.228. In this representation the shape of the rarefaction wave can be seen more easily. It is created by a fan of characteristics, resulting in a smooth change of density and pressure across the wave.