imod.mf6.Modflow6Simulation#

class imod.mf6.Modflow6Simulation(name: str, validation_settings: ValidationSettings | None = None)[source]#

Modflow6Simulation is a class that represents a Modflow 6 simulation. It contains data on simulation timing, models that are present in the simulation, how models exchange information, and how models are solved. More information can be found here: https://water.usgs.gov/water-resources/software/MODFLOW-6/mf6io_6.4.2.pdf#page=20

Parameters:
  • name (str) – Name of the simulation. This is used to create the simulation name file and the directory in which the simulation is written.

  • validation_settings (ValidationSettings, optional) – Settings for validation of the simulation. If not provided, default settings are used. These settings can be used to control whether the simulation is validated at write time, and whether strict validation rules are applied.

Examples

Create a Modflow 6 simulation and add a groundwater flow model to it:

>>> import imod
>>> simulation = imod.mf6.Modflow6Simulation("example_simulation")
>>> simulation["GWF"] = imod.mf6.GroundwaterFlowModel()

You can configure the validation settings for the simulation as follows:

>>> validation_settings = imod.mf6.ValidationSettings(ignore_time=True)
>>> simulation = imod.mf6.Modflow6Simulation("example_simulation", validation_settings)

See imod.mf6.ValidationSettings for information on how to configure validation settings. Configuring imod.mf6.ValidationSettings can help performance or reduce the strictness of validation for some packages, namely the Well and HFB packages.

__init__(name: str, validation_settings: ValidationSettings | None = None)[source]#

Methods

__init__(name[, validation_settings])

clear()

clip_box([time_min, time_max, layer_min, ...])

Clip a simulation by a bounding box (time, layer, y, x).

copy()

create_time_discretization(additional_times)

Collect all unique times from model packages and additional given times.

dump([directory, validate, mdal_compliant, crs])

Dump simulation to files.

from_file(toml_path)

from_imod5_data(imod5_data, period_data, times)

Imports a GroundwaterFlowModel (GWF) from the data in an iMOD5 project file and puts it in a simulation.

fromkeys(iterable[, value])

get(k[,d])

get_exchange_relationships()

get_models()

get_models_of_type(model_id)

get_solution_name(model_name)

has_key(k)

has_one_flow_model()

is_split()

items()

keys()

mask_all_models(mask)

This function applies a mask to all models in a simulation, provided they use the same discretization.

open_concentration([species_ls, dry_nan, ...])

Open concentration of finished simulation, requires that the run method has been called.

open_flow_budget([flowja, ...])

Open flow budgets of finished simulation, requires that the run method has been called.

open_head([dry_nan, simulation_start_time, ...])

Open heads of finished simulation, requires that the run method has been called.

open_transport_budget([species_ls, ...])

Open transport budgets of finished simulation, requires that the run method has been called.

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()

as a 2-tuple; but raise KeyError if D is empty.

regrid_like(regridded_simulation_name, ...)

This method creates a new simulation object.

render(write_context)

Renders simulation namefile

run([mf6path])

Run Modflow 6 simulation.

setdefault(k[,d])

split(submodel_labels[, ignore_time_purge_empty])

Split a simulation in different partitions using a submodel_labels array.

time_discretization(times)

update([E, ]**F)

If E present and has a .keys() method, does: for k in E.keys(): D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values()

write([directory, binary, validate, ...])

Write Modflow6 simulation, including assigned groundwater flow and transport models.