Add generic Mie-Gruneisen equation-of-state core#1665
Closed
fahnab666 wants to merge 3 commits into
Closed
Conversation
This was referenced Jul 21, 2026
fahnab666
marked this pull request as ready for review
July 21, 2026 07:40
… CI-run toolchain suite
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1665 +/- ##
==========================================
- Coverage 59.46% 59.39% -0.07%
==========================================
Files 83 84 +1
Lines 21170 21192 +22
Branches 3135 3135
==========================================
Hits 12588 12588
- Misses 6476 6498 +22
Partials 2106 2106 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sbryngelson
marked this pull request as draft
July 21, 2026 12:32
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.
What this PR does
Adds a generic Mie-Gruneisen equation-of-state core as a leaf module,
src/common/m_eos_mie_gruneisen.fpp. This is the clean second non-chemistry EOS thatsits between the existing stiffened gas and any explosives-branded path: JWL becomes a
particular Mie-Gruneisen reference curve rather than an unrelated special case. No solver
path selects it yet, and
mie_gruneisenstays rejected at runtime; this PR lands theverified thermodynamic core ahead of the reference curve (JWL principal isentrope) that
will consume it.
Structure: reference-curve provider plus generic assembler
A Mie-Gruneisen material obeys
p = p_ref(rho) + Gamma*rho*(e - e_ref(rho)). The referencepair
(p_ref, e_ref)and its density derivatives are the only thing that distinguishes onematerial from another, so the module follows the production hydrocode split (Arienti,
Morano and Shepherd, GALCIT FM99-8, 2004; LLNL singularity-eos): one provider returns the
reference curve, one curve-agnostic assembler consumes it. Stiffened gas, ideal gas, and
JWL then differ only in the provider.
s_mg_stiffened_referencep(rho, e)f_mg_pressuree(rho, p)f_mg_internal_energy,dp/dec^2(assembled from the two derivatives)f_mg_sound_speed_sqGammais a constant scalar (the correct convention for detonation products and stiffenedgas), passed to the assembler, not the density-dependent
rho*Gamma = constshock closure.Sound speed
The frozen identity
c^2 = dp/drho|_e + (p/rho^2) dp/de|_rhowithdp/de|_rho = Gamma*rho(Arienti et al. 2004 Eq. 12; Menikoff and Plohr 1989), written in terms of pressure so no
separate energy argument is needed:
The result can go negative outside the admissible domain, so it is returned as a value and
the caller tests it before taking a square root, matching the existing
mixture_err/f_validate_statepattern rather than aborting on the GPU device.The stiffened-gas reference curve
The one concrete reference curve shipped here is stiffened gas expressed in Mie-Gruneisen
form:
Gamma = gamma_s - 1,p_ref = -pi_inf,e_ref = pi_inf/rho. It is the template theJWL isentrope follows, and it is also the manufactured verification oracle: the generic
assembler fed this curve must reproduce the existing stiffened-gas pressure and sound speed
exactly. Ideal gas is the
pi_inf = 0sub-case.Verification
toolchain/mfc/test_mg_eos.pyholds the manufactured tests. They run in CI on every PRthrough the Toolchain Compatibility matrix (Python 3.9 to 3.14, via
./mfc.sh lint).There is no golden case because the backend is not yet runtime-selectable; the runnable
golden lands with the JWL consumer PR. The tests mirror the Fortran formulas and check:
parameter sets: pressure, energy round-trip, and sound speed all match the analytic
stiffened-gas oracle to machine precision (worst relative error 2e-16).
p(rho, e)for a synthetic (non-calibrated) JWL-form isentrope reference, which exercises the
density-dependent
p_refand its derivatives that stiffened gas alone cannot.de_ref/drho = p_ref/rho^2(the density form of
de = -p dv), the check that catches per-mass vs per-initial-volumescaling errors in
e_ref.c^2 > 0over the synthetic envelope for admissible states.Build: pre_process, simulation, and post_process all compile with the new module. The
golden suite is unaffected by construction, since nothing calls the module yet.
formatand
precheckpass; the module is registered indocs/module_categories.json.Scope
Out of scope, by design: the enum dispatch and adapter registration (needs the PR1
thermodynamics interface), the JWL reference curve and its cases (PR4), and any reaction
source. This is the generic base only.
Related
Part of the incremental EOS ladder tracked in #1638. Ladder so far: PR 1 #1663 (central thermodynamics interface), PR 2 #1664 (explicit EOS selector), PR 3 #1665 (generic Mie-Gruneisen core); JWL follows as a Mie-Gruneisen reference curve. The three open PRs are independent and can be reviewed in parallel.