Collapse of 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 → Fr1 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.
∂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
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.
û = (√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
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
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
Що таке число Фруїда і чому воно має значення для рівнянь для неглибоких вод?
Число Фруїда Fr = |u|/c порівнює швидкість потоку u з швидкістю поширення хвилі в неглибоких водах c = √(gh). Fr 1 є надкритичним (стрімким) потоком, де вони не можуть. Fr = 1 позначає гідравлічний стрибок, аналог удару в неглибоких водах.
Чому використовувати приблизний розв’язувач Рімана замість точного розв’язання задачі Рімана?
Точне розв’язання задачі Рімана для рівнянь неглибоких вод вимагає ітеративного нелінійного розв’язку на кожному інтерфейсі комірки, на кожному кроці часу. Лінеаризація Роя замінює її одним лінійним алгебраїчним кроком за допомогою спеціально усередненого стану, що є швидким, консервативним і достатньо точним для інженерних симуляцій повеней та хвиль.
Чому наївні розв’язувачі вибухають на суші?
Коли глибина h наближається до нуля, швидкість поширення хвилі c = √(gh) також наближається до нуля, а швидкість потоку u = hu/h стає діленням на дрібне число, що призводить до величезних або від’ємних глибин. Виправлення включають порогові значення глибини, які розглядають комірки, близькі до сухості, як стіни, лімітери, що зберігають позитивність, які обрізають h після кожного кроку, та гідростатичне реконструктування, яке гарантує невід’ємні глибини за конструкцією.
Спробуйте наживо
Усе, що вище, працює прямо у вашому браузері — відкрийте the simulation і змінюйте параметри під час роботи. Нічого не встановлюється, нічого не завантажується на сервер, уся модель живе в одній вкладці.
▶ Відкрити симуляцію the simulation