Skip to content
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

Add missing - from fluctuation loop #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mandli
Copy link
Member

@mandli mandli commented Jun 11, 2024

In the shallow water fwave solver the final loop over the waves is missing a negative sign. As is the if statement was never reaching the case where the speed $s_k = 0$ and splitting the wave $\mathcal{Z_k}$ into both $\mathcal{A}^\pm \Delta Q$.

@rjleveque
Copy link
Member

I've never used this particular solver, I guess it's similar to the standard GeoClaw solver rpn2_geoclaw.f but without handling dry states? I notice the geoclaw version just uses < 0 and > 0 rather than comparing to +/- 1e-14. I'm not sure if there's any particular advantage to one or the other...

@mandli
Copy link
Member Author

mandli commented Jun 12, 2024

This is used in a sill example in PyClaw. Dry states are looked for but nothing robust by any means. As to the zero issue, I am not aware of anything where doing 1e-14 instead of 0 would be advantageous. If we do keep the non-zero option we of course will need the sign kept.

@ketch
Copy link
Member

ketch commented Jun 12, 2024

Git blame says I committed that code 10 years ago, when the Geoclaw solver didn't work with PyClaw. I think it might have originally been written by Matteo Parsani even earlier. I have no idea now why I used that 1e-14 threshold, and the omission of the minus sign definitely seems like an error.

Regarding the threshold, I think that the only really problematic situation is the near-dry-state causing a divide-by-almost-zero in the calculation of beta, but the dry_tolerance parameter already protects against that, so I would favor changing the threshold for s to zero.

@mandli
Copy link
Member Author

mandli commented Jun 12, 2024

Yeah, I would not push the dry-state thing but it is relatively good about handling it for easy cases.

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.

None yet

3 participants