AMReX-Astro / AMReX-Astro/Microphysics
NSE derivatives remain nonzero outside the clamped table domain
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 43
- Forks
- 46
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
reproduce.cpp
reproduction-output.txt
Reviewed commit: 3ac0bda4f00da3eed0446beadfc1cd5c51b99a40
Suggested priority: Medium
Affected code: nse_tabular/nse_table.H:402-418, nse_tabular/nse_table.H:496-539, nse_tabular/nse_table.H:549-592.
Description
nse_interp() clamps temperature and density to the table bounds. Outside a bound, the returned composition is constant with respect to that coordinate. The derivative routines also clamp their interpolation coordinates, but return the boundary polynomial slope divided by the original temperature or density instead of zero. This creates an inconsistent EOS Jacobian even with default cubic interpolation.
Reproduction
Using the shipped table, cubic interpolation, and Ye=0.472:
| State | Reported derivative | Centered finite difference |
|---|---|---|
T=3e10, rho=1.23e9 |
dabar/dT=-1.456288624132152e-13 |
0 |
T=5.18e9, rho=2e10 |
dabar/drho=1.942508832455048e-11 |
0 |
Both finite-difference samples remain outside the relevant bound. Temperature and density units are K and g/cm³.
Expected behavior / suggested fix
Return zero for differentiation along a strictly out-of-range coordinate when values use constant extension. Specify the derivative
convention exactly on the boundary. Alternatively, reject out-of-domain evaluations consistently across value and derivative APIs.
Impact and validation: Newton iterations can visit outside the table, where these artificial composition slopes affect their co
rrections. The derivative mismatch is reproduced in output; no convergence failure is attributed specifically to this defect.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with nse_tabular/nse_table.H at the listed ranges around nse_interp() and the temperature and density derivative routines. Run reproduce.cpp with the shipped table and compare the reported derivatives with reproduction-output.txt and the centered finite differences. Done means out-of-range derivatives match the constant extension and boundary behavior is specified and validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100