Skip to content
SHD Sim
Menu

Validation/Free-surface flow

A tank of water that should not move

A closed tank of water under gravity, which should stay exactly still — the standard test of whether pressure and gravity are discretised consistently.

VerificationSpurious current in the water 2.6130 × 10⁻³ m/s — 0.132 % of √(gh), against an exact zero

Why this case

The free-surface family — volume-of-fluid, and one of the most used solvers in the product — had no reference behind it of any kind. This case gives it the one reference that needs nothing fetched, nothing transcribed and nothing fitted: a closed tank of water under gravity, left alone, does not move.

Written out, the exact answer is four numbers known in advance to unlimited precision. The velocity is zero. The surface is where it was put. The volume is what was put in. And the phase fraction is 0 or 1 with nothing in between.

That is not a trivial thing to ask for. It is the standard test of whether the pressure and gravity terms are discretised consistently — well balanced, in the shallow-water literature. A scheme that is not turns the hydrostatic pressure gradient into a force out of nothing, and the tank develops a slow circulation. The failure mode is dangerous precisely because it looks reasonable: a gentle current in a tank of water is what most people would expect a picture to show.

PhysicsTwo-phase incompressible volume-of-fluid, water under air, no inflow
Tank1 × 0.8 × 0.4 m, closed, filled with water to 0.4 m
Gravity9.81 m/s² down the y axis
MeshTwo: 28 × 22 × 11 (6776 cells) and 40 × 32 × 16 (20 480 cells)
TimeTo 0.5 s — several gravity-wave crossing times of the tank
Velocity scale√(g h) = 1.9809088823 m/s, with h the 0.4 m fill depth
ReferenceHydrostatic equilibrium: velocity exactly zero, the surface exactly where it was put, the volume exactly what was put in, and the phase fraction exactly 0 or 1
AgreementLargest current in the water 2.6130 × 10⁻³ m/s — 0.132 % of √(g h), against an exact zero

The exact solution

There is no algebra to do. Set the velocity to zero in the momentum equation and every convective and viscous term vanishes with it, leaving

    grad(p) = rho g        with rho = alpha rho_water + (1 - alpha) rho_air

which is satisfied identically by the initial state, for ever. The reference is therefore the initial condition itself, and it carries no constants, no correlation and no experimental scatter. What the case measures is how far the discretised equations drift away from a state their continuous form holds exactly.

That is also the honest description of the weakness in the case, and it is dealt with in its own section below: a check whose right answer is zero is passed by a solver that computed nothing at all.

Two fluids, and only one of them is under test

This is the distinction the whole case turns on, and it is the reason the numbers on this page are quoted for the water separately.

The largest velocity anywhere in the domain on the product’s own mesh is 0.11374 m/s, which is 5.742 % of √(g h) and reads as a bad failure. It is in the air, at a corner near the surface. In the water the largest velocity is 2.6130 × 10⁻³ m/s, 0.132 % of the same scale, and the mean over all 10 240 water cells is 2.266 × 10⁻⁵ m/s — 0.00114 %.

Air moving above a still pool is air. A check that took the maximum over the whole domain would report this product as five per cent wrong at a case it solves essentially exactly, and send somebody after a defect that is not there. The air figure is printed every time the judge runs and is deliberately not judged. The test that proves the judge really is reading only the water re-runs the accepted result with the velocity band set to 3 % — above the water’s 0.132 % and below the air’s 5.742 % — and requires it still to pass.

Result

Two meshes, half a second, against a state that should not have changed at all
MeshCellsWater volume (m³)vs exact 0.16Surface levelWater max |U|Air max |U|
28 × 22 × 1167760.1600000000002+1.2 × 10⁻¹⁰ %0.02138 %0.1475 %8.676 %
40 × 32 × 1620 4800.1600000000259+1.6 × 10⁻⁸ %0.00719 %0.1319 %5.742 %
Volumes and velocities are from the fixture. The surface-level column is the worst departure of the free surface from the 0.4 m it was put at, as a percentage of that depth; the velocity columns are percentages of √(g h) = 1.98091 m/s. The air column is reported and not judged.

The volume is the tightest of the three. Nothing enters or leaves a closed tank, so any movement at all is the phase-fraction limiter losing or making water, and the limiter conserves it to round-off: the finer mesh ends with 0.16000000002591 m³ of the 0.16000000000000 m³ it was given.

The surface stays flat. On the finer mesh it runs from 0.39997126 to 0.40001561 m against the 0.4 m it was put at — a 44 µm spread across a metre of tank, on cells 25 mm tall. On the coarser mesh it runs 0.39991446 to 0.40000860 m. Both meshes are inside a tenth of a cell.

The phase fraction stays bounded. On the finer mesh it spans −9.9214153 × 10⁻¹⁸ to 1.0002561, and on the coarser one 7.5269552 × 10⁻⁵⁴ to 1.0001155. The overshoot above one is real, it is two and a half parts in ten thousand, and it does not grow with refinement.

Neither mesh is a refinement study, and the case does not present one. Nothing is supposed to happen here, so there is no error to converge — the second mesh is there to say the first answer is not an accident of one particular cell size.

Agreeing with zero, and what stops that being empty

What this page does not establish

  • Nothing that moves has been verified here. This case establishes that the pressure and gravity terms are discretised consistently — that the solver does not invent a current. It says nothing about whether a wave, a sloshing tank or a breaking interface is computed correctly. The reference is exact because nothing happens, and that is also its ceiling.
  • The air is measured and not judged. Its 5.742 % of √(g h) is a real number in the run and it is reported on this page rather than filtered out. What the case does not do is say whether that velocity is right, because a still-tank reference has nothing to say about the gas above the pool.
  • The alpha overshoot above one is bounded, not explained. 1.0002561 on the finer mesh and 1.0001155 on the coarser one. It is inside the band and it does not grow, and this page does not claim to know which term produces it.
  • Half a second, and two meshes. Long enough for several gravity-wave crossings of the tank, and not a statement about what a much longer run drifts to. There is no time-refinement study on this page either.

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.