imod.mf6.Viscosity#
- class imod.mf6.Viscosity(*_, **__)[source]#
The Viscosity Package in MODFLOW 6 is used to account for the effects of solute concentration or temperature on fluid viscosity and thereby their effects on hydraulic conductivity and stress-package conductance. If the Viscosity package is used, the Groundwater Transport process must also be used. In addition, the flow and transport models must be part of the same simulation. The Viscosity package will adjust the conductances in the model based on the solute concentrations.
- Parameters:
reference_viscosity (float) – Fluid reference viscosity used in the equation of state.
viscosity_concentration_slope (sequence of floats) – Slope of the (linear) viscosity concentration line used in the viscosity equation of state. This value will be used when
thermal_formulationis equal to"linear"(the default) in the OPTIONS block. Whenthermal_formulationis set to"nonlinear", a value for DVISCDC must be specified though it is not used.reference_concentration (sequence of floats) – Reference concentration used in the viscosity 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 viscosity value.
temperature_species_name (str) – Name of the species to be interpreted as temperature. This species is used to calculate the temperature-dependent viscosity, using all
thermal_arguments.thermal_formulation (str, optional) – The thermal formulation to use for the temperature-dependent viscosity.
thermal_a2 (float, optional) – Is an empirical parameter specified by the user for calculating viscosity using a nonlinear formulation. If thermal_a2 is not specified, a default value of 10.0 is assigned (Voss, 1984).
thermal_a3 (float, optional) – Is an empirical parameter specified by the user for calculating viscosity using a nonlinear formulation. If thermal_a3 is not specified, a default value of 248.37 is assigned (Voss, 1984).
thermal_a4 (float, optional) – Is an empirical parameter specified by the user for calculating viscosity using a nonlinear formulation. If thermal_a4 is not specified, a default value of 133.15 is assigned (Voss, 1984).
viscosityfile (str, optional) – Name of the binary output file to write viscosity information.
validate (bool, optional) – 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.
Examples
The viscosity input for a single species called “salinity”, which is simulated by a GWT model called “gwt-1” are specified as follows:
>>> vsc = imod.mf6.Viscosity( ... reference_viscosity=8.904E-04, ... viscosity_concentration_slope=[1.92e-6], ... 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"]} >>> vsc = imod.mf6.Viscosity( ... reference_viscosity=8.904E-04, ... viscosity_concentration_slope=[1.92e-6, 3.4e-6], ... reference_concentration=[0.0, 0.0], ... modelname=["gwt-1", "gwt-2], ... species=["c1", "c2"], ... )
You can also specify thermal properties, even with a nonlinear thermal formulation.
>>> coords = {"species": ["salinity", "temperature"]} >>> vsc = imod.mf6.Viscosity( ... reference_viscosity=8.904E-04, ... viscosity_concentration_slope=[1.92e-6, 0.0], ... reference_concentration=[0.0, 25.0], ... modelname=["gwt-1", "gwt-2"], ... species=["salinity", "temperature"], ... temperature_species_name="temperature", ... thermal_formulation="nonlinear", ... thermal_a2=10.0, ... thermal_a3=248.37, ... thermal_a4=133.15, ... )
- __init__(reference_viscosity: float, viscosity_concentration_slope: Sequence[float], reference_concentration: Sequence[float], modelname: Sequence[str], species: Sequence[str], temperature_species_name: str | None = None, thermal_formulation: Literal['linear', 'nonlinear'] = 'linear', thermal_a2: float = 10.0, thermal_a3: float = 248.37, thermal_a4: float = 133.15, viscosityfile: str | None = None, validate: bool = True)[source]#
Methods
__init__(reference_viscosity, ...[, ...])clip_box([time_min, time_max, layer_min, ...])Clip a package by a bounding box (time, layer, y, x).
copy()Copy package into a new package of the same type.
from_file(path, **kwargs)Loads an imod mf6 package from a file (currently only netcdf and zarr are supported).
Returns the default regrid methods for this package.
is_empty([ignore_time])Returns True if the package is empty, that is if it contains only no-data values.
mask(mask)Mask values outside of domain.
regrid_like(target_grid, regrid_cache[, ...])Creates a package of the same type as this package, based on another discretization.
to_file(modeldirectory, pkgname[, ...])Write package to file.
write(pkgname, globaltimes, directory[, ...])Write package to file
Attributes
auxiliary_data_fieldsdatasetpkg_id