Skip to content

ShallowWater: bugfix: fix h_star selection and limiter dpsi derivative - #378

Merged
tamiko merged 1 commit into
conservation-laws:developmentfrom
ejtovar:shallow_water_fix_hstar_dpsi
Sep 28, 2026
Merged

tamiko merged 1 commit into
conservation-laws:developmentfrom
ejtovar:shallow_water_fix_hstar_dpsi

Conversation

@ejtovar

@ejtovar ejtovar commented Sep 27, 2026

Copy link
Copy Markdown
Contributor
  • compute_h_star(): the second mask discarded the first one's result, so h_star_left was never used. Safe (overestimates lambda_max) but overly dissipative.
  • Limiter: dpsi was 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-avx2 variant still has pre-fix numbers; I'll update it from CI.

🤖 Generated with Claude Code

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>
@ejtovar

ejtovar commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

@tamiko Claude found 2 bugs with the shallow water solver.

@tamiko
tamiko merged commit 2e24a17 into conservation-laws:development Sep 28, 2026
9 checks passed
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));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am a little bit shocked that we got this one wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants