Skip to content

Fix InternalEnergyFromDensityPressure for JWL for some states#645

Merged
Yurlungur merged 4 commits into
mainfrom
jmm/jwl
Jul 16, 2026
Merged

Fix InternalEnergyFromDensityPressure for JWL for some states#645
Yurlungur merged 4 commits into
mainfrom
jmm/jwl

Conversation

@Yurlungur

@Yurlungur Yurlungur commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

PR Summary

A user discovered that the InternalEnergyFromDensityPressure call was failing to produce the correct internal energy for some EOS calls for JWL. The problem in question was a shock tube described in this paper. The issue it turns out was that singularity-eos generically uses a root find for this call and it picks the bounds for the root find based on the max and min temperature. But JWL is not a thermodynamically consistent EOS and the result was that the lower bound is below the reference temperature curve.

In this case, the fix is easy: simply replace the root find with the analytic solution, since JWL has an analytically invertable sie(rho, P). I implement the fix and add tests to JWL to check that it's functioning properly.

PR Checklist

  • Adds a test for any bugs fixed. Adds tests for new features.
  • Format your changes by using the make format command after configuring with cmake.
  • Document any new features, update documentation for changes made.
  • Make sure the copyright notice on any files you modified is up to date.
  • After creating a pull request, note it in the CHANGELOG.md file.
  • LANL employees: make sure tests pass both on the github CI and on the Darwin CI
  • If ML was used, make sure to add a disclaimer at the top of a file indicating ML was used to assist in generating the file.
  • If Agentic AI was used, have the AI generate a "proposed changes" markdown file and store it in the plan_histories folder, with a filename the same as the MR number.

If preparing for a new release, in addition please check the following:

  • Update the version in cmake.
  • Move the changes in the CHANGELOG.md file under a new header for the new release, and reset the categories.
  • Maintainers: ensure spackages are up to date:
    • LANL-internal team, update XCAP spackages
    • Current maintainer of upstream spackages, submit MR to spack

@Yurlungur Yurlungur self-assigned this Jul 16, 2026
@Yurlungur Yurlungur added the bug Something isn't working label Jul 16, 2026
@Yurlungur

Copy link
Copy Markdown
Collaborator Author

Thanks @chadmeyer for your help figuring this out

Comment thread singularity-eos/eos/eos_jwl.hpp Outdated
Co-authored-by: Adam M. Dempsey <adempsey@lanl.gov>
@Yurlungur

Copy link
Copy Markdown
Collaborator Author

Tests passing on darwin. Pulling the trigger.

@Yurlungur
Yurlungur merged commit ef4e975 into main Jul 16, 2026
9 checks passed
@Yurlungur
Yurlungur deleted the jmm/jwl branch July 16, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants