class imod.mf6.Buoyancy(*_, **__)[source]#

Buoyancy package. This package must be included when performing variable density simulation.

Note that reference_density is a single value, but density_concentration_slope, reference_concentration and modelname require an entry for every active species. Please refer to the examples.

  • reference_density (float,) – fluid reference density used in the equation of state.

  • density_concentration_slope (sequence of floats) – Slope of the (linear) density concentration line used in the density equation of state.

  • reference_concentration (sequence of floats) – Reference concentration used in the density equation of state.

  • modelname (sequence of strings,) – Name of the GroundwaterTransport (GWT) model used for the concentrations.

  • species (sequence of str,) – Name of the species used to calculate a density value.

  • hhformulation_rhs (bool, optional.) – use the variable-density hydraulic head formulation and add off-diagonal terms to the right-hand. This option will prevent the BUY Package from adding asymmetric terms to the flow matrix. Default value is False.

  • densityfile – name of the binary output file to write density information. The density file has the same format as the head file. Density values will be written to the density file whenever heads are written to the binary head file. The settings for controlling head output are contained in the Output Control option.

  • validate ({True, False}) – Flag to indicate whether the package should be validated upon initialization. This raises a ValidationError if package input is provided in the wrong manner. Defaults to True.


The buoyancy input for a single species called “salinity”, which is simulated by a GWT model called “gwt-1” are specified as follows:

>>> buy = imod.mf6.Buoyance(
...     reference_density=1000.0,
...     density_concentration_slope=[0.025],
...     reference_concentration=[0.0],
...     modelname=["gwt-1"],
...     species=["salinity"],
... )

Multiple species can be specified by presenting multiple values with an associated species coordinate. Two species, called “c1” and “c2”, simulated by the GWT models “gwt-1” and “gwt-2” are specified as:

>>> coords = {"species": ["c1", "c2"]}
>>> buy = imod.mf6.Buoyance(
...     reference_density=1000.0,
...     density_concentration_slope=[0.025, 0.01],
...     reference_concentration=[0.0, 0.0],
...     modelname=["gwt-1", "gwt-2"],
...     species=["c1", "c2"],
... )
__init__(reference_density: float, density_concentration_slope: Sequence[float], reference_concentration: Sequence[float], modelname: Sequence[str], species: Sequence[str], hhformulation_rhs: bool = False, densityfile: Optional[str] = None, validate: bool = True)[source]#


__init__(reference_density, ...[, ...])


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

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


from_file(path, **kwargs)

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




returns true if package supports regridding.



Mask values outside of domain.


regrid_like(target_grid[, regridder_types])

Creates a package of the same type as this package, based on another discretization.

render(directory, pkgname, globaltimes, binary)



to_netcdf(*args, **kwargs)

Write dataset contents to a netCDF file.

write(pkgname, globaltimes, write_context)

write_binary_griddata(outpath, da, dtype)

write_blockfile(pkgname, globaltimes, ...)

write_netcdf(directory, pkgname[, ...])

Write to netcdf.

write_text_griddata(outpath, da, dtype)