pycomus.Package package

Submodules

pycomus.Package.CDRN module

class pycomus.Package.CDRN.ComusDrn(model: ComusModel, cond: int | float | Dict[int, int | float | ndarray], delev: int | float | Dict[int, int | float | ndarray])[source]

Bases: object

Initialize the COMUS Model with the Drainage(DRN) package.

Attributes:

model: pycomus.ComusModel

The COMUS model to which the DRN package will be applied.

cond: Union[int, float, Dict[int, Union[int, float, np.ndarray]]]

The hydraulic conductivity coefficient between the drainage ditch and the aquifer at the grid cell (L²/T).

delev: Union[int, float, Dict[int, Union[int, float, np.ndarray]]]

The elevation of the bottom of the drainage ditch at the grid cell (L).

Methods:

__init__(self, model: pycomus.ComusModel,

cond: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], delev: Union[int, float, Dict[int, Union[int, float, np.ndarray]]])

Initialize the COMUS Model with the Drainage(DRN) package.

load(cls, model, drn_params_file: str)

Load parameters from a DRN.in file and create a ComusDrn instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusDrn module to the specified path as <DRN.in>.

Returns:

instance: pycomus.ComusDrn

COMUS Drainage(DRN) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> drnPkg = pycomus.Package.ComusDrn(model1, Cond={0: 1}, Delev={0: 20})
classmethod load(model, drn_params_file: str)[source]

Load parameters from a DRN.in file and create a ComusDrn instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

drn_params_file: str

Grid DRN Params File Path(DRN.in).

Returns:

instance: pycomus.ComusDrn

COMUS Drainage(DRN) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> drnPkg = pycomus.ComusDrn.load(model, "./InputFiles/DRN.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusDrn module to the specified path as <DRN.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CEVT module

class pycomus.Package.CEVT.ComusEvt(model: ComusModel, et_surf: int | float | Dict[int, int | float | ndarray], et_rate: int | float | Dict[int, int | float | ndarray], et_mxd: int | float | Dict[int, int | float | ndarray], et_exp: int | float | Dict[int, int | float | ndarray], evt: int = 1, num_seg: int = 10)[source]

Bases: object

Initialize the COMUS Model with the Evapotranspiration(EVT) package.

Attributes:

model: pycomus.ComusModel

The COMUS model to which the EVT package will be applied.

et_surf: Union[int, float, Dict[int, Union[int, float, np.ndarray]]]

The elevation of the subsurface evaporation interface at the grid cell (L).

et_rate: Union[int, float, Dict[int, Union[int, float, np.ndarray]]]

The potential (maximum) subsurface evaporation intensity at the grid cell (L/T).

et_mxd: Union[int, float, Dict[int, Union[int, float, np.ndarray]]]

The limit depth for subsurface evaporation at the grid cell (L).

et_exp: Union[int, float, Dict[int, Union[int, float, np.ndarray]]]

The subsurface evaporation exponent at the grid cell.

evt: int

Subsurface evaporation calculation option. 1: Calculate subsurface evaporation for specified layer grid cells; 2: Calculate subsurface evaporation for the highest layer effective

num_seg: int

The number of segments in the curve representing the change of subsurface evaporation with depth at the grid cell, with a minimum of 2 segments and a maximum of 20 segments.

Methods:

__init__(self, model: pycomus.ComusModel, et_surf: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

et_rate: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], et_mxd: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], et_exp: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], evt: int = 1, num_seg: int = 10)

Initialize the COMUS Model with the Evapotranspiration(EVT) package.

load(cls, model: pycomus.ComusModel, evt_params_file: str)

Load parameters from a EVT.in file and create a ComusEvt instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusEvt module to the specified path as <EVT.in>.

Returns:

instance: pycomus.ComusEvt

COMUS Evapotranspiration(EVT) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> evtPkg = pycomus.ComusEvt(model1, et_surf=1, et_rate=1, et_mxd=1, et_exp=1)
classmethod load(model: ComusModel, evt_params_file: str)[source]

Load parameters from a EVT.in file and create a ComusEvt instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

evt_params_file: str

Grid EVT Params File Path(EVT.in).

Returns:

instance: pycomus.ComusEvt

COMUS Evapotranspiration(EVT) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> evtPkg = pycomus.ComusRch.load(model1, "./InputFiles/EVT.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusEvt module to the specified path as <EVT.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CGHB module

class pycomus.Package.CGHB.ComusGhb(model: ComusModel, cond: int | float | Dict[int, int | float | ndarray], shead: int | float | Dict[int, int | float | ndarray], ehead: int | float | Dict[int, int | float | ndarray])[source]

Bases: object

Initialize the COMUS Model with the General-Head Boundary(GHB) package.

Attributes:

model:

The COMUS model to which the GHB package will be applied.

Cond:

The hydraulic conductivity coefficient between the general head and the aquifer (L²/T).

Shead:

The general head value at the beginning of the stress period (L).

Ehead:

The general head value at the end of the stress period (L).

Methods:

__init__(self, model: pycomus.ComusModel, cond: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

shead: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], ehead: Union[int, float, Dict[int, Union[int, float, np.ndarray]]])

