Test line-sink strings#

This notebook tests line-sink string elements.

import matplotlib.pyplot as plt

import timflow.steady as tfs

One RiverString in one layer#

ml = tfs.ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000])
rf = tfs.Constant(ml, xr=0, yr=10000, hr=20, layer=0)
ls1 = tfs.RiverString(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
plt.figure(figsize=(16, 4))
for i in range(3):
    ax = plt.subplot(1, 3, i + 1)
    ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=i, ax=ax)
../../_images/4c439cdbaa1a631d2f9a731b8a64e13f781c34b4199b5af1c11815cb7e185cb8.png

RiverString in two layers#

ml = tfs.ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000])
rf = tfs.Constant(ml, xr=0, yr=10000, hr=20, layer=0)
ls1 = tfs.RiverString(
    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
plt.figure(figsize=(16, 4))
for i in range(3):
    ax = plt.subplot(1, 3, i + 1)
    ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=i, ax=ax)
../../_images/dfc15dab1f238f50e2082958058a0922996cc0b95c0c7f5f23326f488be90367.png

RiverString, each section in different layer#

ml = tfs.ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000])
rf = tfs.Constant(ml, xr=0, yr=10000, hr=20, layer=0)
ls1 = tfs.RiverString(
    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
plt.figure(figsize=(16, 4))
for i in range(3):
    ax = plt.subplot(1, 3, i + 1)
    ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=i, ax=ax)
../../_images/2e5cd0b2ffecdef74ef49e82307f356ac58434c04977770de5f517d8df1ae458.png

A 2D array (NLS, NLAYERS)#

Layers can always be specified as a 2D array.

ml = tfs.ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000])
rf = tfs.Constant(ml, xr=0, yr=10000, hr=20, layer=0)
ls1 = tfs.RiverString(
    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
plt.figure(figsize=(16, 4))
for i in range(3):
    ax = plt.subplot(1, 3, i + 1)
    ml.plots.contour([-200, 200, -100, 100], ngr=50, layers=i, ax=ax)
../../_images/dfc15dab1f238f50e2082958058a0922996cc0b95c0c7f5f23326f488be90367.png