imod.evaluate.stability_constraint_advection#

imod.evaluate.stability_constraint_advection(front, lower, right, top_bot, porosity=0.3, R=1.0)[source]#

Computes advection stability constraint as applied in MT3D for adaptive timestepping (Zheng & Wang, 1999 p54):

\[\Delta t \leq \frac{R}{\frac{\left | v_{x} \right |}{\Delta x}+\frac{\left | v_{y} \right |}{\Delta y}+\frac{\left | v_{z} \right |}{\Delta z}}\]

This function can be used to select which cells necessitate a small timestap, thereby slowing down calculations.

Front, lower, and right arguments refer to iMOD face flow budgets, in cubic meters per day. In terms of flow direction these are defined as:

  • front: positive with y (negative with row index)

  • lower: positive with layer (positive with layer index)

  • right: negative with x (negative with column index)

Returns the minimum timestep that is required to satisfy this constraint. The resulting dt xr.DataArray is the minimum timestep over all three directions, dt_xyz is an xr.Dataset containing minimum timesteps for the three directions separately.

Parameters
  • front (xr.DataArray of floats, optional) – Dimensions must be exactly ("layer", "y", "x").

  • lower (xr.DataArray of floats, optional) – Dimensions must be exactly ("layer", "y", "x").

  • right (xr.DataArray of floats, optional) – Dimensions must be exactly ("layer", "y", "x").

  • top_bot (xr.Dataset of floats, containing 'top', 'bot' and optionally) – ‘dz’ of layers. Dimensions must be exactly ("layer", "y", "x").

  • porosity (float or xr.DataArray of floats, optional (default 0.3)) – If xr.DataArray, dimensions must be exactly ("layer", "y", "x").

  • R (Retardation factor, optional (default)) – Only when sorption is a factor.

Returns

  • dt (xr.DataArray of floats)

  • dt_xyz (xr.Dataset of floats)