flopy.modpath.mpsim Module

mpsim module. Contains the ModpathSim class. Note that the user can access the ModpathSim class as flopy.modpath.ModpathSim.

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

class flopy.modpath.mpsim.ModpathSim(model, mp_name_file='mp.nam', mp_list_file='mp.list', option_flags=[1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1], ref_time=0, ref_time_per_stp=[0, 0, 1.0], stop_time=None, group_name=['group_1'], group_placement=[[1, 1, 1, 0, 1, 1]], release_times=[[1, 1]], group_region=[[1, 1, 1, 1, 1, 1]], mask_nlay=[1], mask_layer=[1], mask_1lay=[1], face_ct=[1], ifaces=[[6, 1, 1]], part_ct=[[1, 1, 1]], time_ct=1, release_time_incr=1, time_pts=[1], particle_cell_cnt=[[2, 2, 2]], cell_bd_ct=1, bud_loc=[[1, 1, 1, 1]], trace_id=1, stop_zone=1, zone=1, retard_fac=1.0, retard_fcCB=1.0, extension='mpsim')

MODPATH Simulation File Package Class.

Parameters:

model : model object

The model object (of type flopy.modpath.mp.Modpath) to which this package will be added.

extension : string

Filename extension (default is ‘mpsim’)

Examples

>>> import flopy
>>> m = flopy.modpath.Modpath()
>>> dis = flopy.modpath.ModpathSim(m)

Attributes

heading (str) Text string written to top of package input file.
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

load(model, pack_type, f, nper=None, pop_key_list=None, check=True, unitnumber=None, ext_unit_dict=None)

The load method has not been implemented for this package.

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
class flopy.modpath.mpsim.StartingLocationsFile(model, inputstyle=1, extension='loc', verbose=False)

Class for working with MODPATH Starting Locations file for particles.

Parameters:

model : Modpath object

The model object (of type flopy.modpath.mp.Modpath) to which this package will be added.

inputstyle : 1

Input style described in MODPATH6 manual (currently only input style 1 is supported)

extension : string

Filename extension (default is ‘loc’)

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_dtypes()

Build numpy dtype for the MODPATH 6 starting locations file.

static get_empty_starting_locations_data(npt=0, default_xloc0=0.5, default_yloc0=0.5, default_zloc0=0.0)

get an empty recarray for particle starting location info.

Parameters:

npt : int

Number of particles. Particles in array will be numbered consecutively from 1 to npt.

load(model, pack_type, f, nper=None, pop_key_list=None, check=True, unitnumber=None, ext_unit_dict=None)

The load method has not been implemented for this package.

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')