DiffSWE2d: a differentiable Shallow Water Equations solver for end-to-end flood and tsunami modelling
Zhonghou Xu
Abstract
Solving inverse and optimisation problems with traditional shallow water equations (SWE) solvers can be computationally expensive, particularly when gradients with respect to model inputs or parameters must be estimated through repeated forward simulations. In this paper, we introduce DiffSWE2d, an open-source differentiable shallow water equations solver for end-to-end flood and tsunami modelling implemented in PyTorch. By leveraging automatic differentiation, DiffSWE2d represents the time-marching physics as a differentiable computational graph, enabling gradients to be propagated directly through the numerical solver. We validate the solver against two established benchmark cases and demonstrate its application to tsunami waveform inversion, showing its ability to infer model inputs through gradient-based optimisation. DiffSWE2d provides a flexible framework for integrating physics-based hydrodynamic modelling with modern optimisation and machine learning methods. The source code and reproducible examples are publicly available at: https://github.com/ZhonghouXu/DiffSWE2d
Create a lesson
Related papers
Particle dynamics in a microfluidic T-junction vortex flow: the role of history force
Matteo Chiatto, Luigi de Luca, Howard A. Stone et al.
Predicting the Final Stationary State of Sheared 2D Euler Fluids
Renato Pakter, Yan Levin
Re-emergence of fingering in solidifying liquid-metal drops
Siyu Zhang, Feng Wang, Yuan Ma et al.
The binormal flow: a toy model for turbulence
Elena Danesi, Pablo Merino, Luis Vega
Non intrusive parametric Reduced Order Models based on physics for incompressible flow
Cyrille Allery, Claudine Beghein
Conjugate heat transfer in turbulent pipe flow with azimuthally non-uniform heating
Jonathan Neuhauser, Davide Gatti, Bettina Frohnapfel