flopy.modflow.mfhyd Module

mfhyd module. Contains the ModflowHydclass. Note that the user can access the ModflowHyd class as flopy.modflow.ModflowHyd.

Additional information for this MODFLOW package can be found at the Online MODFLOW Guide.

class flopy.modflow.mfhyd.ModflowHyd(model, nhyd=1, ihydun=None, hydnoh=-999.0, obsdata=[['BAS', 'HD', 'I', 1, 0.0, 0.0, 'HOBS1']], extension=['hyd', 'hyd.bin'], unitnumber=None, filenames=None)

MODFLOW HYDMOD (HYD) Package Class.

Parameters:

model : model object

The model object (of type flopy.modflow.mf.Modflow) to which this package will be added.

nhyd : int

the maximum number of observation points. (default is 1).

ihydun : int

A flag that is used to determine if hydmod data should be saved. If ihydun is non-zero hydmod data will be saved. (default is 1).

hydnoh : float

is a user-specified value that is output if a value cannot be computed at a hydrograph location. For example, the cell in which the hydrograph is located may be a no-flow cell. (default is -999.)

obsdata : list of lists, numpy array, or numpy recarray (nhyd, 7)

Each row of obsdata includes data defining pckg (3 character string), arr (2 characater string), intyp (1 character string) klay (int), xl (float), yl (float), hydlbl (14 character string) for each observation.

pckg
: str

is a 3-character flag to indicate which package is to be addressed by hydmod for the hydrograph of each observation point.

arr
: str

is a text code indicating which model data value is to be accessed for the hydrograph of each observation point.

intyp
: str

is a 1-character value to indicate how the data from the specified feature are to be accessed; The two options are ‘I’ for interpolated value or ‘C’ for cell value (intyp must be ‘C’ for STR and SFR Package hydrographs.

klay
: int

is the layer sequence number (one-based) of the array to be addressed by HYDMOD.

xl
: float

is the coordinate of the hydrograph point in model units of length measured parallel to model rows, with the origin at the lower left corner of the model grid.

yl
: float

is the coordinate of the hydrograph point in model units of length measured parallel to model columns, with the origin at the lower left corner of the model grid.

hydlbl
: str

is used to form a label for the hydrograph.

The simplest form is a list of lists. For example, if nhyd=3 this gives the form of:

obsdata =
[
    [pckg, arr, intyp, klay, xl, yl, hydlbl],
    [pckg, arr, intyp, klay, xl, yl, hydlbl],
    [pckg, arr, intyp, klay, xl, yl, hydlbl]
]

extension : list string

Filename extension (default is [‘hyd’, ‘hyd.bin’])

unitnumber : int

File unit number (default is None).

filenames : str or list of str

Filenames to use for the package and the output files. If filenames=None the package name will be created using the model name and package extension and the hydmod output name will be created using the model name and .hyd.bin extension (for example, modflowtest.hyd.bin). If a single string is passed the package will be set to the string and hydmod output name will be created using the model name and .hyd.bin extension. To define the names for all package files (input and output) the length of the list of strings should be 2. Default is None.

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> hyd = flopy.modflow.ModflowHyd(m)
static load(f, model, ext_unit_dict=None)

Load an existing package.

Parameters:

f : filename or file handle

File to load.

model : model object

The model object (of type flopy.modflow.mf.Modflow) to which this package will be added.

ext_unit_dict : dictionary, optional

If the arrays in the file are specified using EXTERNAL, or older style array control records, then f should be a file handle. In this case ext_unit_dict is required, which can be constructed using the function flopy.utils.mfreadnam.parsenamefile.

Returns:

hyd : ModflowHyd object

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> hyd = flopy.modflow.ModflowHyd.load('test.hyd', m)
write_file()

Write the package file.

Returns:None