gwsource.config#
Configuration of a trace: accounting mode, solver choice, strong sinks and cycle handling.
- class gwsource.config.TraceConfig(accounting='gross', solver='auto', remove_cycles=False, closed_loop_tol=1e-12, strong_sinks=())[source]#
Bases:
objectOptions for backward() and forward(). accounting: "gross" (default; one sink/source node per external term, outflow/inflow normalisation) or "net" (net source/sink per cell, destination cells absorbing; the reference method of Foley & Black 2013, for regression and comparison only). solver: "auto" (topological substitution if the flow graph is acyclic, block-triangular sparse LU otherwise), "topological" (fails on cyclic graphs), "block" (block-triangular LU in strongly-connected-component order) or "lu" (SuperLU with COLAMD ordering on the whole matrix; slow on large 3D grids, kept as a reference). closed_loop_tol: a strongly connected set with no edge leaving it and no row whose exit share (sink or source flow / cell throughflow) exceeds this is a closed recirculation loop; its fractions are set to 0 and it is reported (result.closed_loops). remove_cycles: net mode only; delete the smallest edge of each flow cycle until the graph is acyclic, as the reference method does. strong_sinks: backward traces only; package selectors (names, budget texts or types, any case, as select(package=)) whose sink cells are absorbing, or "all" for every cell with a sink term. A strong-sink cell passes no water on to its neighbours, as a cell that stops particles (MODPATH 7 weak sink option "stop"). Gross: its F is its destination share of its sink outflow, d_i / Snk_i, so water in a cell with sinks of several groups is split by their flows. Net: destination cells stay fixed at 1 and the other strong-sink cells absorb with f = 0. Default () keeps every cell mixing. Any outflowing sink term (q < 0), however small, makes its cell absorbing, as the MODPATH 7 stop option does. A package's *-TO-MVR record matches the package and is one of its sink terms: MF6 splits a provider's outflow between the package record and its -TO-MVR record, so Snk counts that outflow once, as their sum. trace_transient and the ensembles pass this config to every step or realisation, so strong sinks apply to each steady backward snapshot.