Skip to content

Commit 491467d

Browse files
committed
update examples; integer-model examples
1 parent 6942d08 commit 491467d

5 files changed

Lines changed: 292 additions & 1 deletion

File tree

examples/09_compare_exttheis2d_neuman.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
plt.plot(rad, head2[i], label=label2, color="C" + str(i), linestyle="--")
4242
time_ticks.append(head1[i][-1])
4343

44-
plt.title("$T_G={}$, $\sigma^2={}$, $\ell={}$, $S={}$".format(TG, var, len_scale, S))
44+
plt.title(r"$T_G={}$, $\sigma^2={}$, $\ell={}$, $S={}$".format(TG, var, len_scale, S))
4545
plt.xlabel("r in [m]")
4646
plt.ylabel("h in [m]")
4747
plt.legend()

examples/16_integral_model.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
r"""
2+
The integral variogram model
3+
============================
4+
"""
5+
6+
import numpy as np
7+
from matplotlib import pyplot as plt
8+
9+
import anaflow as af
10+
11+
12+
def dashes(i=1, max_n=12, width=1):
13+
return i * [width, width] + [max_n * 2 * width - 2 * i * width, width]
14+
15+
16+
rad = np.linspace(0, 3, 1000)
17+
rough = [0.01, 0.1, 0.25, 0.5, 1.0, 1.5, 2.0, 10.0]
18+
# rescale for integral scale of 1
19+
length = [1 / (nu * np.sqrt(np.pi) / (2 * nu + 2.0)) for nu in rough]
20+
ln_gau = 2 / np.sqrt(np.pi)
21+
var = 1
22+
TG = 1e-4
23+
TH = TG * np.exp(-var / 2)
24+
25+
for i, (ln, nu) in enumerate(zip(length, rough)):
26+
t = 1e4 * af.tools.Int_CG(rad, TG, var, ln, nu)
27+
plt.plot(
28+
rad,
29+
t,
30+
label=r"$T^{Int}_{CG}$($\nu$" + f"={nu:.4})",
31+
dashes=dashes(i),
32+
color="C0" if nu < 1 else "C2",
33+
)
34+
plt.plot(
35+
rad,
36+
af.tools.T_CG(rad, TG, var, ln_gau) / TG,
37+
label=r"$T_{CG}$ - Gaussian",
38+
color="C1",
39+
)
40+
plt.title(f"$T_G=1$ cm²/s, $\\sigma^2={var}$")
41+
plt.xlabel(r"r / $\ell$")
42+
plt.ylabel(r"T / cm²s⁻¹")
43+
plt.grid()
44+
ax = plt.gca()
45+
ax.legend()
46+
ax.ticklabel_format(axis="y", style="scientific", scilimits=[-3, 0], useMathText=True)
47+
ax.locator_params(tight=True, nbins=5)
48+
49+
ylim = ax.get_ylim()
50+
ax2 = ax.twinx()
51+
ax2.set_ylim(ylim)
52+
ax2.set_yticks([TH * 1e4, TG * 1e4])
53+
ax2.set_yticklabels([r"$T_H$", r"$T_G$"])
54+
55+
plt.tight_layout()
56+
plt.show()

