Skip to content
SHD Sim
Menu

Validation/Shallow water

A dam break

An idealised dam break has a closed form, so there is nothing to argue about — including the depth at the dam itself, which is exactly four ninths of the reservoir, whatever the reservoir is.

VerificationDepth at the dam 0.4451 against an exact 0.4444, error falling under refinement

Why this case

The shallow-water solver had no reference behind it at all. This case gives it one, and like the shock tube the reference is arithmetic rather than somebody else’s experiment: an ideal dam break over a flat, frictionless bed has a closed-form answer, so there is nothing to transcribe from a paper and nothing that can be mis-transcribed.

It also has a number a reader can check without running anything. Whatever the reservoir depth, the water directly over the dam site settles instantly at exactly four ninths of it, and stays there.

PhysicsShallow water — depth-averaged, inviscid, flat bed, no friction
ReservoirStill water 1.0 m deep to the left of a dam at x = 0
DownstreamA thin film 0.001 m deep — see the caveat below
Gravity9.81 m/s²
Domain±10.0 m, compared at t = 1.0 s
MeshThree uniform meshes: 200, 400 and 800 cells, so 0.1, 0.05 and 0.025 m
ReferenceRitter (1892) for the fan, exactly; Stoker for the whole domain — Ritter (1892), Zeitschrift des Vereines deutscher Ingenieure 36, 947–954
AgreementDepth at the dam 0.44507931 m against an exact 0.44444444 m on the finest mesh

The exact solution

Water at rest, depth h₀ to the left of a dam at x = 0, the dam removed at t = 0. With c₀ = √(g h₀) the state depends on x and t only through the similarity variable s = x/t:

Ritter (1892)

    s <= -c0        h = h0                      u = 0
    -c0 < s < 2c0   h = (2c0 - s)^2 / (9 g)     u = (2/3)(s + c0)
    s >= 2c0        h = 0                       u = 0

The harness derives it rather than quoting it: the fan is the simple wave on which the Riemann invariant u + 2c is constant at its upstream value 2c₀, and on which the other characteristic speed u − c equals s. Solving those two together gives the formulae above, and a self-check confirms the result satisfies the shallow-water equations in similarity form to machine precision.

Putting s = 0 into the middle line gives the two numbers this page is measured on:

The exact state over the dam site, from Ritter
QuantityExact value
Depth at x = 00.44444444 m — exactly 4h₀/9
Velocity at x = 02.08806130 m/s
Wave speed c₀ = √(g h₀)3.13209195 m/s
Front, at 2c₀6.26418391 m/s — so x = 6.264 m at t = 1 s
Read out of the fixture the harness writes; the depth is the closed form 4h₀/9 with h₀ = 1 m.

The bed is dry, and the solver cannot run a dry bed

This is the one place where the reference and the product are solving different problems, and it is stated rather than tuned away.

Stoker's solution for the wet bed actually run, h₁ = 0.001 m
FeatureValue
Fan head, x/t−3.13209195
Fan tail, x/t+3.83510968
Shock, x/t+4.71535884
Plateau depth h₂0.06682978 m
Plateau velocity u₂4.64480109 m/s
Plateau wave speed c₂0.80969141 m/s
Also from the fixture. The fan head is at −c₀, the same as Ritter's; the fan tail is where the two solutions part company.

Ritter’s other two assumptions do hold here exactly, and the harness asserts both rather than assuming them. The solver has no friction term at all — no Manning, no Chézy, no Laplacian in its momentum equation — so there is nothing to switch off. And the bed elevation is an optional field the product does not write, so the bed is flat; the harness refuses to continue if one ever appears, and keeps a separate fixture showing what a sloping bed looks like. Coriolis is off in the staged gravity properties, and that is asserted too.

Result

Depth and velocity over the dam site against Ritter, on three meshes
CellsCell sizeDepth at x = 0 (m)vs 4h₀/9Velocity at x = 0 (m/s)vs exact
2000.1 m0.44587633+0.322 %2.0824862−0.267 %
4000.05 m0.44525011+0.181 %2.0840715−0.191 %
8000.025 m0.44507931+0.143 %2.0848160−0.155 %
Depths and velocities are the fixture's own; the per-cent columns are those numbers against the exact 0.44444444 m and 2.08806130 m/s in the table above.
Depth at the dam on three meshes, falling towards the exact four-ninths line
The depth directly over the dam site on each of the three meshes, against Ritter’s exact 4h₀/9. Both axes are read out of the fixture; the exact line is 4/9 of the 1 m reservoir.

Mesh refinement

One agreeing depth is one number that happens to be close. What makes this verification is that the error over the fan falls when the mesh is refined.

Error norms on three meshes
CellsCells in the fanL1 in h over the fanL∞ in h over the fanL1 in u over the fanL1 in h over the whole domain
200694.021 × 10⁻³2.277 × 10⁻²1.774 × 10⁻²2.374 × 10⁻³
4001402.400 × 10⁻³2.196 × 10⁻²1.230 × 10⁻²1.229 × 10⁻³
8002781.503 × 10⁻³1.614 × 10⁻²8.234 × 10⁻³8.573 × 10⁻⁴
The fan norms are against Ritter, which is exact there. The whole-domain norm is against Stoker, which is the problem the solver is actually being given.
Observed order of convergence between successive meshes
MeshesDepth over the fanVelocity over the fan
200 → 4000.7440.529
400 → 8000.6750.579

The order sits below one, and that is the expected behaviour rather than a shortcoming: this solution has a shock in it, and a shock reduces any scheme to first order locally. The fan norm still falls monotonically on both fields and on every pair of meshes.

What this page does not establish

Three things, and none of them is hidden in the numbers above.

  • Ritter’s dry bed has not been run, and cannot be. The solver cannot construct a velocity where the depth is zero. Every number here is from a case with a 1 mm film downstream, and the whole-domain solution for that case is Stoker’s, not Ritter’s. Ritter is exact only over the fan, and that is the only place the headline error is taken.
  • The shock is not what this case verifies. Its position on the three meshes is 4.550, 4.625 and 4.6625 m against Stoker’s 4.71535884 m at t = 1 s — 3.5 %, 1.9 % and 1.1 % short. It is approaching the right place under refinement, but a shock position resolved to a cell width on a 0.025 m mesh is a capture measurement, not an accuracy one, and it is reported here rather than claimed as agreement.
  • Nothing is established about friction, a sloping bed or Coriolis. All three are absent from this case by construction, which is what makes the reference exact. A real dam break has all of them.

Repeat this yourself

Every case here is set up from the worked examples in the product, with no hand-editing of solver files — so you can run it, and get the same numbers. The free tier runs real cases up to 250,000 cells of fluids, or 100,000 nodes of solid, with no account needed to download and no time limit.

All validation cases · Written by the team building SHD Sim.