Home / Method
Method
What HydraClims computes, how it computes it, and why the graphics card is what makes a fine grid affordable.
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.
∂(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.
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.
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
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.
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.
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.
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.