Initialize the COMUS Model with the General-Head Boundary(GHB) package.

load(cls, model, ghb_params_file: str)

Load parameters from a GHB.in file and create a ComusGhb instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusGhb module to the specified path as <GHB.in>.

Returns:

instance: pycomus.ComusGhb

COMUS General-Head Boundary(GHB) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> ghbPkg = pycomus.ComusGhb(model1, cond={0: 1}, shead=1, ehead=2)
classmethod load(model, ghb_params_file: str)[source]

Load parameters from a GHB.in file and create a ComusGhb instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

ghb_params_file: str

Grid GHB Params File Path(GHB.in).

Returns:

instance: pycomus.ComusGhb

COMUS General-Head Boundary(GHB) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> ghbPackage = pycomus.ComusGhb.load(model1, "./InputFiles/DRN.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusGhb module to the specified path as <GHB.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CHFB module

class pycomus.Package.CHFB.ComusHfb(model: ComusModel, hfb_data: List[Tuple[int, int, int, int, int, int | float]])[source]

Bases: object

Initialize the COMUS Model with the Horizontal-Flow Barrier(HFB) package.

Attributes:

model:

The COMUS model to which the HFB package will be applied.

hfb_data:

List[Tuple] type data, in which the Tuple should contain six parameters: ILYR, IROW1, ICOL1, IROW2, ICOL2, HCDW.

Methods:

__init__(self, model: pycomus.ComusModel, hfb_data: List[Tuple[int, int, int, int, int, Union[int, float]]])

Initialize the COMUS Model with the Horizontal-Flow Barrier(HFB) package.

load(cls, model, hfb_params_file: str)

Load parameters from a HFB.in file and create a ComusHfb instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusHfb module to the specified path as <HFB.in>.

Returns:

instance: pycomus.ComusHfb

COMUS Horizontal-Flow Barrier(HFB) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> data = []
>>> for i in range(36):
>>>     data.append((i, 0, 15, 0, 16, 1e-6))
>>> hfbPackage = pycomus.ComusHfb(model=model1, hfb_data=data)
classmethod load(model, hfb_params_file: str)[source]

Load parameters from a HFB.in file and create a ComusHfb instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

hfb_params_file: str

Grid HFB Params File Path(HFB.in).

Returns:

instance: pycomus.ComusHfb

COMUS Horizontal-Flow Barrier(HFB) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> hfbPackage = pycomus.ComusHfb.load(model1, "./InputFiles/HFB.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusHfb module to the specified path as <HFB.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CIBS module

class pycomus.Package.CIBS.ComusIbs(model: ComusModel, hc: int | float | ndarray, sfe: int | float | ndarray, sfv: int | float | ndarray, com: int | float | ndarray)[source]

Bases: object

Initialize the COMUS Model with the Interbed Storage(IBS) package.

Attributes:

model:

The COMUS model to which the IBS package will be applied.

hc:

Preconsolidation head (L) of interbedded bodies within the grid cell.

sfe:

Elastic storage coefficient (-) of interbedded bodies within the grid cell.

sfv:

Inelastic (plastic) storage coefficient (-) of interbedded bodies within the grid cell.

com:

Historical compression amount (L) of interbedded bodies within the grid cell.

Methods:

__init__(self, model: pycomus.ComusModel, hc: Union[int, float, np.ndarray],

sfe: Union[int, float, np.ndarray], sfv: Union[int, float, np.ndarray], com: Union[int, float, np.ndarray])

Initialize the COMUS Model with the Interbed Storage(IBS) package.

load(cls, model, ibs_file: str)

Load parameters from a IBS.in file and create a ComusIbs instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusIbs module to the specified path as <IBS.in>.

Returns:

instance: pycomus.ComusIbs

COMUS Interbed Storage(IBS) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> ibsPackage = pycomus.ComusIbs(model1, hc=1, sfe=1, sfv=1, com=1)
classmethod load(model, ibs_file: str)[source]

Load parameters from a IBS.in file and create a ComusIbs instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

ibs_file: str

Grid IBS Params File Path(IBS.in).

Returns:

instance: pycomus.ComusIbs

COMUS Interbed Storage(IBS) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> ibsPackage = pycomus.ComusIbs.load(model1, "./InputFiles/IBS.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusIbs module to the specified path as <IBS.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CLAK module

class pycomus.Package.CLAK.ComusLak(model, lake_num: int)[source]

Bases: object

Initialize the COMUS Model with the Lake(LAK) package.

Attributes:

model:

COMUS Model Object.

lake_num:

Number of lakes.

Methods:

__init__(self, model, lake_num: int)

Initialize the COMUS Model with the Lake(LAK) package.

set_control_params(self, control_params: Dict[

int, Tuple[int, int, int, float, float, float, float, float, int, float, float, float, float]]) Set Lake Control Params.

set_period_data(self, period_data: Dict[

int, Dict[int, Tuple[float, float, float, float, float, float, float, float]]]) Set Lake Period Data.

set_grid_data(self, btm: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

lnk: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], sc1: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], sc2: Union[int, float, Dict[int, Union[int, float, np.ndarray]]])

Set Lake Grid Cell Data.

load(cls, model, ctrl_pars_file: str, period_file: str, grid_file: str)

Load parameters from LAK(LAKCtrl.in, LAKPer.in, LAKGrd.in) file and create a ComusLak instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusLak module to the specified path as <LAKCtrl.in>, <LAKPer.in> and <LAKGrd.in>.

Returns:

instance: pycomus.ComusLak

COMUS Lake(LAK) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> lakPackage = pycomus.ComusLak(model1, lake_num=1)
classmethod load(model, ctrl_pars_file: str, period_file: str, grid_file: str)[source]

Load parameters from LAK(LAKCtrl.in, LAKPer.in, LAKGrd.in) file and create a ComusLak instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

ctrl_pars_file: str

LAK Control Params File Path(LAKCtrl.in).

period_file: str

LAK Period Params File Path(LAKPer.in).

grid_file: str

LAK Grid Params File Path(LAKGrd.in).

Returns:

instance: pycomus.ComusLak

COMUS Lake(LAK) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> lakPackage = pycomus.ComusLak.load(model1, "LAKCtrl.in", "LAKPer.in", "LAKGrd.in")
set_control_params(control_params: Dict[int, Tuple[int, int, int, float, float, float, float, float, int, float, float, float, float]]) None[source]

Set Lake Control Params.

Parameters:

control_params – A Dict type data where the keys represent the lake IDs, and the values are Tuples containing 13 elements: STRID, DIVSID, DIVSAT, BETA, INIHLEV, DEADHLEV, EVEXP, EVMAXD, NUMSEG, STRBED, STRWDT, STRNDC, STRSLP.

set_grid_data(btm: int | float | Dict[int, int | float | ndarray], lnk: int | float | Dict[int, int | float | ndarray], sc1: int | float | Dict[int, int | float | ndarray], sc2: int | float | Dict[int, int | float | ndarray]) None[source]

Set Lake Grid Cell Data.

Parameters:
  • btm – Lake bed elevation (L) at the grid cell of the lake.

  • lnk – Overland flow coefficient (1/T) between the lake bed and the aquifer.

  • sc1 – Storage coefficient (-) when the grid cell of the lake is under pressure condition.

  • sc2 – Supply coefficient (-) when the grid cell of the lake is under non-pressure condition.

set_period_data(period_data: Dict[int, Dict[int, Tuple[float, float, float, float, float, float, float, float]]]) None[source]

Set Lake Period Data.

Parameters:

period_data

A Dict type data where the keys represent the Period IDs, and the values are Dicts with lake IDs as keys. Within the inner Dicts, the values are Tuples containing four elements: PCP, RNFCOF, PRHCOF,

ET0, EVWBCOF, GEVCOF, WATDIV, WATUSE.

write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusLak module to the specified path as <LAKCtrl.in>, <LAKPer.in> and <LAKGrd.in>.

Parameters:

folder_path – Output folder path.

class pycomus.Package.CLAK.Lak[source]

Bases: object

pycomus.Package.CRCH module

class pycomus.Package.CRCH.ComusRch(model: ComusModel, rechr: int | float | Dict[int, int | float | ndarray], rech: int)[source]

Bases: object

Set COMUS Model With Recharge(RCH) Package.

Attributes:

model:

COMUS Model Object.

rechr:

The rate of areal recharge to the grid cell (L/T). This value must be greater than or equal to 0.

rech:

The computation option for areal recharge. The value 1 indicates that areal recharge is calculated for specified layer grid cells; 2 indicates that areal recharge is calculated for the highest active grid cells in the model.

Methods:

__init__(self, model: pycomus.ComusModel, rechr: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

rech: int)

Set COMUS Model With Recharge(RCH) Package.

load(cls, model, rch_params_file: str)

Load parameters from a RCH.in file and create a ComusRch instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusRch module to the specified path as <RCH.in>.

Returns:

instance: pycomus.ComusRch

COMUS Recharge(RCH) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> recharge = np.zeros((40, 1, 100))
>>> recharge[0, 0, 49:52] = 0.0015
>>> rchPkg = pycomus.ComusRch(model1, rechr={0: recharge}, rech=1)
classmethod load(model, rch_params_file: str)[source]

Load parameters from a RCH.in file and create a ComusRch instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

rch_params_file: str

Grid RCH Params File Path(RCH.in).

Returns:

instance: pycomus.ComusRch

COMUS Recharge(RCH) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> rchPkg = pycomus.ComusRch.load(model1, "./InputFiles/RCH.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusRch module to the specified path as <RCH.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CREG module

class pycomus.Package.CREG.ComusReg(model: ComusModel, reg_data: Dict[str, Dict[str, List[Tuple[int, int, int]]]])[source]

Bases: object

Initialize the COMUS Model with the Region Statistics tool.

Attributes:

model: pycomus.ComusModel

The COMUS model to which the IBS package will be applied.

reg_data: Dict[str, Dict[str, List[Tuple[int, int, int]]]]

The reg_data is a nested dictionary. The keys of the outer dictionary are the names of the statistical schemes, and the values are dictionaries. The keys of the inner dictionary are the names of the statistical partitions, and the values are a list of tuples, where each tuple represents the layer number, row number , and column number.

Methods:

__init__(self, model: pycomus.ComusModel, reg_data: Dict[str, Dict[str, List[Tuple[int, int, int]]]])

Initialize the COMUS Model with the Region Statistics tool.

load(cls, model, reg_file: str)

Load parameters from a RegSta.in file and create a ComusReg instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusReg module to the specified path as <RegSta.in>.

Returns:

instance: pycomus.ComusReg

COMUS Region Statistics Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> reg_sta = pycomus.ComusReg(model1,{"scheme1": {"par1": [(0,0,0), (0,0,1), (1,1,1)]}})
classmethod load(model, reg_file: str)[source]

Load parameters from a RegSta.in file and create a ComusReg instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

reg_file: str

Grid Region Statistics File Path(RegSta.in).

Returns:

instance: pycomus.ComusReg

COMUS Region Statistics Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="OneDimFlowSim(File-Input)")
>>> reg_sta = pycomus.ComusReg.load(model, "./InputFiles/RegSta.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusReg module to the specified path as <RegSta.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CRES module

class pycomus.Package.CRES.ComusRes(model, res_num: int)[source]

Bases: object

Initialize the COMUS Model with the Reservoir(RES) package.

Attributes:

model:

COMUS Model Object.

res_num:

Number of reservoirs.

Methods:

__init__(self, model, res_num: int)

Initialize the COMUS Model with the Reservoir(RES) package.

set_control_params(self, control_params: Dict[int, Tuple[float, float, int, int]])

Set Reservoir Control Params.

set_period_data(self, period_data: Dict[int, Dict[int, Tuple[float, float, float, float]]])

Set Reservoir Period Data.

set_grid_data(self, btm: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

bvk: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], btk: Union[int, float, Dict[int, Union[int, float, np.ndarray]]])

Set Reservoir Grid Cell Data.

load(cls, model, ctrl_pars_file: str, period_file: str, grid_file: str)

Load parameters from RES(RESCtrl.in, RESPer.in, RESGrd.in) file and create a ComusRes instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusRes module to the specified path as <RESCtrl.in>, <RESPer.in> and <RESGrd.in>.

Returns:

instance: pycomus.ComusRes

COMUS Reservoir(RES) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> resPackage = pycomus.ComusRes(model1, res_num=1)
classmethod load(model, ctrl_pars_file: str, period_file: str, grid_file: str)[source]

Load parameters from RES(RESCtrl.in, RESPer.in, RESGrd.in) file and create a ComusRes instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

ctrl_pars_file: str

Grid RES Params File Path(RESCtrl.in).

period_file: str

Grid RES Params File Path(RESPer.in).

grid_file: str

Grid RES Params File Path(RESGrd.in).

Returns:

instance: pycomus.ComusRes

COMUS Reservoir(RES) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="OneDimFlowSim(File-Input)")
>>> resPackage = pycomus.ComusRes.load(model1, "./InputFiles/RESCtrl.in", "./InputFiles/RESPer.in",
>>> "./InputFiles/RESGrd.in")
set_control_params(control_params: Dict[int, Tuple[float, float, int, int]]) None[source]

