AI/ML Solutions for Shallow Water Equations: Replacing Numerical Solvers for Geospatial Applications
Research Report — April 2026
The Shallow Water Equations (SWEs) are the foundational PDEs used in flood modeling, coastal surge prediction, river hydraulics, tsunami propagation, and dam-break analysis. In their 2D conservative form, they describe the evolution of water depth h and momentum (hu, hv) over terrain with bathymetry:
∂h/∂t + ∂(hu)/∂x + ∂(hv)/∂y = 0 (continuity)
∂(hu)/∂t + ∂(hu² + ½gh²)/∂x + ∂(huv)/∂y = -gh·∂b/∂x + Sf (x-momentum)
∂(hv)/∂t + ∂(huv)/∂x + ∂(hv² + ½gh²)/∂y = -gh·∂b/∂y + Sf (y-momentum)
Traditional numerical solvers (finite volume, finite difference, finite element) discretize these equations on meshes and march forward in time. The critical bottleneck is the Courant-Friedrichs-Lewy (CFL) condition, which forces the time step to satisfy:
Δt ≤ CFL × Δx / (|u| + √(gh))
This means that as you refine your spatial mesh to capture small features (sea walls, narrow channels, urban streets), the time step must shrink proportionally. For a 1-meter resolution coastal flood model, this can force sub-second time steps over simulations spanning hours or days, resulting in millions of solver iterations. A single 2D SWE simulation of a real flood event at high resolution can take hours to days on HPC clusters.
This computational cost makes SWEs impractical for real-time forecasting, ensemble-based uncertainty quantification (which requires hundreds of runs), rapid what-if scenario exploration, and operational early-warning systems requiring sub-minute response.
The core idea is to train a neural network to learn the input-output mapping of the SWE solver—given initial/boundary conditions, terrain, and forcing, predict the water depth and velocity fields directly—without stepping through the CFL-constrained time integration. Once trained, inference runs in seconds to minutes on a GPU, achieving speedups of 1,000x to 10,000x over traditional solvers.
There are several distinct families of approaches, each with different trade-offs.
PINNs embed the SWE residuals directly into the neural network's loss function, so the network learns to satisfy the governing equations without requiring labeled simulation data.
How it works: A fully connected or convolutional neural network takes spatiotemporal coordinates (x, y, t) as input and outputs (h, u, v). The loss function penalizes violation of the SWE PDEs (computed via automatic differentiation), boundary conditions, and initial conditions. No pre-computed training data from a numerical solver is needed.
Recent advances (2024-2025):
- Tian et al. (2025) developed PINNs for 2D SWEs with terrain topography and spatially distributed rainfall source terms, published in Water Resources Research. Their model handles real-world complexity including variable bathymetry and time-varying rainfall forcing.
- Dazzi (2024) proposed PINNs for the augmented system of SWEs with topography, demonstrating that accuracy is less sensitive to mesh resolution compared to traditional finite volume methods—a major advantage.
- Physics-informed convolutional neural networks (PICNs) and physics-informed fully connected networks (PIFCNs) have both been validated for 2D SWE problems without labeled data.
Strengths: No training data needed; embeds physical conservation laws; mesh-resolution independent.
Limitations: Training can be slow and unstable; balancing multiple loss terms is challenging; struggles with sharp discontinuities (shocks, hydraulic jumps); currently limited to relatively small spatial domains.
Best for: Research settings, small-to-medium domain problems, scenarios where simulation data is unavailable.
Neural operators learn the solution operator of the PDE—a mapping from input functions (initial conditions, boundary conditions, terrain) to output functions (flow fields at future times). Unlike PINNs, they generalize across different input parameters after training.
Fourier Neural Operator (FNO): Operates in spectral space, learning global convolution kernels via the Fast Fourier Transform. The Spherical FNO (S-FNO) variant handles problems on spherical domains, making it suitable for global-scale SWE applications in weather/climate.
DeepONet: Uses a branch-trunk architecture where the branch network encodes the input function and the trunk network encodes the query coordinates. Physics-informed DeepONets can predict solutions up to three orders of magnitude faster than conventional PDE solvers.
Recent advances:
- A Neural Operator-Based Emulator for Regional Shallow Water Dynamics (Feb 2025, arXiv:2502.14782) introduced MITONet (Multiple-Input Temporal Operator Network), which uses dimensionality reduction to efficiently approximate high-dimensional SWE solvers on regional scales.
- FNO-based surrogates have been applied to 1D shallow-water debris-flow simulations, demonstrating fast, physics-consistent emulation.
- Composite architectures coupling DeepONet encoders with PINNs-style decoders have been trained on ~100,000 CFD-generated cases for coastal applications.
Strengths: Generalizes across parameter variations; very fast inference; resolution-invariant; handles complex input functions.
Limitations: Requires substantial training data (typically thousands of numerical simulations); high upfront training cost; can struggle with out-of-distribution scenarios.
Best for: Operational forecasting where you need rapid predictions across many scenarios; ensemble modeling; parameter sweeps.
These treat the SWE solver as a black box and learn the mapping from inputs to outputs using standard deep learning architectures.
Key architectures:
- U-Net: Encoder-decoder with skip connections, excellent for spatial flood inundation mapping. Captures both local detail and global context.
- ConvLSTM / Temporal CNNs: Handle spatiotemporal sequences, predicting flood evolution over time.
- Transformers: Self-attention mechanisms capture long-range spatial and temporal dependencies. A transformer-based model for dam-break flood forecasting was shown to enable real-time early warning.
- NN-p2p (Point-to-Point): A surrogate model that makes predictions on unstructured/irregular meshes, important for real geospatial domains with complex boundaries.
Performance highlights:
- Song & Shen (published in Journal of Hydraulic Engineering, 2023) developed the NN-p2p surrogate, with code available at github.com/psu-efd/Surrogate_Modeling_SWEs.
- Deep learning-based image super-resolution combined with coarse-grid hydrodynamic modeling achieved 2,800x speedup while maintaining high accuracy for flood inundation mapping.
- Random forest + physics hybrid models have achieved 3,000x speedup for urban community flood prediction.
Strengths: Massive speedups; flexible architectures; can leverage transfer learning; works well with geospatial raster data.
Limitations: Requires large training datasets from numerical simulations; purely data-driven models lack physical guarantees; may violate conservation laws.
Best for: Operational flood mapping; real-time forecasting; integration with existing GIS workflows.
GNNs operate on irregular, unstructured meshes—a natural fit for geospatial domains with complex coastlines, river networks, and varying resolution.
FloodCast (2024): A major framework combining multi-satellite observation with a Geometry-Adaptive Physics-Informed Neural Solver (GeoPINS). It uses FNO-based architectures with sequence-to-sequence learning for temporal dynamics and hard-encoded boundary conditions. FloodCast is resolution-invariant and geometry-adaptive, meaning it works across different domain shapes and mesh sizes without retraining.
SWE-GNNs: Hydraulic-based graph neural networks that embed SWE physics into the message-passing framework. They enable transferability to domains not seen during training—critical for deploying across different geographic regions.
HydroGraphNet (NVIDIA PhysicsNeMo): An interpretable physics-informed GNN for flood forecasting, part of NVIDIA's PhysicsNeMo framework. It provides both predictions and interpretability of the learned physics.
Multi-scale hydraulic GNNs (published in Natural Hazards and Earth System Sciences, 2025) handle the multi-resolution nature of real flood domains, with coarse representation in floodplains and fine resolution near structures.
Strengths: Handles irregular domains naturally; physically interpretable; transferable across geographies; respects mesh topology.
Limitations: Graph construction adds preprocessing; scaling to very large domains requires careful design; training can be complex.
Best for: Regional and continental-scale modeling; multi-basin forecasting; applications requiring domain transferability.
Rather than replacing the solver entirely, this approach augments traditional SWE solvers with learned components using differentiable programming.
Hydrograd (2025): Published in Water Resources Research, this Universal SWEs (USWEs) solver combines a physics-based 2D SWE solver with neural networks via differentiable programming. Unlike pure surrogate models, it keeps the SWE solver as the physics backbone and uses neural networks to learn unknown components (like flow resistance). This eliminates the need for data-intensive pretraining while maintaining physical fidelity.
Strengths: Maintains physical guarantees; learns unknown physics from data; doesn't need massive pretraining datasets; solver remains interpretable.
Limitations: Still requires time-stepping (though potentially with larger steps); more complex to implement; relatively new approach.
Best for: Calibration and parameter estimation; learning unknown physics (friction, infiltration); scenarios where physical fidelity is paramount.
The primary killer application. Traditional SWE solvers cannot deliver results fast enough for operational early warning during rapidly evolving flood events. ML surrogates can provide flood inundation maps in seconds, enabling real-time decision support for emergency managers and evacuation planning.
The FloodCastBench dataset (published in Scientific Data, 2025) provides standardized benchmarks covering four major flood events (Pakistan 2022, UK 2015, Australia 2022, Mozambique 2019) for training and evaluating ML flood models.
Integration of ML models with GIS and remote sensing data for identifying flood-prone areas. Approaches combine geospatial factors (elevation, slope, land use, soil type, drainage density, distance to rivers) with ML classifiers (XGBoost, Random Forest, CNN, LightGBM). Sentinel-1 SAR-based flood inventories provide ground truth for training. SHAP-based interpretability allows understanding which geographic features drive flood risk.
Neural operators trained on coastal SWE simulations can predict storm surge inundation for different hurricane tracks, intensities, and tidal conditions in near-real-time—critical for hurricane season operations.
FNO-based surrogates for 1D shallow-water debris-flow simulations have been demonstrated. Transformer-based models enable real-time dam-break flood map forecasting, providing instant scenario analysis for dam safety assessment.
Urban environments require very high resolution (1-5 meters) to capture streets, buildings, and drainage infrastructure, making the CFL constraint especially punishing. CNN and U-Net architectures that process urban terrain as images are particularly effective here, achieving thousands-fold speedups.
Graph-based approaches (FloodCast, SWE-GNNs, HydroGraphNet) scale to regional and continental domains by leveraging irregular meshes that adapt to local complexity. Multi-scale GNNs handle the extreme resolution variations between narrow river channels and broad floodplains.
You need a corpus of SWE simulation results. Use an existing open-source solver:
| Solver | Language | Strengths |
|---|---|---|
| ANUGA | Python | Unstructured triangular meshes, well-documented |
| GeoClaw | Fortran/Python | Adaptive mesh refinement, tsunami-validated |
| HEC-RAS 2D | GUI + API | Industry standard, FEMA-accepted |
| Basilisk | C | High performance, adaptive grids |
| LISFLOOD-FP | C++ | Simplified SWE, very fast for training data |
Run hundreds to thousands of simulations varying initial water levels, inflow hydrographs, rainfall patterns, Manning's roughness, and terrain perturbations. Store input-output pairs as your training dataset.
| Scenario | Recommended Approach |
|---|---|
| No training data available | PINNs |
| Fixed domain, many scenarios | FNO or U-Net surrogate |
| Multiple domains, transferability needed | GNN (SWE-GNN or HydroGraphNet) |
| Need physical guarantees | Hydrograd (differentiable solver) |
| Operational deployment, max speed | Pre-trained FNO or CNN surrogate |
Neural Operator Library (Python/PyTorch): Open-source library at github.com/neuraloperator/neuraloperator. Provides FNO, DeepONet, and other operator architectures with benchmark datasets and training pipelines.
Physics-Informed Neural Operator (PINO): github.com/neuraloperator/physics_informed. Combines operator learning with physics constraints.
NVIDIA PhysicsNeMo: Includes HydroGraphNet for flood modeling. Enterprise-grade, GPU-optimized.
FloodCast: GeoPINS-based framework for large-scale flood modeling with satellite data integration.
Penn State Surrogate Modeling SWEs: github.com/psu-efd/Surrogate_Modeling_SWEs. Reference implementation of the NN-p2p approach.
SWE Solvers for Training Data:
- github.com/milankl/swm — Shallow water solver in Python (NumPy/SciPy)
- github.com/suhasdl/pySWE — Spherical SWE solver in Python
For real-world geospatial applications, your pipeline needs to handle DEM/terrain data (SRTM, LiDAR, Copernicus DEM), land use / land cover for roughness estimation (NLCD, Corine), hydrological boundary conditions from gauging stations or forecast models, satellite-derived flood extents for validation (Sentinel-1 SAR), and rainfall data (radar, GPM satellite, forecast models).
Preprocessing typically involves reprojecting to a common CRS, resampling to your target resolution, and encoding terrain features as input channels to the neural network.
Validate against held-out numerical simulations (interpolation accuracy), observed flood events with satellite-derived flood extents (real-world accuracy), and conservation law satisfaction (mass conservation error). Use metrics including water depth RMSE, flood extent F1/IoU, peak timing error, and volume conservation error.
Training data cost: Generating thousands of high-fidelity SWE simulations for training is itself expensive. Transfer learning, few-shot approaches, and physics-informed methods help reduce this burden.
Shock handling: SWEs produce hydraulic jumps and bore waves (discontinuities) that are difficult for neural networks. Approaches like adaptive loss weighting and domain decomposition are active research areas.
Out-of-distribution generalization: ML models may fail silently when encountering conditions outside their training distribution (unprecedented rainfall, novel terrain configurations). Uncertainty quantification is critical.
Long-time stability: Autoregressive rollout (predicting step-by-step) can accumulate errors over long time horizons. Approaches like sequence-to-sequence training and temporal bundling help.
Regulatory acceptance: For FEMA floodplain mapping and engineering design, traditional solvers remain the regulatory standard. ML models are currently more accepted for operational forecasting and screening-level analysis.
| Approach | Training Data Needed | Speedup | Physical Guarantees | Generalizability | Maturity |
|---|---|---|---|---|---|
| PINNs | None | 10-100x | Strong (PDE in loss) | Limited to trained domain | Medium |
| FNO / DeepONet | Large (1000s of sims) | 1000-10000x | Weak (unless physics-informed) | Across parameters | High |
| CNN/U-Net Surrogate | Large | 1000-3000x | None (pure data) | Limited | High |
| GNN (SWE-GNN) | Moderate | 100-1000x | Moderate (physics-informed) | Across domains | Medium |
| Transformer | Large | 1000x+ | Weak | Good temporal | Medium |
| Differentiable Solver | Small | 2-10x | Strong (solver backbone) | Physics-guaranteed | Early |
For a practitioner wanting to get started:
- Start with LISFLOOD-FP or ANUGA to generate a training dataset for your region of interest using real DEM data.
- Use the NeuralOperator Python library to train an FNO on your dataset. FNO provides the best balance of speed, accuracy, and ease of implementation.
- Integrate with your GIS stack using rasterio/GDAL for terrain data handling and geopandas for vector features.
- Validate against Sentinel-1 SAR flood extents from real events in your region.
- For operational deployment, consider wrapping the trained model in a FastAPI service that accepts terrain + forcing inputs and returns flood inundation maps as GeoTIFFs.
This approach bypasses the CFL constraint entirely—your trained model produces flood predictions in seconds regardless of the spatial resolution, because it has learned the input-output mapping without needing to time-step through the physics.
- Surrogate Model for SWEs with Deep Learning (Song & Shen)
- Neural Operator-Based Emulator for Regional Shallow Water Dynamics (MITONet)
- Scientific ML of Flow Resistance Using Universal SWEs (Hydrograd)
- PINNs for 2D SWEs Without Labeled Data
- PINNs for SWEs with Terrain and Rainfall (Tian et al. 2025)
- PINNs for Augmented SWEs with Topography (Dazzi 2024)
- Interpretable Physics-Informed GNNs for Flood Forecasting
- FloodCast: Large-Scale Flood Modeling and Forecasting
- FloodCastBench Dataset
- Multi-Scale Hydraulic GNNs for Flood Modelling
- HydroGraphNet — NVIDIA PhysicsNeMo
- NeuralOperator Python Library
- Physics-Informed Neural Operator (PINO)
- Penn State Surrogate Modeling SWEs
- Rapid Flood Inundation via DL Image Super-Resolution
- ML Prediction-to-Map Framework for Flood Prediction
- Local Time-Stepping for SWEs Using CFL Optimized Schemes
- Physics-Informed GNNs for Operational Flood Modeling
- Learning Nonlinear Operators in Latent Spaces (Nature Comms)