flopy.modflow.mfhfb module

mfhfb module. Contains the ModflowHfb class. Note that the user can access the ModflowHfb class as flopy.modflow.ModflowHfb.

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

class ModflowHfb(model, nphfb=0, mxfb=0, nhfbnp=0, hfb_data=None, nacthfb=0, no_print=False, options=None, extension='hfb', unitnumber=None, filenames=None)[source]

Bases: flopy.pakbase.Package

MODFLOW HFB6 - Horizontal Flow Barrier Package

Parameters:
  • model (model object) – The model object (of type: class:flopy.modflow.mf.Modflow) to which this package will be added.
  • nphfb (int) – Number of horizontal-flow barrier parameters. Note that for an HFB parameter to have an effect in the simulation, it must be defined and made active using NACTHFB to have an effect in the simulation (default is 0).
  • mxfb (int) – Maximum number of horizontal-flow barrier barriers that will be defined using parameters (default is 0).
  • nhfbnp (int) – Number of horizontal-flow barriers not defined by parameters. This is calculated automatically by FloPy based on the information in layer_row_column_data (default is 0).
  • hfb_data (list of records) –

    In its most general form, this is a list of horizontal-flow barrier records. A barrier is conceptualized as being located on the boundary between two adjacent finite difference cells in the same layer. The innermost list is the layer, row1, column1, row2, column2, and hydrologic characteristics for a single hfb between the cells. The hydraulic characteristic is the barrier hydraulic conductivity divided by the width of the horizontal-flow barrier. (default is None). This gives the form of:

    hfb_data = [
                [lay, row1, col1, row2, col2, hydchr],
                [lay, row1, col1, row2, col2, hydchr],
                [lay, row1, col1, row2, col2, hydchr],
               ].
    
  • nacthfb (int) – The number of active horizontal-flow barrier parameters (default is 0).
  • no_print (boolean) – When True or 1, a list of horizontal flow barriers will not be written to the Listing File (default is False)
  • options (list of strings) – Package options (default is None).
  • extension (string) – Filename extension (default is ‘hfb’).
  • unitnumber (int) – File unit number (default is None).
  • filenames (str or list of str) – Filenames to use for the package. If filenames=None the package name will be created using the model name and package extension. If a single string is passed the package will be set to the string. Default is None.

Notes

Parameters are supported in Flopy only when reading in existing models. Parameter values are converted to native values in Flopy and the connection to “parameters” is thus nonexistent.

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> hfb_data = [[0, 10, 4, 10, 5, 0.01],[1, 10, 4, 10, 5, 0.01]]
>>> hfb = flopy.modflow.ModflowHfb(m, hfb_data=hfb_data)
static get_default_dtype(structured=True)[source]

Get the default dtype for hfb data

static get_empty(ncells=0, aux_names=None, structured=True)[source]

Get an empty recarray that corresponds to hfb dtype and has been extended to include aux variables and associated aux names.

classmethod load(f, model, ext_unit_dict=None)[source]

Load an existing package.

Parameters:
  • f (filename or file handle) – File to load.
  • model (model object) – The model object (of type: class: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:

hfb – ModflowHfb object (of type flopy.modflow.mfbas.ModflowHfb)

Return type:

ModflowHfb object

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> hfb = flopy.modflow.ModflowHfb.load('test.hfb', m)
write_file()[source]

Write the package file.

Returns:
Return type:None