Test line-sink comparison with row of wells#

import matplotlib.pyplot as plt
import numpy as np

import timflow.transient as tft

plt.rcParams["font.size"] = 8.0
ml = tft.ModelMaq(tmin=0.01, tmax=10)
ls1 = tft.LineSink(ml, -1, 0, 1, 0, tsandQ=[(0, 10)])
ml.solve()
self.neq  0
No unknowns. Solution complete
ml2 = tft.ModelMaq(tmin=0.01, tmax=10)
x = np.arange(-0.9, 1, 0.2)
nwells = len(x)
Qtot = 10
for i in range(nwells):
    tft.Well(ml2, x[i], 0, tsandQ=[(0, Qtot / nwells)])
ml2.solve()
self.neq  10
solution complete
t = np.logspace(-2, 1, 100)
h1a = ml.head(0.5, 1, t)
h1b = ml.head(0.5, 10, t)
h2a = ml2.head(0.5, 1, t)
h2b = ml2.head(0.5, 10, t)
plt.figure(figsize=(4, 3))
plt.semilogx(t, h1a[0], "b", label="line-sink")
plt.semilogx(t, h2a[0], "r--", label="wells")
plt.semilogx(t, h1b[0], "b")
plt.semilogx(t, h2b[0], "r--")
plt.xlabel("time")
plt.ylabel("head")
plt.legend()
plt.grid()
../../_images/761f13665034779ae56c25a7034b116ff28644db92f79875061f1926d0944ad4.png
ml.plots.contour([-2, 2, -2, 2], [40, 40], t=5, figsize=(4, 4), labels=False)
ml2.plots.contour([-2, 2, -2, 2], [40, 40], t=5, figsize=(4, 4), labels=False);
../../_images/add83c52df51f9474f98b906a24d1da79f488114143a3e007c5359041885aa38.png ../../_images/97d2707ca280c41386a979ff3301a231aeabdbdc832937fa327ea7fedc4bb830.png
xg1 = np.linspace(-2, 2, 100)
ygtop = np.linspace(1e-6, 2, 50)
ygbot = np.linspace(-2, -1e-6, 50)
htop = ml.headgrid(xg1, ygtop, t=5)
hbot = ml2.headgrid(xg1, ygbot, t=5)
print(f"min and max head: {np.min(htop)}, {np.max(htop)}")
min and max head: -9.01284678395817, -5.765937859998859
plt.figure(figsize=(4, 4))
plt.subplot(aspect=1)
plt.contour(xg1, ygtop, htop[0, 0], np.arange(-10, 0, 0.5), colors="C0", linestyles="-")
plt.contour(xg1, ygbot, hbot[0, 0], np.arange(-10, 0, 0.5), colors="C0", linestyles="-")
plt.title("Top half: line-sink, bottom-half: row of wells");
../../_images/f1a925f9fbdda10eaf0cf5cf9ebd9bb9d2f103a9350ac776628aabebb0bc8eed.png