examples/17_compare_nugget.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
"""
2+
Impact of roughness on effective drawdown on anti-persistent fields
3+
===================================================================
4+
5+
When the field roughness approaches zero, the drawdown approaches
6+
the homogeneous solution for the geometric mean transmissivity.
7+
"""
8+
9+
import numpy as np
10+
from matplotlib import pyplot as plt
11+
12+
import anaflow as af
13+
14+
min_s = 60
15+
hour_s = min_s * 60
16+
day_s = hour_s * 24
17+
18+
19+
def dashes(i=1, max_n=12, width=1):
20+
return i * [width, width] + [max_n * 2 * width - 2 * i * width, width]
21+
22+
23+
time_labels = ["10 s", "30 min", "steady\nshape"]
24+
time = [10, 30 * min_s, 10 * day_s] # 10s, 30min, 10d
25+
rad = np.geomspace(0.05, 4) # radius from the pumping well in [0, 4]
26+
27+
TG = 1e-4 # the geometric mean of the transmissivity
28+
var = 2.25 # variance of the log-transmissivity
29+
len_scale = 10 # correlation length of the log-transmissivity
30+
31+
# different roughness values from very rough to very smooth
32+
rough = [0.01, 0.1, 0.25, 0.5, 1.0]
33+
S = 1e-4 # storativity
34+
rate = -1e-4 # pumping rate
35+
heads = []
36+
hom_theis = af.theis(time, rad, S, TG, rate=rate)
37+
ext_theis = af.ext_theis_2d(
38+
time, rad, S, TG, var, len_scale / np.sqrt(np.pi) * 2, rate=rate
39+
)
40+
41+
for roughness in rough:
42+
# rescale to constant integral scale
43+
ln = len_scale / (roughness * np.sqrt(np.pi) / (2 * roughness + 2.0))
44+
# ln = len_scale
45+
heads.append(
46+
af.ext_theis_int(time, rad, S, TG, var, ln, roughness, rate=rate, parts=50)
47+
)
48+
49+
time_ticks = []
50+
for i, step in enumerate(time):
51+
for j, roughness in enumerate(rough):
52+
label = (
53+
r"Theis$^{Int}_{CG}(\nu=" + f"{roughness:.4})$"
54+
if i == len(time) - 1
55+
else None
56+
)
57+
plt.plot(
58+
rad,
59+
heads[j][i],
60+
label=label,
61+
color=f"C0",
62+
dashes=dashes(j),
63+
alpha=(1 + i) / len(time),
64+
)
65+
time_ticks.append(hom_theis[i][-1])
66+
label = "Theis($T_G$)" if i == len(time) - 1 else None
67+
plt.plot(rad, hom_theis[i], label=label, color="k") # , dashes=dashes(1))
68+
69+
70+
plt.title(
71+
f"$T_G=1$ cm²/s, $\\sigma^2={var}$, $\\ell={len_scale}$ m, $S={S}$, $Q={-rate*1000}$ L/s"
72+
)
73+
plt.xlabel("r / m")
74+
plt.ylabel("h / m")
75+
plt.grid()
76+
plt.legend()
77+
plt.gca().locator_params(tight=True, nbins=5)
78+
plt.gca().set_ylim([-3.2, 0.1])
79+
plt.gca().set_xlim([0, rad[-1]])
80+
ylim = plt.gca().get_ylim()
81+
ax2 = plt.gca().twinx()
82+
ax2.set_yticks(time_ticks)
83+
ax2.set_yticklabels(time_labels)
84+
ax2.set_ylim(ylim)
85+
plt.tight_layout()
86+
plt.show()

