Exemplo n.º 1
0
 def test_homogeneous(self):
     steady = af.thiem(
         rad=self.rad,
         r_ref=self.r_ref,
         transmissivity=self.t_gmean,
         rate=self.rate,
         h_ref=self.h_ref,
     )
     transient = af.theis(
         time=self.time,
         rad=self.rad,
         storage=self.storage,
         transmissivity=self.t_gmean,
         rate=self.rate,
         r_bound=self.r_ref,
         h_bound=self.h_ref,
     )
     self.assertTrue(inc(steady, self.delta))
     for rad_arr in transient:
         self.assertTrue(inc(rad_arr, self.delta))
     for time_arr in transient.T:
         self.assertTrue(dec(time_arr, self.delta))
     self.assertAlmostEqual(np.abs(np.max(steady - transient[-1, :])),
                            0.0,
                            places=4)
Exemplo n.º 2
0
    def test_create(self):
        # create the field-site and the campaign
        field = wtp.FieldSite(name="UFZ", coordinates=[51.3538, 12.4313])
        campaign = wtp.Campaign(name="UFZ-campaign", fieldsite=field)

        # add 4 wells to the campaign
        campaign.add_well(name="well_0", radius=0.1, coordinates=(0.0, 0.0))
        campaign.add_well(name="well_1", radius=0.1, coordinates=(1.0, -1.0))
        campaign.add_well(name="well_2", radius=0.1, coordinates=(2.0, 2.0))
        campaign.add_well(name="well_3", radius=0.1, coordinates=(-2.0, -1.0))

        # generate artificial drawdown data with the Theis solution
        self.rad = [
            campaign.wells["well_0"].radius,  # well radius of well_0
            campaign.wells["well_0"] - campaign.wells["well_1"],  # dist. 0-1
            campaign.wells["well_0"] - campaign.wells["well_2"],  # dist. 0-2
            campaign.wells["well_0"] - campaign.wells["well_3"],  # dist. 0-3
        ]
        drawdown = ana.theis(
            time=self.time,
            rad=self.rad,
            storage=self.storage,
            transmissivity=self.transmissivity,
            rate=self.rate,
        )

        # create a pumping test at well_0
        pumptest = wtp.PumpingTest(
            name="well_0",
            pumpingwell="well_0",
            pumpingrate=self.rate,
            description="Artificial pump test with Theis",
        )

        # add the drawdown observation at the 4 wells
        pumptest.add_transient_obs("well_0", self.time, drawdown[:, 0])
        pumptest.add_transient_obs("well_1", self.time, drawdown[:, 1])
        pumptest.add_transient_obs("well_2", self.time, drawdown[:, 2])
        pumptest.add_transient_obs("well_3", self.time, drawdown[:, 3])

        # add the pumping test to the campaign
        campaign.addtests(pumptest)
        # plot the well constellation and a test overview
        campaign.plot_wells()
        campaign.plot()
        # save the whole campaign
        campaign.save()
        # test making steady
        campaign.tests["well_0"].make_steady()
Exemplo n.º 3
0
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import theis

time = [10, 100, 1000]
rad = np.geomspace(0.1, 10)

head = theis(time=time, rad=rad, storage=1e-4, transmissivity=1e-4, rate=-1e-4)

for i, step in enumerate(time):
    plt.plot(rad, head[i], label="Theis(t={})".format(step))

plt.legend()
plt.tight_layout()
plt.show()
Exemplo n.º 4
0
time_labels = ["10 s", "10 min", "10 h"]
time = [10, 600, 36000]  # 10s, 10min, 10h
rad = np.geomspace(0.05, 4)  # radial distance from the pumping well in [0, 4]
var = 0.5  # variance of the log-conductivity
len_scale = 10.0  # correlation length of the log-conductivity
anis = 0.75  # anisotropy ratio of the log-conductivity
KG = 1e-4  # the geometric mean of the conductivity
Kefu = KG * np.exp(
    var * (0.5 - aniso(anis)))  # the effective conductivity for uniform flow
KH = KG * np.exp(-var / 2.0)  # the harmonic mean of the conductivity
S = 1e-4  # storage
rate = -1e-4  # pumping rate
L = 1.0  # vertical extend of the aquifer

