fip-ems / fip

3 stars 1 forks source link

fip

This repository provides the implementation of fip, the Flood Inundation Parallel computation model.

Accelerating flash flood simulations: An efficient GPU implementation for a slim shallow water solver
Arne Rak, Peter Mewis, Stefan Guthe
Environmental Modelling & Software, 2024

Massively Parallel Large Scale Inundation Modelling
Arne Rak, Stefan Guthe, Peter Mewis
EGPGV@ EuroVis, 2022

Windows compilation

You can build FIP on Windows using CMake and Visual Studio Community Edition. CUDA toolkit has to be installed in version 11.4 or above.

Precompiled binaries for Windows can be found in the Releases section.

Linux compilation steps

FIP may work fine with CUDA toolkit versions above 11.4. The following is an installation example for CUDA toolkit version 11.4 on Ubuntu 18.04.

CUDA Toolkit 11.4 installation

Disable nouveau kernel driver

sudo echo -e "blacklist nouveau\noptions nouveau modeset=0" >> /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u
sudo reboot

Install CUDA toolkit 11.4

wget https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda_11.4.0_470.42.01_linux.run
sudo sh cuda_11.4.0_470.42.01_linux.run
# Add to .bashrc
echo 'PATH="/usr/local/cuda/bin:$PATH"' >> ~/.bashrc
echo 'LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"' >> ~/.bashrc

Project compilation

sudo apt install cmake build-essential
mkdir bin; cd bin
cmake ..
make -j

Running FIP

The simulation parameters are given in a YAML file as the first launch argument of FIP ./fip parameters.yml. The following table lists all simulation parameters and their usage: Parameter Type Required Example Description
name string yes name: my_simulation Name of the simulation. Used when writing out simulation buffers.
terrain [string, offset] yes terrain: [marchfeld_sohle, 36] Binary DTM file. offset is the byte offset at which the data array starts.
W integer yes W: 5667 Number of grid cells in x direction.
H integer yes H: 6500 Number of grid cells in y direction.
dx float yes dx: 3 Grid cell resolution in meters.
dt float yes dt: 0.1 Initial timestep in seconds.
duration float yes duration: 3600*24*12 Simulation duration in seconds. Only used when run without GUI. Can be a math expression using only multiplications.
kSt or
kSt_var
float or
[string, offset]
yes kSt: 30.0 or
kSt_var: [marchfeld_kst, 36]
Strickler roughness coefficient.
z [string, offset] optional z: [marchfeld_init_z, 36] Initial water levels.
qx [string, offset] optional qx: [marchfeld_init_qx, 36] Initial discharges in x direction.
qy [string, offset] optional qy: [marchfeld_init_qy, 36] Initial discharges in y direction.
variable_dt boolean optional variable_dt: true When true, the timestep dt will adjust during simulation according to the CFL condition.
no_data float optional no_data: -1 When set, cells in the DTM with this value will be ignored in rendering and during computation.
save_state float[] optional
save_state:
  - 3600 24 0.5
  - 3600 24 2.5
The GPU buffers for z, qx, qy and flood plains will be written to disk at the given timestamps.
sampling { label: string,
type: z | qx | qy,
x: integer,
y: integer }[]
optional
sampling:
  - x: 0
    y: 170
    label: sample1
    type: z
  - { x: 42, y: 170,
     label: sample2, type: qx }
At the given sample_interval, all sampling points in the sampling list will be printed to the standard output in CSV format. x,y define the cell coordinate, type defines which buffer is sampled.
sampling_interval integer optional sampling_interval: 100 Sampling interval in seconds.
boundary_conditions { side: right | left | top | bottom,
type: z | q | close | open,
z: float | csv,
q: float | csv,
from: integer,
to: integer }[]
optional
boundary_conditions:
  - side: left
    type: z
    z: [timeseries.csv, 0, 1]
  - side: right
    type: close
    from: 0
    to: 500
Boundary conditions that drive the simulation when no initial water levels are given. side defines at which grid border the condition is applied. from, to are optional and define the range of cells at which the condition is applied. When omitted, condition is applied to entire border. type can be open (water flows out), close (walled off), a water level z, or discharge q. z,q can be fixed values or timeseries in CSV format given as [filename, time-column, data-column].