imod.wq.AdvectionMOC#

class imod.wq.AdvectionMOC(courant=0.75, tracking='hybrid', weighting_factor=0.5, dconcentration_epsilon=1e-05, nplane=2, nparticles_no_advection=10, nparticles_advection=40, cell_min_nparticles=5, cell_max_nparticles=80)[source]#

Solve the advection term using the Method of Characteristics (MIXELM = 1)

Nota bene: number of particles settings have not been tested. The defaults here are chosen conservatively, with many particles. This increases both memory usage and computational effort.

courant#

Courant number (PERCEL) is the number of cells (or a fraction of a cell) advection will be allowed in any direction in one transport step. For implicit finite-difference or particle tracking based schemes, there is no limit on PERCEL, but for accuracy reasons, it is generally not set much greater than one. Note, however, that the PERCEL limit is checked over the entire model grid. Thus, even if PERCEL > 1, advection may not be more than one cell’s length at most model locations. For the explicit finite-difference, PERCEL is also a stability constraint, which must not exceed one and will be automatically reset to one if a value greater than one is specified.

Type:

float

max_nparticles#

is the maximum total number of moving particles allowed (MXPART).

Type:

int

tracking#

indicates which particle tracking algorithm is selected for the Eulerian-Lagrangian methods. ITRACK = 1, the first-order Euler algorithm is used; ITRACK = 2, the fourth-order Runge-Kutta algorithm is used; this option is computationally demanding and may be needed only when PERCEL is set greater than one. ITRACK = 3, the hybrid 1st and 4th order algorithm is used; the Runge- Kutta algorithm is used in sink/source cells and the cells next to sinks/sources while the Euler algorithm is used elsewhere. Default value is “hybrid”.

Type:

string {“euler”, “runge-kutta”, “hybrid”}, optional

weighting_factor#

is a concentration weighting factor (WD) between 0.5 and 1. It is used for operator splitting in the particle tracking based methods. The value of 0.5 is generally adequate. The value may be adjusted to achieve better mass balance. Generally, it can be increased toward 1.0 as advection becomes more dominant. Default value: 0.5.

Type:

float, optional

dconcentration_epsilon#

is a small Relative Cell Concentration Gradient below which advective transport is considered negligible. A value around 10-5 is generally adequate. Default value: 1.0e-5.

Type:

float, optional

nplane#

is a flag indicating whether the random or fixed pattern is selected for initial placement of moving particles. NPLANE = 0, the random pattern is selected for initial placement. Particles are distributed randomly in both the horizontal and vertical directions by calling a random number generator. This option is usually preferred and leads to smaller mass balance discrepancy in nonuniform or diverging/converging flow fields. NPLANE > 0, the fixed pattern is selected for initial placement. The value of NPLANE serves as the number of vertical “planes” on which initial particles are placed within each cell block. The fixed pattern may work better than the random pattern only in relatively uniform flow fields. For two-dimensional simulations in plan view, set NPLANE = 1. For cross sectional or three-dimensional simulations, NPLANE = 2 is normally adequate. Increase NPLANE if more resolution in the vertical direction is desired. Default value: 2.

Type:

int, optional

nparticles_no_advection#

is number of initial particles per cell to be placed at cells where the Relative Cell Concentration Gradient is less than or equal to DCEPS. Generally, NPL can be set to zero since advection is considered insignificant when the Relative Cell Concentration Gradient is less than or equal to DCEPS. Setting NPL equal to NPH causes a uniform number of particles to be placed in every cell over the entire grid (i.e., the uniform approach). Default value: 10.

Type:

int, optional

nparticles_advection#

is number of initial particles per cell to be placed at cells where the Relative Cell Concentration Gradient is greater than DCEPS. The selection of NPH depends on the nature of the flow field and also the computer memory limitation. Generally, use a smaller number in relatively uniform flow fields and a larger number in relatively nonuniform flow fields. However, values exceeding 16 in twodimensional simulation or 32 in three-dimensional simulation are rarely necessary. If the random pattern is chosen, NPH particles are randomly distributed within the cell block. If the fixed pattern is chosen, NPH is divided by NPLANE to yield the number of particles to be placed per vertical plane. Default value: 40.

Type:

int, optional

cell_min_nparticles#

is the minimum number of particles allowed per cell. If the number of particles in a cell at the end of a transport step is fewer than NPMIN, new particles are inserted into that cell to maintain a sufficient number of particles. NPMIN can be set to zero in relatively uniform flow fields, and a number greater than zero in diverging/converging flow fields. Generally, a value between zero and four is adequate. Default value is 5.

Type:

int, optional

cell_max_nparticles#

is the maximum number of particles allowed per cell. If the number of particles in a cell exceeds NPMAX, all particles are removed from that cell and replaced by a new set of particles equal to NPH to maintain mass balance. Generally, NPMAX can be set to approximately twice of NPH. Default value: 80.

Type:

int, optional

__init__(courant=0.75, tracking='hybrid', weighting_factor=0.5, dconcentration_epsilon=1e-05, nplane=2, nparticles_no_advection=10, nparticles_advection=40, cell_min_nparticles=5, cell_max_nparticles=80)[source]#

Methods

__init__([courant, tracking, ...])

from_file(path, **kwargs)

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

isel()

save(directory)

sel()