SWEpy
High-performance GPU solver for the 2D shallow water equations
SWEpy is a Python solver for the two-dimensional shallow water equations (SWE). It uses the finite volume method on unstructured triangular meshes and runs on the GPU through CuPy, so large hydrodynamic simulations such as dam breaks, tsunamis and floods run efficiently.
The solver implements a well-balanced, positivity-preserving, high-order central-upwind finite volume scheme that handles wet and dry fronts and irregular topography. To reduce the numerical diffusion typical of finite volume methods, it uses a second-order WENO reconstruction and a third-order strong stability-preserving Runge-Kutta time integrator (SSP-RK3). Its modular design lets users combine different initial conditions, boundary conditions and source terms.
SWEpy was validated against standard benchmarks, including Synolakis' conical island and Bryson's flow over a Gaussian bump, and applied to large-scale simulations of the 1959 Malpasset Dam failure and the Mw 8.8 2010 Maule tsunami. It produces high-resolution results on consumer-grade hardware and can be used both in research and in operational forecasting.
SWEpy requires NVIDIA's CUDA architecture for parallel computing. For numerical stability and reproducibility, we recommend managing the Python environment with Miniconda.
For scientific questions, collaboration proposals or technical support, write to the authors.