-
Notifications
You must be signed in to change notification settings - Fork 90
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
WIP: New speed_limit parameter to avoid too many dt reductions #637
base: master
Are you sure you want to change the base?
Conversation
A new parameter `rundata.geo_data.speed_limit` can be set in `setrun.py` and is used in `b4step2.f90` and `getmaxspeed.f90` to scale down the fluid speed sqrt(u**2 + v**2) if it is larger than this value (preserving the flow direction). This helps avoid crashing the code with "too many dt reductions" in cases when flow off very steep topography with delta B larger than the fluid depth gives big speeds in the Riemann solution (shallow water equations aren't valid for flow off a cliff). If not specified in `setrun.py`, the default value `speed_limit = 50` m/s (approx 100 knots) is set in `data.py`. This is much larger than physically reasonable speeds for most problems, so this should give consistent results with past version of GeoClaw for runs that don't die along the way. In practice it is better to use a smaller value for most problems. Setting `speed_limit = 20` has been found to work well for several tsunami inundation problems, eliminating the tiny time steps that are sometimes forced by unphysical huge speeds in one cell, and allowing jobs to run to completion that otherwise fail in sevaral tests. This speed is probably larger than fluid speeds expected in most tsunami, storm surge, or flooding problems. But more experiments are needed to try to optimize this. And for some extreme problems, such as asteroid-impact mega-tsunamis or catastrophic dam failures, larger values of `speed_limit` may be appropriate.
why did you set the default to 50 m/s, instead of the 20 we've tested?
— Marsha
… On Feb 17, 2025, at 4:31 PM, Randall J. LeVeque ***@***.***> wrote:
Assigned #637 <#637> to @mjberger <https://github.com/mjberger>.
—
Reply to this email directly, view it on GitHub <#637 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAGUGCZ7CGQAJQ532KZ6YOD2QJIMZAVCNFSM6AAAAABXKGE6NCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJWGMZTSMJRGQZDONY>.
You are receiving this because you were assigned.
|
I set it to 50 so it would be backwards compatible in case anyone is running a case where speeds are actually greater than 20 and doesn't know about this new limit. I'm not sure what the best value is in general, but I recommend setting it to 20 in setrun.py for now. I need to dig into past work more to see if there were cases where speed > 20 m/s was correct some places. At any rate, for the few cases I've looked at so far, we got "too many dt reductions" in cells where the speed was much larger than 50 at times (supersonic in some cases), so setting it to 50 might be sufficient to keep it from crashing. Recall that it dies only if it's trying to reduce the timestep by more than a factor of 100. On the other hand, if a smaller |
@rjleveque this looks very useful. I'm testing it in some D-Claw simulations and will let you know if I have any feedback. |
I imagine that 20 m/s would be plenty high to avoid anything in storm surge but I can check our examples. Couple general thoughts:
|
@rjleveque A question/thought: Why not put this in stepgrid right before src2 is called? I think this may be a better location because if there are elements of src2 that depend on hu and hv (like manning friction) it may be better to have this adjustment made immediately after step2 but before src2. |
@mandli, Maybe we should just write to the log file @kbarnhart: Interesting idea to do it in |
manning-explore.zip |
That makes sense to me. I think I was thinking about a "too many dt reductions" type thing mostly. If this is being implemented but probably never reached without explicit knowledge it's probably something for future thought.
|
@kbarnhart: I tried imposing the speed limit in So I don't think it's necessary to reduce the speeds in these cells before applying friction, and in fact doesn't seem necessary because of friction (unless trying to do a frictionless run). Moreover, I checked that doing so does not eliminate the need to also do it before the call to |
A new parameter
rundata.geo_data.speed_limit
can be set insetrun.py
and is used inb4step2.f90
andgetmaxspeed.f90
to scale down the fluid speedsqrt(u**2 + v**2)
if it is larger than this value (preserving the flow direction).This helps avoid crashing the code with "too many dt reductions" in cases when flow off very steep topography with delta B larger than the fluid depth gives big speeds in the Riemann solution (shallow water equations aren't valid for flow off a cliff).
If not specified in
setrun.py
, the default valuespeed_limit = 50
m/s (approx 100 knots) is set indata.py
. This is much larger than physically reasonable speeds for most problems, so this should give consistent results with past version of GeoClaw for runs that don't die along the way.In practice it is better to use a smaller value for most problems. Setting
speed_limit = 20
has been found to work well for several tsunami inundation problems, eliminating the tiny time steps that are sometimes forced by unphysical huge speeds in one cell, and allowing jobs to run to completion that otherwise fail in sevaral tests. This speed is probably larger than fluid speeds expected in most tsunami, storm surge, or flooding problems.But more experiments are needed to try to optimize this. And for some extreme problems, such as asteroid-impact mega-tsunamis or catastrophic dam failures, larger values of
speed_limit
may be appropriate.