Skip to content

Fix the test case constants, and check every case against its paper - #9

Merged
gouarin merged 8 commits into
mainfrom
fix-test-case-constants
Sep 13, 2026
Merged

gouarin merged 8 commits into
mainfrom
fix-test-case-constants

Conversation

@gouarin

@gouarin gouarin commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Six constants in the test cases were wrong. Each gets its own commit, with its
regenerated reference fields, since each changes results.

case change
Riemann configuration 3 p = 0.29 to 0.029 in quadrant 3, the quadrant that drives the diagonal structure
the three 2D Riemann problems interfaces from 0.5 to 0.8, so the waves stop reaching the boundary before t_f
riemann2d_config12 it held configuration 8, with a quadrant moving where the reference has it at rest
Riemann configuration 4 0.89396 to 0.8939, a typo
2D Sedov energy 0.244816, which we could not trace to any publication, to 0.311357
1D Sedov energy 0.0673185 to 0.134637

The two Sedov energies now agree with Kamm's standard cases: the shock reaches
0.5, 0.75 and 1 at t = 1 in planar, cylindrical and spherical geometry. The
factor of two in 1D is a convention, not a correction of his number: his planar
blast releases its energy on one side of the plane, this one straddles the
origin and feeds two shocks.

Where the numbers come from

Each case header now names the paper its data was taken from, with the doi and
the published parameters, and says where this repository departs from them.
free_stream and closed_box state that they have no paper behind them.

Two exact solutions come with it, each of which checks itself when run:

  • python/exact_riemann.py reproduces the star states of Toro's Table 4.3 to
    the digits the book prints.
  • python/sedov_exact.py integrates the similarity equations and returns
    alpha = 0.851072 in spherical geometry, the published value for
    gamma = 1.4. That is what makes the planar and cylindrical constants it
    also computes usable, neither being quoted anywhere we could find.

Four validation runs hold the cases to them, 35 s together, marked slow like the
rest of test_validation.py:

check measured
Sod against the exact Riemann solution L1 4.2e-3, shock 0.3% short, transverse velocity 1.2e-3
Toro test 2 against the exact Riemann solution L1 3.5e-3, star pressure above exact and within a factor 2
2D Sedov front against the similarity radius 1.2% outside
the three Lax & Liu configurations, symmetry about the diagonal 3e-15

The last one is the sharp one: those configurations are invariant under
(x,y,u,v) -> (y,x,v,u), a uniform mesh carries that exactly, and one mistyped
digit in a quadrant breaks it while leaving a picture that still looks
plausible.

The Kelvin-Helmholtz case departs from Springel (2010) on gamma and on the
boundary conditions, both stated in its header. Periodicity is wired through
mesh_config but no case uses it yet, so that one resolves with
blast_periodic.

The quadrant carried p = 0.29; Lax & Liu, the article this repository
reproduces (eq. 4) and its reference implementation all give 0.029. It is the low density, low pressure quadrant that
drives the whole diagonal structure of the case, and the case is the one the
paper measures its performance on, so the figures were not comparable.

The reference fields of riemann2d_config3 move with it, for the three schemes.
The three configurations split the unit square at x0 = y0 = 0.5. Lax & Liu, and
the article this repository reproduces after them, place the interfaces at 0.8
and integrate to
t_f = 0.8, so that the waves fill the domain without leaving it. At 0.5 they
reach the boundary before t_f and the outflow condition pollutes the solution.

The reference fields of the three cases move with it, for the three schemes.
The registered states (rho = 0.5197 / 1 / 0.8 / 1, velocities +/-0.6259) were
those of Lax & Liu configuration 8 with its 0.1 velocity offsets zeroed, and its
quadrant 3, at rest in the reference, carried u = v = -0.6259 here. Replaced by
the configuration the case claims to be: (0.5313,0,0,0.4) / (1,0.7276,0,1) /
(0.8,0,0,1) / (1,0,0.7276,1). Configuration 8 comes back with the parameterised
lax_liu case.

The reference fields of riemann2d_config12 move with it, for the three schemes.
The vertical component read 0.89396 in quadrants 3 and 4, against 0.8939
everywhere else in the case and in Lax & Liu. The effect is marginal, but it
made the case asymmetric where the reference is symmetric.

The reference fields of riemann2d_config4 move with it, for the three schemes.
The two-dimensional blast energy was 0.244816, a value that appears in no
publication we could trace, while the 1D and 3D values of the file are those of
the Kamm & Timmes verification suite. Since r_s ~ E^(1/4) in cylindrical
geometry, the shock stood about 5.8% short of the analytic solution, which ruled
the case out as a quantitative test.

The reference fields of the 2D sedov_blast move with it, for the three schemes.
Every case header now carries the reference its data was taken from, with the
doi, the parameters as published and, where we depart from them, what we
changed and why. The two cases that answer to no publication say so.

Two exact solutions come with it, both self-checking so that they are
references rather than second opinions:

  python/exact_riemann.py  the exact Riemann solution of Toro chapter 4. Run
                           alone it reproduces the star states of his Table 4.3
                           to the digits the book prints.
  python/sedov_exact.py    the Sedov similarity solution, integrated rather
                           than tabulated. It returns alpha = 0.851072 in
                           spherical geometry, the published value for gamma =
                           1.4, which is what makes the planar and cylindrical
                           constants it also produces trustworthy.

and four validation runs that hold the cases to them: Toro test 2 and Sod
against the exact Riemann solution, the Sedov shock against the similarity
radius, and the symmetry of the three Lax & Liu configurations about their
diagonal. They take 20 s together and are marked slow, like the rest of
test_validation.py.

Measured, at the resolutions those tests use: Sod L1 4.2e-3 with the shock
0.3% short of exact and a transverse velocity of 1.2e-3, the 2D Sedov front
1.2% outside the similarity radius, and the three Lax & Liu configurations
symmetric to 3e-15.
Kamm's planar standard case releases E = 0.0673185 on one side of the plane and
puts its shock at r = 0.5 at t = 1. The 1D case here straddles the origin and
drives two shocks, so the same number split between them left each one at 0.397
instead. Depositing twice it gives each shock his energy, and the three
dimensions now land on 0.5, 0.75 and 1 at t = 1 as the report tabulates them.

python/sedov_exact.py computes the similarity constants this rests on, and the
validation run measures the 1D front against them.

The reference fields of the 1D sedov_blast move with it, for the three schemes.
@gouarin
gouarin force-pushed the fix-test-case-constants branch 3 times, most recently from 1f8182b to c2c1b0e Compare September 13, 2026 04:38
@gouarin
gouarin merged commit 88727a7 into main Sep 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant