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

Many Rivers #115

Open CyprienBosserelle opened 1 month ago

CyprienBosserelle commented 1 month ago

Improve efficiency if may rivers are involved

I'm changing the structure of the model workflow to be efficient if a lot of rivers are in the model. Currently kernels are launched in serial for each river. This is very inefficient when you have many rivers. In an example using a crud model of the lower Waitaki River.

n rivers Run times
1 6
10 7
100 14
675 71

This doesn't look too bad but things gets worse in other setting (may need a better example to make the point about the point of this)

CyprienBosserelle commented 3 weeks ago

using the same test: 675 river: 19s runtime!

CyprienBosserelle commented 3 weeks ago

Using the same setup as above but rerunning each scenarios. (Waitaki domain, single level (256m res). 3600 s run )

n rivers Run times old code Run times new code
1 5 5
10 5 6
100 14 7
675 73 9-10

Results between old and new code are exactly identical but the new code is 7 times faster with 675 rivers.

[!TIP] SUCCESS

CyprienBosserelle commented 3 weeks ago

Two Birds, one PR

Momentum conserving rain input

Also added a momentum preserving correction for u and v when adding rain input.