imod.wq.ParallelKrylovFlowSolver#

class imod.wq.ParallelKrylovFlowSolver(max_iter=150, inner_iter=100, hclose=0.0001, rclose=1000.0, relax=0.98, h_fstrict=1.0, r_fstrict=1.0, partition='uniform', solver='pcg', preconditioner='ilu', deflate=False, debug=False, load_balance_weight=None)[source]#

The Parallel Krylov Flow Solver is used for parallel solving of the flow model.

Parameters:
  • max_iter (int) – is the maximum number of outer iterations (MXITER); it should be set to an integer greater than one (1) only when a nonlinear sorption isotherm is included in simulation.

  • inner_iter (int) – is the maximum number of inner iterations (INNERIT); a value of 30-50 should be adequate for most problems.

  • hclose (float) – is the head change criterion for convergence (HCLOSEPKS), in units of length. When the maximum absolute value of head change from all nodes during an iteration is less than or equal to HCLOSE, and the criterion for RCLOSE is also satisfied (see below), iteration stops.

  • rclose (float) – is the residual criterion for convergence (RCLOSEPKS), in units of cubic length per time. The units for length and time are the same as established for all model data. When the maximum absolute value of the residual at all nodes during an iteration is less than or equal to RCLOSE, and the criterion for HCLOSE is also satisfied (see above), iteration stops.

  • relax (float) – is the relaxation parameter used. Usually, RELAX = 1.0, but for some problems a value of 0.99, 0.98, or 0.97 will reduce the number of iterations required for convergence.

  • h_fstrict (float, optional) – is a factor to apply to HCLOSE to set a stricter hclose for the linear inner iterations (H_FSTRICTPKS). HCLOSE_inner is calculated as follows: HCLOSEPKS * H_FSTRICTPKS.

  • r_fstrict (float, optional) – is a factor to apply to RCLOSE to set a stricter rclose for the linear inner iterations (R_FSTRICTPKS). RCLOSE_inner is calculated as follows: RCLOSEPKS * R_FSTRICTPKS.

  • partition ({"uniform", "rcb"}, optional) – Partitioning option (PARTOPT). “uniform” partitions the model domain into equally sized subdomains. “rcb” (Recursive Coordinate Bisection) uses a 2D pointer grid with weights to partition the model domain. Default value: “uniform”

  • solver ({"pcg"}, optional) – Flag indicating the linear solver to be used (ISOLVER). Default value: “pcg”

  • preconditioner ({"ilu"}, optional) – Flag inicating the preconditioner to be used (NPC). Devault value: “ilu”

  • deflate ({True, False}, optional) – Flag for deflation preconditioner. Default value: False

  • debug ({True, False}, optional) – Debug option. Default value: False

  • load_balance_weight (xarray.DataArray, optional) –

    2D grid with load balance weights, used when partition = “rcb” (Recursive Coordinate Bisection). If None (default), then the module will create a load balance grid by summing active cells over layers: (ibound != 0).sum(“layer”)

    Note that even though the iMOD-SEAWAT helpfile states .idf is accepted, it is not. This load balance grid should be a .asc file (without a header). Formatting is done as follows: pd.DataFrame(load_balance_weight.values).to_csv(path, sep=’t’, header=False, index=False, float_format = “%8.2f”)

__init__(max_iter=150, inner_iter=100, hclose=0.0001, rclose=1000.0, relax=0.98, h_fstrict=1.0, r_fstrict=1.0, partition='uniform', solver='pcg', preconditioner='ilu', deflate=False, debug=False, load_balance_weight=None)[source]#

Methods

__init__([max_iter, inner_iter, hclose, ...])

from_file(path, **kwargs)

Loads an imod-wq package from a file (currently only netcdf and zarr are supported).

isel()

save(directory)

Overloaded method to write .asc instead of .idf.

sel()