mtbtn module. Contains the Mt3dBtn class. Note that the user can access the Mt3dBtn class as flopy.mt3d.Mt3dBtn.
Additional information for this MT3DMS package can be found in the MT3DMS User’s Manual.
Mt3dBtn(model, MFStyleArr=False, DRYCell=False, Legacy99Stor=False, FTLPrint=False, NoWetDryPrint=False, OmitDryBud=False, AltWTSorb=False, nlay=None, nrow=None, ncol=None, nper=None, ncomp=1, mcomp=1, tunit='D', lunit='M', munit='KG', laycon=None, delr=None, delc=None, htop=None, dz=None, prsity=0.3, icbund=1, sconc=0.0, cinact=1e+30, thkmin=0.01, ifmtcn=0, ifmtnp=0, ifmtrf=0, ifmtdp=0, savucn=True, nprs=0, timprs=None, obs=None, nprobs=1, chkmas=True, nprmas=1, perlen=None, nstp=None, tsmult=None, ssflag=None, dt0=0, mxstrn=50000, ttsmult=1.0, ttsmax=0, species_names=None, extension='btn', unitnumber=None, filenames=None, **kwargs)¶
Basic Transport Package Class.
model : model object
The model object (of type
flopy.mt3dms.mt.Mt3dms) to which this package will be added.
MFStyleArr : str
Specifies whether or not to read arrays using the MODFLOW array reader format or the original MT3DMS array reader
DRYCell : str
Specifies whether or not to route mass through dry cells. When MF-NWT is used to generate the flow-transport link file, this is a distinct possibility.
Legacy99Stor : str
Specifies whether or not to use the storage formulation used in MT3DMS
FTLPrint : str
Specifies if flow-transport link terms (cell-by-cell flows) should be echoed to the MT3D-USGS listing file.
NoWetDryPrint : str
Specifies whether or not to suppress wet/dry messaging in the MT3D-USGS listing file.
OmitDryBudg : str
Specifies whether or not to include the mass flux terms through dry cells in the mass budget written to the listing file.
AltWTSorb : str
Specifies whether or not to use the MT3DMS formulation (this keyword omitted) for the solid phase, whereby the entire cell thickness is available for interacting with the aqueous phase, even though the aqueous phase may only occupy a portion of the cell’s thickness. When used, only the saturated portion of the cell is available for sorbing
ncomp : int
The total number of chemical species in the simulation. (default is None, will be changed to 1 if sconc is single value)
mcomp : int
The total number of ‘mobile’ species (default is 1). mcomp must be equal or less than ncomp.
tunit : str
The name of unit for time (default is ‘D’, for ‘days’). Used for identification purposes only.
lunit : str
The name of unit for length (default is ‘M’, for ‘meters’). Used for identification purposes only.
munit : str
The name of unit for mass (default is ‘KG’, for ‘kilograms’). Used for identification purposes only.
prsity : float or array of floats (nlay, nrow, ncol)
The effective porosity of the porous medium in a single porosity system, or the mobile porosity in a dual-porosity medium (the immobile porosity is defined through the Chemical Reaction Package. (default is 0.25).
icbund : int or array of ints (nlay, nrow, ncol)
The icbund array specifies the boundary condition type for solute species (shared by all species). If icbund = 0, the cell is an inactive concentration cell; If icbund < 0, the cell is a constant-concentration cell; If icbund > 0, the cell is an active concentration cell where the concentration value will be calculated. (default is 1).
sconc : float, array of (nlay, nrow, ncol), or filename
sconc is the starting concentration for the first species. To specify starting concentrations for other species in a multi-species simulation, include additional keywords, such as sconc2, sconc3, and so forth.
cinact : float
The value for indicating an inactive concentration cell. (default is 1e30).
thkmin : float
The minimum saturated thickness in a cell, expressed as the decimal fraction of its thickness, below which the cell is considered inactive. (default is 0.01).
ifmtcn : int
A flag/format code indicating how the calculated concentration should be printed to the standard output text file. Format codes for printing are listed in Table 3 of the MT3DMS manual. If ifmtcn > 0 printing is in wrap form; ifmtcn < 0 printing is in strip form; if ifmtcn = 0 concentrations are not printed. (default is 0).
ifmtnp : int
A flag/format code indicating how the number of particles should be printed to the standard output text file. The convention is the same as for ifmtcn. (default is 0).
ifmtrf : int
A flag/format code indicating how the calculated retardation factor should be printed to the standard output text file. The convention is the same as for ifmtcn. (default is 0).
ifmtdp : int
A flag/format code indicating how the distance-weighted dispersion coefficient should be printed to the standard output text file. The convention is the same as for ifmtcn. (default is 0).
savucn : bool
A logical flag indicating whether the concentration solution should be saved in an unformatted file. (default is True).
nprs : int
A flag indicating (i) the frequency of the output and (ii) whether the output frequency is specified in terms of total elapsed simulation time or the transport step number. If nprs > 0 results will be saved at the times as specified in timprs; if nprs = 0, results will not be saved except at the end of simulation; if NPRS < 0, simulation results will be saved whenever the number of transport steps is an even multiple of nprs. (default is 0).
timprs : list of floats
The total elapsed time at which the simulation results are saved. The number of entries in timprs must equal nprs. (default is None).
obs: array of int
An array with the cell indices (layer, row, column) for which the concentration is to be printed at every transport step. (default is None). obs indices must be entered as zero-based numbers as a 1 is added to them before writing to the btn file.
An integer indicating how frequently the concentration at the specified observation points should be saved. (default is 1).
A logical flag indicating whether a one-line summary of mass balance information should be printed. (default is True).
An integer indicating how frequently the mass budget information should be saved. (default is 1).
The user-specified initial transport step size within each time-step of the flow solution. (default is 0).
The maximum number of transport steps allowed within one time step of the flow solution. (default is 50000).
The multiplier for successive transport steps within a flow time-step if the GCG solver is used and the solution option for the advection term is the standard finite-difference method. (default is 1.0).
The maximum transport step size allowed when transport step size multiplier TTSMULT > 1.0. (default is 0).
species_names: list of str
A list of names for every species in the simulation.
extension : string
Filename extension (default is ‘btn’)
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.
>>> import flopy >>> mt = flopy.mt3dms.Mt3dms() >>> btn = flopy.mt3dms.Mt3dBtn(mt)
check(f=None, verbose=True, level=1)¶
Check package data for common errors.
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.
>>> import flopy >>> m = flopy.modflow.Modflow.load('model.nam') >>> m.dis.check()
load(f, model, ext_unit_dict=None)¶
Load an existing package.
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.
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
btn : Mt3dBtn object
>>> import flopy >>> mt = flopy.mt3d.Mt3dms() >>> btn = flopy.mt3d.Mt3dBtn.load('test.btn', mt)
Plot 2-D, 3-D, transient 2-D, and stress period list (MfList) package input data
**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)
axes : list
Empty list is returned if filename_base is not None. Otherwise a list of matplotlib.pyplot.axis are returned.
>>> import flopy >>> ml = flopy.modflow.Modflow.load('test.nam') >>> ml.dis.plot()
setmodflowvars(nlay, nrow, ncol, nper, laycon, delr, delc, htop, dz, perlen, nstp, tsmult)¶
Set these variables from the MODFLOW model, if it exists
Export 2-D, 3-D, and transient 2-D model data to shapefile (polygons). Adds an attribute for each layer in each data array
filename : str
Shapefile name to write
>>> import flopy >>> ml = flopy.modflow.Modflow.load('test.nam') >>> ml.lpf.to_shapefile('test_hk.shp')
Write the package file
read1d_fixed(f, a, nvalperline=8)¶
Read a 10 real value array (such as TIMPRS) and return it as a.
f : file handle
a : np.ndarray
array to fill
a : np.ndarray