Set Reservoir Control Params.

Parameters:

control_params – A Dict type data where the keys represent the reservoir IDs, and the values are Tuples containing four elements: EvExp, EvMaxd, NumSeg, and NumPt.

set_grid_data(btm: int | float | Dict[int, int | float | ndarray], bvk: int | float | Dict[int, int | float | ndarray], btk: int | float | Dict[int, int | float | ndarray]) None[source]

Set Reservoir Grid Cell Data.

Parameters:
  • btm – btm represents the elevation of the reservoir grid cell’s bed (L).

  • bvk – bvk represents the hydraulic conductivity coefficient of the low-permeability medium at the reservoir grid cell (L/T).

  • btk – btk represents the thickness of the low-permeability medium at the reservoir grid cell (L).

set_period_data(period_data: Dict[int, Dict[int, Tuple[float, float, float, float]]]) None[source]

Set Reservoir Period Data.

Parameters:

period_data – A Dict type data where the keys represent the reservoir IDs, and the values are Dicts with Period IDs as keys. Within the inner Dicts, the values are Tuples containing four elements: Shead, Ehead, Rchrg, and Gevt.

write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusRes module to the specified path as <RESCtrl.in>, <RESPer.in> and <RESGrd.in>.

Parameters:

folder_path – Output folder path.

