Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@

# -- Project information -----------------------------------------------------

project = 'flopy'
copyright = '2020, Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N.'
author = 'Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N.'
project = "flopy"
copyright = "2020, Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N."
author = "Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N."

# The version.
version = __version__
Expand Down Expand Up @@ -112,7 +112,6 @@
]



# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
64 changes: 33 additions & 31 deletions .docs/pysrc/tutorial1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,82 @@
import numpy as np
import flopy

#Assign name and create modflow model object
modelname = 'tutorial1'
# Assign name and create modflow model object
modelname = "tutorial1"
exe_name = os.path.join("..", ".bin", "mf2005")
mf = flopy.modflow.Modflow(modelname, exe_name=exe_name)

#model domain and grid definition
Lx = 1000.
Ly = 1000.
ztop = 0.
zbot = -50.
# model domain and grid definition
Lx = 1000.0
Ly = 1000.0
ztop = 0.0
zbot = -50.0
nlay = 1
nrow = 10
ncol = 10
delr = Lx/ncol
delc = Ly/nrow
delr = Lx / ncol
delc = Ly / nrow
delv = (ztop - zbot) / nlay
botm = np.linspace(ztop, zbot, nlay + 1)

# Create the discretization object
dis = flopy.modflow.ModflowDis(mf, nlay, nrow, ncol, delr=delr, delc=delc,
top=ztop, botm=botm[1:])
dis = flopy.modflow.ModflowDis(
mf, nlay, nrow, ncol, delr=delr, delc=delc, top=ztop, botm=botm[1:]
)

# Variables for the BAS package
ibound = np.ones((nlay, nrow, ncol), dtype=np.int32)
ibound[:, :, 0] = -1
ibound[:, :, -1] = -1
strt = np.ones((nlay, nrow, ncol), dtype=np.float32)
strt[:, :, 0] = 10.
strt[:, :, -1] = 0.
strt[:, :, 0] = 10.0
strt[:, :, -1] = 0.0
bas = flopy.modflow.ModflowBas(mf, ibound=ibound, strt=strt)

#Add LPF package to the MODFLOW model
lpf = flopy.modflow.ModflowLpf(mf, hk=10., vka=10., ipakcb=53)
# Add LPF package to the MODFLOW model
lpf = flopy.modflow.ModflowLpf(mf, hk=10.0, vka=10.0, ipakcb=53)

# Add OC package to the MODFLOW model
spd = {(0, 0): ['print head', 'print budget', 'save head', 'save budget']}
spd = {(0, 0): ["print head", "print budget", "save head", "save budget"]}
oc = flopy.modflow.ModflowOc(mf, stress_period_data=spd, compact=True)

#Add PCG package to the MODFLOW model
# Add PCG package to the MODFLOW model
pcg = flopy.modflow.ModflowPcg(mf)

#Write the MODFLOW model input files
# Write the MODFLOW model input files
mf.write_input()

#Run the MODFLOW model
# Run the MODFLOW model
mf.run_model()

import matplotlib.pyplot as plt
import flopy.utils.binaryfile as bf
plt.subplot(1,1,1,aspect='equal')
hds = bf.HeadFile(modelname+'.hds')

plt.subplot(1, 1, 1, aspect="equal")
hds = bf.HeadFile(modelname + ".hds")
head = hds.get_data(totim=1.0)
levels = np.arange(1,10,1)
extent = (delr/2., Lx - delc/2., Ly - delc/2., delc/2.)
levels = np.arange(1, 10, 1)
extent = (delr / 2.0, Lx - delc / 2.0, Ly - delc / 2.0, delc / 2.0)
plt.contour(head[0, :, :], levels=levels, extent=extent)
plt.savefig('tutorial1a.png')
plt.savefig("tutorial1a.png")


fig = plt.figure(figsize=(10,10))
ax = fig.add_subplot(1, 1, 1, aspect='equal')
fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(1, 1, 1, aspect="equal")

hds = bf.HeadFile(modelname + '.hds')
hds = bf.HeadFile(modelname + ".hds")
times = hds.get_times()
head = hds.get_data(totim=times[-1])
levels = np.linspace(0, 10, 11)

cbb = bf.CellBudgetFile(modelname + '.cbc')
cbb = bf.CellBudgetFile(modelname + ".cbc")
kstpkper_list = cbb.get_kstpkper()
frf = cbb.get_data(text='FLOW RIGHT FACE', totim=times[-1])[0]
fff = cbb.get_data(text='FLOW FRONT FACE', totim=times[-1])[0]
frf = cbb.get_data(text="FLOW RIGHT FACE", totim=times[-1])[0]
fff = cbb.get_data(text="FLOW FRONT FACE", totim=times[-1])[0]

pmv = flopy.plot.PlotMapView(model=mf, layer=0)
qm = pmv.plot_ibound()
lc = pmv.plot_grid()
cs = pmv.contour_array(head, levels=levels)
quiver = pmv.plot_discharge(frf, fff, head=head)
plt.savefig('tutorial1b.png')
plt.savefig("tutorial1b.png")
Loading