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:
The
mf6pathargument.The
MODFLOW6_EXECUTABLEenvironment variable.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
writemethod 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_EXECUTABLEenvironment variable if set, otherwise to callingmf6. 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()