class pycomus.Package.CRES.Res[source]

Bases: object

pycomus.Package.CRIV module

class pycomus.Package.CRIV.ComusRiv(model: ComusModel, cond: int | float | Dict[int, int | float | ndarray], shead: int | float | Dict[int, int | float | ndarray], ehead: int | float | Dict[int, int | float | ndarray], riv_btm: int | float | Dict[int, int | float | ndarray])[source]

Bases: object

Initialize the COMUS Model with the River(RIV) package.

Attributes:

model:

The COMUS model to which the RIV package will be applied.

cond:

The hydraulic conductivity coefficient between the river and the aquifer on the grid cell (L²/T)

shead:

The river stage at the beginning of the stress period (L)

ehead:

The river stage at the end of the stress period (L)

riv_btm:

The elevation of the bottom of the low permeability medium in the riverbed on the grid cell (L).

Methods:

__init__(self, model: pycomus.ComusModel, cond: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

shead: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], ehead: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], riv_btm: Union[int, float, Dict[int, Union[int, float, np.ndarray]]])

Initialize the COMUS Model with the River(RIV) package.

load(cls, model, riv_params_file: str)

Load parameters from a RIV.in file and create a ComusRiv instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusRiv module to the specified path as <RIV.in>.

Returns:

instance: pycomus.ComusRiv

