ADR-0002: Engine family for layered soils¶
| Status | Accepted — amended 2026-07-09 (audit WP-E, see the end of this document) |
| Date | 2026-05-01 |
| Deciders | Project maintainers |
| Scope | groundfield |
Context¶
ADR-0001 settled the methodology for the 2-layer case: closed-form
Tagg/Sunde image-charge series (image_2layer) plus a Galerkin MoM
cross-validation engine (mom). For two-layer soils in isolation
that is enough. Two outstanding issues motivate this ADR:
- Three or more layers. Although the default scope targets a 2-layer soil, several supporting cases involve a weathered or frozen surface layer above a representative two-layer stack (i.e. effectively 3 layers). The closed-form Tagg/Sunde series does not extend cleanly to \(n \ge 3\): the upward-looking reflection \(\Gamma_1(\lambda)\) stops being constant in \(\lambda\) and a real geometric image series develops a doubly-nested expansion that becomes fragile at hard contrasts.
- Independent cross-validation. The current engine family
(
image_2layer/mom) shares the same Green's-function kernel, so its agreement reflects the resolution scheme but not the physics layer. ADR-0001 already lists the addition of a methodologically independent reference engine as an open action item.
A literature review of recent layered-soil grounding work
(Dawalibi 1991, Meliopoulos 1993, Güemes 2004, Colominas 2007/2012,
Li 2006, Zou 2015, Dan 2021) yielded four method families that map
cleanly onto the existing groundfield data model:
- Image-charge series (Tagg/Sunde 2-layer; Stefanescu/Sunde n-layer).
- Complex Image Method (matrix-pencil or segmented-sampling least-squares fit of \(\Gamma_1(\lambda)\)).
- Direct Sommerfeld quadrature, optionally with the Zou et al. complex integration path.
- Boundary-element method (Colominas) and finite-element method (Güemes), each adding either a different test-function weighting (collocation vs. Galerkin) or a different problem form (volume PDE vs. integral equation).
Decision¶
groundfield ships eight backends arranged in three families:
| Family | Backends |
|---|---|
| Closed-form image-charge | image, image_2layer, image_nlayer, cim |
| Integral equation | mom, mom_sommerfeld, bem |
| Volume PDE | fem |
The selection heuristic is:
- Homogeneous soil →
image(cheapest, closed form). - 2-layer soil →
image_2layer(auto-dispatched frombackend="image"). Cross-check withmom,cim,bem,mom_sommerfeld. - 3+ layer soil →
cimis the recommended primary engine (closed form, cost independent of layer count once fitted).mom_sommerfeldis the reference for hard contrasts.image_nlayerraises aValueErrorforn ≥ 3(the real image-charge series is not implemented for that regime). - Volume cross-check →
fem(axisymmetric, equivalent-hemisphere reduction). Used as a third independent line of defence; not intended for general meshing.
Mathematical / physical model¶
All seven layered engines evaluate the same Sommerfeld integral of the quasi-static layered Green's function
with the recursive upward reflection \(\Gamma_1(\lambda)\) built bottom
up from the per-interface Fresnel coefficients
\(K_i = (\rho_{i+1} - \rho_i)/(\rho_{i+1} + \rho_i)\). Differences
between the engines lie purely in the numerical strategy used to
evaluate the integral (real images, complex images, quadrature,
volume PDE). The frequency band targeted by groundfield is
\(f < 1\,\text{kHz}\), where the quasi-static formulation is valid.
Cross-validation envelope¶
For simple configurations all engines must agree within tightly
defined tolerances (codified in
tests/test_cross_engines_extended.py):
| Pair | Tolerance | Notes |
|---|---|---|
| any closed-form image vs. another closed-form image | 1e-9 | exact reduction (e.g. image_nlayer → image_2layer) |
closed-form image vs. mom / bem / cim |
5 % | resolution scheme differs |
mom_sommerfeld vs. closed-form layered engines |
5 % | quadrature is the reference |
fem vs. integral engines |
10 % | equivalent-hemisphere bias |
Layer-contrast sweeps must produce a monotonically increasing cluster impedance for every engine — a basic physics consistency check.
Consequences¶
Positive.
- Three independent methodologies (closed-form images, integral equation, volume PDE) are now available side by side. A bug in any single one is detectable through cross-comparison.
- For 3+ layer soils there is a clear recommended engine (
cim) with an independent reference (mom_sommerfeld) and a second-line cross-check (bem). femadds a methodologically distinct line of defence at the cost of a simple equivalent-hemisphere reduction; the bias is documented and bounded.
Negative / open.
mom_sommerfeldis slow (per-pair adaptive quadrature). Acceptable for the cross-check role; not intended for production sweeps.cimquality depends on the matrix-pencil fit; very hard contrasts may need more images. The fit RMS is exposed inresult.metadata["cim_rms"].femcovers single-cluster worlds via the equivalent-hemisphere reduction. Multi-cluster volume runs would need a real 3-D mesh generator and a stronger FEM kernel — out of scope for typical cases.
Action items¶
- Add
_layered.pywith the recursive \(\Gamma_1(\lambda)\) and the sharedLayerStackhelper. - Implement
image_nlayer,cim,mom_sommerfeld,bem,femwith NumPy docstrings. - Extend
Engine.solvedispatcher and theBackendliteral. - Notebooks
04–09covering each engine and the joint cross-engine view. -
tests/test_image_nlayer.py,test_cim.py,test_mom_sommerfeld.py,test_bem.py,test_fem.py,test_cross_engines_extended.py. - Reference-case library for typical cases (separate notebooks).
- Optional: scikit-fem-backed 3-D
fem(lifted from the equivalent-hemisphere reduction) for full multi-cluster worlds; deferred until a concrete use case demands it.
Amendment 2026-07-09 — engine-family independence (audit 2026-07-08, WP-E)¶
Two corrections to this ADR's cross-validation narrative:
bemandmomare not independent for n ≤ 2. They assemble the identical reaction matrix from the same kernels and solve it with the same constraint solver (measured relative difference 4e-16). Their agreement validates the shared discretisation, not the physics. Genuine methodological independence in the layered cross-checks comes frommom_sommerfeld(direct Sommerfeld quadrature of the full layered Green's function) andfem(volume PDE, with its documented equivalent-hemisphere reduction bias).cimshares the exact Tagg/Sunde kernel withimage_2layerfor n = 2.cim/bemreject n ≥ 3 soils. The historic n ≥ 3 complex-image kernel implemented an incomplete Green's function (single (z+z_s) image family; missing the 2·h_1-reflected families and the surface-interface multiple-reflection denominator — seesolver/_layered.py) and systematically underestimated the layered correction. This ADR's designation ofcimas the primary n ≥ 3 engine is revoked until a complete kernel exists; usemom_sommerfeldorfemfor three and more layers.