The groundwater engine and several other tools of OGR Slip2D are checked against results that admit no approximation: a closed-form solution, an identity that has to hold exactly, or a requirement of consistency.
Each check has an exact target, or one that can be computed independently (Section 4.1.2). Required is the tolerance written in the test; obtained is the value of the quantity that the test asserts, measured by running the model of the test in version 0.1.235. The file of each test is linked in its section, and each can be run on its own (Section 4.1.7).
4.3.1The checks at a glance#
| Check | Reference | Required | Obtained |
|---|---|---|---|
| Confined flow | Darcy's law: linear head, | Heads within 10−9 m; flow within 10−6 | 8×10−14 m; 2×10−15 |
| Layered media | Harmonic mean (series), arithmetic mean (parallel) | Flow within 10−4 and 10−3 | 1×10−12; 1×10−14 |
| Anisotropy | Patch test with | Heads within 10−9 m; velocities within 10−6 | 2×10−14 m; 4×10−14 |
| Transient flow | Complementary error function | Within 1 % of the head step | 0.11 % |
| Long time | The steady state | Heads within 0.05 m | 3×10−7 m |
| Finite-element mesh | Area of the regions | Within 10−6 m² | 0 |
| Support back analysis | Active = passive at | Difference below 10−6 | 0 |
| Hoek–Brown constants | GSI = 100: , , | 10−9, 10−9, 10−3 | exact |
| DXF round trip | The shape is kept | Area within 10−9; vertices within 10−6 m | 0; 4×10−15 m |
| Rectangular dam | Discharge of Dupuit and Charnyi | Error falls to below 5 % as sharpens | 34 % to 1.8 % |
| Retention curve | Derivative of | Within 10−3 | 9×10−9 |
| Rapid drawdown | Morgenstern (1963) | Within 6 % of 1.20; worst at the total drawdown | 1.2103 (+0.86 %) |
The checks run in the test suite, and the tests behind this page can be run on their own, from a clone of the repository: python tests/_runner.py seepage_v126 transient_v130 mesh_v125 for the first six rows, and the file named in each section for the others. Several groundwater checks are made twice: on the solver, and through the operations layer ogr_api, whose operations the MCP server publishes as tools (Section 5.3), so that the numbers an agent receives are the verified ones.
4.3.2Confined flow: Darcy's law in one dimension#
In a confined, saturated layer between two edges with prescribed heads and no flow across the other boundaries, the head is linear and the discharge follows the law of Darcy (1856):
where
- total heads prescribed at and (m)
- conductivity of the layer (m/s)
- thickness of the layer, across the flow (m)
- discharge per unit length of the section (m²/s)
- pore pressure (kPa), unit weight of water (kN/m³) and elevation (m)
A linear head belongs to the space of the linear triangles, so the finite-element solution of this problem is exact up to round-off whatever the mesh; any fault in the assembly, in the boundary conditions or in the computation of the flow shows as a difference.
| Test of the solver | Test through the operations layer | |
|---|---|---|
| Model | Rectangle L = 20 m by h = 10 m; K = 1×10−5 m/s; H0 = 10 m, H1 = 4 m | Rectangle 20 m by 10 m; K = 1×10−5 m/s; H0 = 15 m, H1 = 12 m |
| Mesh | Linear triangles, target size 1.2 m | Target of 400 elements |
| Closed form | Q = 3×10−5 m²/s | Q = 1.5×10−5 m²/s |
| Required | Head within 10−9 m at every node; discharge through the middle section within 10−6; the same discharge, within 10−6, through the sections x = 2, 6, 10, 14 and 18 m; pressure head equal to H − y to 10−12 m | Head within 10−6 m at four points and u within 10−5 kPa; discharge through three sections within 10−6; the sign of the flow follows the orientation of the section |
| Obtained | Head 7.9×10−14 m; discharge 2.0×10−15; sections 7.3×10−14 | Passes |
The solver imposes the prescribed heads by elimination and computes the discharge through any segment of the model (Section 3.7.3). The second test builds the same box through the operations mesh_generate, seepage_bc_set and groundwater_run, and shows, besides, that the conductivity set by hydraulic_set is the one the solver reads.
4.3.3Layered media: harmonic and arithmetic means#
Two layers of conductivities and give two limiting cases, both consequences of Darcy's law and of continuity. When the flow crosses the layers, in series, the same discharge passes through each of them and the head losses add up, which gives the harmonic mean of the conductivities; when it runs along them, in parallel, every layer sees the same head and the discharges add up, which gives the arithmetic mean:
where
- length of layer along the flow, with (m)
- thickness of layer across the flow, with (m)
- hydraulic resistance of layer (s)
- head at the interface of two layers in series (m)
The check uses a contrast of 100, which puts the numerical method under stress: almost the whole head loss has to take place in the layer of low conductivity, and the flow has to be conserved across the interface.
| Test of the solver | Test through the operations layer | |
|---|---|---|
| Model | Box 20 m by 10 m; K1 = 1×10−4 and K2 = 1×10−6 m/s; H0 = 10 m, H1 = 4 m; mesh of 0.9 m | Box 20 m by 10 m; K = 1×10−5 and 4×10−5 m/s; H0 = 15 m, H1 = 12 m |
| In series | Two layers 10 m wide, side by side; discharge through x = 5 m; Q = 5.94×10−6 m²/s | Two layers 10 m wide; discharge through x = 5 m, and head at the interface |
| In parallel | Two layers 5 m thick, one above the other; discharge through x = 10 m; Q = 1.515×10−4 m²/s | Two layers 5 m thick; discharge through x = 10 m |
| Required | Discharge within 10−4 in series and 10−3 in parallel; the flow through six sections on both sides of the interface equal within 10−4; the head loss in the layer of low conductivity more than 90 times that in the other (the exact ratio is K1/K2 = 100) | Discharge within 10−6, in series and in parallel; head at the interface within 10−6 m of Hint |
| Obtained | Series 1.0×10−12; parallel 1.2×10−14; sections 1.3×10−12; ratio of head losses 100.0000000000 | Passes |
Each layer is a material region with its own hydraulic properties, and the mesh is built region by region, so that the elements do not cross the interface and its nodes are shared (Section 3.7.4).
Source: tests/test_seepage_v126.py · tests/test_groundwater_ops_v1200.py4.3.4Anisotropy: the patch test with a full tensor#
The conductivity of a material is a tensor whose principal values and are rotated by the angle of from the axis, which gives (Eq. (3.7.5)). A linear field of head satisfies the steady equation for any constant tensor, since its gradient is constant:
If that field is prescribed on the whole boundary, the finite-element solution has to reproduce it at every node, and the Darcy velocity has to be the constant vector of Eq. (4.3.4) in every element. It is the patch test of an element. With it exercises the rotation of the tensor and the cross terms of the element matrix, which isotropic cases cannot, and so it checks both the rotation and the Galerkin assembly.
| Principal conductivity | Ratio | Angle | Cross term |
|---|---|---|---|
| K1 = 1×10−5 m/s | K2/K1 = 1 | 0° | |
| K1 = 1×10−5 m/s | K2/K1 = 0.25 | 0° | |
| K1 = 1×10−5 m/s | K2/K1 = 0.25 | 45° | |
| K1 = 2×10−4 m/s | K2/K1 = 0.1 | 30° | |
| K1 = 5×10−6 m/s | K2/K1 = 4 | −60° |
Required. The head within 10−9 m at every node, for the five tensors; the velocity of every element within 10−6 of the exact one, relative to its larger component; and, for the isotropic case, the magnitude of the gradient equal to within 10−9. Obtained. Heads within 2.5×10−14 m and velocities within 3.6×10−14, for all five.
The tensor is built from Saturated permeability Ks, K2 / K1 and K1 angle (deg from +X) of the material, and in the unsaturated zone the whole tensor is multiplied by , so that the ratio and the direction are kept (Section 3.7.2). The tests also check that the tensor is positive definite and that its trace does not change with the rotation.
Source: tests/test_seepage_v126.py · ogr_core/hydraulic/hydraulic_properties.py4.3.5Transient flow: the response to a step in head#
In a confined, fully saturated aquifer the transient equation reduces to the diffusion equation, with the hydraulic diffusivity , where is the specific storage. For a semi-infinite aquifer at the uniform head , whose boundary at is raised to at , the solution is the classical profile of the complementary error function (Carslaw & Jaeger, 1959):
The front advances as . The solution holds only while the front is far from the other end of the aquifer, and it is the analytical solution, not the solver, that stops applying beyond that: the test compares only where the semi-infinite assumption holds.
| Item | Data |
|---|---|
| Model | Strip 50 m by 5 m; m/s; m−1, so that m²/s; no flow across the long edges |
| Heads | Initially m; the left edge is raised to m, the right edge stays at 100 m (high enough to stay saturated everywhere) |
| Numerics | Mesh of 1.0 m; 150 time steps; Picard iteration with a tolerance of 10−9 and at most 12 iterations; times and s |
| Compared nodes | At mid-height (within 0.6 m of it), for : up to 8.94 m at (16 nodes) and up to 20 m at (38 nodes) |
| Required | The largest difference from the closed form below 1 % of the head step , that is, 0.1 m |
| Obtained | 0.109 % at ; 0.097 % at |
The same file checks that the front advances with time and that a storage ten times larger delays it. The same aquifer is built through the operations layer, with the same bound of 1 % at the same two times, and a third time of 106 s has to reproduce the linear steady profile within 10−3 of the head step.
The transient solver integrates the mixed form of Richards' equation in time with a modified Picard iteration, by stages (Section 3.7.8). In a saturated zone the storage is the elastic specific storage , which is what keeps the system from collapsing onto the steady state.
Source: tests/test_transient_v130.py · tests/test_groundwater_ops_v1200.py4.3.6Long time: the steady state#
As time goes on the stored water stops changing, and the transient solution has to approach the steady solution of the same boundary conditions, which is that of Eq. (3.7.4):
The unsaturated steady problem has no closed form, so this is a check of consistency and not of a closed form: it ties the transient scheme to the steady solver, which is itself checked against the exact discharge of a rectangular dam (Section 4.3.11).
Model. A rectangle 20 m by 12 m, with a mesh of 0.9 m. The permeability function is Gardner's, with m/s, and ; the retention curve is van Genuchten's, with m−1 and , and ; the specific storage is m−1. At the start the head is 10 m on both sides; the final conditions are 10 m on the left and 3 m on the right, prescribed up to those levels and free above them. The solution after a single stage of 109 s is compared with the steady solution of the final conditions, computed by the unsaturated steady solver (relaxation 0.4, at most 200 iterations, tolerance 10−6).
Required. The largest difference of total head between the two solutions below 0.05 m. Obtained. 2.8×10−7 m. Through the operations layer, the confined aquifer of the previous section at s has to lie within 10−3 of the head step, 0.01 m, of its linear steady profile. A further test requires that draining lowers the stored water monotonically.
Test: tests/test_transient_v130.py, TestAsymptoticConsistency.
4.3.7The finite-element mesh keeps the area#
A conforming mesh of linear triangles that covers a region exactly has to add up to the area of the region:
The identity fails if the mesh has gaps, overlaps or triangles that leave the domain, so none of these faults can pass it. It is checked on three models:
- a square of 10 m by 10 m, with a target element size of 1.5 m: 100 m²;
- two squares stacked and sharing an edge, which exercise the conformity of the interface between two regions: 200 m²;
- a slope of the test suite with three material regions, at target numbers of 200, 800 and 2 000 elements: the total area must be the same at every refinement and equal to the area of the regions as the program computes it.
Required. A difference below 10−6 m² in each case, and a spread of the areas below 10−6 m² across the three refinements. Obtained. No difference at floating-point precision in any of them. The same file checks that no edge is shared by more than two elements, that no element crosses the interface between regions and that the nodes of a shared edge are shared, that every element has a positive area and is numbered anticlockwise, that the smallest angle stays above 20° on the square and above 15° on the slope, and that the shape functions reproduce a linear field exactly: the gradient of comes out right within 10−6.
The mesh is built region by region, and the nodes of an edge shared by two regions are shared by both, so the mesh conforms across interfaces by construction (Section 3.7.4).
Source: tests/test_mesh_v125.py · ogr_fem2d/mesh/mesh.py4.3.8Support back analysis: active and passive forces coincide at a factor of 1#
The back analysis fixes the factor of safety at a target and solves for the horizontal force that has to be added to reach it (Section 3.10.6). With and the resisting and the driving sums of the method, evaluated at , and the arm factor of that section,
so that the two assumptions give the same force at , whatever the slope, the surface and the method, and the passive force is the larger one for any target above 1 when a force is needed. The identity would break under almost any algebraic slip, because and are the same expression. The force is zero when is the factor of safety of the surface without support.
Models. In the test of the engine, a slope of the test suite with three material regions, the circle with centre (88.0, 70.5) m and radius 47.212 m, 25 slices, Bishop's simplified method and the force applied at an elevation of 25 m. In the test through the operations layer, the operation back_analysis_run on a slope 10 m high at 1V:2H ( kPa, , kN/m³) with a grid search of 3 × 3 intervals, a target of 1.0 and the force at an elevation of 5 m.
Required. At , a difference between the active and the passive force below 10−6 (in the units of force per unit length), in both tests. In the test of the engine, also: a passive force above the active one for targets of 1.2, 1.5 and 2.0; a force that grows with the target (1.0, 1.2, 1.4, 1.6); and a force of zero, not negative, for a target the surface already exceeds, with less than 1 kN/m at the unsupported factor itself. Obtained. A difference of 0 at , and a ratio of 1.2, 1.5 and 2.0 for those targets, to within 4×10−16.
The back analysis supports Bishop's simplified method, on circular surfaces, and Janbu's simplified and corrected methods; every other method is refused. The elevation of the force changes the result of Bishop's method, whose moments depend on the arm, and does not change that of Janbu's, whose force balance does not, and both properties are tested. The calculation does not use or alter the results of the stability analysis.
Source: tests/test_back_analysis_v140.py · tests/test_f3b_ops_v1201.py · ogr_slip2d/back_analysis.py4.3.9Hoek–Brown constants for intact rock#
The Parameter Calculator derives the constants of the generalised Hoek–Brown criterion from the Geological Strength Index, the intact-rock constant and the disturbance factor (Hoek, Carranza-Torres & Corkum, 2002; Eq. (3.5.14) and Eq. (3.5.15)):
For and the exponents of and vanish, and the two exponentials of are the same number, so the rock mass reduces to the intact rock: , and , exactly.
Required. For , and : within 10−9 of 10, within 10−9 of 1 and within 10−3 of 0.5. Obtained. Exactly 10, 1 and 0.5. A second test uses a value of Hoek et al. (2002): for , and the constants are within 10−3, within 10−5 and within 10−3, and the program gives 1.67677, 0.0038659 and 0.50573. A further test goes through the button of the material dialog and checks, in closed form against , the value of that arrives in the material, and not only the value the calculator shows; a low GSI, whose is very small, has to arrive whole.
The calculator clamps GSI to 0–100, and to 1.999, where would become undefined, and says so in a note instead of returning an infinite constant; both clamps are tested (Section 2.3.2).
Source: tests/test_m6_v157.py · tests/test_gsi_calculator_write_v1192.py · ogr_core/materials/parameter_calculator.py4.3.10DXF round trip#
A model exported to DXF and imported again has to come back as the same geometry. Stated precisely, the drawing is not vertex for vertex identical, and it should not be: the importer splits the boundaries at their crossings, so the external boundary gains nodes where a material boundary or a water line meets it. What has to hold is that the shape is unchanged:
- the enclosed area is the same, with ;
- every original vertex is still present;
- every added vertex lies on an original segment.
That is stronger than asking for identical lists, because it still catches a coordinate that is moved, dropped or rounded.
Model. A slope of the test suite whose external boundary has eight vertices, with two material boundaries and a water table from (0, 32) to (120, 22), exported in metres and imported with a welding tolerance of 0.05 % and no simplification; the area is also checked after a round trip in millimetres. Required. The same boundary types and counts; a relative difference of the enclosed area below 10−9; every original vertex present, matched to 10−6; every added vertex within 10−6 m of an original segment; the material boundaries unchanged to nine decimals; the closed or open character of each boundary kept; and the regions still buildable. Obtained. A difference of area of 0, in metres and in millimetres, and an external boundary that goes from 8 to 13 vertices, the five added vertices at up to 4×10−15 m from the original outline.
The geometry goes to layers that the importer recognises (OGR_EXTERNAL, OGR_MATERIAL, OGR_WATER_TABLE and the others) and the drawings of results go to layers whose name starts with OGR_X_, which the importer ignores, so that re-importing cannot turn a load arrow into a material boundary; a test checks the layer contract and the units recorded in the header (Section 2.2.5).
4.3.11A rectangular dam: the discharge of Dupuit and Charnyi#
For flow through a rectangular dam of width on an impervious base, with an upstream level and a downstream level above the base, the discharge per unit length is the following expression (Charnyi's result, which is also the discharge of Dupuit's approximation), provided that the zone above the free surface does not conduct:
The unsaturated formulation of OGR Slip2D lets that zone conduct, so the computed discharge is expected to be higher. Making the permeability function sharper has to drive it, monotonically, down to the closed form; the test checks that convergence, which validates the solver and accounts for the excess.
Model. A dam 20 m wide and 12 m high on an impervious base, m/s, m on the left face and m on the right; the crest and the faces above the water levels carry the condition of a possible seepage face; mesh of 0.6 m; the discharge through the vertical section in the middle of the dam. The closed form is m²/s. The permeability function is that of Gardner (1958), with a floor of , in four increasingly sharp versions, listed in Table 4.3.6.
| Gardner parameters | Discharge | Difference |
|---|---|---|
| a = 0.05, n = 2 | 3.213×10−5 m²/s | +33.9 % |
| a = 1, n = 3 | 2.758×10−5 m²/s | +14.9 % |
| a = 50, n = 4 | 2.533×10−5 m²/s | +5.5 % |
| a = 104, n = 5 | 2.443×10−5 m²/s | +1.8 % |
Required. The difference decreases as the function sharpens (a rise of up to 10−3 between consecutive cases is tolerated) and the sharpest case falls below 5 %. The same file requires that the free surface leaves the downstream face above the tail-water level and below the upstream one, that it starts near the upstream head, that it descends monotonically, allowing for the noise of the discrete trace, and that the nodes of the seepage face are reported. Through the operations layer the same dam, with the sharpest function, has to give the closed form within 5 %.
The free surface is the line of the solution, and the seepage face is found by nodal switching, with a hysteresis band and a budget of switches per node so that the iteration does not chatter (Section 3.7.6).
Source: tests/test_unsaturated_v127.py · tests/test_groundwater_ops_v1200.py4.3.12The retention curve and its derivative#
The retention curve of van Genuchten (1980) gives the water content as a function of the suction head , and its derivative is the specific moisture capacity that appears as the storage term of the unsaturated zone (Eq. (3.7.15)):
Both hold for ; where the soil is saturated, and . Model. , , m−1 and . Required. within 10−12 at zero suction and for positive pore pressure, and below 0.09 at a suction of 106 m; and the analytical capacity within 10−3, in relative terms, of the central difference of the curve (relative step of 10−4) at and 150 m. Obtained. Differences of 1.6×10−10, 2.0×10−9, 4.0×10−9 and 9.4×10−9, and at 106 m. The same file checks that the storage content is the integral of the storage in both zones, to within 1 %, which is what keeps the modified Picard scheme valid across the water table.
The retention curve of van Genuchten is used with every permeability model: the permeability function governs how fast the water moves, and the retention curve how much of it is stored (Section 3.7.7).
Source: tests/test_transient_v130.py4.3.13Rapid drawdown: the factor of safety against level and time#
Two properties of rapid drawdown are checked, one against a published result and one as a physical requirement.
The complete drawdown of a homogeneous slope. For a homogeneous slope of the kind charted by Morgenstern (1963), the reference values used by the test suite put the lowest factor of safety at the complete drawdown, 1.20, against 1.41 at half drawdown. The sweep of drawdown levels repeats the whole search at each level (Section 3.8.6). Model. A slope of 3 horizontal to 1 vertical, with , and , undrained behaviour with , and a full reservoir up to the crest; Bishop's method, a grid of 3 × 4 intervals, 18 slices and four levels from the crest to the toe. Required. The critical level is the complete drawdown; its factor of safety is within 6 % of 1.20; the factor at the intermediate level closest to half drawdown is higher; and sweeping the levels reveals no unsafe margin above 1 %. Obtained. 1.2103 at the complete drawdown, 0.86 % above 1.20, and 1.304, 1.673 and 2.588 at one third, two thirds and the full height of the reservoir.
The factor of safety in time. With the transient analysis, the factor of safety of the stages flagged Calculate SF is lowest right after the level drops, when the pressures have not yet dissipated, and recovers as they do (Section 3.8.7 and Figure 3.8.4). The test builds a drawdown on a slope of the suite with three materials, whose heads fall from 45 m and 30 m on the two sides to 28 m and 26 m, with two flagged stages at 104 and 106 time units, and requires that the factor of safety of the second stage is higher than that of the first. It is a requirement of ordering and not a closed form, and it passes in version 0.1.235.
The sweep repeats the search at every level because the critical surface moves with the level: a surface held fixed would report a factor of safety that is too high, and a test guards that choice. The numbers of the sweep are the same through the interface and through the operations layer.
Source: tests/test_drawdown_sweep_v170.py · tests/test_groundwater_ops_v1200.py · tests/test_transient_v130.py4.3.14References#
- Darcy, H. (1856). Les fontaines publiques de la ville de Dijon. Victor Dalmont, Paris.
- Gardner, W.R. (1958). Some steady-state solutions of the unsaturated moisture flow equation with application to evaporation from a water table. Soil Science, 85(4), 228–232.
- Hoek, E., Carranza-Torres, C. & Corkum, B. (2002). Hoek–Brown failure criterion – 2002 edition. Proceedings of the 5th North American Rock Mechanics Symposium and 17th Tunnelling Association of Canada Conference (NARMS-TAC 2002), Toronto, Vol. 1, 267–273.
- Morgenstern, N. (1963). Stability charts for earth slopes during rapid drawdown. Géotechnique, 13(2), 121–131.
- van Genuchten, M.Th. (1980). A closed-form equation for predicting the hydraulic conductivity of unsaturated soils. Soil Science Society of America Journal, 44(5), 892–898.
- Carslaw, H.S. & Jaeger, J.C. (1959). Conduction of Heat in Solids, 2nd ed. Oxford University Press, Oxford.