flopy.modflow.mfpcg Module

mfpcg module. Contains the ModflowPcg class. Note that the user can access the ModflowPcg class as flopy.modflow.ModflowPcg.

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

class flopy.modflow.mfpcg.ModflowPcg(model, mxiter=50, iter1=30, npcond=1, hclose=1e-05, rclose=1e-05, relax=1.0, nbpol=0, iprpcg=0, mutpcg=3, damp=1.0, dampt=1.0, ihcofadd=0, extension='pcg', unitnumber=None, filenames=None)

MODFLOW Pcg Package Class.

Parameters:

model : model object

The model object (of type flopy.modflow.mf.Modflow) to which this package will be added.

mxiter : int

maximum number of outer iterations. (default is 50)

iter1 : int

maximum number of inner iterations. (default is 30)

npcond : int

flag used to select the matrix conditioning method. (default is 1). specify npcond = 1 for Modified Incomplete Cholesky. specify npcond = 2 for Polynomial.

hclose : float

is the head change criterion for convergence. (default is 1e-5).

rclose : float

is the residual criterion for convergence. (default is 1e-5)

relax : float

is the relaxation parameter used with npcond = 1. (default is 1.0)

nbpol : int

is only used when npcond = 2 to indicate whether the estimate of the upper bound on the maximum eigenvalue is 2.0, or whether the estimate will be calculated. nbpol = 2 is used to specify the value is 2.0; for any other value of nbpol, the estimate is calculated. Convergence is generally insensitive to this parameter. (default is 0).

iprpcg : int

solver print out interval. (default is 0).

mutpcg : int

If mutpcg = 0, tables of maximum head change and residual will be printed each iteration. If mutpcg = 1, only the total number of iterations will be printed. If mutpcg = 2, no information will be printed. If mutpcg = 3, information will only be printed if convergence fails. (default is 3).

damp : float

is the steady-state damping factor. (default is 1.)

dampt : float

is the transient damping factor. (default is 1.)

ihcofadd : int

is a flag that determines what happens to an active cell that is surrounded by dry cells. (default is 0). If ihcofadd=0, cell converts to dry regardless of HCOF value. This is the default, which is the way PCG2 worked prior to the addition of this option. If ihcofadd<>0, cell converts to dry only if HCOF has no head-dependent stresses or storage terms.

extension : list string

Filename extension (default is ‘pcg’)

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.

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> pcg = flopy.modflow.ModflowPcg(m)
static load(f, model, 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.modflow.mf.Modflow) 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 flopy.utils.mfreadnam.parsenamefile.

Returns:

pcg : ModflowPcg object

Examples

>>> import flopy
>>> m = flopy.modflow.Modflow()
>>> pcg = flopy.modflow.ModflowPcg.load('test.pcg', m)
write_file()

Write the package file.

Returns:None