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/68d67622a4691560dd8efa6e3c4d5d65bf67fb6ba73ac698cc7b24a84577b917.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/0ffd0343692eaf5043a9cb1239c40e7baa5a17d8438b13c74b5ef594ba105471.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/b90e0669275f8f3f79de9c97aaf860e9b2134fe6be564c01f27eb9e8ceeb6f69.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/0ffd0343692eaf5043a9cb1239c40e7baa5a17d8438b13c74b5ef594ba105471.png