SWEpy is a high-performance Python solver for the 2D Shallow Water Equations (SWE), based on the Finite Volume Method (FVM) on unstructured triangular meshes. It leverages CuPy for GPU acceleration, enabling efficient simulations of large-scale hydrodynamic phenomena such as dam breaks, tsunamis, and flooding.
SWEpy is designed with a strong focus on flexibility and performance. It implements a well-balanced, positivity-preserving, high-order central-upwind finite volume scheme, suitable for complex free-surface flow scenarios involving wet–dry interfaces and irregular topography.
To reduce numerical diffusion—commonly observed in finite volume methods—the solver incorporates a second-order WENO reconstruction and a third-order strong stability-preserving Runge–Kutta (SSP-RK3) time integrator. The software follows a modular architecture, allowing flexible combinations of initial conditions, boundary conditions, and source terms.
The performance, stability, and accuracy of SWEpy are validated using canonical benchmarks, including Synolakis’ conical island and Bryson’s flow over a Gaussian bump, and further demonstrated through large-scale simulations of the 1959 Malpasset Dam failure and the Mw 8.8 2010 Maule tsunami. SWEpy delivers high-resolution results on consumer-grade hardware, making it suitable for both research applications and operational forecasting.
SWEpy relies on NVIDIA’s CUDA architecture for parallel computing. To ensure numerical stability and reproducibility, we strongly recommend using Miniconda for Python environment management.
Links & Documentation
Creators & Contact
SWEpy is developed and maintained by the following authors.
Juan Fuenzalida (juan.fuenzalidaa@sansano.usm.cl)
Joaquín Meza (joaquin.meza@usm.cl )
For scientific inquiries, collaboration proposals, or technical support, feel free to get in touch.