examples/18_compare_roughness.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
r"""
2+
Impact of roughness on effective drawdown on persistent fields
3+
==============================================================
4+
5+
When the field gets smoother, the drawdown approaches
6+
the effective theis solution for a gaussian correlation structure.
7+
"""
8+
9+
import numpy as np
10+
from matplotlib import pyplot as plt
11+
12+
import anaflow as af
13+
14+
min_s = 60
15+
hour_s = min_s * 60
16+
day_s = hour_s * 24
17+
18+
19+
def dashes(i=1, max_n=12, width=1):
20+
return i * 2 * [width] + [max_n * 2 * width - 2 * i * width, width]
21+
22+
23+
time_labels = ["10 s", "30 min", "steady\nshape"]
24+
time = [10, 30 * min_s, 10 * day_s] # 10s, 30min, 10days
25+
26+
rad = np.geomspace(0.05, 4) # radius from the pumping well in [0, 4]
27+
28+
TG = 1e-4 # the geometric mean of the transmissivity
29+
var = 2.25 # 3 # correlation length of the log-transmissivity
30+
len_scale = 10 # variance of the log-transmissivity
31+
32+
# different roughness values from very rough to very smooth
33+
rough = [1.0, 1.5, 2.0, 10.0]
34+
35+
S = 1e-4 # storativity
36+
rate = -1e-4 # pumping rate
37+
heads = []
38+
hom_theis = af.theis(time, rad, S, TG, rate=rate)
39+
ext_theis = af.ext_theis_2d(
40+
time, rad, S, TG, var, len_scale / np.sqrt(np.pi) * 2, rate=rate
41+
)
42+
43+
for roughness in rough:
44+
# rescale to constant integral scale
45+
ln = len_scale / (roughness * np.sqrt(np.pi) / (2 * roughness + 2.0))
46+
heads.append(
47+
af.ext_theis_int(time, rad, S, TG, var, ln, roughness, rate=rate, parts=50)
48+
)
49+
50+
time_ticks = []
51+
for i, step in enumerate(time):
52+
for j, roughness in enumerate(rough):
53+
label = (
54+
r"Theis$^{Int}_{CG}(\nu=" + f"{roughness:.4})$"
55+
if i == len(time) - 1
56+
else None
57+
)
58+
plt.plot(
59+
rad,
60+
heads[j][i],
61+
label=label,
62+
color=f"C2",
63+
dashes=dashes(j),
64+
alpha=(1 + i) / len(time),
65+
)
66+
time_ticks.append(heads[-1][i][-1])
67+
label = "extended Theis" if i == len(time) - 1 else None
68+
plt.plot(rad, ext_theis[i], label=label, color="k")
69+
70+
71+
plt.title(
72+
f"$T_G=1$ cm²/s, $\\sigma^2={var}$, $\\ell={len_scale}$ m, $S={S}$, $Q={-rate*1000}$ L/s"
73+
)
74+
plt.xlabel("r / m")
75+
plt.ylabel("h / m")
76+
plt.grid()
77+
plt.legend()
78+
plt.gca().locator_params(tight=True, nbins=5)
79+
plt.gca().set_ylim([-3.2, 0.1])
80+
plt.gca().set_xlim([0, rad[-1]])
81+
ylim = plt.gca().get_ylim()
82+
ax2 = plt.gca().twinx()
83+
ax2.set_yticks(time_ticks)
84+
ax2.set_yticklabels(time_labels)
85+
ax2.set_ylim(ylim)
86+
plt.tight_layout()
87+
plt.show()
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
r"""
2+
Convergence of the extended Theis solutions for the Integral model
3+
==================================================================
4+
5+
Here we set an outer boundary to the transient solution, so this condition
6+
coincides with the references head of the steady solution.
7+
"""
8+
9+
import numpy as np
10+
from matplotlib import pyplot as plt
11+
12+
from anaflow import ext_theis_int, ext_thiem_int
13+
14+
time = 86400 # time point for steady state (1 day)
15+
rad = np.geomspace(0.05, 5) / 5 # radius from the pumping well in [0, 1]
16+
r_ref = 2 # reference radius
17+
18+
KG = 1e-4 # the geometric mean of the transmissivity
19+
len_scale = 1 # correlation length of the log-transmissivity
20+
roughness = 1 # roughness parameter
21+
var = 1 # variance of the log-transmissivity
22+
S = 1e-4 # storativity
23+
rate = -1e-4 # pumping rate
24+
dim = 2
25+
26+
head1 = ext_thiem_int(rad, r_ref, KG, var, len_scale, roughness, dim=dim, rate=rate)
27+
head2 = ext_theis_int(
28+
time,
29+
rad,
30+
S,
31+
KG,
32+
var,
33+
len_scale,
34+
roughness,
35+
dim=dim,
36+
rate=rate,
37+
r_bound=r_ref,
38+
)
39+
40+
plt.plot(rad, head1, label=r"Thiem$^{Int}_{CG}$", linewidth=3, color="k")
41+
plt.plot(
42+
rad,
43+
head2,
44+
label=r"Theis$^{Int}_{CG}$" + f"(t=1 day)",
45+
linestyle="--",
46+
linewidth=3,
47+
color="C1",
48+
)
49+
plt.title(
50+
f"$T_G=1$ cm²/s, $\\sigma^2={var}$, $\\nu={roughness}$, $S={S}$, $Q=0.1$ L/s, "
51+
+ r"$r_{ref}=2\ell$"
52+
)
53+
54+
plt.xlabel(r"r / $\ell$")
55+
plt.ylabel("h / m")
56+
plt.grid()
57+
plt.gca().set_ylim([-1.25, 0])
58+
plt.gca().set_xlim([0, 1])
59+
plt.gca().locator_params(tight=True, nbins=5)
60+
plt.tight_layout()
61+
plt.legend(loc="lower right")
62+
plt.show()

0 commit comments

Comments
 (0)