swn.modflow.SwnMf6.flopy_package_period#

SwnMf6.flopy_package_period(package: str, auxiliary: list = [], boundname=None)#

Return dict of lists of lists for flopy’s stress_period_data.

Parameters:
packagestr

MODFLOW 6 package name, such as “drn” for DRAIN, or “GWT/SRC” for Mass Source Loading.

auxiliarystr, list, optional

String or list of auxiliary variable names. Default [].

boundnamebool, optional

Default None will determine if “boundname” column is added if available in reaches.columns.

Returns:
dict

See also

SwnMf6.package_period_frame

Dataframe generator.

SwnMf6.write_package_period

Write native file.

Examples

>>> import flopy
>>> import geopandas
>>> import pandas as pd
>>> import swn
>>> lines = geopandas.GeoSeries.from_wkt([
...    "LINESTRING (60 100, 60  80)",
...    "LINESTRING (40 130, 60 100)",
...    "LINESTRING (70 130, 60 100)"])
>>> lines.index += 100
>>> n = swn.SurfaceWaterNetwork.from_lines(lines)
>>> sim = flopy.mf6.MFSimulation()
>>> _ = flopy.mf6.ModflowTdis(sim, nper=1, time_units="days")
>>> gwf = flopy.mf6.ModflowGwf(sim)
>>> _ = flopy.mf6.ModflowGwfdis(
...     gwf, nrow=3, ncol=2, delr=20.0, delc=20.0, top=10, botm=0,
...     idomain=1, length_units="meters", xorigin=30.0, yorigin=70.0)
>>> nm = swn.SwnMf6.from_swn_flopy(n, gwf)
>>> nm.set_reach_data_from_array("elev", gwf.dis.top.array)
>>> nm.reaches["dlen"] = nm.reaches.length.round(3)
>>> nm.reaches["cond"] = 15.0
>>> nm.reaches["boundname"] = nm.reaches["segnum"]
>>> drn = nm.set_package_obj("drn", auxmultname="dlen")
>>> pd.DataFrame(drn.stress_period_data.data[0])
      cellid  elev  cond    dlen boundname
0  (0, 0, 0)  10.0  15.0  18.028       101
1  (0, 0, 1)  10.0  15.0   6.009       101
2  (0, 1, 1)  10.0  15.0  12.019       101
3  (0, 0, 1)  10.0  15.0  21.082       102
4  (0, 1, 1)  10.0  15.0  10.541       102
5  (0, 1, 1)  10.0  15.0  10.000       100
6  (0, 2, 1)  10.0  15.0  10.000       100