flopy.mt3d.mtsft Module

class flopy.mt3d.mtsft.Mt3dSft(model, nsfinit=0, mxsfbc=0, icbcsf=0, ioutobs=None, ietsfr=0, isfsolv=1, wimp=0.5, wups=1.0, cclosesf=1e-06, mxitersf=10, crntsf=1.0, iprtxmd=0, coldsf=0.0, dispsf=0.0, nobssf=0, obs_sf=None, sf_stress_period_data=None, unitnumber=None, filenames=None, dtype=None, extension='sft', **kwargs)

MT3D-USGS StreamFlow Transport package class

Parameters:

model : model object

The model object (of type flopy.mt3dms.mt.Mt3dms) to which this package will be added.

nsfinit : int

Is the number of simulated stream reaches (in SFR2, the number of stream reaches is greater than or equal to the number of stream segments). This is equal to NSTRM found on the first line of the SFR2 input file. If NSFINIT > 0 then surface-water transport is solved in the stream network while taking into account groundwater exchange and precipitation and evaporation sources and sinks. Otherwise, if NSFINIT < 0, the surface-water network as represented by the SFR2 flow package merely acts as a boundary condition to the groundwater transport problem; transport in the surface-water network is not simulated.

mxsfbc : int

Is the maximum number of stream boundary conditions.

icbcsf : int

Is an integer value that directs MT3D-USGS to write reach-by-reach concentration information to unit ICBCSF.

ioutobs : int

Is the unit number of the output file for simulated concentrations at specified gage locations. The NAM file must also list the unit number to which observation information will be written.

ietsfr : int

Specifies whether or not mass will exit the surface-water network with simulated evaporation. If IETSFR = 0, then mass does not leave via stream evaporation. If IETSFR > 0, then mass is allowed to exit the simulation with the simulated evaporation.

isfsolv : int

Specifies the numerical technique that will be used to solve the transport problem in the surface water network. The first release of MT3D-USGS (version 1.0) only allows for a finite-difference formulation and regardless of what value the user specifies, the variable defaults to 1, meaning the finite-difference solution is invoked.

wimp : float

Is the stream solver time weighting factor. Ranges between 0.0 and 1.0. Values of 0.0, 0.5, or 1.0 correspond to explicit, Crank-Nicolson, and fully implicit schemes, respectively.

wups : float

Is the space weighting factor employed in the stream network solver. Ranges between 0.0 and 1.0. Values of 0.0 and 1.0 correspond to a central-in-space and upstream weighting factors, respectively.

cclosesf : float

Is the closure criterion for the SFT solver

mxitersf : int

Limits the maximum number of iterations the SFT solver can use to find a solution of the stream transport problem.

crntsf : float

Is the Courant constraint specific to the SFT time step, its value has no bearing upon the groundwater transport solution time step.

iprtxmd : int

A flag to print SFT solution information to the standard output file. IPRTXMD = 0 means no SFT solution information is printed; IPRTXMD = 1 means SFT solution summary information is printed at the end of every MT3D-USGS outer iteration; and IPRTXMD = 2 means SFT solution details are written for each SFT outer iteration that calls the xMD solver that solved SFT equations.

coldsf : array of floats

Represents the initial concentrations in the surface water network. The length of the array is equal to the number of stream reaches and starting concentration values should be entered in the same order that individual reaches are entered for record set 2 in the SFR2 input file.

dispsf : array of floats

Is the dispersion coefficient [L2 T-1] for each stream reach in the simulation and can vary for each simulated component of the simulation. That is, the length of the array is equal to the number of simulated stream reaches times the number of simulated components. Values of dispersion for each reach should be entered in the same order that individual reaches are entered for record set 2 in the SFR2 input file. The first NSTRM entries correspond to NCOMP = 1, with subsequent entries for each NCOMP simulated species.

nobssf : int

Specifies the number of surface flow observation points for monitoring simulated concentrations in streams.

isobs : int

The segment number for each stream flow concentration observation point.

irobs : int

The reach number for each stream flow concentration observation point.

ntmp : int

The number of specified stream boundary conditions to follow. For the first stress period, this value must be greater than or equal to zero, but may be less than zero in subsequent stress periods.

isegbc : int

Is the segment number for which the current boundary condition will be applied.

irchbc : int

Is the reach number for which the current boundary condition will be applied.

isfbctyp : int

Specifies, for ISEGBC/IRCHBC, what the boundary condition type is
0 A headwater boundary. That is, for streams entering at the

boundary of the simulated domain that need a specified concentration, use ISFBCTYP = 0

1 a precipitation boundary. If precipitation directly to

channels is simulated in the flow model and a non-zero concentration (default is zero) is desired, use ISFBCTYP = 1

2 a runoff boundary condition that is not the same thing as

runoff simulated in the UZF1 package and routed to a stream (or lake) using the IRNBND array. Users who specify runoff in the SFR2 input via the RUNOFF variable appearing in either record sets 4b or 6a and want to assign a non-zero concentration (default is zero) associated with this specified source, use ISFBCTYP=2;

3 a constant-concentration boundary. Any ISEGBC/IRCHBC

combination may set equal to a constant concentration boundary condition.

4 a pumping boundary condition. 5 an evaporation boundary condition. In models where

evaporation is simulated directly from the surface of the channel, users can use this boundary condition to specify a non-zero concentration (default is zero) associated with the evaporation losses.

cbcsf : float

Is the specified concentration associated with the current boundary condition entry. Repeat CBCSF for each simulated species (NCOMP).

extension : string

