HomeArticlesFluid Dynamics

Shallow Water Equations: Dam Breaks, Bores & the Roe Solver

How two conservation laws and a linearised Riemann solver reproduce tsunamis, tidal bores and a broken dam from first principles.

mysimulator teamUpdated July 2026≈ 10 min read▶ Open the simulation

Collapsing 3D flow into two equations

The shallow water equations (also called the Saint-Venant equations) describe a thin layer of fluid whose horizontal extent vastly exceeds its depth — a river, a flooded plain, a tsunami crossing an ocean basin, or the atmosphere's large-scale weather systems. Depth-averaging the full 3D incompressible Navier-Stokes equations under a hydrostatic pressure assumption collapses the whole vertical structure into two conserved quantities per point: depth h and depth-averaged momentum hu.

∂U/∂t + ∂F(U)/∂x = S      U = [h, hu]ᵀ,  F(U) = [hu, hu² + ½gh²]ᵀ
Wave speeds (eigenvalues of the flux Jacobian): λ = u ± c,  c = √(gh)
Froude number: Fr = |u| / c   →  Fr<1 subcritical, Fr>1 supercritical

The celerity c = √(gh) plays the same role as the speed of sound in gas dynamics, and Fr is the direct shallow-water analogue of the Mach number — which is why the same numerical machinery built for compressible aerodynamics carries over almost unchanged.

Roe's approximate Riemann solver

A finite-volume scheme updates each cell from the fluxes at its two interfaces. Computing the flux at an interface between two different states — a "Riemann problem" — has an exact solution, but it is nonlinear and iterative. Philip Roe's 1981 trick is to linearise it: build a specially weighted average state (û, ĉ) from the left and right cells, and solve the resulting linear problem exactly.

û = (√h_L·u_L + √h_R·u_R) / (√h_L + √h_R)     Roe-averaged velocity
ĉ = √( g·(h_L + h_R)/2 )                      Roe-averaged celerity
F_i+½ = ½(F_L + F_R) − ½ Σ |λ̂ₖ| αₖ rₖ          the |λ̂| term is numerical diffusion

That diffusion term is what keeps the scheme stable across a shock — it smears a discontinuity over a few cells instead of oscillating around it — but on its own it is only first-order accurate. MUSCL reconstruction (Monotone Upstream-Centred Schemes for Conservation Laws) recovers second order by extrapolating a limited linear profile within each cell before the Roe solve, using a slope limiter — minmod, van Leer, or superbee — that suppresses the spurious oscillations a naive linear extrapolation would create near a shock.

The CFL condition: how far one step is allowed to travel

Because the scheme is explicit, the timestep cannot outrun the fastest wave in the domain. The Courant-Friedrichs-Lewy condition caps Δt so that information never crosses more than one cell per step:

Δt ≤ CFL · Δx / max(|u| + c)     safe CFL ≈ 0.9 first-order, ≈ 0.5 with MUSCL+RK2
live demo · wave propagation across a free surface● LIVE

The dry-bed problem

Flood simulations routinely have to deal with dry ground, where h → 0. That is dangerous numerically: the celerity c = √(gh) vanishes, velocity u = hu/h becomes a division near zero, and a naive Roe solver can produce negative depths and diverge outright. Practical fixes include a depth threshold that treats near-zero cells as solid walls, a positivity-preserving limiter that clips h ≥ 0 after every step, and — the more rigorous option — hydrostatic reconstruction (Audusse et al., 2004), which reconstructs interface depths from the bed slope so that they are guaranteed non-negative by construction. That same reconstruction also gives the scheme the well-balanced property: a lake at rest with a bumpy bed stays exactly at rest, rather than drifting under numerical noise from imperfectly cancelled flux and source terms.

One equation, many phenomena

The same two-equation system, with different source terms switched on, reproduces a striking range of real flows. A sudden dam-break is almost pure inertia and pressure, splitting into a rarefaction wave racing upstream and a shock-like bore racing downstream — the textbook Riemann problem this article's simulation solves directly. A tidal bore adds bed friction to that same balance. An ocean tsunami is dominated by pressure over enormous length scales, travelling near 200 m/s in deep water. Add the Coriolis term f = 2Ω sin(φ) and the equations describe geostrophic ocean eddies and storm surges, where the Earth's rotation balances the pressure gradient over scales of a hundred kilometres or more.

Frequently asked questions

What is the Froude number and why does it matter for the shallow water equations?

The Froude number Fr = |u|/c compares flow speed u to the shallow-water wave celerity c = √(gh). Fr < 1 is subcritical (tranquil) flow where disturbances can travel upstream; Fr > 1 is supercritical (shooting) flow where they cannot. Fr = 1 marks a hydraulic jump, the shallow-water analogue of a shock.

Why use an approximate Riemann solver instead of solving the Riemann problem exactly?

The exact Riemann problem for the shallow water equations requires an iterative nonlinear solve at every cell interface, every timestep. Roe's linearisation replaces it with a single linear algebra step using a specially averaged state, which is fast, conservative, and accurate enough for engineering flood and wave simulations.

Why do naive solvers blow up on a dry bed?

As depth h approaches zero, the wave celerity c = √(gh) also approaches zero, and velocity u = hu/h becomes a division by a vanishingly small number, producing huge or negative depths. Fixes include depth thresholds that treat near-dry cells as walls, positivity-preserving limiters that clip h after each step, and hydrostatic reconstruction that guarantees non-negative depths by construction.

Try it live

Run the dam-break Riemann problem yourself in Shallow Water Equations, switch to sloshing, tidal inflow or a hydraulic step, and watch the Froude number and mass conservation tracked live as the Lax-Friedrichs scheme advances the state.

▶ Open Shallow Water Equations simulation

What did you find?

Add reproduction steps (optional)