Test catalogue
Tests named *_np1, *_np2, *_np4 run on 1, 2 and 4 MPI ranks.
Tests named *_second_order repeat a test with flume.order = 2.
“eps” is the machine epsilon of the build.
Grid, output and time loop
Tests |
What is checked |
|---|---|
|
Plotfile headers and every cell against a closed form: names, step, time, domain, cell size, box coverage, one data file per rank. The defaults of the grid and output keys. |
|
A uniform flow in a periodic domain, or along a channel between walls, is unchanged in every plotfile; step count and times as computed by hand (step 0.0625 s, 16 steps). |
|
Defaults of |
|
A dry domain takes one step to the stop time, also for 10308 s. |
Initial state and water at rest
Tests |
What is checked |
|---|---|
|
Every cell of the initial state against its closed form; a cell centre on the dam belongs to the high side. |
|
A lake at rest that does not cover its sloping bed, in 8 uneven boxes: every cell after three steps; the step is reduced over ranks that hold only dry boxes. |
|
Level surface over a rough bed, 50 steps: unchanged within 16 eps of the surface elevation; with dry islands; with a dry depth of 0.05 m. |
|
The dry depth set to the depth one side of a face presents: the cut is decided once per face and the lake stays at rest (64 eps). |
|
The lake with outflow and wall segments, every value a signalling NaN at the start. |
Wetting and drying
Tests |
What is checked |
|---|---|
|
One column of water between dry cells, to 5 s: no negative depth, mass within 16 eps, no discharge in dry cells. |
|
The closed form of the first step at CFL 1: fluxes scaled by \(3 / (4 n)\), the column ends empty (64 eps). |
|
A depth the outflow limit leaves a rounding error below zero is set to zero. |
|
A film below the dry depth passes no water on; the tolerance acts on the depth at the face, not on the depth of the cell. |
|
A fast film below the dry depth does not set the time step (2 steps; 1130 with a dry depth of 0). |
Dam break and shear
Tests |
What is checked |
|---|---|
|
Wet-bed exact solution at 5 s: L1 errors, constant state, shock position, mass (Verification). |
|
Ritter’s solution: L1 errors, no negative depth, no water beyond the exact front; with a dry depth of 0, a trace below 10-11 of the depth. |
|
The closed form of the first step: pins the dry-bed wave speeds. |
|
Walls one cell apart, narrower than the two ghost layers. |
|
A jump of the tangential velocity carried by a uniform flow: bounded, conserved, within one cell of its place; at most 10 cells wide at order 2. |
|
A dam break over a rough bed between four walls, 20 s: mass within 16 eps, also in boxes two cells and one cell wide. |
Moving shoreline and convergence
Tests |
What is checked |
|---|---|
|
Thacker’s planar and radial solutions on 100 and 200 cells, half a period and three periods: L1 errors, no negative depth, mass. |
|
Simple wave at 1 s on 100, 200 and 400 cells: each bound is below half the error of the run on cells twice as large, so a first-order scheme fails. |
Friction
Tests |
What is checked |
|---|---|
|
Discharge against \(q(t)\) in an inclined periodic channel: transient and steady, slope along x, y and diagonal, starting above the normal discharge, between walls, with another gravity. |
|
A stiff film: 5 steps of 2 s against a friction time of 0.0645 s; a film of uneven depth follows the local Manning discharge within 3e-3. |
|
Friction does not move still water or change the mass. |
Boundaries
Tests |
What is checked |
|---|---|
|
A dry-bed front leaves through an outflow side; Ritter’s solution holds inside. |
|
A shock leaves through an outflow side; the reflected wave is bounded. |
|
One segment and two that meet inside a box give identical plotfiles. |
|
A side that is half outflow, half wall: Ritter’s solution in the open rows, the bore depth in the wall rows. |
|
One box and boxes of one cell give the same cells. |
|
A centre on the first coordinate of a range is in the segment; a centre on the second is not. |
Rasters
Tests |
What is checked |
|---|---|
|
Bilinear interpolation reproduces a plane; edge values are held within half a raster cell of the sides. |
|
A dam break through streets: 256 building cells stay dry, mass within 64 eps; heights and a mask give the same footprints; water goes over low buildings. |
|
Water at rest among and over buildings. |
|
Each row follows \(q(t)\) with its own coefficient; a uniform map equals the scalar key to the last bit; a centre on a raster edge takes the cell above. |
Rain
Tests |
What is checked |
|---|---|
|
Every cell of a flat, closed domain holds the rain fallen, at every plotfile time (4 eps per step); discharges exactly 0. |
|
Rain below the rounding of the depth is kept by the compensated sum. |
|
A dry domain under rain gets a finite step, also from a burst ahead and from a rate of 1e-300 mm/h; discharges of a dry domain are 0. |
|
The volume of a closed basin with moving water grows by the rain fallen. |
|
Depth and outlet discharge against the kinematic-wave solution to 900 s. |
Rain that varies in space
Decks in Tests/RainField, checked by check_rain_field.py, which
computes the rain from the grid files or the cell’s numbers independently of
the solver.
Tests |
What is checked |
|---|---|
|
One step on a closed, flat, dry domain: every cell holds the rain of its area, on grids that share no edge with the solver’s (16 eps). |
|
Grid edges on solver edges, NODATA just outside the domain: no abort, every cell within 32 eps. |
|
Water in the domain to 1200 s equals the integral of three grids, held and linear (4 eps per step). |
|
A grid ahead of the run’s time sets the step of a dry domain. |
|
The moving cell against the closed form: at rest (16 eps), 29 m in one step (1e-11), leaving the domain over 1200 s (volume). |
|
A cell of peak 0 takes one step of 1e7 s and adds no water. |
Infiltration
Decks in Tests/Infiltration, checked by check_infiltration.py, which
computes the closed forms independently of the solver (bisection for the
Green-Ampt equation).
Tests |
What is checked |
|---|---|
|
0.5 m of still water on silt loam for 6 h: every cell against the implicit solution \(K_s t = F - M \ln(1 + F/M)\). |
|
The same water moving on a periodic domain: the velocity is kept. |
|
36 mm/h on dry sandy loam: all rain infiltrates up to \(F_s\) at 1437 s, then ponding (round-off). |
|
CN 75 (\(\lambda = 0.2\)) and CN 65.31 (\(\lambda = 0.05\)) under constant rain: the cumulative loss against the formula. |
|
CN 75 on 2 cm cells, 279217 steps: the loss within a few epsilons, with a bound that does not grow with the steps (compensated sums). |
|
A map of curve numbers with flow and buildings: each cell loses the loss of its own rain; buildings and CN 100 lose nothing. |
|
A sloped, walled domain, second order, hyetograph, conductivity map and buildings: surface water plus infiltrated water equals the rain, to round-off. |
|
A 1 mm film on a soil that could take 28 m in a step: the cell loses exactly its water and holds no discharge. |
|
Rain in the first step only, on cells that infiltration empties: the rain’s negative carry does not take a depth below 0 in the next, dry step, and the water balances. |
Input checks
Tests |
What is checked |
|---|---|
|
At least one test per check in Inputs: missing keys, wrong numbers of values, values out of range, unknown and unused keys, keys that need or exclude each other, fields that are not finite. |
|
Each check of the raster reader, on files in |
|
Each check of the rain inputs and of the hyetograph reader, on files
in |
|
Each infiltration key: ranges, missing and excluded keys, a value with a file, the curve number without rain, and files with values out of range or NODATA cells. |
|
Each check of the index reader and the grids (files in
|
Not repeated at second order: the closed forms of one first-order step, the
lower bound of dam_break_dry_x_no_tolerance, and the draining columns at
CFL 0.8 and 1, which are above the 0.5 that flume.order = 2 allows.