Skip to content

Validation 1 — The duct area jump against exact Riemann solutions

Time: ~10 minutes. Case: examples/benchmarks/duct_area_jump_riemann.toml. Gated by: tests/validation/test_duct_area_jump_riemann.py, which also runs this case file.

A pipe whose cross-section steps at one face is the simplest model of a sudden expansion or contraction. aeolus1d treats the step as a stationary wave at that face (solver/area_jump.py): mass flow and total enthalpy pass through it unchanged, and so does entropy unless a shock stands in the step. This page runs that model against the exact solution of the Euler equations in such a duct.

Where the case is

examples/benchmarks/ is in a clone, in the GUI installers and, from the release after 0.5.2, in the pip install aeolus1d wheel, where aeolus1d examples prints its directory on line 1. The commands below run from a clone. The comparison snippet also imports the exact solver from tests/, which only a clone has.

The problem

Han, Hantke & Warnecke, "Exact Riemann solutions to compressible Euler equations in ducts with discontinuous cross-section", J. Hyperbolic Differ. Equ. 9 (2012) 403, doi:10.1142/S0219891612500130, solve the Riemann problem in a duct whose area jumps where the two states meet. A wave configuration is which waves form and in what order. The paper names six for a contact moving to the right, and gives one table of data for each:

Table Configuration What happens at the jump
4.2 A a left-moving wave, then the stationary wave
4.3 B choked at the smaller area, a transonic rarefaction attached to the jump
4.4 C a normal shock stands inside the jump
4.5 D a supersonic jet leaves the jump, then a right-moving wave
4.6 E a normal shock stands inside the jump, fed by a supersonic jet
4.7 F the supersonic stationary wave, then a right-moving wave

Each runs on a 2 m duct with the jump at 0.8 m and γ = 1.4, to the paper's sampling time. Supersonic inflow into a contraction can have more than one exact solution (the paper's section 4.3) and is left out.

The exact solver (tests/validation/_duct_riemann_exact.py) is checked before it gates anything: each table lands on the configuration the paper names, two tables built backwards from a round contact pressure give that pressure back to the six figures the data were printed with, and the mirror image of each problem solves to the mirror image.

The bundled case is Table 4.6, configuration E:

ρ [kg/m³] u [m/s] p [Pa] area
left of 0.8 m 1.0 500.0 1.0 × 10⁵ 0.5
right of 0.8 m 1.34771 314.46597 2.5 × 10⁵ 1.0

400 cells, MUSCL with minmod, CFL 0.5, transmissive ends, to 1.2 ms. The area is a tabulated profile that steps between the two cells either side of 0.8 m.

Run it

Terminal

aeolus1d run examples/benchmarks/duct_area_jump_riemann.toml --out /tmp/area_jump.h5

It takes under a second; the summary line reads pipe 'duct' : rho=[1, 1.348] u=[187.1, 500] p=[1e+05, 2.5e+05].

GUI

  1. File → Open Example → Benchmarks → duct_area_jump_riemann. The duct appears as one pipe with a transmissive end on each side.
  2. Click Run in the Runner dock (or press F5). The case takes under a second.
  3. The post-processing tab loads the result. Pick ρ in the field selector; the 2D Plot dock shows the density along the duct. Left of the jump the jet arrives at 1.0. At the jump it rises to 1.336 through the shock that stands there, falls to 1.04 across the contact near 1.02 m, and climbs back to the right state through the rarefaction fan from 1.6 m.

Compare with the exact solution

From the repository root:

import h5py
import numpy as np
from tests.validation.test_duct_area_jump_riemann import CASES, X0, G
from tests.validation._duct_riemann_exact import sample_duct_exact, solve_duct_riemann

aL, WL, aR, WR, t, *_ = CASES["4.6"]
with h5py.File("/tmp/area_jump.h5") as f:
    x, rho = f["pipes/duct/x"][:], f["pipes/duct/rho"][:]
rho_x = sample_duct_exact(x, t, solve_duct_riemann(WL, aL, WR, aR, G), WL, WR, X0, G)[0]
print(np.mean(np.abs(rho - rho_x)) / np.mean(np.abs(rho_x)))     # 0.0028

Results

Density along the duct for Tables 4.2-4.7: the exact solution in black, MUSCL and first order on 400 cells

Density at each table's sampling time. Black: the exact solution. Blue: MUSCL; orange: first order, both on 400 cells. The grey vertical line is the jump at 0.8 m.

L1 error, mean |error| over mean |exact|, on 400 cells (measured 2026-11-09; the bundled case is the 4.6 row):

Table Config. First order ρ / u / p MUSCL ρ / u / p
4.2 A 0.0202 / 0.0151 / 0.0093 0.0073 / 0.0041 / 0.0024
4.3 B 0.0168 / 0.0139 / 0.0133 0.0052 / 0.0038 / 0.0033
4.4 C 0.0078 / 0.0061 / 0.0053 0.0028 / 0.0020 / 0.0017
4.5 D 0.0096 / 0.0082 / 0.0095 0.0037 / 0.0027 / 0.0037
4.6 E 0.0092 / 0.0079 / 0.0099 0.0028 / 0.0017 / 0.0021
4.7 F 0.0090 / 0.0065 / 0.0102 0.0027 / 0.0024 / 0.0028

Every error falls with each refinement. At 1600 cells each is about a third to a half of its 400-cell value (MUSCL density 0.0008-0.0027). These solutions are discontinuous, which caps the L1 rate: first order converges at 0.56-0.65 and MUSCL at 0.72-0.95 between 400 and 1600 cells, not at their formal orders. The test gates each error at 1.5 times the table, the mirror images (the smaller area on the right) to 1e-9 of the forward runs, and the convergence at order floors of 0.4 and 0.6.

What it found

Table 4.6 crashed every run, in every scheme, mesh and CFL, until 2026-11-09. A supersonic jet leaves the smaller area and meets a shock that stands inside the jump. The flux at the larger area saw a left-moving wave, and mapping its face state back to the smaller area choked, so the small cell took too little momentum out and accelerated until its pressure went negative (500 to 937 m/s in 8 steps). The jump now gives the exact flows when the shock stands in it or clears it (area_jump._jet_into_expansion). A sweep of back pressures at the same jet covers the three outcomes: the shock clears the jump, stands in it, or is pushed into the smaller pipe.

Still open: the real-gas EOS path has the same structure and the same crash (BACKLOG.md, "Found validating the duct area jump").

Reproduce the figure

python scripts/validation_figures.py area_jump

It runs the test's own harness for every table and both schemes, prints the errors in the table above, and writes docs/img/validation/area_jump.png.