Skip to content

Shocks, Weak Solutions, and Entropy Conditions

Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

Scrollable table. Use Left and Right arrow keys to reveal additional columns.

Scrollable figure. Use Left and Right arrow keys to inspect hidden content.

Compressive waves in relativistic Euler flow can steepen until derivatives diverge even though density, pressure, and velocity remain finite. Beyond that time the equations must be interpreted weakly: integral conservation selects the allowed jump relations, and an entropy condition excludes unphysical branches. This page derives those conditions and reports an executed, reproducible special-relativistic shock-tube verification against an independently implemented exact Riemann solution.

Required background. Hilbert Stress–Energy from Metric Variation supplies stress–energy conservation; Events, Intervals, and Minkowski Geometry supplies relativistic velocity; and Differential Equations supplies weak solutions and characteristics.

Helpful background. The Einstein Equation gives gravitational coupling; Relativistic Matter and Compact Objects gives the matter context; and Computational Relativity provides numerical evolution methods.

Assume that the shock carries no separate surface stress or particle reservoir. The continuum inputs are baryon conservation, stress–energy conservation, and an equation of state:

∇a(nua)=0,∇aTab=0,Tab=(ε+p)uaub+pgab.\nabla_a(n u^a)=0, \qquad \nabla_aT^{ab}=0, \qquad T^{ab}=(\varepsilon+p)u^a u^b+p g^{ab}.

Let a smooth hypersurface Σ\Sigma separate left and right states and let sas_a be any nonzero normal covector. Integrating over a thin pillbox and taking its thickness to zero gives the Rankine–Hugoniot conditions

[nua]sa=0,[Tab]sa=0,\bigl[n u^a\bigr]s_a=0, \qquad \bigl[T^{ab}\bigr]s_a=0,

where [Q]=QR−QL[Q]=Q_R-Q_L. Scaling sas_a changes neither condition. In one-dimensional Minkowski coordinates, a balance law

∂tU+∂xF(U)=0\partial_tU+\partial_xF(U)=0

with a jump moving at speed VsV_s obeys

Vs[U]=[F].V_s[U]=[F].

For one-dimensional special-relativistic hydrodynamics, let ρ\rho be rest-mass density, ee specific internal energy, h=1+e+p/ρh=1+e+p/\rho specific enthalpy, and W=(1−v2)−1/2W=(1-v^2)^{-1/2}. A rest-mass-subtracted conservative state and its flux are

U=(DSτ)=(ρWρhW2vρhW2−p−D),F=(DvSv+pS−Dv).U= \begin{pmatrix} D\\ S\\ \tau \end{pmatrix} = \begin{pmatrix} \rho W\\ \rho hW^2v\\ \rho hW^2-p-D \end{pmatrix}, \qquad F= \begin{pmatrix} Dv\\ Sv+p\\ S-Dv \end{pmatrix}.

The total energy is E=τ+DE=\tau+D and has flux SS; mixing the EE and τ\tau conventions would corrupt the energy jump. Andersson and Comer develop the related Eulerian variables and conservative-to-primitive map in Andersson and Comer 2021, §§ 11.2–11.3, Eqs. (11.21)–(11.50). Conservation alone admits compressive shocks, unphysical expansion shocks, and contact discontinuities unless the characteristic family and entropy behavior are also examined. Martí and Müller describe the hyperbolic wave structure in Martí and Müller 2015, § 3.2.1 and give the exact relativistic Riemann construction in § 8.5, pp. 128–133, Eqs. (179)–(200).

For a smooth adiabatic perfect fluid, entropy per baryon satisfies ua∇as=0u^a\nabla_as=0. Across a physical shock, irreversible microscopic processes occur in a layer omitted by the ideal equations, and downstream entropy must exceed upstream entropy. Equivalently, the entropy current satisfies a distributional inequality

∇a(nsua)≥0.\nabla_a(n s u^a)\geq0.

In one dimension choose the normal covector sa=(−Vs,1)s_a=(-V_s,1). Baryon conservation makes j=nuasaj=n u^as_a the same on both sides. The entropy inequality at the discontinuity is then j[s]≥0j[s]\geq0. For j>0j\gt0, matter flows from left to right and requires sR≥sLs_R\geq s_L; if the flow reverses, the upstream and downstream labels reverse too. A contact has j=0j=0 and permits an entropy jump without entropy production.