head_Kefu = theis(time, rad, S, Kefu * L, rate)
head_KH = theis(time, rad, S, KH * L, rate)
head_ef = ext_theis_3d(time, rad, S, KG, var, len_scale, anis, L, rate)
time_ticks = []
for i, step in enumerate(time):
    label_TG = "Theis($K_{efu}$)" if i == 0 else None
    label_TH = "Theis($K_H$)" if i == 0 else None
    label_ef = "extended Theis 3D" if i == 0 else None
    plt.plot(rad,
             head_Kefu[i],
             label=label_TG,
             color="C" + str(i),
             linestyle="--")
    plt.plot(rad,
             head_KH[i],
             label=label_TH,
Exemplo n.º 5
0
import numpy as np
from matplotlib import pyplot as plt
from anaflow import theis, neuman2004


time_labels = ["10 s", "10 min", "10 h"]
time = [10, 600, 36000]      # 10s, 10min, 10h
rad = np.geomspace(0.05, 4)  # radius from the pumping well in [0, 4]
var = 0.5                    # variance of the log-transmissivity
len_scale = 10.0             # correlation length of the log-transmissivity
TG = 1e-4                    # the geometric mean of the transmissivity
TH = TG*np.exp(-var/2.0)     # the harmonic mean of the transmissivity
S = 1e-4                     # storativity
rate = -1e-4                   # pumping rate

head_TG = theis(time, rad, S, TG, rate)
head_TH = theis(time, rad, S, TH, rate)
head_ef = neuman2004(
    time=time,
    rad=rad,
    trans_gmean=TG,
    var=var,
    len_scale=len_scale,
    storage=S,
    rate=rate,
)
time_ticks = []
for i, step in enumerate(time):
    label_TG = "Theis($T_G$)" if i == 0 else None
    label_TH = "Theis($T_H$)" if i == 0 else None
    label_ef = "transient Neuman [2004]" if i == 0 else None
Exemplo n.º 6
0
time = np.geomspace(10, 7200, 10)
transmissivity = 1e-4
storage = 1e-4
rad = [
    campaign.wells["well_0"].radius,  # well radius of well_0
    campaign.wells["well_0"] -
    campaign.wells["well_1"],  # distance between 0-1
    campaign.wells["well_0"] -
    campaign.wells["well_2"],  # distance between 0-2
    campaign.wells["well_0"] -
    campaign.wells["well_3"],  # distance between 0-3
]
drawdown = ana.theis(
    rad=rad,
    time=time,
    T=transmissivity,
    S=storage,
    Qw=prate,
)

### create a pumping test at well_0
pumptest = wtp.data.PumpingTest(
    name="well_0",
    pumpingwell="well_0",
    pumpingrate=prate,
    description="Artificial pump test with Theis",
)

### add the drawdown observation at the 4 wells
pumptest.add_transient_obs("well_0", time, drawdown[:, 0])
pumptest.add_transient_obs("well_1", time, drawdown[:, 1])
Exemplo n.º 7
0
from matplotlib import pyplot as plt
from anaflow import theis, ext_theis_tpl

time_ticks = []
time_labels = ["10 s", "10 min", "10 h"]
time = [10, 600, 36000]  # 10s, 10min, 10h
rad = np.geomspace(0.05, 4)  # radial distance from the pumping well in [0, 4]
S = 1e-4  # storage
KG = 1e-4  # the geometric mean of the conductivity
len_scale = 20.0  # upper bound for the length scale
hurst = 0.5  # hurst coefficient
var = 0.5  # variance of the log-conductivity
rate = -1e-4  # pumping rate
KH = KG * np.exp(-var / 2)  # the harmonic mean of the conductivity

head_KG = theis(time, rad, S, KG, rate)
head_KH = theis(time, rad, S, KH, rate)
head_ef = ext_theis_tpl(
    time=time,
    rad=rad,
    storage=S,
    cond_gmean=KG,
    len_scale=len_scale,
    hurst=hurst,
    var=var,
    rate=rate,
)
for i, step in enumerate(time):
    label_TG = "Theis($K_G$)" if i == 0 else None
    label_TH = "Theis($K_H$)" if i == 0 else None
    label_ef = "extended Theis TPL 2D" if i == 0 else None
Exemplo n.º 8
0
    LINEAR_SOLVER=[2, 5, 1e-14, 1000, 1.0, 100, 4])
