[solver] SolverConfig#

TOML section: [solver]

Pydantic model: SolverConfig defined in hydromodpy.solver.base.solver_config.

Source on GitHub

Configuration block defining the active groundwater solver engine.

The V1 TOML form is backend = { backend = "modflow6" } for a built-in backend, or backend = { backend = "custom", name = "x" } for a plugin-registered backend.

It also carries the backend-agnostic preprocessing switches both MODFLOW backends read, so one TOML key drives both. sink_fill and drain_band_depth_m both act on the drains of a depressed model top and are mutually exclusive.

Show fields:

Fields#

backend in TOML: [solver.backend]

backend = “modflow6” | “modflow_nwt” | “boussinesq” | “custom” factory user source

Active flow backend selector (discriminated union).

Pick a tab below: setting backend selects the matching schema.

TOML: [solver.backend] with backend = "modflow6" – model Modflow6Backend.

TOML: [solver.backend] with backend = "modflow_nwt" – model ModflowNwtBackend.

TOML: [solver.backend] with backend = "boussinesq" – model BoussinesqBackend.

TOML: [solver.backend] with backend = "custom" – model CustomBackend.

name

str required user source

Plugin-registered flow backend name (matches registry).

sink_fill

bool default = False user source

Dimensionless. Remove the drain from every cell sitting in a closed depression of the model top, by setting its DRN conductance to zero. A closed depression has no outlet, so water reaching it ponds instead of seeping into a stream, and a drain there invents a discharge point. The depressions are measured on the solver mesh, by a priority flood seeded on every cell water can leave the domain through; both MODFLOW backends read the same mask. This does NOT move the topography: no elevation is raised, no DEM is rewritten, and every other package sees the surface it would have seen. Refused when the mask cannot be built. The depressions are counted on the four shared faces MODFLOW connects, not on the eight neighbours a raster fill uses: measured on the Nancon, 4.56 per cent of the mesh against 2.12 per cent, a factor of two that is the neighbourhood and nothing else. NOT SANCTIONED BY ANY SOURCE: no manual, no USGS document and no guideline removes a discharge boundary where a pit is detected, and measured here it degrades both scores. The remedy the USGS does document for the same question is solver.drain_band_depth_m, which gives every cell a discharge band instead of taking the drain away. Default false, which drains every cell as before.

Examples

  • false

  • true

drain_bed_thickness_m

float default = 1.0 expert source

Metres. Thickness of the drain BED in the fallback conductance C = K * cell_area / bed_thickness, used when no drainage conductance is declared. A drain bed is the clogging layer at the bottom of a watercourse, decimetres to a metre; it is NOT the aquifer, and the layer thickness this used to borrow (30 m on the Nancon) has no physical relation to it. The value matters because it sets how much head the drain itself imposes to pass the recharge: dh = R * bed_thickness / K, independent of the cell size. On the Nancon at R = 439 mm/yr, 30 m gives 4.17 m of head at K = 1e-7 m/s and makes the drain the limiting resistance over two decades of a [1e-7, 1e-3] search; 1 m gives 13.9 cm and 0.1 m gives 1.4 cm. In this method the drain is a seepage face, so it must never limit: K and the recharge decide where water surfaces, not the boundary condition. Proportionality to K is preserved either way, so the K/R invariance the network criterion rests on is untouched.

Examples

  • 1.0

  • 0.5

  • 0.1

drain_conductance_floor_m2_s

float default = 1e-12 expert source

m2/s. Floor applied to every DRN conductance, whether declared or derived from hk. It exists for degenerate cells only, a zero-thickness or zero-conductivity cell whose formula would divide by zero or emit a zero-conductance drain MODFLOW reads as absent. It is not a physical choice and moving it does not tune anything: a real conductance on a real cell is many orders of magnitude above it. Raise it only to make a degenerate mesh audible.

drain_band_depth_m

float default = 0.0 user source

Metres. Depth D of the sub-cell discharge band every drain cell gets instead of a single elevation: the drain sits at top - D/2 and its conductance is multiplied by top_layer_thickness / D. The multiplier is the thickness and not the cell area because the conductance it scales is already Kv*A/b, so scaling by b/D gives Kv*A/D, which is CDRN exactly; scaling by A/D would give an m3/s where a conductance is m2/s, too high by A/b. The cell therefore starts discharging before the head reaches its mean elevation, and discharges harder the higher the head climbs into the band. This answers the one question the USGS documents about a model top, that the land inside a cell is not flat: UZF1 exposes the same depth as SURFDEP, ‘the average undulation depth within a finite-difference cell’, and MODFLOW 6 carries it into DRN as DDRN, with HDRN = land surface - DDRN/2 and CDRN = Kv*A/DDRN. MODFLOW 6 solves its DDRN band with a smooth (linear then cubic) curve; the option here is the piecewise equivalent of the same idea, applied identically by both MODFLOW backends, so a later switch to the native smooth form is a documented refinement and not a surprise. It does NOT move the topography: no elevation is raised, no DEM is rewritten, and every other package sees the surface it would have seen. The seepage criterion is the one reader that cannot: a banded cell discharges at top - D/2 and never climbs back to top, so the mask follows the band and the run persists D in its store for every figure drawn afterwards. It classifies no cell: every drain cell gets the same band, so nothing has to be sorted into artefact and real. Pick D the way Feinstein et al. 2020 (Groundwater 58:524-534, doi:10.1111/gwat.12931) do, from the standard deviation of the fine land-surface elevations inside a cell; they obtain 0.61 m. Mutually exclusive with solver.sink_fill, which answers the same question by removing drains instead. Default 0.0: one elevation per drain, unchanged from every earlier run.

Examples

  • 0.0

  • 0.5

Starter TOML snippet#

Click to expand a copy-pasteable [solver] TOML skeleton

Copy this block into your project.toml and uncomment the lines you want to set. Sub-tables ([parent.subfield]) appear in the order Pydantic expects them.

[solver]
# sink_fill = false
# drain_band_depth_m = 0.0

[solver.backend]
# backend = "modflow6"

Entity-relationship diagram#

ER diagram for SolverConfig

Click to zoom and pan. Press Esc or click outside to close.