For a genuinely nonlinear characteristic family, the Lax compressivity condition states that its characteristics enter a shock from both sides: λk(UR)<Vs<λk(UL)\lambda_k(U_R)\lt V_s\lt\lambda_k(U_L). A rarefaction has the opposite structure: it is a continuous self-similar fan in which the relevant characteristic speed spreads monotonically. A contact discontinuity moves with the fluid; pressure and normal velocity remain continuous, while density and entropy may jump.

The entropy condition is not an extra conserved equation. It is an inequality inherited from the dissipative regularization as viscosity and heat conduction tend to zero. Different regularizations can matter for non-convex equations of state, phase boundaries, or undercompressive shocks. For a convex gamma-law gas, however, the standard relativistic Riemann solution consists of two nonlinear waves separated by a contact. The distinction between convex and non-convex wave patterns is reviewed in Martí and Müller 2015, § 3.2.3, and the rarefaction, shock, and matching branches are explicit in §§ 8.5.1–8.5.3, Eqs. (186)–(200).

A demanding reference problem uses flat spacetime, domain 0≤x≤10\leq x\leq1, discontinuity at x=0.5x=0.5, outflow boundaries, and gamma-law equation of state

p=(Γ−1)ρe,Γ=53.p=(\Gamma-1)\rho e, \qquad \Gamma=\frac53.

Take primitive initial data, rationalizing the source’s printed pL=13.33333p_L=13.33333 as 40/340/3,

(ρ,p,v)L=(10,403,0),(ρ,p,v)R=(1,10−6,0).(\rho,p,v)_L=\left(10,\frac{40}{3},0\right), \qquad (\rho,p,v)_R=(1,10^{-6},0).

The exact self-similar solution has a left-family rarefaction, a contact, and a right-going shock. The rarefaction’s head travels left, but its tail moves right for these data; the family label does not mean that every ray has negative coordinate speed. An exact relativistic Riemann solver determines the common star-region pressure by matching the velocity behind the left and right waves, then reconstructs density and wave speeds. It is the benchmark; a high-resolution numerical solution should not be compared only with another discretization.

The exact calculation gives

p∗=1.44794515599414,v∗=0.714020700932636,p_*=1.44794515599414, \qquad v_*=0.714020700932636, ρL∗=2.63929554954561,ρR∗=5.07077596424752,Vs=0.828398034190528.\rho_{L*}=2.63929554954561, \qquad \rho_{R*}=5.07077596424752, \qquad V_s=0.828398034190528.

The normalized residuals of Vs[U]−[F]V_s[U]-[F] are below 2×10−122\times10^{-12} componentwise. At t=0.4t=0.4, the rarefaction head, rarefaction tail, contact, and shock are at x=0.21355405x=0.21355405, 0.566894520.56689452, 0.785608280.78560828, and 0.831359210.83135921. The shell speed, shell width divided by time, shock speed, and compression agree with the rounded published anchors 0.7140200.714020, 0.1143780.114378, 0.8283980.828398, and 5.0707765.070776. The source and benchmark are Martí and Müller 2015, §§ 6.3–6.3.1, pp. 76–81, Table 3.

The spacetime diagram turns these numbers into a wave pattern. Read horizontally at t=0.4t=0.4: the expanding fan comes first, then the left star state, the contact, the compressed right star state, and the shock. The two star states share p∗p_* and v∗v_* but have different densities.

The exact shock-tube waves separate from the initial discontinuity: the rarefaction spans left- and right-moving rays, followed by a contact and a faster right-moving shock.

Quantitative spacetime wave fan for the stated gamma-law shock tube. Each boundary follows x=0.5+λtx=0.5+\lambda t; the dotted horizontal line samples the solution at t=0.4t=0.4. Positions and slopes come from the retained exact Riemann solution. Rays inside the rarefaction indicate the continuous range of similarity speeds, rather than additional discontinuities.