model.out.add_block(  # point observation
    PCS_TYPE="GROUNDWATER_FLOW",
    NOD_VALUES="HEAD",
    GEO_TYPE=["POINT", "owell"],
    DAT_TYPE="TECPLOT",
)
model.tim.add_block(  # set the timesteps
    PCS_TYPE="GROUNDWATER_FLOW",
    **generate_time(time)  # generate input from time-series
)
model.write_input()
success = model.run_model()
print("success:", success)
# observation
point = model.readtec_point(pcs="GROUNDWATER_FLOW")
time = point["owell"]["TIME"]
head = point["owell"]["HEAD"]
# analytical solution
head_ana = ana.theis(time, obs, storage, transmissivity, rate=rate)
# comparisson plot
plt.scatter(time, head, color="k", label="simulated, r={:04.2f}m".format(obs))
plt.plot(time, head_ana, label="analytical solution")
plt.xscale("symlog", linthreshx=10, subsx=range(1, 10))
plt.xlim([0, 1.1 * time[-1]])
plt.xlabel("time in s")
plt.ylabel("head in m")
plt.legend()
plt.show()
# show mesh
model.msh.show()
Exemplo n.º 9
0
def plotfitting3Dtheis(data, para, rad, time, radnames, prate, plotname):
    """Plot of estimation fitting with theis."""
    radarr = np.linspace(rad.min(), rad.max(), 100)
    timarr = np.linspace(time.min(), time.max(), 100)

    plt.style.use("default")

    t_gen = np.ones_like(radarr)
    r_gen = np.ones_like(time)
    r_gen1 = np.ones_like(timarr)
    xydir = np.zeros_like(time)

    fig = plt.figure(figsize=(12, 8))
    ax = fig.gca(projection="3d")

    for ri, re in enumerate(rad):
        r1 = re * r_gen
        r11 = re * r_gen1

        h = ana.theis(time=time,
                      rad=re,
                      T=np.exp(para[0]),
                      S=np.exp(para[1]),
                      Qw=prate).reshape(-1)
        h1 = data[:, ri]
        h2 = ana.theis(time=timarr,
                       rad=re,
                       T=np.exp(para[0]),
                       S=np.exp(para[1]),
                       Qw=prate).reshape(-1)

        zord = 1000 * (len(rad) - ri)

        ax.plot(
            r11,
            timarr,
            h2,
            label=radnames[ri] + " r={:04.2f}".format(re),
            zorder=zord,
        )
        ax.quiver(
            r1,
            time,
            h,
            xydir,
            xydir,
            h1 - h,
            alpha=0.5,
            arrow_length_ratio=0.0,
            color="C" + str(ri % 10),
            zorder=zord,
        )
        ax.scatter(r1, time, h1, depthshade=False, zorder=zord)

    for te in time:
        t11 = te * t_gen
        h = ana.theis(time=te,
                      rad=radarr,
                      T=np.exp(para[0]),
                      S=np.exp(para[1]),
                      Qw=prate).reshape(-1)
        ax.plot(radarr, t11, h, color="k", alpha=0.1, linestyle="--")

    ax.view_init(elev=45, azim=155)
    ax.set_xlabel(r"$r$ in $\left[\mathrm{m}\right]$")
    ax.set_ylabel(r"$t$ in $\left[\mathrm{s}\right]$")
    ax.set_zlabel(r"$h/|Q|$ in $\left[\mathrm{m}\right]$")
    ax.legend(loc="lower left")
    #    plt.tight_layout()
    plt.savefig(plotname, format="pdf")
Exemplo n.º 10
0
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import theis

time = np.linspace(10, 200)
rad = [1, 5]

# Q(t) = Q * characteristic([0, T])
lap_kwargs = {"cond": 3, "cond_kw": {"a": 100}}
head = theis(
    time=time,
    rad=rad,
    storage=1e-4,
    transmissivity=1e-4,
    rate=-1e-4,
    lap_kwargs=lap_kwargs,
)

for i, step in enumerate(rad):
    plt.plot(time, head[:, i], label="Theis(r={})".format(step))

plt.title("The Stehfest algorithm is not suitable for this!")
plt.legend()
plt.tight_layout()
plt.show()
Exemplo n.º 11
0
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import theis, thiem

time = [10, 100, 1000]
rad = np.geomspace(0.1, 10)
r_ref = 10.0

head_ref = theis(time,
                 np.full_like(rad, r_ref),
                 storage=1e-3,
                 transmissivity=1e-4,
                 rate=-1e-4)
head1 = theis(time, rad, storage=1e-3, transmissivity=1e-4,
              rate=-1e-4) - head_ref
head2 = theis(time,
              rad,
              storage=1e-3,
              transmissivity=1e-4,
              rate=-1e-4,
              r_bound=r_ref)
head3 = thiem(rad, r_ref, transmissivity=1e-4, rate=-1e-4)

for i, step in enumerate(time):
    label_1 = "Theis quasi steady" if i == 0 else None
    label_2 = "Theis bounded" if i == 0 else None
    plt.plot(rad, head1[i], label=label_1, color="C" + str(i), linestyle="--")
    plt.plot(rad, head2[i], label=label_2, color="C" + str(i))

plt.plot(rad, head3, label="Thiem", color="k", linestyle=":")
Exemplo n.º 12
0
# Generate artificial drawdown data with the Theis solution

rate = -1e-4
time = np.geomspace(10, 7200, 10)
transmissivity = 1e-4
storage = 1e-4
rad = [
    campaign.wells["well_0"].radius,  # well radius of well_0
    campaign.wells["well_0"] - campaign.wells["well_1"],  # distance 0-1
    campaign.wells["well_0"] - campaign.wells["well_2"],  # distance 0-2
    campaign.wells["well_0"] - campaign.wells["well_3"],  # distance 0-3
]
drawdown = ana.theis(
    time=time,
    rad=rad,
    storage=storage,
    transmissivity=transmissivity,
    rate=rate,
)

###############################################################################
# Create a pumping test at well_0

pumptest = wtp.PumpingTest(
    name="well_0",
    pumpingwell="well_0",
    pumpingrate=rate,
    description="Artificial pump test with Theis",
)

###############################################################################