imod.mf6.Modflow6Simulation.run#

Modflow6Simulation.run(mf6path: str | Path | None = None) → None[source]#

Run Modflow 6 simulation. This method runs a subprocess calling the Modflow 6 executable. The executable is determined in the following order of precedence:

  1. The mf6path argument.

  2. The MODFLOW6_EXECUTABLE environment variable.

  3. mf6, which means the Modflow 6 executable is expected to be added to your PATH environment variable.

See this writeup how to add Modflow 6 to your PATH on Windows

Note that the write method needs to be called before this method is called. The executable is looked up from within the directory the simulation was written to, so relative paths are relative to this directory. Provide an absolute path to avoid ambiguity.

Parameters:

mf6path (str | Path, optional) – Path to the Modflow 6 executable. Defaults to the MODFLOW6_EXECUTABLE environment variable if set, otherwise to calling mf6. The value should be a path to the executable only: arguments are not supported.

Examples

Make sure you write your model first

>>> simulation.write(path/to/model)
>>> simulation.run()