hydrodynamics
F. D. Lora-Clavijo, J. P. Cruz-Pérez, F. S. Guzmán, J. A. González1
1
Instituto de Fı́sica y Matemáticas, Universidad Michoacana de San Nicolás de Hidalgo. Edificio C-3,
Cd. Universitaria, 58040 Morelia, Michoacán, México.
(Dated: March 19, 2013)
Some of the most interesting scenarios that can be studied in astrophysics, contain fluids and
plasma moving under the influence of strong gravitational fields. To study these problems it is
required to implement numerical algorithms robust enough to deal with the equations describing
arXiv:1303.3999v1 [astro-ph.HE] 16 Mar 2013
such scenarios, which usually involve hydrodynamical shocks. It is traditional that the first problem
a student willing to develop research in this area is to numerically solve the one dimensional Riemann
problem, both Newtonian and relativistic. Even a more basic requirement is the construction of the
exact solution to this problem in order to verify that the numerical implementations are correct.
We describe in this paper the construction of the exact solution and a detailed procedure of its
implementation.
that is very detailed in the construction and implemen- The initial data of the Riemann problem is defined as
tation of the solution. We focus on the solution of the follows
2
waves. Once again we use the Riemann invariant equali- When the wave is moving to the left, we assume in-
ties, which for vectors 1 and 3 read formation from the left state is available and we look for
expression of the variables on the state to the right from
dρ d(ρv) dE the wave. For the velocity of the fluid at the right state
= = , we then have from (15)
1 v−a H − av
dρ d(ρv) dE
= = . 2
1 v+a H + av vR = vL − [aR − aL ], (17)
Γ−1
Manipulation of these equalities results in the following
equations now considering
p that the
pspeed of sound on both sides
obeys a = KΓρ Γ−1 = Γp/ρ (see (13))
dρ ρ
= − for λ1 , (10) Γ−1
dv a
pR 2Γ
dρ ρ aR = aL , (18)
= for λ3 , (11) pL
dv a
dε p a useful expression for vR arises
= 2 for both λ1 and λ3 . (12)
dρ ρ
The next step is to integrate these equations assuming
" Γ−1 #
2aL pR 2Γ
an equation of state, in our case the ideal gas. From (12) vR = vL − −1 . (19)
we obtain Γ−1 pL
where + stands for the wave moving to the right (the aL = aR , (21)
pR
case of λ3 and r3 corresponding to a rarefaction wave)
and − when moving to the left (the case of λ1 and r1 which finally implies
corresponding to a rarefaction wave), where k is an in-
tegration constant and therefore the velocity is constant " Γ−1 #
as well. This property allows us to set relations between 2aR pL 2Γ
vL = vR − 1− . (22)
the velocity of the gas on the state at the left and at the Γ−1 pR
right from the rarefaction wave, explicitly there are two
possible cases: The only unknown quantity in this case is pL .
The rarefaction zone has a finite size, bounded by two
i) When the wave is moving to the left, condition (14)
curves, the tail and the head. The head of the wave is the
implies that
line of the front of the wave and the tail is the boundary
left behind the wave. The region in the middle is called
2aL 2aR the fan of the rarefaction wave.
vL + = vR + . (15) The velocity of all the particles between the head and
Γ−1 Γ−1
the tail obeys the following expression
ii) When the wave is moving to the right, condition
(14) implies x − x0
= v ± a, (23)
t
2aL 2aR where + is used when the wave is propagating to the right
vL − = vR − (16)
Γ−1 Γ−1 and the − when it is moving to the left. Then, when the
4
wave is moving to the left, using this expression we have C. Shock waves
aR = vR −(x−x0 )/t, which substituted into (19) provides
the following expression for the velocity of the gas on the Similar to the previous case, the shock can move either
state at the right from the wave is to the right (if λ3 and r3 correspond to a shock wave) or
to the left (if λ1 and r1 correspond to a shock wave), and
for each of the two cases there is known and unknown
2 1 x − x0 information. When a shock is moving to the right one
vR = aL + (Γ − 1)vL + . (24)
Γ+1 2 t is expected to have information of the state at the right
from the shock and conversely, when the shock is moving
Then it is possible to calculate the pressure and density to the left one accounts with information of the state at
as well. Substituting (24) into (15) and (18) we obtain an the left.
expression for the pressure also at the state to the right Shocks require the use of Rankine Hugoniot conditions
(6). We express these conditions in terms of the primitive
variables as follows
2Γ
Γ−1
2 Γ−1 x − x0
pR = pL + vL − .
Γ + 1 aL (Γ + 1) t
(25) ρL vL − ρR vR = S(ρL − ρR ),
2 2
Now, using this into (13) implies the expression for the ρL vL + pL − ρR vR − pR = S(ρL vL − ρR vR ),
density vL (EL + pL ) − vR (ER + pR ) = S(EL − ER ),
Now, in order to express the velocity in terms of the From expression (36) and using (40) we express the shock
pressure and the variables of the state at the left from velocity as follows
the shock, we can rewrite (33) as follows
s
j j pR (Γ + 1) + pL (Γ − 1)
vR − S = , vL − S = . (36) S = vL − .
ρR ρL 2ρL
q
Thus, substituting this into (34) we obtain Finally, using the sound speed expression aL = pρLLΓ we
obtain the final expression for the shock velocity
pR − pL
j2 = − 1 1 . (37)
ρR − ρL s
(Γ + 1)pR Γ−1
On the other hand, using equation (32) and the expres- S = vL − aL + . (42)
2pL Γ 2Γ
sion for the specific internal enthalpy h we can easily
get the following expression for the difference of internal Analogously, when the shock moves to the right, it is
specific enthalpies possible to construct the expressions for the variables for
the state at the left from the shock
1 2 2
hR − hL = v̂ − v̂R , (38)
2 L s
AR
where hL = εL + pL /ρL and hR = εR + pR /ρR . Now, vL = vR + (pL − pR ) , (43)
p L + BR
from equations (30) and (31) we give expressions for the
velocitites measured by the observer located in the rest pR (Γ − 1) + pL (Γ + 1)
ρL = ρR , (44)
frame of the shock wave pL (Γ − 1) + pR (Γ + 1)
s
(Γ + 1)pL Γ − 1
ρL p L − p R S = vR + aR + . (45)
2
v̂R = , 2pR Γ 2Γ
ρR ρL − ρR
2 ρR p L − p R and we let this as an exercise to the reader.
v̂L = .
ρL ρL − ρR
With the substitution of these last equations into (38) D. Classical Riemann Problem
and considering the definitions for the specific internal
enthalpy mentioned above, we obtain The Riemann problem is physically a tube filled with
gas which is divided into two chambers separated by a
1 (pL + pR )(ρR − ρL ) removable membrane at x = x0 . At the initial time the
εR − εL = . membrane is removed and the gas begins to flow. Once
2 ρL ρR
the membrane is removed, the discontinuity decays into
Assuming the gas obeys an ideal equation of state we get two elementary, non-linear waves that move in opposite
an expression for the density as follows directions.
Depending on the values of the thermodynamical vari-
ρR pL (Γ − 1) + pR (Γ + 1) ables in each chamber, four cases can occur. Considering
= . (39) the fluid is described on a one-dimensional spatial do-
ρL pR (Γ − 1) + pL (Γ + 1)
main, rarefaction and shock waves can evolve toward the
Notice that this expression relates the density among the left or right from the location of the membrane.
two sides from the shock. Now, substituting this expres- In general the solution in all the cases can be studied
sion into (37) we obtain in six following regions:
Region 4: region between the contact discontinuity Region 3 plays the role of the state at the right from
and the wave moving to the right, called region the rarefaction wave and region 1 the state at the left.
star-right Then we can use (19) to obtain an expression for v3
1 2 3 4 6
pexact = p3 ,
vexact = v3 , FIG. 1: Description of the relevant regions for the
ρexact = ρ3 . Rarefaction-Shock case.
0.9
1
4. Region 4 is defined by the condition tVcontact <
0.8 0.8 x − x0 < tVt , where the velocity of the tail of the
0.7
0.6
0.6
rarefaction wave Vt is the third eigenvalue (4) eval-
p
ρ
0.5
0.4
uated at the region behind the tail Vt = v4 + a4 .
0.4
0.3
0.2
One uses (53) to calculate v4 and (13) implies
p4 /p6 = (ρ4 /ρ6 )Γ for a constant value of K, which
0.2
0.1
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
1
x
3
x implies an expression for ρ4 . The resulting exact
0.9
0.8
2.8 solution is
0.7 2.6
0.6
2.4
v
ε
0.5
2.2
pexact = p4 ,
0.4
0.3 2
0.2
0.1
1.8
vexact = v4
0 1.6 1/Γ
p4
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
ρexact = ρ6 .
FIG. 2: Exact solution for the Rarefaction-Shock case at time
p6
t = 0.25 for the parameters in Table I.
5. Region 5 is a fan region defined by the condition
tVt < x − x0 < tVh where the velocity of the head
Equating these two expression one obtains a trascenden- of the wave is again the third eigenvalue, but this
tal equation for p∗ : time evaluated at the head Vh = v6 + a6 . One
uses the expressions for a fan region of a rarefaction
∗ Γ−1 wave moving to the right (27,28,29) to calculate the
s " #
A1 2a 6 p 2Γ
−(p∗ −p1 ) + 1− +v1 −v6 = 0 exact solution
p ∗ + B1 Γ − 1 p6
(54)
that one solves numerically for p∗ . This information pro- 2Γ
Γ−1
2 Γ−1 x − x0
vides the necessary information to construct the solution pexact = p6 − v6 − ,
in the whole domain as described below. The different Γ + 1 a6 (Γ + 1) t
regions are illustrated in Fig. 3 and the exact solution 2 1 x − x0
vexact = −a6 + (Γ − 1)v6 + ,
region by region is as follows. Γ+1 2 t
2
1. Region 1 is defined by x − x0 < tVshock , where the
Γ−1
2 Γ−1 x − x0
velocity of the shock is given by (42) because the ρexact = ρ6 − v6 − .
Γ + 1 a6 (Γ + 1) t
shock is traveling to the left:
t
2 5 Again, once p∗ is calculated numerically, the solution in
all the regions of the domain can be calculated as follows.
4 The first implication is that p3 = p4 = p∗ , and thus
3
v3 and v4 can be calculated using (55) and (56). The
different regions are illustrated in Fig. 5.
0.8 0.8
tVh,2 < x − x0 < tVt,2 , where the velocity of the
0.7 tail Vt,2 is that of the state left behind by the wave,
0.6
0.6
that is Vt,2 = v3 − a3 .
p
ρ
0.5
0.4
0.4
0.3
The exact solution is that of a fan region of a rar-
0.2
0.2
-0.1
2.8
-0.2 2Γ
Γ−1
-0.3 2.6 2 Γ−1 x − x0
-0.4 pexact = p1 + v1 − ,
2.4
Γ+1 a1 (Γ + 1) t
v
-0.5
2.2
-0.6
-0.7 2 1 x − x0
vexact = a1 + (Γ − 1)v1 + ,
2
-0.8
-0.9
1.8
Γ+1 2 t
-1
0 0.2 0.4 0.6 0.8 1
1.6
0 0.2 0.4 0.6 0.8 1 2
Γ−1
x x
2 Γ−1 x − x0
ρexact = ρ1 + v1 − .
FIG. 4: Exact solution for the Shock-Rarefaction case at time Γ+1 a1 (Γ + 1) t
t = 0.25 for the parameters in Table I.
3. Region 3 is defined by the condition tVt,2 < x−x0 <
tVcontact . The velocity of the contact discontinuity
is an expression for v3 in terms of v1 for a rarefaction is Vcontact = v3 = v4 = v ∗ according to the eigen-
wave moving to the left given by (19) and another one value (3). In this region p3 = p∗ and v3 = v ∗ are
for v4 in terms of v6 for a rarefaction wave moving to the already known from p∗ . Finally, the density is ob-
right (22): tained from (13) for an isentropic process like the
rarefaction wave for a constant C on both sides of
such wave as found in the previous two cases. Thus
Γ−1 # "
2a1 p3 2Γ the solution is
v3 = v1 − −1 , (55)
Γ−1 p1
" Γ−1 #
2a6 p4 2Γ pexact = p3 ,
v4 = v6 − 1− . (56)
Γ−1 p6 vexact = v3 .
1/Γ
p3
The condition v3 = v4 = v ∗ at the contact discontinuity ρexact = ρ1 ,
p1
implies a trascendental equation for p∗ = p3 = p4 :
4. Region 4 is defined by the condition tVcontact <
" Γ−1 # " Γ−1 # x − x0 < tVt,5 , where the velocity of the tail of
p∗ 2Γ p∗ 2Γ
2a6 2a1 the wave moving to the right Vt,5 is given by the
1− − − 1 +v1 −v6 = 0
Γ−1 p6 Γ−1 p1 eigenvalue (4) evaluated at the state left behind
(57) the rarefaction wave moving to the right, that is
10
t
Vt,5 = v4 + a4 , where again we point out that v4 =
2
v ∗ and p4 = p∗ are known once p∗ is calculated.
The solution is obtained in the same way as for the 3 4
previous region, but now the wave relates states in
regions 4 and 6:
1 6
pexact = p4 ,
vexact = v4 .
1/Γ
p4
ρexact = ρ6 , x
p6
0.9
2Γ
Γ−1 0.35
2 Γ−1 x − x0 0.8
0.3
pexact = p6 − v6 − , 0.7
Γ + 1 a6 (Γ + 1) t
0.25
p
ρ
0.6
0.2
2 1 x − x0
0.5
0.15
0.2 0
2 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Γ−1 x x
2 Γ−1 x − x0 1
ρexact = ρ6 − v6 − . 1
Γ + 1 a6 (Γ + 1) t 0.5 0.9
0.8
v
ε
0
0.7
0.6
region the gas has not been affected yet by the dy- 0 0.2 0.4
x
0.6 0.8 1
0.5
0 0.2 0.4
x
0.6 0.8 1
t
In this particular case regions 2 and 5 reduce to lines.
2 5
The solution in each region reads as follows and the re-
gions are illustrated in Fig. 7. 4
3
1. Region 1 is defined by the condition x − x0 < tVs,2 ,
where the velocity of the shock moving to the
leftqVs,2 is given by (42) and reads Vs,2 = v1 − 1 6
(Γ+1)p3 Γ−1
a1 2p1 Γ + 2Γ . The solution there is that of
the initial values of the variables on the left cham-
ber:
x
pexact = p1 ,
vexact = v1 , 1 3 4 6
ρexact = ρ1 .
FIG. 7: Description of the relevant regions for the Shock-
2. There is no region 2. Shock case.
2.6 1.8
Once (54) is solved one can calculate all the re- 2.4 1.6
2
1.4
p
ρ 1.8
1
1.6
0.8
1.4
0.6
1.2
1 0.4
1.8
0 0.2 0.4
x
0.6 0.8 1
vexact = v3 1.7
1.6
p1 (Γ − 1) + p3 (Γ + 1)
0.5
ρexact = ρ1 .
1.5
p3 (Γ − 1) + p1 (Γ + 1) 1.4
v
ε
0
1.3
1.2
-0.5
right
q is given by (45) and reads Vs,5 = v6 +
FIG. 8: Exact solution for the Shock-Shock case at time t =
a6 (Γ+1)p 4 Γ−1
2p6 Γ + 2Γ . Finally, using (59) for v4 and 0.25 for the parameters in Table I.
(44) for ρ4 the solution in this region reads
∂t u + ∂x F(u) = 0, (62)
∂x p = −Dda (hW v), (70)
where conservative variables are defined by u = ∂t p = Dda (hW ), (71)
(D, S x , τ )T and the resulting fluxes are F = (Dv, Sv +
p, S), where we assume that specifically v = v x and where we have used the rest mass conservation law to
S = S x , since we are only considering one spatial di- simplify the expressions. From (69) we obtain for the
mension. The conservative variables are defined in terms advective derivative da = 1t (ξ − v)d/dξ, for which we will
of the primitive ones as follows use d := d/dξ from now on. With this in mind we obtain
from (70,71) the differential equation
D = ρ0 W,
S = ρ0 hW 2 v, (v − ξ)ρhW 2 dv + (1 − ξv)dp = 0. (72)
τ = = ρ0 hW − p. (63) On the other hand, the change of variable in (64) from
t, x to ξ implies
The flux balance equations are explicitly:
1 1+v
Z
cs 1 + vL ± 1 + vR ±
ln ± dρ = constant. (79) AL = A . (87)
2 1−v ρ 1 − vL 1 − vR R
Assuming that when the wave is propagating to the
In order to calculate the integral we use the definition
left we account with information from the left state, we
of the sound speed and the polytropic equation of state
can calculate the velocity of the fluid on the region at the
p = KρΓ , from which we obtain
right from the wave in terms of the state variables on the
state at the left and A+ :
KΓ(Γ − 1)ρΓ−1
c2s (ρ) = , (80)
Γ − 1 + KΓρΓ−1 (1 + vL )A+ +
L − (1 − vL )AR
vR = +. (88)
or in terms of the pressure instead of the density the (1 + vL )A+
L + (1 − vL )AR
speed of sound reads
Analogously when the wave is moving to the right we
expect to account with information on the state to the
Γ−1 right. Then we can express the velocity on the left in
c2s (p) = Γ−1 . (81) terms of the variables on the state at the right and A−
1−Γ p
KΓ K
Γ
+1
1
ρ= h 1
i Γ−1 . (82) 1. The fan
1 1
KΓ c2 − Γ−1
s
The fan is the region where the rarefaction takes place,
Then the integral can be written as propagating with velocity either λ+ if the wave is moving
to the right or λ− when moving to the left. The fan will
1
be bounded by two values of ξ corresponding to the head
and the tail of the wave:
Γ−1
cs 1 1 dρ
Z Z
dρ = cs KΓ 2
− dcs . (83)
ρ cs Γ−1 dcs
(L,R)
Integrating by parts and using (79) we find the useful vL,R ± cs
ξh = (L,R)
, (90)
constraint 1 ± vcs
(R,L)
vR,L ± cs
√ ξt = (R,L)
, (91)
1 1+v 1 Γ − 1 + cs 1 ± vcs
ln ± ln √ = constant,
2 1 − v (Γ − 1)1/2 Γ − 1 − cs where the − sign applies to waves traveling to the left and
(84)
+ when the wave moves to the right. In order to con-
which in turn simplifies as follows
struct the solution inside the fan, we use the constraint
(87). We have two cases according to the direction of the
1+v ± rarefaction wave. If the rarefaction wave travels to left
A = constant, (85) we use
1−v
14
1 + vL + 1 + vR + DL vL − DR vR = Vs (DL − DR ), (96)
A − A =0 (92)
1 − vL L 1 − vR R SL vL + pL − (SR vR + pR ) = Vs (SL − SR ), (97)
and solve the equation for vR . When the rarefaction wave SL − SR = Vs (τL − τR ). (98)
travels to right we use The subindices (L, R) represent two arbitrary states at
left and at the right from the shock. These equations
1 + vL − 1 + vR − can be written in the reference rest frame of the shock
A − A = 0, (93) by considering a Lorentz transformation, that is
1 − vL L 1 − vR R
and solve the equation for vL . We calculate in each case D̂L v̂L = D̂R v̂R , (99)
A± using (86) in the appropriate region
ŜL v̂L + pL = ŜR v̂R + pR , (100)
"√ #±2(Γ−1)−1/2 ŜL = ŜR , (101)
Γ − 1 + c±
s,(L,R)
A±
(L,R) = √ , (94) where the hatted quantities are evaluated at the rest
Γ − 1 − c±
s,(L,R)
Vs −v(L,R)
frame of the shock. Here v̂(L,R) = 1−V , D̂(L,R) =
s v(L,R)
2
where the sound speed is given by (75) and (77) ρ(L,R) ŴL,R , Ŝ(L,R) = ρ(L,R) h(L,R) Ŵ(L,R) v̂(L,R) and
Ŵ(L,R) = q 1 .
2
1−v̂(L,R)
v(L,R) − ξ From (99), we can introduce the invariant relativistic
c±
s,(L,R) = ± , (95)
1 − v(L,R) ξ mass flux across the shock as
where the + sign is used when the wave moves to the left
and − when moving to the right. Finally since we are in j = Ws DL (Vs − vL ) = Ws DR (Vs − vR ), (102)
the rarefaction zone we can express a point (x, t) with ξ = where Ws = √ 1
. It is important to point out that
1−Vs2
(x − x0 )/t in (95) and using this expression in (94) and
substituting into (92) or (93) depending on the direction when the shock moves to the right the mass flux is pos-
of propagation we finally obtain a trascendental equation itive j > 0, whereas when the shock moves to the left it
for the velocity v(L,R) . We assume that if the wave moves has to be negative j < 0.
to the left we know the variables on the state to the left L Now, using the expression for the mass flux (102) into
and ignore those of the state to the right R and viceversa. the Rankine-Hugoniot conditions (96, 97, 98) we can ob-
Then we look for a solution of vL when the wave moves tain the following system of equations in terms of a com-
to the left and of vR when moving to the right. Instead bination of primitive and conservative variables
of looking for a closed solution to this equation we solve
it numerically to obtain v(L,R) assuming we know v(R,L) . j 1 1
Once v(L,R) is calculated we can substitute back, and vL − vR = − − , (103)
Ws DL DR
using equation (95) obtain the sound speed; next, using j
SL SR
(82) obtain the density ρ; finally with the help of the EOS pL − pR = − , (104)
we can calculate the pressure p = KρΓ . This completes Ws DL DR
the solution in the fan region. j τL τR
vL pL − vR pR = − . (105)
The particular cases described later illustrate how to Ws DL DR
implement this procedure.
Considering the shock is moving to the right and thus
that the state R is known, we will write an expression for
B. Shock Waves
the velocity vL in terms of the state variables R and also
in terms of j, Vs and pL . In order to do this, we rewrite
expressions (104) and (105) using the definitions for the
Shocks require the use of the relativistic Rankine- conservative variables in terms of the primitive variables
Hugoniot jump conditions [ρ0 uµ ]nµ = 0 and [T µν ]nν = 0 (63) as follows
across the shock [6], where nµ = (−Vs Ws , W s, 0, 0) is
a normal vector to the shock’s front, Ws is the shock’s
Lorentz factor and Vs is the speed of the shock. Here Ws vR
(pL − pR ) = hL WL − hR WR , (106)
we have used the notation [F ] = FL − FR , where FL jvL vL
and FR are the values of the function F at both sides Ws pL
(vL pL − vR pR ) = hL WL − (107)
of the shock’s surface. These conditions reduce to the j ρL WL
following system of equations, in terms of primitive and pR
conservative variables, as − hR WR + .
ρR WR
15
ρL hL Ws2 WL2 (Vs −vL )2 −ρR hR Ws2 WR2 (Vs −vR )2 = −(pL −pR ).
Ws vR pR 1 pR
vL − − + = (108) (114)
j pL vL vL pL
As we can see from this equation, the definition of the
hR WR vR pR 1
−1 + − . conserved mass flux is present, then using equation (102)
pL vL pL ρR WR ρL WL in this last equation, we obtain a useful expression for
the square of the flux
Inserting this into (103) we finally obtain an expression
for the velocity vL
−(pL − pR )
hR WR vR + Ws
j (pL − pR ) j2 = , (115)
vL = . (109) hL hR
ρL − ρR
Ws vR 1
hR WR + (pL − pR ) j + ρR WR
When the shock moves to the left and the state L is where the positive root corresponds to a shock moving
known, the velocity on the state to the right is to the right whereas the negative root to a shock moving
to the left.
hL WL vL + Ws Another useful expression comes from equation (101),
j (pR − pL )
vR = , (110) which can be rewritten directly in the form
Ws vL 1
hL WL + (pR − pL ) j + ρL WL
ρL hL (Vs − vL )2 ρR hR (Vs − vR )2 1 σ
2 + V 2 v2 − 2 + V 2 v2 = [pL (2σ − 1) + pR ] + 2 [p2L (σ − 1) + pL pR ] =
1 − Vs2 − vL s L 1 − Vs2 − vR s R ρL ρL
− (pL − pR ). (113) 1 σ
[pR (2σ − 1) + pL ] + 2 [p2R (σ − 1) + pL pR ],(118)
1 ρR ρR
Considering that Ws W(L,R) = √ q
2
=
1−Vs2 1−v(L,R)
1
q
2 2
the last equation takes the follow- Γ
1−Vs2 −v(L,R) +Vs2 v(L,R) where σ = Γ−1 . The solution for the quadratic equation
ing form reads
16
p
1 −[pL (2σ − 1) + pR ] ± [pL (2σ − 1) + pR ]2 + 4ζL σ[p2L (σ − 1) + pL pR ]
= , (119)
ρL 2σ[p2L (σ − 1) + pL pR ]
p
1 −[pR (2σ − 1) + pL ] ± [pR (2σ − 1) + pL ]2 + 4ζR σ[p2R (σ − 1) + pR pL ]
= , (120)
ρR 2σ[p2R (σ − 1) + pR pL ]
1
where ζL = ρR [pR (2σ − 1) + pL ] + ρσ2 [p2R (σ − 1) + pL pR ],
R
and ζR = ρ1L [pL (2σ − 1) + pR ] + ρσ2 [p2L (σ − 1) + pR pL ].
L (1 + v1 )A+ +
1 − (1 − v1 )A3
A physically acceptable solution requires ρ > 0, which v3 = +. (122)
(1 + v1 )A+
1 + (1 − v1 )A3
restricts the sign to be positive one in both cases.
where according to (94)
C. Contact Wave
"√ #+2(Γ−1)−1/2
The equations describing the jump conditions Γ − 1 + c+
s,(1,3)
A+
(1,3) = √ . (123)
(96,97,98) admit the solution using Vs = vR = vL = Γ − 1 − c+
s,(1,3)
λo = Vcontact where vR and vL are the values of the ve-
locity of the fluid at the right and at the left from the p1 Γ
Here c+
p
contact discontinuity. This represents the contact wave s,1 := cs (p1 ) = Γp1 /(ρ1 h1 ), h1 = 1+ ρ1 (Γ−1) and
+
traveling along the line x − x0 = λ0 t. cs,3 := cs (p3 ) is given by equation (81)
Then (96) is trivial and (97) reads
v
Γ−1 p1
u
c+
s,3 (p3 ) = t , K= , (124)
u
(SL − SR )Vs + pL − pR = (SL − SR )Vs , (121)
Γ−1 p3
1−Γ
Γ
+1 ρΓ1
KΓ K
which implies pR = pL and equation (98) is satisfied.
We are now in the position of analyzing each of the where we remind the reader that in the rarefaction region
possible combinations of shock and rarefaction waves in the polytopic constant remains the same during the pro-
a Riemann problem. We then proceed in the same way cess, that is, it is the same in regions 1, 2 and 3. On the
as in the Newtonian case studying each combination. other hand the velocity of the gas in region 4 corresponds
to the velocity on the state at the left of a shock moving
to the right (109)
D. The four different cases
p
1 −[p4 (2σ − 1) + p6 ] + [p4 (2σ − 1) + p6 ]2 + 4ζ4 σ[p24 (σ − 1) + p4 p6 ]
= , (126)
ρ4 2σ[p24 (σ − 1) + p4 p6 ]
1 σ Γ
ζ4 = [p6 (2σ − 1) + p4 ] + 2 [p26 (σ − 1) + p4 p6 ], where σ = . (127)
ρ6 ρ6 Γ−1
17
Case pL pR vL vR ρL ρR
Rarefaction-Shock 13.33 0 0 0 10 1
Shock-Rarefaction 0 13.33 0.0 0.0 1 10
Rarefaction-Rarefaction 0.05 -0.05 -0.2 0.2 0.1 0.1
Shock-Shock 3.333e-9 -3.333e-9 0.999999 0.999999 0.001 0.001
TABLE II: Initial data for the four different cases. We choose the spatial domain to be x ∈ [0, 1] and the location of the
membrane at x0 = 0.5. In all cases we use Γ = 4/3.
• Once ρ4 is given in terms of p4 it is possible to 1. Region 1 is defined by the condition x − x0 < tξh ,
compute the enthalpy in region 4 as h4 = 1 + σ ρp44 . where according to (90) ξh is the velocity of the
head of the rarefaction wave traveling to the left
• Then equation (115) reads v1 −cs,1
ξh = 1−v . The values of the physical variables
1 cs,1
are known from the initial conditions:
(p4 − p6 )
j2 = − h4 h6
, (128)
ρ4 − ρ6
pexact = p1 , (131)
where h6 = 1 + σ pρ66 . Something to remember here vexact = v1 , (132)
is the fact that as the shock moves to the right, we ρexact = ρ1 . (133)
consider j to be the positive square root.
• Once j is obtained, the shock velocity can be found 2. Region 2 is defined by the condition tξh < x − x0 <
from expression (111) as tξt , where according to (91) ξt is the characteristic
value again, but this time evaluated at the tail of
v3 −cs,3
p the rarefaction wave, that is ξt = 1−v 3 cs,3
. In order
ρ26 W62 v6 + |j| j 2 + ρ26 to compute v2 we use (92)
Vs,5 = . (129)
j 2 + ρ26 W62
1
• Finally one calculates Ws,5 = √ 2
and in this 1 + v1 + 1 + v2 +
1−Vs,5
A − A (v2 ) = 0 (134)
way v4 in terms of p4 and the known state in region 1 − v1 1 1 − v2 2
6 using (125).
According to the contact discontinuity condition v3 = considering equations (76), (94) and (95) as follows
v4 = v ∗ , we equate (122) and (125) and obtain a tran-
scendental equation for p∗ : "√ #+2(Γ−1)−1/2
Γ − 1 + c+
s,(1,2)
A+
(1,2) =
√ , (135)
(1 + v1 )A+ + ∗
1 − (1 − v1 )A3 (p ) Γ − 1 − c+
− s,(1,2)
(1 + v1 )A+ + ∗
1 + (1 − v1 )A3 (p )
s
Γp1 p1 Γ
h6 W6 v6 + Ws
j (p
∗
− p6 ) c+
s,1 = , h1 = 1 + (136)
= 0, (130) ρ1 h 1 ρ1 Γ−1
Ws v6 1
h6 W6 + (p∗ − p6 ) j + ρ6 W6 ξ + c+
v2 − ξ s,2
c+
s,2 = ⇒ v2 = . (137)
which has to be solved using a root finder. 1 − v2 ξ 1 + c+
s,2 ξ
Once this equation is solved, p3 and p4 are automati-
cally known and v3 and v4 can be calculated using (122) where ξ = (x − x0 )/t. In this way, equation (134)
and (125), respectively. It is possible to calculate ρ3 using is transcendental and has to be solved equivalently
the fact that in the rarefaction zone the process is adi- for v2 or for c+
s,2 using a root finder for each point of
abatic and then ρ3 = ρ1 (p3 /p1 )1/Γ . On the other hand
region 2. We recommend solving for c+ s,2 and then
we can also calculate ρ4 using (126). With this informa-
tion it is already possible to construct the solution in the construct v2 using (137). Finally we calculate ρ2
whole domain. using equation (82):
Up to this point we account with the known initial
states (p1 , v1 , ρ1 ) and (p6 , v6 , ρ6 ), the solution in regions
1 p1
3 and 4 given by (p3 , v3 , ρ3 ) and (p4 , v4 , ρ4 ), and Vs,5 ρ2 = 1 , K= . (138)
which represents the velocity of propagation of the shock
Γ−1 ρΓ1
KΓ (c+1 )2 − 1
5. The exact solution region by region is described next. s,2
Γ−1
18
Finally we obtain p2 using the fact that in the pro- 2. Case 2: Shock-Rarefaction
cess K is constant
This is pretty much the previous case, except that one
Γ has to be careful at using the correct signs and conditions.
ρ2 We then start again with the contact wave conditions
p2 = p1 . (139)
ρ1 v3 = v4 = v ∗ and p3 = p4 = p∗ . The velocity of the gas
in region 3 corresponds to the velocity on the state at the
3. Region 3 is defined by the condition tξt < x − x0 < right from a shock moving to the left (110)
tVcontact , where Vcontact = λo = v3 = v4 . The
solution there reads
Ws,2
h1 W1 v1 + j (p3 − p1 )
v3 = , (149)
Ws,2 v1 1
pexact = p3 , (140) h1 W1 + (p3 − p1 ) j + ρ1 W1
vexact = v3 , (141)
ρexact = ρ3 . (142) q
2 is the Lorentz factor of the
where Ws,2 = 1/ 1 − Vs,2
4. Region 4 is defined by the condition tVcontact < shock. In order to obtain v3 in terms of p3 and other
x − x0 < tVs,5 , where Vs,5 is given by (129) and known information we need to perform the following
explicitly steps:
14
10
12
8
10
pexact = p4 , (143) 6 8
p
ρ 4
6
vexact = v4 , (144) 4
ρexact = ρ4 . (145) 0
2
0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
2
0.6
0.4
v
ε
6. Region 6 is defined by tVs,5 < x − x0 . In this region 0.3
1
0.1
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
pexact = p6 , (146)
FIG. 9: Exact solution for the Rarefaction-Shock case at time
vexact = v6 , (147) t = 0.35 for the parameters in Table II.
ρexact = ρ6 . (148)
As an example we show in Fig. 9 the primitive vari- • The rest mass density is given in terms of p3 using
ables at t = 0.35, for the initial parameters in Table II. the expression (120) as
p
1 −[p3 (2σ − 1) + p1 ] + [p3 (2σ − 1) + p1 ]2 + 4ζ3 σ[p23 (σ − 1) + p3 p1 ]
= , (150)
ρ3 2σ[p23 (σ − 1) + p3 p1 ]
1 σ Γ
ζ3 = [p1 (2σ − 1) + p3 ] + 2 [p21 (σ − 1) + p3 p1 ], where σ = . (151)
ρ1 ρ1 Γ−1
• Then from equation (115) we obtain where h1 = 1 + σ pρ11 . As the shock is moving to
19
the left we consider the negative root of the above 1. Region 1 is defined by the condition x − x0 < tVs,2 ,
expression for j. where Vs,2 is given by (153) and the solution there
is that of the initial state on the left chamber
• Once j is obtained, the shock velocity can be found
from expression (112) in terms of p3 as
pexact = p1 , (158)
p
ρ21 W12 v1 − |j| j 2 + ρ21 vexact = v1 , (159)
Vs,2 = . (153)
j 2 + ρ21 W12 ρexact = ρ1 . (160)
1
• Finally one calculates Ws,2 = √ 2
and in this 2. There is no region 2. Only the shock traveling with
1−Vs,2
way v3 in terms of p3 and the known state in region speed Vs,2 .
1 using (149).
3. Region 3 is defined by the condition tVs,2 < x −
The velocity in region 4 is given by equation (89) that x0 < tVcontact , where Vcontact = λo = v3 = v4 . The
provides the velocity on the state at the left from a rar- solution is
efaction wave moving to the right:
because K is the same in regions 4 and 6. 5. Region 5 is defined by the condition tξt < x − x0 <
We obtain a transcendental equation for p∗ using the tξh , where according to (90) ξh is the velocity of the
contact discontinuity condition v3 = v4 = v ∗ , and equate head of the rarefaction wave traveling to the right
v6 +cs,6
(149) and (154): ξh = 1+v 6 cs,6
. In order to compute v5 we use (93)
(1 + v6 )A− − ∗
6 − (1 − v6 )A4 (p ) 1 + v6 − 1 + v5 −
− A − A (v5 ) = 0, (167)
(1 + v6 )A− − ∗
6 + (1 − v6 )A4 (p ) 1 − v6 6 1 − v5 5
Ws ∗
h1 W1 v1 + j (p − p1 )
= 0, (157) whoch requires the information in (76), (94) and
Ws v1 1
h1 W1 + (p∗ − p1 ) j + ρ1 W1
(95):
for v5 or for c−
s,5 using a root finder for each point of
region 5. We recommend solving for c− s,5 and then (1 + v1 )A+ +
1 − (1 − v1 )A3
construct v5 using (170). Finally we calculate ρ5 v3 = , (176)
using equation (82): (1 + v1 )A1 + (1 − v1 )A+
+
3
10
14
"√ #−2(Γ−1)−1/2
12
Γ − 1 + c−
s,(4,6)
A−
8
10
(4,6) = √ , (180)
6 8 Γ − 1 − c−
s,(4,6)
p
ρ
6
4
2
4
2
and the speed of sound in region 4 is given by
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x v
0
2
Γ−1 p6
u
c−
-0.1
-0.4 1
-0.5
0.5
Then using the contact discontinuity condition v3 =
v4 = v ∗ , we equate (176) and (179) and obtain a tran-
-0.6
-0.7
0 0.2 0.4
x
0.6 0.8 1
0
0 0.2 0.4
x
0.6 0.8 1
scendental equation for p∗ :
the solution in regions 3 and 4 given by (p3 , v3 , ρ3 ) and 3. Region 3 is defined by the condition tξt2 < x−x0 <
(p4 , v4 , ρ4 ). The solution in each of the fan regions aside tVcontact , where Vcontact = λo = v3 = v4 . The
the rarefaction zones has to be constructed in terms of solution there reads
the position and time ξ = (x − x0 )/t as described below
for regions 2 and 5.
pexact = p3 , (192)
1. Region one is defined by the condition x−x0 < tξh2 , vexact = v3 , (193)
where according to (90) ξh2 is the velocity of the
head of the rarefaction wave traveling to the left ρexact = ρ3 . (194)
v1 −cs,1
ξh2 = 1−v 1 cs,1
. The values of the physical variables
4. Region 4 is defined by the condition tVcontact <
are known from the initial conditions: x − x0 < tξt5 , where ξt5 is the third characteristic
value calculated at the tail of rarefaction moving to
v4 +cs,4
the right, and according to (91) ξt5 = 1+v 4 cs,4
. In
pexact = p1 , (183) this region thus
vexact = v1 , (184)
ρexact = ρ1 . (185)
pexact = p4 , (195)
2. Region 2 is defined by the condition tξh2 < x−x0 < vexact = v4 , (196)
tξt2 , where according to (91) ξt2 is the characteristic ρexact = ρ4 . (197)
value again, but this time evaluated at the tail of
v3 −cs,3
the rarefaction wave, that is ξt2 = 1−v 3 cs,3
. In 5. Region 5 is defined by the condition tξt5 < x−x0 <
v6 +cs,6
order to compute v2 we use (92) tξh5 , where ξh5 = 1+v 6 cs,6
according to (90). In
order to compute v5 we use (93)
1 + v1 + 1 + v2 +
A − A (v2 ) = 0, (186) 1 + v5 − 1 + v6 −
1 − v1 1 1 − v2 2 A (v5 ) − A = 0, (198)
1 − v5 5 1 − v6 6
where using (76), (94) and (95) where according to (76), (94) and (95)
where ξ = (x − x0 )/t. In this way, equation (186) where ξ = (x − x0 )/t. Again (198) is a transcen-
is transcendental and has to be solved equivalently dental equation either for v5 or for c− −
s,5 . Once cs,5
for v2 or for c+
s,2 using a root finder for each point has been calculated use (201) to construct v5 or di-
of region 2. We solve for c+ rectly solve (198) for v5 . It is possible to calculate
s,2 and construct v2 using
(189). Finally we calculate ρ2 using equation (82): ρ5 using (82):
1 p6
1 p1 ρ5 = 1 , K= , (202)
ρ2 = 1 , K = Γ. (190) Γ−1 ρΓ6
Γ−1 ρ1 KΓ (c−1 )2 − 1
1 1 Γ−1
KΓ (c+ 2
− Γ−1
s,5
s,2 )
0.05 h1 W1 v1 + j2 (p3 − p1 )
v3 = , (207)
0.1
0.095
Ws,2 v1 1
h1 W1 + (p3 − p1 ) +
0.045
j2 ρ1 W1
0.09
0.085 0.04
p
ρ
0.08
0.035
0.075
0.07
0.03
0.065
q
0.06
0 0.2 0.4
x
0.6 0.8 1
0.025
0 0.2 0.4
x
0.6 0.8 1
0.15
shock moving to the left. In this particular case we dis-
0.1
0.05
1.45
tinguish between the two values of j depending using the
subindices 2 and 5. In order to obtain v3 in terms of p3
v
0 1.4
-0.05
we can proceed following these steps:
-0.1 1.35
-0.15
1.3
-0.2
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
FIG. 11: Exact solution for the Rarefaction-Rarefaction case • The rest mass density is given in terms of p3 using
at time t = 0.25 for the parameters in Table II. the expression (120) as
p
1 −[p3 (2σ − 1) + p1 ] + [p3 (2σ − 1) + p1 ]2 + 4ζ3 σ[p23 (σ − 1) + p3 p1 ]
= , (208)
ρ3 2σ[p23 (σ − 1) + p3 p1 ]
1 σ Γ
ζ3 = [p1 (2σ − 1) + p3 ] + 2 [p21 (σ − 1) + p3 p1 ], where σ = . (209)
ρ1 ρ1 Γ−1
1
• Once ρ3 is given in terms of p3 it is possible to • Finally we calculate Ws,2 = √ 2
and thus v3 in
1−Vs,2
compute enthalpy in region 3 as h3 = 1 + σ pρ33 . terms of p3 and the known state in region 1 using
• Then from equation (115) we obtain (207).
• The rest mass density is given in terms of p4 using the expression (119) as
p
1 −[p4 (2σ − 1) + p6 ] + [p4 (2σ − 1) + p6 ]2 + 4ζ4 σ[p24 (σ − 1) + p4 p6 ]
= , (213)
ρ4 2σ[p24 (σ − 1) + p4 p6 ]
1 σ Γ
ζ4 = [p6 (2σ − 1) + p4 ] + 2 [p26 (σ − 1) + p4 p6 ], where σ = . (214)
ρ6 ρ6 Γ−1
• Once ρ4 is given in terms of p4 , we are able to 4 given by (p3 , v3 , ρ3 ) and (p4 , v4 , ρ4 ), together with Vs,2
compute enthalpy in region 4 as h4 = 1 + σ pρ44 . and Vs,5 which represent the velocities of propagation of
the shocks.
• Then equation (115) reads
1. Region 1 is defined by the condition x − x0 < tVs,2 ,
where the velocity of the shock is (211). The solu-
(p4 − p6 ) tion there is that of the initial values of the variables
j52 = − h4 h6
, (215) on the left chamber:
ρ4 − ρ6
Ws,2 ∗
h1 W1 v1 + j2 (p − p1 )
− pexact = p4 ,
Ws,2 v1 1
h1 W1 + (p∗ − p1 ) j2 + ρ1 W1 vexact = v4 ,
h6 W6 v6 + Ws ∗ ρexact = ρ4 .
j5 (p − p6 )
= 0, (217)
Ws v6 1
h6 W6 + (p∗ − p6 ) j5 + ρ6 W6
5. There is no region 5, only the shock wave traveling
with speed Vs,5 .
which has to be solved using a root finder.
6. Finally region 6 is defined by the condition Vs,5 <
Once this equation is solved, p3 and p4 are automati-
x − x0 . The exact solution is given by the initial
cally known, and v3 and v4 can be calculated using (207)
values at the chamber at the right:
and (212), respectively. It is possible to calculate ρ3 and
ρ4 using (208) and (213), respectively. With this infor-
mation it is already possible to construct the solution in pexact = p6 ,
the whole domain.
Up to this point we have the known initial states vexact = v6 ,
(p1 , v1 , ρ1 ) and (p6 , v6 , ρ6 ), the solution in regions 3 and ρexact = ρ6 .
24
As an example we show in Fig. 12 the primitive vari- in the newtonian and relativistic regimes, which accord-
ables at t = 0.55, for the initial parameters in Table II. ing to our experience is not presented in a straightforward
enough recipe in literature.
5
4 1200
1000
manners, specially to: i) test numerical solutions of the
3
p
ρ
2 600
dynamics, ii) test numerical implementations of codes
1
400
solving hydrodynamical relativistic equations, iii) under-
200
0 0
stand the different properties of the propagation of the
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
1
x x different type of waves developing in a gas and the differ-
1000
ent conditions on the hydrodynamical variables in each
0.5
800
case.
600
-0.5
400
sible to straightforwardly implement the exact solution,
200
and this will save some time to a student starting a career
-1
0 0.2 0.4 0.6 0.8 1
0
0 0.2 0.4 0.6 0.8 1
in astrophysics involving hydrodynamical processes.
x x
Acknowledgments
[1] E. F. Toro, Riemann solvers and numerical methods for [4] R. J. LeVeque, in Numerical methods for conservation
fluid dynamics. Springer-Verlag Berlin-Heidelberg, 2009. laws. Birkhauser, Basel (1992).
[2] J. Ma. Martı́, E. Müller, ”Numerical Hydrodynamics in [5] G. A. Sod, J. Comp. Phys. 27 (1978) 1-31.
Special Relativity”, Living Rev. Relativity 6, (2003), 7. [6] A. Taub, Relativistic Rankine-Hugoniot relations, Phys.
http://www.livingreviews.org/lrr-2003-7 Rev. (1948), vol. 74, pp. 328-334.
[3] J. Ma. Martı́, E. Müller, The analytical solution of the [7] K. S. Thorne, Relativistic Shocks: the Taub adiabat, As-
Riemann problem in relativistic hydrodynamics, J. Fluid. trophys. J. (1973), vol. 179, pp. 897-907.
Mech. (1994), vol. 258, pp. 317-333.