Fix the test case constants, and check every case against its paper - #9
Merged
Merged
Conversation
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
force-pushed
the
fix-test-case-constants
branch
3 times, most recently
from
September 13, 2026 04:38
1f8182b to
c2c1b0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six constants in the test cases were wrong. Each gets its own commit, with its
regenerated reference fields, since each changes results.
p = 0.29to0.029in quadrant 3, the quadrant that drives the diagonal structure0.5to0.8, so the waves stop reaching the boundary beforet_friemann2d_config120.89396to0.8939, a typo0.244816, which we could not trace to any publication, to0.3113570.0673185to0.134637The two Sedov energies now agree with Kamm's standard cases: the shock reaches
0.5, 0.75 and 1 at
t = 1in planar, cylindrical and spherical geometry. Thefactor 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_streamandclosed_boxstate that they have no paper behind them.Two exact solutions come with it, each of which checks itself when run:
python/exact_riemann.pyreproduces the star states of Toro's Table 4.3 tothe digits the book prints.
python/sedov_exact.pyintegrates the similarity equations and returnsalpha = 0.851072in spherical geometry, the published value forgamma = 1.4. That is what makes the planar and cylindrical constants italso 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: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 mistypeddigit in a quadrant breaks it while leaving a picture that still looks
plausible.
The Kelvin-Helmholtz case departs from Springel (2010) on
gammaand on theboundary conditions, both stated in its header. Periodicity is wired through
mesh_configbut no case uses it yet, so that one resolves withblast_periodic.