Preprints
https://doi.org/10.5194/egusphere-2026-5446
https://doi.org/10.5194/egusphere-2026-5446
05 Nov 2026
 | 05 Nov 2026
Status: this preprint is open for discussion and under review for Geoscientific Model Development (GMD).

WarpFlow v1.0: A Single-Source CPU/GPU Shallow-Water Solver for Operational City-Scale Urban Flood Modeling

Lars Backhaus and Jürgen Stamm

Abstract. Operational urban flood management increasingly needs two-dimensional hydrodynamic models that re-run on demand, are driven by data pipelines without hand editing, and run on hardware a municipality already owns. We present WarpFlow, an open-source solver for the two-dimensional shallow-water equations built against these three constraints. WarpFlow solves the full shallow-water equations on a staggered Arakawa C-grid, retaining advective momentum. The scheme combines an Audusse well-balanced hydrostatic reconstruction, a first-order upwind mass flux, and a semi-implicit momentum update with implicit bed friction and advective damping. The velocity update is evaluated in Jacobi form, so it is independent of traversal order. Together with a single-source, three-backend implementation, this yields CPU and GPU results that agree to single-precision round-off. A positivity floor guarantees non-negative depth, and an optional flux-corrected-transport limiter is available where required at wetting fronts. Rainfall, infiltration, drainage sinks, stage and discharge boundaries, and weir/orifice culverts with lumped transport delay are treated as first-class source terms. WarpFlow is a Python package whose kernels compile to multi-core CPU code and to NVIDIA CUDA through Numba and CuPy. The CPU, dense CUDA and memory-sparse tiled CUDA backends share one kernel formulation. Static fields are compressed by lookup-table encoding, and the tiled backend allocates memory only for terrain-bearing tiles, so city-scale domains fit in consumer-GPU memory. Two automatic runtime controls reduce work: active-tile scheduling skips dry terrain tiles, and an adaptive CFL-stride controller amortizes global time-step reductions when the characteristic speed is stable. A hook-based plugin layer and scripting API expose every stage of a run, allowing WarpFlow to operate inside automated modeling pipelines. We verify WarpFlow against analytical dam-break and lake-at-rest solutions, and demonstrate water-budget closure, grid convergence and CPU/GPU reproducibility. We validate it against the Environment Agency 2D benchmark subset and the Malpasset dam break. As an operational showcase, we simulate a 100-year, one-hour Euler-II design storm over the administrative area of Dresden, Germany, across a two-hour window. At 5 m resolution (≈ 365 km² terrain area), the run completes in 51.68 s. At 2 m resolution (≈ 1.66 × 10⁸ total cells, ≈ 9.1 × 10⁷ terrain cells), it completes in ≈ 14.4 min on one consumer GPU, compared with ≈ 15.4 h for the same solver's 24-thread CPU backend (≈ 64.3× speedup). WarpFlow is the engine behind the operational Urban Digital Flood Twin Dresden; here we document the solver. The code is released under the AGPLv3 license.

Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims made in the text, published maps, institutional affiliations, or any other geographical representation in this paper. While Copernicus Publications makes every effort to include appropriate place names, the final responsibility lies with the authors. Views expressed in the text are those of the authors and do not necessarily reflect the views of the publisher.
Share
Lars Backhaus and Jürgen Stamm

Status: open (until 31 Dec 2026)

Comment types: AC – author | RC – referee | CC – community | EC – editor | CEC – chief editor | : Report abuse
Lars Backhaus and Jürgen Stamm

Data sets

WarpFlow v1.0: Test Suite Data and Reproducibility Package Lars Backhaus and Jürgen Stamm https://doi.org/10.5281/zenodo.22276867

Model code and software

WarpFlow v1.0: A Single-Source CPU/GPU Shallow-Water Solver for Operational City-Scale Urban Flood Modeling Lars Backhaus and Jürgen Stamm https://doi.org/10.5281/zenodo.22275530

Lars Backhaus and Jürgen Stamm
Metrics will be available soon.
Latest update: 05 Nov 2026
Download
Short summary
Cities need fast, automated flood models to manage rising climate risks using local hardware. We created WarpFlow, an open-source simulation program that models urban surface flooding on standard graphics cards. For the city of Dresden, it simulates a major storm across 365 square kilometers at two-meter resolution in 14 minutes, running 64 times faster than standard processors. This allows local authorities to run real-time flood nowcasts.
Share