CyprienBosserelle / BG_Flood

Numerical model for simulating shallow water hydrodynamics on the GPU using an Adaptive Mesh Refinment type grid. The model was designed with the goal of simulating inundation (River, Storm surge or tsunami). The model uses a Block Uniform Quadtree approach that runs on the GPU but the adaptive/multi-resolution/AMR is being implemented and not yet operational. The core SWE engine and adaptivity has been inspired and taken from St Venant solver from Basilisk and the CUDA GPU memory model has been inspired by the work from Vacondio _et al._2017)
GNU General Public License v3.0
34 stars 15 forks source link

Crash detection #69

Closed AliceHarang closed 1 year ago

AliceHarang commented 2 years ago

Creation of a Crash detection to stop the run if the time-step collapses.

AliceHarang commented 2 years ago

Need to improve the crash detection: Calculate the critical time-step function of the previous ones.

CyprienBosserelle commented 1 year ago

Few things with this solution ATM:

  1. This method doesn't see +INF crashes. Because dt will not collapse but instead grow and stabilize
  2. I don't think I agree with the weighting. if anything I would simplify and not weighting (dtmin=dt)
  3. We need a mechanism for selecting which dt criteria we use: the dt<XParam.dtmin or dt<0.1*Xloop.dtmin

On one end the dt<XParam.dtmin is simple and easy for user to control

On the other end dt<0.1*Xloop.dtmin may be more sensitive and detect a wider range of crash. but without a test crash model it is difficult to know .

Possible solutions

Some crash do not affect the model timestep/minimum timestep (e.g. +INF) but we can probably look at the largest time step as well as the smallest to find crazy values.
We have a user defined dtmin and dtmax that detects the crashes using both the minimum timestep and maximum timestep. Timestep is a good value to look at because locally dt approx to (sqrt(g*h) + hypot(u,v))/dx

Implementing that technique would move the crash detection inside the timestep calculation but that is a more complex operation and more code changes. Should that detection be moved to post v1.0?

Do you agree?

I suggest we do:

AliceHarang commented 1 year ago

This development is useful to detect the code crashes, locate the source and understand the origin of the crash. It detects the crash based on the time steps and create a map of the variables at the last steps. It has been test on a time steps getting too small during the simulation, with different zones output and multi-resolution grid.