The numerical contact and shock locations reported below are explicitly target-assisted diagnostics, not blind feature detections. Each is the unique midpoint-level crossing inside a window centered on the corresponding exact position, with a quoted uncertainty of ±Δx\pm\Delta x. Requiring exactly one crossing makes an ambiguous feature inside that window fail rather than silently selecting the nearest candidate; oscillations outside the window or below the chosen midpoint level require separate diagnostics.

The retained verification source is dependency-free JavaScript executed with Node.js 24.18.0 using IEEE binary64 arithmetic. It evolves finite-volume cell averages with primitive-variable piecewise-linear reconstruction, a monotonized-central limiter, an HLLE flux, and second-order strong-stability-preserving Runge–Kutta time stepping. Primitive recovery uses a safeguarded Newton–bisection pressure solve and requires both a normalized pressure residual and a conserved-state round-trip postcondition. No atmosphere or primitive-variable floor is applied: an inadmissible reconstruction falls back locally and is counted, while an inadmissible cell, exhausted solve, or failed postcondition terminates the run.

The shock convergence calculation uses N=200,400,800N=200,400,800 uniform cells, constant outflow boundaries, and Courant factors 0.40.4 and 0.20.2. It compares numerical cell averages with exact cell averages, splitting quadrature at every wave. The conserved-density error and observed order are

E1(N)=1N∑j=1N∣Dj−Djexact∣,qN=log⁡2 ⁣E1(N)E1(2N).E_1(N)=\frac1N\sum_{j=1}^N|D_j-D_j^{\mathrm{exact}}|, \qquad q_N=\log_2\!\frac{E_1(N)}{E_1(2N)}.
Courant factorNNE1(D)E_1(D)qNq_N
0.42000.07999490.940
0.44000.04171040.779
0.48000.0243073—
0.22000.07641770.939
0.24000.03986950.784
0.28000.0231612—

The errors decrease under both refinements. Their pre-asymptotic orders lie below one because the diffused contact and shock dominate the global norm. A separate periodic entropy wave,

ρ(x,t)=1+0.2sin⁡[2π(x−0.3t)],p=1,v=0.3,\rho(x,t)=1+0.2\sin[2\pi(x-0.3t)], \qquad p=1, \qquad v=0.3,

tests the smooth regime. For N=50,100,200,400N=50,100,200,400, its E1(D)E_1(D) values are 7.47193×10−47.47193\times10^{-4}, 1.90671×10−41.90671\times10^{-4}, 4.82236×10−54.82236\times10^{-5}, and 1.19141×10−51.19141\times10^{-5}. The conserved fields D,S,τD,S,\tau and recovered density all give orders 1.9701.970, 1.9831.983, and 2.0172.017 to the shown precision. Pressure and velocity are exact invariants of this test; their largest deviations are respectively below 2.8×10−152.8\times10^{-15} and 7.3×10−167.3\times10^{-16}. This full-state check separates the second-order smooth discretization from the lower global order of a discontinuous solution.

Halving the Courant factor is also compared directly at fixed spatial resolution. For each Q∈{D,S,τ,ρ}Q\in\{D,S,\tau,\rho\}, define

RQ(N)=∥Q0.4−Q0.2∥1E1,0.4(Q).R_Q(N)=\frac{\lVert Q_{0.4}-Q_{0.2}\rVert_1}{E_{1,0.4}(Q)}.

The retained same-cell differences and the largest ratio over the four fields are

NN∥ΔD∥1\lVert\Delta D\rVert_1∥ΔS∥1\lVert\Delta S\rVert_1∥Δτ∥1\lVert\Delta\tau\rVert_1∥Δρ∥1\lVert\Delta\rho\rVert_1max⁡QRQ\max_Q R_Q
2000.004495620.006257590.004877210.003687550.0694
4000.002196800.003517260.002844570.001802310.0830
8000.001314790.001792670.001343690.001058080.0646

All ratios remain below the declared 0.100.10 gate. This is a timestep-sensitivity test, not a measurement of temporal order for a discontinuous solution.

