Test line-sink strings#
This notebook tests line-sink string elements.
import matplotlib.pyplot as plt
import timml as tml
One HeadLineSinkString in one layer#
ml = tml.ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000])
rf = tml.Constant(ml, xr=0, yr=10000, hr=20, layer=0)
ls1 = tml.HeadLineSinkString(
ml, xy=[(-100, 0), (0, 0), (100, 0), (100, 50)], hls=10, layers=0
)
ml.solve()
Number of elements, Number of equations: 2 , 4
.
.
solution complete
/tmp/ipykernel_3233/556936792.py:3: DeprecationWarning: HeadLineSinkString is deprecated. Use RiverString instead.
ls1 = tml.HeadLineSinkString(
plt.figure(figsize=(16, 4))
for i in range(3):
plt.subplot(1, 3, i + 1)
ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=i, newfig=False)
HeadLineSinkString in two layers#
ml = tml.ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000])
rf = tml.Constant(ml, xr=0, yr=10000, hr=20, layer=0)
ls1 = tml.HeadLineSinkString(
ml, xy=[(-100, 0), (0, 0), (100, 0), (100, 50)], hls=10, layers=[0, 1]
)
ml.solve()
Number of elements, Number of equations: 2 , 7
.
.
solution complete
/tmp/ipykernel_3233/4220116219.py:3: DeprecationWarning: HeadLineSinkString is deprecated. Use RiverString instead.
ls1 = tml.HeadLineSinkString(
plt.figure(figsize=(16, 4))
for i in range(3):
plt.subplot(1, 3, i + 1)
ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=i, newfig=False)
HeadLineSinkString, each section in different layer#
ml = tml.ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000])
rf = tml.Constant(ml, xr=0, yr=10000, hr=20, layer=0)
ls1 = tml.HeadLineSinkString(
ml, xy=[(-100, 0), (0, 0), (100, 0), (100, 50)], hls=10, layers=[0, 1, 0]
)
ml.solve()
Number of elements, Number of equations: 2 , 4
.
.
solution complete
/tmp/ipykernel_3233/1708078998.py:3: DeprecationWarning: HeadLineSinkString is deprecated. Use RiverString instead.
ls1 = tml.HeadLineSinkString(
TODO: make sure segments are plotted correctly in each layer#
plt.figure(figsize=(16, 4))
for i in range(3):
plt.subplot(1, 3, i + 1)
ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=i, newfig=False)
ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=2)
[<matplotlib.contour.QuadContourSet at 0x7559cc4b95d0>]
ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=1, newfig=False)
[<matplotlib.contour.QuadContourSet at 0x7559cc372790>]
A 2D array (NLS, NLAYERS)#
Layers can always be specified as a 2D array.
ml = tml.ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000])
rf = tml.Constant(ml, xr=0, yr=10000, hr=20, layer=0)
ls1 = tml.HeadLineSinkString(
ml,
xy=[(-100, 0), (0, 0), (100, 0), (100, 50)],
hls=10,
layers=[[0, 1], [0, 1], [0, 1]],
)
ml.solve()
Number of elements, Number of equations: 2 , 7
.
.
solution complete
/tmp/ipykernel_3233/1848151938.py:3: DeprecationWarning: HeadLineSinkString is deprecated. Use RiverString instead.
ls1 = tml.HeadLineSinkString(
plt.figure(figsize=(16, 4))
for i in range(3):
plt.subplot(1, 3, i + 1)
ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=i, newfig=False)