ShallowWater: bugfix: fix h_star selection and limiter dpsi derivative - #378
Merged
tamiko merged 1 commit intoSep 28, 2026
Merged
Conversation
compute_h_star() discarded the double rarefaction estimate h_star_left. The limiter's dpsi was missing a factor 2 and had the sign of the t term flipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@tamiko Claude found 2 bugs with the shallow water solver. |
tamiko
approved these changes
Sep 28, 2026
tamiko
reviewed
Sep 28, 2026
Comment on lines
+230
to
+235
| const auto dpsi_l = ScalarNumber(2.) * | ||
| (relax_small * (h_U + t_l * h_P) * h_P * v2_max - | ||
| ((q_U * q_P) + q_P * q_P * t_l)); | ||
| const auto dpsi_r = ScalarNumber(2.) * | ||
| (relax_small * (h_U + t_r * h_P) * h_P * v2_max - | ||
| ((q_U * q_P) + q_P * q_P * t_r)); |
Member
There was a problem hiding this comment.
I am a little bit shocked that we got this one wrong.
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.
compute_h_star(): the second mask discarded the first one's result, soh_star_leftwas never used. Safe (overestimates lambda_max) but overly dissipative.dpsiwas missing a factor 2 and had the sign of the t term flipped.Updated test outputs: errors decrease by 10-20% for paraboloid and Ritter dam break. No bounds violations with
DEBUG_EXPENSIVE_BOUNDS_CHECK.The
paraboloid ... .output.gcc-13.3-avx2variant still has pre-fix numbers; I'll update it from CI.🤖 Generated with Claude Code