flopy.modflow.mfwel module

mfwel module. Contains the ModflowWel class. Note that the user can access the ModflowWel class as flopy.modflow.ModflowWel.

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

class ModflowWel(model, ipakcb=None, stress_period_data=None, dtype=None, extension='wel', options=None, binary=False, unitnumber=None, filenames=None)[source]

Bases: flopy.pakbase.Package

MODFLOW Well Package Class.

Parameters:
  • model (model object) – The model object (of type flopy.modflow.mf.Modflow) to which this package will be added.
  • ipakcb (int) – A flag that is used to determine if cell-by-cell budget data should be saved. If ipakcb is non-zero cell-by-cell budget data will be saved. (default is 0).
  • stress_period_data (list of boundaries, or recarray of boundaries, or) –

    dictionary of boundaries Each well is defined through definition of layer (int), row (int), column (int), flux (float). The simplest form is a dictionary with a lists of boundaries for each stress period, where each list of boundaries itself is a list of boundaries. Indices of the dictionary are the numbers of the stress period. This gives the form of:

    stress_period_data = {0: [
    [lay, row, col, flux], [lay, row, col, flux], [lay, row, col, flux] ],
    1: [
    [lay, row, col, flux], [lay, row, col, flux], [lay, row, col, flux] ], …
    kper:
    [ [lay, row, col, flux], [lay, row, col, flux], [lay, row, col, flux] ]

    }

    Note that if the number of lists is smaller than the number of stress periods, then the last list of wells will apply until the end of the simulation. Full details of all options to specify stress_period_data can be found in the flopy3 boundaries Notebook in the basic subdirectory of the examples directory

  • dtype (custom datatype of stress_period_data.) – If None the default well datatype will be applied (default is None).
  • extension (string) – Filename extension (default is ‘wel’)
  • options (list of strings) – Package options (default is None).
  • 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 cbc output name will be created using the model name and .cbc extension (for example, modflowtest.cbc), if ipakcbc is a number greater than zero. If a single string is passed the package will be set to the string and cbc output names will be created using the model name and .cbc extension, if ipakcbc is a number greater than zero. To define the names for all package files (input and output) the length of the list of strings should be 2. Default is None.
mxactw

Maximum number of wells for a stress period. This is calculated automatically by FloPy based on the information in stress_period_data.

Type:int

Notes

Parameters are not supported in FloPy.

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> lrcq = {0:[[2, 3, 4, -100.]], 1:[[2, 3, 4, -100.]]}
>>> wel = flopy.modflow.ModflowWel(m, stress_period_data=lrcq)
add_record(kper, index, values)[source]
static get_default_dtype(structured=True)[source]
static get_empty(ncells=0, aux_names=None, structured=True)[source]
classmethod load(f, model, nper=None, ext_unit_dict=None, check=True)[source]

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.
  • nper (int) – The number of stress periods. If nper is None, then nper will be obtained from the model object. (default is None).
  • 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:

wel – ModflowWel object.

Return type:

ModflowWel object

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> wel = flopy.modflow.ModflowWel.load('test.wel', m)
phiramp_unit

Get phiramp unit

Returns:iunitramp – unit number of phiramp file
Return type:int
write_file(f=None)[source]

Write the package file.

Parameters:f – (str) optional file name
Returns:
Return type:None