fix low density/Pressure SCVH EOS tables #997
Open
Debraheem wants to merge 3 commits into
Open
Conversation
…low table edges instead of HELM fallback, fix FreeEOS low T boundary dlnE/dlnT partial bug
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.
This pr is an attempt to address #995, which spawned from a mailing-list thread initially raised by Natasha Ivanova:
I believe the main concern was the mean molecular weight being that of an ionized mixture in the regions highighted in the plots below, when adopting both Free_EOS and OPAL/SCVH.
https://lists.mesastar.org/pipermail/mesa-users/2026-May/015873.html:

Particularly in the low T-rho regime, as I'm not sure there is a better fallback than HELM in the high pressure regime (that would require an actual eos for that region).
For the SCVH tables, below
logP_min = -0.6the SCVH coverage is now supplied analytically ineos/eosDT_builder/src/scvh_core.f90. For each fixedlogTrow and each species, the tail uses the edge state and extrapolates to the ideal gas limit.and the ideal low-pressure limit
The implementation uses this ideal value below the first lower-pressure grid
step and applies a local cubic correction between
logP0and that point so thetail is value-continuous and has the same
d/dlogPas the restored processedSCVH table at the edge. That keeps the generated eosDT interpolation support
smooth without editing the raw SCVH data files.
In this pr, I also noticed when regenerating the eos tables that there was a HELM fallback in
the high pressure region, and it produced noisy
mufeaturesnear the OPAL/SCVH support boundary in regenerated tables. I think this fallback didn't exist,
when the tables where generated the first time, so i turned it off for the table generation. see check_results :
was
gamma1_opalscvh <= 1d0 .or. gamma1_opalscvh >= 2d0 .or. grad_ad_opalscvh >= 50d0) thennow
gamma1_opalscvh <= 0d0) thenThis might not be correct, but it was the only way for me to make the new eos smooth like the old eos tables, but maybe this expression should be adjusted.
See the plots below


After adding the smooth extrapolation to SCVH, i also noticed there was a bad row of partials on the

FreeEOS SCVH boundary at logT = 3 - 3.1. It turns out the fallback here were rows generated from the
MESA EOS with
lnPgas,lnE, andlnSin natural log form, but the FreeEOS data filesstore those columns as base-10 logarithms. so i these just need to be converted in
eos/eosFreeEOS_builder/src/free_eos_table.f90. (See the original issue below).I had to regenerate the eos for this pr.
eos/eosFreeEOS_data.tar.xzeos/eosDT_data.tar.xzI bumped the the FreeEOS table version and the eosDT table version to
52.A few plots from the new eos looks like this:
(a bit low res for the eos plotter)

The eosDT region definitions shifted very slightly in
eos/eosDT_builder/src/eos_regions_defs.dekandeos/eosDT_builder/src/eos_regions_code.dekkeep the generated OPAL/SCVH supportout of the warm, very-low-density FreeEOS side. This prevents the SCVH
low-pressure floor from interacting with the FreeEOS boundary at
logrho ~ -15.This PR probably needs some further attention validation and testing, maybe clean up.