Across every shock run, density and pressure remain positive, ∣v∣<0.721|v|<0.721, no reconstruction fallback occurs, and boundary-flux-corrected conservation residuals remain below 7×10−147\times10^{-14}. The largest normalized primitive-recovery pressure residual is 1.84×10−131.84\times10^{-13} and the largest conserved-state round-trip residual is 2.85×10−132.85\times10^{-13}, within gates of 2×10−132\times10^{-13} and 10−1210^{-12}. The exact star-pressure solve converges with a pre-alignment velocity mismatch below 2.3×10−162.3\times10^{-16}. The exact rarefaction preserves ln⁡(p/ρΓ)\ln(p/\rho^\Gamma) to 4.5×10−164.5\times10^{-16}, while it increases by 11.4811.48 across the right shock. The bundle deliberately rejects negative pressure, superluminal primitive velocity, a non-dominant conserved state, and an expansion state passed to the shock branch. All 143 declared checks pass in the retained machine-readable results.

The public rerun is independent of the site’s private source repository. Start in an empty directory and download the complete single-file program together with the retained reference result:

Terminal window
mkdir srhd-shock-tube-rerun
cd srhd-shock-tube-rerun
curl --fail --location --output verify-srhd-shock-tube.mjs \
https://blackhole.org/computations/compact-objects/verify-srhd-shock-tube.mjs
curl --fail --location --output reference-srhd-shock-tube-results.json \
https://blackhole.org/computations/compact-objects/srhd-shock-tube-results.json
shasum -a 256 -c <<'SHA256'
4c4c0e42201118db57eeff7ab384b8cedfe29fd5eca35582ee76c1af2fc210fc verify-srhd-shock-tube.mjs
e046d224941c675e88e2268d4aace3ad7be3961c88babd1e7e2d6cffd7d43f82 reference-srhd-shock-tube-results.json
SHA256

Use Node.js 24.18.0 to match the retained environment. The program needs only the Node.js standard library. Its portable no-argument mode recomputes the exact solution, all numerical refinements, every failure injection, and all 143 gates, then writes a fresh report to standard output:

Terminal window
node --version
node verify-srhd-shock-tube.mjs > rerun-srhd-shock-tube-results.json
node -e 'const fs=require("node:fs");const r=JSON.parse(fs.readFileSync("rerun-srhd-shock-tube-results.json","utf8"));if(r.summary.status!=="pass"||r.summary.failed!==0||r.summary.passed!==143||r.summary.total!==143)process.exit(1);console.log(`PASS ${r.summary.passed}/${r.summary.total} scientific checks`);'

The fresh report records its actual runtime and download location, so it is not expected to be byte-identical to the retained reference JSON. Its source hash, 143 named checks, physical outputs, tolerances, convergence results, and failure diagnostics are the comparison objects. No other script, data file, package, or environment file is required.

Failure modes are diagnostic. A negative reconstructed pressure signals an inadmissible state or failed primitive recovery; excessive contact smearing points to flux or limiter diffusion; oscillations behind the shock indicate inadequate limiting; a wrong wave order usually indicates a sign or relativistic-velocity error; apparent superconvergence often comes from comparing point values or shifting the exact solution to match the computed shock. Near vacuum, conservative-to-primitive inversion becomes ill-conditioned and requires an explicit admissibility or vacuum treatment. If floors are used, their mass and energy contributions must be measured; floors are not a mathematical requirement of every method.

For a scalar conservation law with left and right constants, derive Vs[U]=[F]V_s[U]=[F] by integrating over a thin spacetime control volume crossed by the discontinuity.

Solution

Integrate ∂tU+∂xF=0\partial_tU+\partial_xF=0 over a rectangle whose moving internal boundary is x=Vstx=V_st. Flux through the two sides of that boundary must cancel. Per unit time, the boundary sweeps volume VsV_s, contributing Vs(UR−UL)V_s(U_R-U_L), while the net physical flux is FR−FLF_R-F_L. Equality gives

Vs(UR−UL)=FR−FL.V_s(U_R-U_L)=F_R-F_L.

Applied componentwise to baryon number and stress–energy, this is the coordinate form of the covariant pillbox conditions.

  • Andersson, Nils, and Gregory L. Comer. “Relativistic Fluid Dynamics: Physics for Many Different Scales.” Living Reviews in Relativity 24, 3 (2021). DOI.
  • Martí, José María, and Ewald Müller. “Grid-Based Methods in Relativistic Hydrodynamics and Magnetohydrodynamics.” Living Reviews in Computational Astrophysics 1, 3 (2015). DOI.