The HydraClims site, in development (plan/09). Fig. 1 is drawn from the New Orleans example's 2 m lidar. The speed bars come from the project's records, and the button measures this computer.

Theme
HydraClimsHydrology, Hydrodynamics and Climate Resilience SolutionsBuild a new model

Home / Method

Method

What HydraClims computes, how it computes it, and why the graphics card is what makes a fine grid affordable.

1Equations

Depth-averaged flow on a grid of square cells.

HydraClims solves the two-dimensional shallow-water equations: water depth and the two components of its flow, in every cell, as they change with time. They hold where water is much wider than it is deep, which covers rivers, floodplains, streets, surges and long waves.

∂h/∂t + ∂(hu)/∂x + ∂(hv)/∂y = r
∂(hu)/∂t + ∂(hu² + ½gh²)/∂x + ∂(huv)/∂y = −gh ∂z/∂x − g n² u|u| / h1/3
∂(hv)/∂t + ∂(huv)/∂x + ∂(hv² + ½gh²)/∂y = −gh ∂z/∂y − g n² v|u| / h1/3

h depth, u and v velocity, z ground level, g gravity, n Manning's roughness, r rain and inflow per unit area. Wind stress, Coriolis and a turbulence closure add terms when a study needs them.

2Resolution

Resolution is what 2D models trade away.

Water follows streets, walls, channels and embankments a few metres wide, and a grid sees only what is wider than its cells. Halve the cell size and there are four times as many cells. Each time step must also be half as long, so the work grows about eight times.

On a processor, that cost pushes studies to coarser grids and fewer scenarios. A graphics card updates thousands of cells at the same moment, because each cell needs only its neighbours.

Cell size
Cell size

Fig. 1One city block beside a canal, at four cell sizes, each averaged from the same 1 m terrain (made up for this figure, like the New Orleans case). Profile A crosses the canal and its 1 m floodwall, profile B a road embankment. The thin line is the 1 m terrain, the thick line what the grid sees, the blue dashes the canal's water level.
3The GPU

Hundreds of millions of cell updates a second, in a browser.

The model runs through WebGPU, the graphics interface built into Chrome and Edge. It needs no driver install and no account, and the data never leave the computer.

The solver's measured speed

256² to 1024² cells610–700
2048² cells (4.2 million)406–474
This computernot measured
0200400600800million/s

Your GPU

Run FluxCell for about four seconds on this computer's GPU, and see how long the two examples would take here. Nothing is sent anywhere.

Not measured yet. The measurement needs Chrome or Edge, and the site served by HydraClims.

Fig. 2Throughput of FluxCell's fused kernel in millions of cell updates a second, measured with GPU timestamp queries on a built-in Intel GPU (xe-2lpg) shared with the desktop. Source: docs/VERIFICATION.md §7. Other GPUs haven't been measured yet. The measurement on this computer is timed by the page rather than on the GPU, so it also counts the browser's overhead and anything else using the GPU, and comes out lower on the same hardware.
4A run

Every run checks itself and keeps its own record.

While a run goes, the map, the gauges, the flooded area and the water balance update in the page. The water balance compares the water in the model now, less the water at the start, with what came in and what left. It is the first thing to read when a result looks wrong.

Each run is saved with an exact copy of its setup, the GPU it ran on and its timings, so it can be run again and compared with another.

5How it's built

Two parts, both on your computer.

The app is a set of web pages, and the model runs inside them on the GPU. A small helper does the work that needs files and geodata: downloads, grids, maps and reports. Only data downloads and map tiles use the internet.

Build a new model, at the top of every page, opens the app on your computer at 127.0.0.1:8090/app/, once HydraClims.cmd has started it.

This computer Internet: data downloads and map tiles only In the browser Setup, Runs, Analysis, Report FluxCell solver on the GPU Live checks, charts, maps, 3D WebGPU · Chrome or Edge The helper Downloads, grids, maps Statistics, exports, reports The run queue Python · 127.0.0.1 Files on disk The setup of each study Frames, maxima, gauges Each run's inputs, GPU, timings projects/
Fig. 3The parts of HydraClims and where each one runs.

Built on FluxCell

FluxCell is a shallow-water solver for WebGPU from the HydroInformatics Lab at Tulane University, released under the MIT licence. HydraClims adds Setup, Runs, Analysis and Report around it. How to cite it.