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/e464264ef7fb45b3f6f923a6a7e54c09752b384cfdf7d10e053c27096b900de3.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/ec6ba6d92c5b13a3b27726ebd4fa5dfd30822399fddfe4dff79c29cf6c44ada4.png ../../_images/3ae79c38909d4d3f8ee51d451690dbe3052a362cf778dc5bc6d51d8e03374ed8.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/1a8950f0c40cab491e88388850cea9b74271671ebebf56ed5f34fbe2af27c695.png