Skip to content

Jmm/t sie fix #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 17, 2025
Merged

Jmm/t sie fix #495

merged 7 commits into from
Apr 17, 2025

Conversation

Yurlungur
Copy link
Collaborator

@Yurlungur Yurlungur commented Apr 16, 2025

PR Summary

The MinimumTemperature and MinimumDensity functions in SpinerEOSDependsRhoSie had a bug that reported the incorrect bounds. This MR fixes this bug and adds a test. Thanks to Julien Loiseau for reporting the issue.

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 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.
  • Ensure that any when='@main' dependencies are updated to the release version in the package.py

@Yurlungur Yurlungur added the bug Something isn't working label Apr 16, 2025
@Yurlungur Yurlungur self-assigned this Apr 16, 2025
@Yurlungur
Copy link
Collaborator Author

I also added a new example that can quickly allow a user to report these bounds from a spiner file.

@Yurlungur
Copy link
Collaborator Author

Tests pass on re-git.

@@ -475,16 +475,16 @@ class SpinerEOSDependsRhoSie : public EosBase<SpinerEOSDependsRhoSie> {
}
PORTABLE_FORCEINLINE_FUNCTION Real rhoMax() const { return rhoMax_; }
PORTABLE_FORCEINLINE_FUNCTION Real TMin() const {
return fromLog_(T_.range(0).min(), lTOffset_);
return fromLog_(sie_.range(0).min(), lTOffset_);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let me make sure I follow here:

  • sie = f(rho, T) and T = f(rho, sie)
  • so you're getting the T bounds by:
    • looking at the domain of T in sie
  • the sie bounds by:
    • looking at the domain of sie in T?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and they are both rank 2 databoxes in which the 2nd dimension is density and the first is (T, sie), depending on the data box?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep exactly. In SpinerEOSDependsRhoSie, the temperature is a function of density and energy and energy is a function of density and temperature. That point of confusion was the cause of the bug I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

and they are both rank 2 databoxes in which the 2nd dimension is density and the first is (T, sie), depending on the data box?

Yep.

Comment on lines +43 to +50
printf("rho bounds, depends(r, T): %.14e %.14e\n", deprt.MinimumDensity(),
deprt.rhoMax());
printf("rho bounds, depends(r, sie): %.14e %.14e\n", depre.MinimumDensity(),
depre.rhoMax());
printf("T bounds, depends(r, T): %.14e %.14e\n", deprt.MinimumTemperature(),
deprt.TMax());
printf("T bounds, depends(r, sie): %.14e %.14e\n", depre.MinimumTemperature(),
depre.TMax());
Copy link
Collaborator

Choose a reason for hiding this comment

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

I realize this isn't necessarily touched by this MR, but I do think the naming should be consistent between min and max, i.e. MinimumTemperature and MaximumTemperature or TMin and Tmax

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Reason it's not consistent is MaximumTemperature isn't a public function in the variant. That may be the time to fix.

@Yurlungur Yurlungur merged commit 95b4d38 into main Apr 17, 2025
9 checks passed
@Yurlungur Yurlungur deleted the jmm/TSieFix branch April 17, 2025 18:51
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