Filename extension (default is ‘sft’)

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 sfr output name will be created using the model name and lake concentration observation extension (for example, modflowtest.cbc and modflowtest.sftcobs.out), if ioutobs is a number greater than zero. If a single string is passed the package will be set to the string and lake concentration observation output name will be created using the model name and .sftcobs.out extension, if ioutobs 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.

Notes

Parameters are not supported in FloPy.

Examples

>>> mf = flopy.modflow.Modflow.load('CrnkNic_mf.nam',
>>>                                  load_only=['dis', 'bas6'])
>>> sfr = flopy.modflow.ModflowSfr2.load('CrnkNic.sfr2', mf)
>>> chk = sfr.check()
>>> # initialize an MT3D-USGS model
>>> mt = flopy.mt3d.Mt3dms.load('CrnkNic_mt.nam',
>>>        exe_name = 'mt3d-usgs_1.0.00.exe',
>>>        model_ws = r'.\CrnkNic',
>>>        load_only='btn')
>>> sft = flopy.mt3d.Mt3dSft.load(mt, 'CrnkNic.sft')
check(f=None, verbose=True, level=1)

Check package data for common errors.

Parameters:

f : str or file handle

String defining file name or file handle for summary file of check method output. If a sting is passed a file handle is created. If f is None, check method does not write results to a summary file. (default is None)

verbose : bool

Boolean flag used to determine if check method results are written to the screen

level : int

Check method analysis level. If level=0, summary checks are performed. If level=1, full checks are performed.

Returns:

None

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow.load('model.nam')
>>> m.dis.check()
static get_default_dtype(ncomp=1)

Construct a dtype for the recarray containing the list of surface water boundary conditions.

static load(f, model, nsfinit=None, nper=None, ncomp=None, 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.mt3d.mt.Mt3dms) to which this package will be added.

nsfinit
: int

number of simulated stream reaches in the surface-water transport process.

isfsolv
: int

Specifies the numerical technique that will be used to solve the transport problem in the surface water network. The first release of MT3D-USGS (version 1.0) only allows for a finite-difference formulation and regardless of what value the user specifies, the variable defaults to 1, meaning the finite-difference solution is invoked.

wimp
: float

Is the stream solver time weighting factor. Ranges between 0.0 and 1.0. Values of 0.0, 0.5, or 1.0 correspond to explicit, Crank-Nicolson, and fully implicit schemes, respectively.

wups
: float

Is the space weighting factor employed in the stream network solver. Ranges between 0.0 and 1.0. Values of 0.0 and 1.0 correspond to a central-in-space and upstream weighting factors, respectively.

cclosesf
: float

Is the closure criterion for the SFT solver

mxitersf
: int

Limits the maximum number of iterations the SFT solver can use to find a solution of the stream transport problem.

crntsf
: float

Is the Courant constraint specific to the SFT time step, its value has no bearing upon the groundwater transport solution time step.

iprtxmd
: int

a flag to print SFT solution information to the standard output file. IPRTXMD can equal 0, 1, or 2, and will write increasing amounts of solver information to the standard output file, respectively.

Returns:

sft : MT3D-USGS object

MT3D-USGS object

lopy_testsfr_test’)
>>> mf = flopy.modflow.Modflow.load('CrnkNic_mf.nam', load_only=['dis', 'bas6'])
>>> sfr = flopy.modflow.ModflowSfr2.load('CrnkNic.sfr2', mf)
>>> chk = sfr.check()
>>> mt = flopy.mt3d.Mt3dms.load('CrnkNic_mt.nam', exe_name = 'mt3d-usgs_1.0.00.exe', load_only='btn')
>>> sft = flopy.mt3d.Mt3dSft.load('CrnkNic.sft', mt)
plot(**kwargs)

Plot 2-D, 3-D, transient 2-D, and stress period list (MfList) package input data

Parameters:

**kwargs : dict

filename_base
: str

Base file name that will be used to automatically generate file names for output image files. Plots will be exported as image files if file_name_base is not None. (default is None)

file_extension
: str

Valid matplotlib.pyplot file extension for savefig(). Only used if filename_base is not None. (default is ‘png’)

mflay
: int

MODFLOW zero-based layer number to return. If None, then all all layers will be included. (default is None)

kper
: int

MODFLOW zero-based stress period number to return. (default is zero)

key
: str

MfList dictionary key. (default is None)

Returns:

axes : list

Empty list is returned if filename_base is not None. Otherwise a list of matplotlib.pyplot.axis are returned.

Examples

>>> import flopy
>>> ml = flopy.modflow.Modflow.load('test.nam')
>>> ml.dis.plot()
to_shapefile(filename, **kwargs)

Export 2-D, 3-D, and transient 2-D model data to shapefile (polygons). Adds an attribute for each layer in each data array

Parameters:

filename : str

Shapefile name to write

Returns:

None

Examples

>>> import flopy
>>> ml = flopy.modflow.Modflow.load('test.nam')
>>> ml.lpf.to_shapefile('test_hk.shp')
write_file()

Write the package file

Returns:None

Examples

>>> mt = flopy.mt3d.Mt3dms.load('CrnkNic_mt.nam',
>>>      exe_name = 'mt3d-usgs_1.0.00.exe',
>>>      model_ws = r'C:\EDM_LT\GitHub\mt3d-usgsutotest        emp\CrnkNic',
>>>      verbose=True)
>>> mt.name = 'CrnkNic_rewrite'
>>>
>>> mt.sft.dispsf.fmtin = '(10F12.2)'
>>> mt.write_input()