COMUS River(RIV) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> rivPackage = pycomus.ComusRiv(model1, cond=1, shead=1, ehead=2, riv_btm=10)
classmethod load(model, riv_params_file: str)[source]

Load parameters from a RIV.in file and create a ComusRiv instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

riv_params_file: str

Grid RIV Params File Path(RIV.in).

Returns:

instance: pycomus.ComusRiv

COMUS River(RIV) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="OneDimFlowSim(File-Input)")
>>> rivPackage = pycomus.ComusRiv.load(model, "./InputFiles/RIV.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusRiv module to the specified path as <RIV.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CSHB module

class pycomus.Package.CSHB.ComusShb(model: ComusModel, shead: int | float | Dict[int, int | float | ndarray], ehead: int | float | Dict[int, int | float | ndarray])[source]

Bases: object

Initialize the COMUS Model with the Transient Specified-Head Boundary(SHB) package.

Parameters:

model:

The COMUS model to which the SHB package will be applied.

shead:

The hydraulic head value of the grid cell at the beginning of the stress period (L).

ehead:

The hydraulic head value of the grid cell at the end of the stress period (L).

Methods:

__init__(self, model: pycomus.ComusModel, shead: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

ehead: Union[int, float, Dict[int, Union[int, float, np.ndarray]]])

Initialize the COMUS Model with the Transient Specified-Head Boundary(SHB) package.

load(cls, model, shb_params_file: str)

Load parameters from a SHB.in file and create a ComusShb instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusShb module to the specified path as <SHB.in>.

Returns:

instance: pycomus.ComusShb

COMUS Transient Specified-Head Boundary(SHB) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> shbPackage = pycomus.ComusShb(model1, shead=1, ehead=2)
classmethod load(model, shb_params_file: str)[source]

Load parameters from a SHB.in file and create a ComusShb instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

shb_params_file: str

Grid SHB Params File Path(SHB.in).

Returns:

instance: pycomus.ComusShb

COMUS Transient Specified-Head Boundary(SHB) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="OneDimFlowSim(File-Input)")
>>> shbPackage = pycomus.ComusShb.load(model, "./InputFiles/SHB.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusShb module to the specified path as <SHB.in>.

Parameters:

folder_path – Output folder path.

pycomus.Package.CSTR module

class pycomus.Package.CSTR.ComusStr(model, stream_num: int)[source]

Bases: object

Initialize the COMUS Model with the Stream(STR) package.

Attributes:

model:

COMUS Model Object.

stream_num:

Number of streams.

Methods:

__init__(self, model, stream_num: int)

Initialize the COMUS Model with the Stream(STR) package.

set_ControlData(self, control_params: Dict[int, Tuple[int, int, int, int, int, int, int, int, int]])

Set Stream Control Params.

set_PeriodData(self, period_data: Dict[int, Dict[

int, Tuple[int, float, float, float, float, float, float, float, float, float, float, float]]]) Set Stream Period Data.

set_GridData(self, cell_id: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

length: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], btm: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], bwdt: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], sizh1: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], sizh2: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], bvk: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], btk: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], slp: Union[int, float, Dict[int, Union[int, float, np.ndarray]]], ndc: Union[int, float, Dict[int, Union[int, float, np.ndarray]]])

Set Stream Grid Cell Data.

set_WatUseData(self, wureg_id: Union[int, np.ndarray], ratio: Union[int, float, np.ndarray])

Set Stream Water Use Data.

set_WatDrnData(self, delev: Union[int, np.ndarray], cond: Union[int, float, np.ndarray],

segm_id: Union[int, float, np.ndarray])

Set Stream Water Drn Data.

load_ctrlPars_file(self, ctrlParFile)

Load data from <STRCtrl.in>.

load_period_file(self, period_file: str)

Load data from <STRPer.in>.

load_strGrid_file(self, strGridFile: str)

Load data from <STRGrd.in>.

load_watUse_file(self, watUseFile: str)

Load data from <STRWatUse.in>.

