swn.modflow.SwnModflow.flopy_package_period#

SwnModflow.flopy_package_period(package: str, auxiliary=[], **kwds)#

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

Parameters:
packagestr

MODFLOW package name, such as “drn” for DRAIN.

auxiliarystr, list, optional

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

**kwdsdict, optional

Keyword arguments used for get_default_dtype, if available. A common keyword is structured=True.

Returns:
dict

See also

SwnModflow.package_period_frame

Dataframe generator.

SwnModflow.set_package_obj

Set MODFLOW package data to flopy model.

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)
>>> m = flopy.modflow.Modflow(version="mf2005")
>>> _ = flopy.modflow.ModflowDis(
...     m, nrow=3, ncol=2, delr=20.0, delc=20.0, xul=30.0, yul=130.0,
...     top=15.0, botm=10.0)
>>> _ = flopy.modflow.ModflowBas(m)
>>> nm = swn.modflow.SwnModflow.from_swn_flopy(n, m)
>>> nm.set_reach_data_from_array("elev", m.dis.top.array)
>>> nm.reaches["dlen"] = nm.reaches.length
>>> nm.reaches["cond"] = nm.reaches.dlen * 10.0
>>> drn = nm.set_package_obj("drn", auxiliary="dlen")
>>> pd.DataFrame(drn.stress_period_data[0])
   k  i  j  elev        cond       dlen
0  0  0  0  15.0  180.277557  18.027756
1  0  0  1  15.0   60.092522   6.009252
2  0  1  1  15.0  120.185043  12.018504
3  0  0  1  15.0  210.818512  21.081852
4  0  1  1  15.0  105.409256  10.540926
5  0  1  1  15.0  100.000000  10.000000
6  0  2  1  15.0  100.000000  10.000000