flopy.seawat.swt module

class Seawat(modelname='swttest', namefile_ext='nam', modflowmodel=None, mt3dmodel=None, version='seawat', exe_name='swtv4', structured=True, listunit=2, model_ws='.', external_path=None, verbose=False, load=True, silent=0)[source]

Bases: BaseModel

SEAWAT Model Class.

Parameters:
  • modelname (str, default "swttest") – Name of model. This string will be used to name the SEAWAT input that are created with write_model.

  • namefile_ext (str, default "nam") – Extension for the namefile.

  • modflowmodel (Modflow, default None) – Instance of a Modflow object.

  • mt3dmodel (Mt3dms, default None) – Instance of a Mt3dms object.

  • version (str, default "seawat") – Version of SEAWAT to use. Valid versions are “seawat” (default).

  • exe_name (str, default "swtv4") – The name of the executable to use.

  • structured (bool, default True) – Specify if model grid is structured (default) or unstructured.

  • listunit (int, default 2) – Unit number for the list file.

  • model_ws (str, default ".") – Model workspace. Directory name to create model data sets. Default is the present working directory.

  • external_path (str, optional) – Location for external files.

  • verbose (bool, default False) – Print additional information to the screen.

  • load (bool, default True) – Load model.

  • silent (int, default 0) – Silent option.

Notes

Examples

>>> import flopy
>>> m = flopy.seawat.swt.Seawat()
change_model_ws(new_pth=None, reset_external=False)[source]

Change the model work space.

Parameters:

new_pth (str or PathLike) – Path of the new model workspace. If this path does not exist, it will be created. If no value (None) is given, the default is the present working directory.

Returns:

val – Can be used to see what packages are in the model, and can then be used with get_package to pull out individual packages.

Return type:

list of strings

get_ifrefm()[source]
get_nrow_ncol_nlay_nper()[source]
classmethod load(f: str, version='seawat', exe_name: str | PathLike = 'swtv4', verbose=False, model_ws: str | PathLike = '.', load_only=None)[source]

Load an existing model.

Parameters:
  • f (str) – Name of SEAWAT name file to load.

  • version (str, default "seawat") – Version of SEAWAT to use. Valid versions are “seawat” (default).

  • exe_name (str, default "swtv4") – The name of the executable to use.

  • verbose (bool, default False) – Print additional information to the screen.

  • model_ws (str or PathLike, default ".") – Model workspace. Directory to create model data sets. Default is the present working directory.

  • load_only (list of str, optional) – Packages to load (e.g. [“lpf”, “adv”]). Default None means that all packages will be loaded.

Return type:

flopy.seawat.swt.Seawat

Examples

>>> import flopy
>>> m = flopy.seawat.swt.Seawat.load(f)
property mcomp
property modelgrid
property modeltime
property ncol
property ncomp
property nlay
property nper
property nrow
property nrow_ncol_nlay_nper
write_name_file()[source]

Write the name file

Return type:

None

class SeawatList(model, extension='list', listunit=7)[source]

Bases: Package

List Package class

write_file()[source]

Every Package needs its own write_file function