load_watDrn_file(self, watDrnFile: str)

Load data from <STRWatDrn.in>.

load(cls, model, ctrl_pars_file: str, period_file: str, grid_file: str, watUse_file: str, watDrn_file: str):

Load parameters from STR(STRCtrl.in, RESPer.in, RESGrd.in, STRWatUse.in, STRWatDrn.in) file and create a ComusStr instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusStr module to the specified path as <STRCtrl.in>, <STRPer.in>, <STRGrd.in>, <STRWatUse.in>, <STRWatDrn.in>.

Returns:

instance: pycomus.ComusStr

COMUS Stream(STR) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> strPackage = pycomus.ComusStr(model1, stream_num=1)
classmethod load(model, ctrl_pars_file: str, period_file: str, grid_file: str, watUse_file: str, watDrn_file: str)[source]

Load parameters from STR(STRCtrl.in, RESPer.in, RESGrd.in, STRWatUse.in, STRWatDrn.in) file and create a ComusStr instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

ctrl_pars_file: str

STR Control Params File Path(STRCtrl.in).

period_file: str

STR Period Params File Path(STRPer.in).

grid_file: str

STR Grid Params File Path(STRGrd.in).

watUse_file: str

STR WaterUse Params FilePath(STRWatUse.in).

watDrn_file: str

STR WaterDrain Params FilePath(STRWatDrn.in).

Returns:

instance: pycomus.ComusStr

COMUS Stream(STR) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="OneDimFlowSim(File-Input)")
>>> strPackage = pycomus.ComusRes.load(model1, "./InputFiles/STRCtrl.in", "./InputFiles/STRPer.in",
>>> "./InputFiles/STRGrd.in", "./InputFiles/STRWatUse.in", "./InputFiles/STRWatDrn.in")
load_ctrlPars_file(ctrlParFile)[source]

Load data from <STRCtrl.in>.

Parameters:

ctrlParFile – Stream Control Parameters File.

load_period_file(period_file: str)[source]

Load data from <STRPer.in>.

Parameters:

period_file – Stream Period Parameters File.

load_strGrid_file(strGridFile: str)[source]

Load data from <STRGrd.in>.

Parameters:

strGridFile – Stream Grid Cell Parameters File.

load_watDrn_file(watDrnFile: str)[source]

Load data from <STRWatDrn.in>.

Parameters:

watDrnFile – Stream Water Drn Parameters File.

load_watUse_file(watUseFile: str)[source]

Load data from <STRWatUse.in>.

Parameters:

watUseFile – Stream Water Use Parameters File.

set_ControlData(control_params: Dict[int, Tuple[int, int, int, int, int, int, int, int, int]]) None[source]

Set Stream Control Params.

Parameters:

control_params – A Dict type data where the keys represent the streams IDs, and the values are Tuples containing nine elements: [“NEXTID”, “NEXTAT”, “DIVSID”, “DIVSAT”, “DIVTPOPT”, “WUTPOPT”, “WUREGID”, “WUBKOPT”, “DRNOPT”]

set_GridData(cell_id: int | float | Dict[int, int | float | ndarray], length: int | float | Dict[int, int | float | ndarray], btm: int | float | Dict[int, int | float | ndarray], bwdt: int | float | Dict[int, int | float | ndarray], sizh1: int | float | Dict[int, int | float | ndarray], sizh2: int | float | Dict[int, int | float | ndarray], bvk: int | float | Dict[int, int | float | ndarray], btk: int | float | Dict[int, int | float | ndarray], slp: int | float | Dict[int, int | float | ndarray], ndc: int | float | Dict[int, int | float | ndarray]) None[source]

Set Stream Grid Cell Data.

Parameters:
  • cell_id – cell_id is an integer representing the sequential upstream and downstream order of the river segment within its parent river unit (1 indicates that the river segment is the first segment of the river unit).

  • length – length is a double precision floating-point number representing the length of the river segment within the grid cell (L).

  • btm – btm is a double precision floating-point number representing the average bed elevation of the river segment (L).

  • bwdt – bwdt is a double precision floating-point number representing the average bed width of the river segment (L).

  • sizh1 – sizh1 is a double precision floating-point number representing the reciprocal of the left bank slope of the river segment (L/L).

  • sizh2 – sizh2 is a double precision floating-point number representing the reciprocal of the right bank slope of the river segment (L/L).

  • bvk – bvk is a double precision floating-point number representing the permeability coefficient of the low-permeability medium of the river segment (L/T).

  • btk – btk is a double precision floating-point number representing the thickness of the low-permeability medium of the river segment (L).

  • slp – slp is a double precision floating-point number representing the average bed slope of the river segment (L/L).

  • ndc – ndc is a double precision floating-point number representing the Manning’s roughness coefficient (n) of the river segment.

set_PeriodData(period_data: Dict[int, Dict[int, Tuple[int, float, float, float, float, float, float, float, float, float, float, float]]]) None[source]

Set Stream Period Data.

Parameters:

