Skip to content

Fix bugs in Davis EOS's#638

Merged
Yurlungur merged 5 commits into
mainfrom
buechler/davisRP
May 12, 2026
Merged

Fix bugs in Davis EOS's#638
Yurlungur merged 5 commits into
mainfrom
buechler/davisRP

Conversation

@buechlerm
Copy link
Copy Markdown
Collaborator

@buechlerm buechlerm commented May 12, 2026

Fix a couple of bugs in the Davis Eos's.

PR Summary

There were a few minor mistakes, but most notably, it was returning something like an isoenergy bulk modulus. It now returns the isentropic bulk modulus

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

@buechlerm buechlerm requested review from jhp-lanl and jonahm-LANL May 12, 2026 13:49
@Yurlungur Yurlungur requested a review from chadmeyer May 12, 2026 13:53
@Yurlungur Yurlungur self-assigned this May 12, 2026
@Yurlungur Yurlungur added the bug Something isn't working label May 12, 2026
Copy link
Copy Markdown
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! @chadmeyer FYI since you are the original author.

Copy link
Copy Markdown
Collaborator

@chadmeyer chadmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks thermodynamically sound to me. Good catch(es)

return robust::ratio(numerator, std::max(rho, 0.));
const Real ke = robust::ratio(numerator, std::max(rho, 0.));
const Real p = -esv + rho * gamma * (sie - es);
return ke + gamma * p;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this looks correct to me. Was the adiabatic bulk modulus, but we want the isentropic bulk modulus.

const Real vvc = robust::ratio(1.0, rho * _vc);
const Real Fx =
-4 * _a *
-4 * _a * _n *
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this is dF/dvvc Which I think it should be, then I'm fairly certain this n should be there.

const Real ke = -robust::ratio(
psv + (sie - es) * rho * (gammav - gamma * rho) - gamma * rho * esv, rho);
const Real p = Ps(rho) + rho * gamma * (sie - es);
return ke + gamma * p;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, with the fix to Fx and this putting it to the isentropic bulk modulus, this should be correct.

@Yurlungur
Copy link
Copy Markdown
Collaborator

@buechlerm assuming tests are passing on re-git this is good to go from my perspective. Should I click merge?

@buechlerm
Copy link
Copy Markdown
Collaborator Author

Yes, tests are all passing on re-git.

@Yurlungur Yurlungur merged commit a349de5 into main May 12, 2026
9 checks passed
@Yurlungur Yurlungur deleted the buechler/davisRP branch May 12, 2026 18:47
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.

3 participants