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/b532882698a939a285bc54c053edecbc5e1c499bc948d6ea55aa2506aa0b30e4.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/20ab29b8c03f2affad8c10c022b4332accde02b1429547ab3252bbbf1c91a82e.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/e678b7dba13bd99dd9cef4c695f94daea18a6047c748f38ead7dbcac50b56c1e.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/20ab29b8c03f2affad8c10c022b4332accde02b1429547ab3252bbbf1c91a82e.png