period_data – A Dict type data where the keys represent the stream IDs, and the values are Dicts with Period IDs as keys. Within the inner Dicts, the values are Tuples containing four elements: (HCALOPT, USLEV, UELEV, DSLEV, DELEV, WATPNT,” WATWAY, WATDIV, WATUSE, EVRATE, RCHCOE, WBKCOE)

set_WatDrnData(delev: int | ndarray, cond: int | float | ndarray, segm_id: int | float | ndarray) None[source]

Set Stream Water Drn Data.

Parameters:
  • delev – delev is a double precision floating-point number representing the elevation of the drainage ditch bottom at the grid cell (in meters). The drainage ditch only discharges groundwater when the groundwater level is higher than this elevation.

  • cond

    cond is a double precision floating-point number representing the hydraulic conductivity coefficient between

    the drainage ditch and the aquifer at the grid cell (in square meters per second).

  • segm_id – segm_id is a double precision floating-point number representing the drainage area number, which is the identifier of the river segment of the seasonal river to which the grid cell drainage flows (starting from 1).

set_WatUseData(wureg_id: int | ndarray, ratio: int | float | ndarray) None[source]

Set Stream Water Use Data.

Parameters:
  • wureg_id

    wureg_id is an integer representing the water use zone number for the river unit (starting from 1). A portion

    of the river unit’s water use will be allocated to simulate surface infiltration recharge on grid cells within the range of this water use zone.

  • ratio – ratio is a double precision floating-point number representing the weight coefficient of surface infiltration recharge for the river unit on the grid cell (-). It must be greater than or equal to 0.

write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusStr module to the specified path as <STRCtrl.in>, <STRPer.in>, <STRGrd.in>, <STRWatUse.in>, <STRWatDrn.in>.

Parameters:

folder_path – Output folder path.

class pycomus.Package.CSTR.Stream[source]

Bases: object

pycomus.Package.CSUB module

class pycomus.Package.CSUB.ComusSub(model: ComusModel, num_ndb: int, num_db: int, num_mz: int, nn: int = 20, acc: float = 0.5, it_min: int = 5, dsh_opt: int = 2)[source]

Bases: object

Initialize the COMUS Model with the Subsidence(SUB) package.

Attributes:

model:

The COMUS model to which the SUB package will be applied.

num_ndb:

Number of delayed interbedded body groups without delay.

num_db:

Number of delayed interbedded bodies.

num_mz:

Only valid when num_ndb > 0, indicating the number of media zones.

nn:

Number of discrete points on the half thickness of equivalent interbedded bodies.

acc:

Representing the simulation acceleration parameter of delayed interbedded bodies.

it_min:

The effective value should be greater than or equal to 2, typically set to 5.

dsh_opt:

Representing the option for determining the initial head values of delayed interbedded bodies.

Methods:

__init__(self, model: pycomus.ComusModel, num_ndb: int, num_db: int, num_mz: int, nn: int = 20,

acc: float = 0.5, it_min: int = 5, dsh_opt: int = 2):

Initialize the COMUS Model with the Subsidence(SUB) package.

set_mz_data(self, mz_data: Union[Dict[int, Tuple[float, float, float]], List[Tuple[float, float, float]]])

Set MZ Data.

set_ndb_lyr(self, ndb_lyr: Union[Dict[int, int], List[int]])

Set No Delay Interbeds Layer Property.

set_ndb_grid(self, hc: Union[int, float, np.ndarray], sfe: Union[int, float, np.ndarray],

sfv: Union[int, float, np.ndarray], com: Union[int, float, np.ndarray])

Set No Delay Interbeds Grid Cell Property.

set_db_lyr(self, db_lyr: Union[Dict[int, int], List[int]])

Set Delay Interbeds Layer Property.

set_db_grid(self, rnb: Union[int, float, np.ndarray], dsh: Union[int, float, np.ndarray],

dhc: Union[int, float, np.ndarray], dcom: Union[int, float, np.ndarray], dz: Union[int, float, np.ndarray], imz: Union[int, float, np.ndarray])

Set Delay Interbeds Grid Cell Property.

load(cls, model, ctrl_file: str, mz_file: str, ndb_lyr_file: str, ndb_grid_file: str, db_lyr_file: str,

db_grid_file: str)

Load parameters from SUB(SUBCtrl.in, SUBMZ.in, SUBNDB.in, SUBGrdNDB.in, SUBDB.in, SUBGrdDB.in) file and create a ComusSub instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusSub module to the specified path as <SUBCtrl.in>, <SUBMZ.in>, <SUBNDB.in>, <SUBDB.in>, <SUBGrdNDB.in>, <SUBGrdDB.in>.

Returns:

instance: pycomus.ComusSub

COMUS Subsidence(SUB) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> subPackage = pycomus.ComusSub(model1, 2, 2, 10)
classmethod load(model, ctrl_file: str, mz_file: str, ndb_lyr_file: str, ndb_grid_file: str, db_lyr_file: str, db_grid_file: str)[source]

Load parameters from SUB(SUBCtrl.in, SUBMZ.in, SUBNDB.in, SUBGrdNDB.in, SUBDB.in, SUBGrdDB.in) file and create a ComusSub instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

ctrl_file: str

SUB Control Params File Path(SUBCtrl.in).

mz_file: str

SUB MZ Params File Path(SUBMZ.in).

ndb_lyr_file: str

SUB NDB Layer Params File Path(SUBNDB.in).

ndb_grid_file: str

SUB NDB Grid Params FilePath(SUBGrdNDB.in).

db_lyr_file: str

SUB DB Layer Params FilePath(SUBDB.in).

db_grid_file: str

SUB DB Grid Params FilePath(SUBGrdDB.in).

Returns:

instance: pycomus.ComusSub

COMUS Subsidence(SUB) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="OneDimFlowSim(File-Input)")
>>> subPackage = pycomus.ComusSub.load(model1, "./InputFiles/SUBCtrl.in", "./InputFiles/SUBMZ.in",
>>> "./InputFiles/SUBNDB.in", "./InputFiles/SUBGrdNDB.in", "./InputFiles/SUBDB.in", "./InputFiles/SUBGrdDB.in")
set_db_grid(rnb: int | float | ndarray, dsh: int | float | ndarray, dhc: int | float | ndarray, dcom: int | float | ndarray, dz: int | float | ndarray, imz: int | float | ndarray)[source]

Set Delay Interbeds Grid Cell Property.

Parameters:
  • rnb – Union[int, float, np.ndarray]

  • dsh – Union[int, float, np.ndarray]

  • dhc – Union[int, float, np.ndarray]

  • dcom – Union[int, float, np.ndarray]

  • dz – Union[int, float, np.ndarray]

  • imz – Union[int, float, np.ndarray]

set_db_lyr(db_lyr: Dict[int, int] | List[int])[source]

Set Delay Interbeds Layer Property.

Parameters:

db_lyr – Union[Dict[int, int], List[int]]

set_mz_data(mz_data: Dict[int, Tuple[float, float, float]] | List[Tuple[float, float, float]])[source]

Set MZ Data.

Parameters:

mz_data – Union[Dict[int, Tuple[float, float, float]], List[Tuple[float, float, float]]]

set_ndb_grid(hc: int | float | ndarray, sfe: int | float | ndarray, sfv: int | float | ndarray, com: int | float | ndarray)[source]

Set No Delay Interbeds Grid Cell Property.

Parameters:
  • hc – Union[int, float, np.ndarray]

  • sfe – Union[int, float, np.ndarray]

  • sfv – Union[int, float, np.ndarray]

  • com – Union[int, float, np.ndarray]

set_ndb_lyr(ndb_lyr: Dict[int, int] | List[int])[source]

Set No Delay Interbeds Layer Property.

Parameters:

ndb_lyr – Union[Dict[int, int], List[int]]

write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusSub module to the specified path as <SUBCtrl.in>, <SUBMZ.in>, <SUBNDB.in>, <SUBDB.in>, <SUBGrdNDB.in>, <SUBGrdDB.in>.

Parameters:

folder_path – Output folder path.

class pycomus.Package.CSUB.LandSub[source]

Bases: object

pycomus.Package.CWEL module

class pycomus.Package.CWEL.ComusWel(model: ComusModel, wellr: int | float | Dict[int, int | float | ndarray], satthr: int | float | Dict[int, int | float | ndarray])[source]

Bases: object

Initialize the COMUS Model with the Well(WEL) package.

Attributes:

model:

The COMUS model to which the WEL package will be applied.

wellr:

The well flow rate (L³/T) for a grid cell.

satthr:

It is the saturation thickness threshold (L) for the grid cell.

Methods:

__init__(self, model: pycomus.ComusModel, wellr: Union[int, float, Dict[int, Union[int, float, np.ndarray]]],

satthr: Union[int, float, Dict[int, Union[int, float, np.ndarray]]])

Initialize the COMUS Model with the Well(WEL) package.

load(cls, model, wel_params_file: str)

Load parameters from a WEL.in file and create a ComusWel instance.

write_file(self, folder_path: str)

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusWel module to the specified path as <WEL.in>.

Returns:

instance: pycomus.ComusWel

COMUS Well(WEL) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> welPackage = pycomus.ComusWel(model1, wellr={0: 1}, satthr=1)
classmethod load(model, wel_params_file: str)[source]

Load parameters from a WEL.in file and create a ComusWel instance.

Parameters:

model: pycomus.ComusModel

COMUS Model Object.

wel_params_file: str

Grid WEL Params File Path(WEL.in).

Returns:

instance: pycomus.ComusWel

COMUS Well(WEL) Params Object.

Example:

>>> import pycomus
>>> model1 = pycomus.ComusModel(model_name="test")
>>> welPackage = pycomus.ComusWel.load(model1, "./InputFiles/WEL.in")
write_file(folder_path: str)[source]

Typically used as an internal function but can also be called directly, it outputs the pycomus.ComusWel module to the specified path as <WEL.in>.

Parameters:

folder_path – Output folder path.

Module contents