Skip to content

Commit

Permalink
Update DOC, examples and README
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Aug 5, 2019
1 parent d525805 commit 89e7964
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 107 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ from anaflow import theis
time = [10, 100, 1000]
rad = np.geomspace(0.1, 10)

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

for i, step in enumerate(time):
plt.plot(rad, head[i], label="Theis(t={})".format(step))
Expand All @@ -60,27 +60,26 @@ plt.show()

The following functions are provided directly

```python
anaflow.thiem # Thiem solution for steady state pumping
anaflow.theis # Theis solution for transient pumping
anaflow.ext_thiem2D # extended Thiem solution in 2D
anaflow.ext_theis2D # extended Theis solution in 2D
anaflow.ext_thiem3D # extended Thiem solution in 3D
anaflow.ext_theis3D # extended Theis solution in 3D
anaflow.grf_model # "General Radial Flow" Model
anaflow.grf_dist # extended "General Radial Flow" Model on disks
```
* ``thiem`` Thiem solution for steady state pumping
* ``theis`` Theis solution for transient pumping
* ``ext_thiem_2d`` extended Thiem solution in 2D from *Zech 2013*
* ``ext_theis_2d`` extended Theis solution in 2D from *Mueller 2015*
* ``ext_thiem_3d`` extended Thiem solution in 3D from *Zech 2013*
* ``ext_theis_3d`` extended Theis solution in 3D from *Mueller 2015*
* ``neuman2004`` transient solution from *Neuman 2004*
* ``neuman2004_steady`` steady solution from *Neuman 2004*
* ``grf`` "General Radial Flow" Model
* ``ext_grf`` the transient extended GRF model
* ``ext_grf_steady`` the steady extended GRF model


### Laplace Transformation

We provide routines to calculate the laplace-transformation as well as the
inverse laplace-transformation of a given function

```python
anaflow.get_lap # Get the laplace transformation of a function
anaflow.get_lap_inv # Get the inverse laplace transformation of a function
```
* ``get_lap`` Get the laplace transformation of a function
* ``get_lap_inv`` Get the inverse laplace transformation of a function


## Requirements
Expand Down
27 changes: 13 additions & 14 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ Provided Functions

The following functions are provided directly

.. code-block:: python
anaflow.thiem # Thiem solution for steady state pumping
anaflow.theis # Theis solution for transient pumping
anaflow.ext_thiem2D # extended Thiem solution in 2D
anaflow.ext_theis2D # extended Theis solution in 2D
anaflow.ext_thiem3D # extended Thiem solution in 3D
anaflow.ext_theis3D # extended Theis solution in 3D
anaflow.grf_model # "General Radial Flow" Model
anaflow.grf_dist # extended "General Radial Flow" Model on disks
* ``thiem`` Thiem solution for steady state pumping
* ``theis`` Theis solution for transient pumping
* ``ext_thiem_2d`` extended Thiem solution in 2D from *Zech 2013*
* ``ext_theis_2d`` extended Theis solution in 2D from *Mueller 2015*
* ``ext_thiem_3d`` extended Thiem solution in 3D from *Zech 2013*
* ``ext_theis_3d`` extended Theis solution in 3D from *Mueller 2015*
* ``neuman2004`` transient solution from *Neuman 2004*
* ``neuman2004_steady`` steady solution from *Neuman 2004*
* ``grf`` "General Radial Flow" Model
* ``ext_grf`` the transient extended GRF model
* ``ext_grf_steady`` the steady extended GRF model


Laplace Transformation
Expand All @@ -45,10 +46,8 @@ Laplace Transformation
We provide routines to calculate the laplace-transformation as well as the
inverse laplace-transformation of a given function

.. code-block:: python
anaflow.get_lap # Get the laplace transformation of a function
anaflow.get_lap_inv # Get the inverse laplace transformation of a function
* ``get_lap`` Get the laplace transformation of a function
* ``get_lap_inv`` Get the inverse laplace transformation of a function


Requirements
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorial_01_call.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ different time-steps.
time = [10, 100, 1000]
rad = np.geomspace(0.1, 10)
head = theis(time=time, rad=rad, T=1e-4, S=1e-4, Qw=-1e-4)
head = theis(time=time, rad=rad, transmissivity=1e-4, storage=1e-4, rate=-1e-4)
for i, step in enumerate(time):
plt.plot(rad, head[i], label="Theis(t={})".format(step))
Expand Down
50 changes: 28 additions & 22 deletions docs/source/tutorial_02_extended_theis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,42 @@ transmissivity.
import numpy as np
from matplotlib import pyplot as plt
from anaflow import theis, ext_theis2D
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
corr = 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
Qw = -1e-4 # pumping rate
head_TG = theis(time=time, rad=rad, T=TG, S=S, Qw=Qw)
head_TH = theis(time=time, rad=rad, T=TH, S=S, Qw=Qw)
head_ef = ext_theis2D(time=time, rad=rad, TG=TG, sig2=var, corr=corr, S=S, Qw=Qw)
from anaflow import theis, ext_theis_2d
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 = ext_theis_2d(time, rad, S, TG, var, len_scale, rate)
time_ticks=[]
for i, step in enumerate(time):
if i == 0:
label_TG = "Theis($T_G$)"
label_TH = "Theis($T_H$)"
label_ef = "extended Theis"
else:
label_TG = label_TH = label_ef = None
label_TG = "Theis($T_G$)" if i == 0 else None
label_TH = "Theis($T_H$)" if i == 0 else None
label_ef = "extended Theis" if i == 0 else None
plt.plot(rad, head_TG[i], label=label_TG, color="C"+str(i), linestyle="--")
plt.plot(rad, head_TH[i], label=label_TH, color="C"+str(i), linestyle=":")
plt.plot(rad, head_ef[i], label=label_ef, color="C"+str(i))
time_ticks.append(head_ef[i][-1])
plt.xlabel("r in [m]")
plt.ylabel("h in [m]")
plt.legend()
ylim = plt.gca().get_ylim()
plt.gca().set_xlim([0, rad[-1]])
ax2 = plt.gca().twinx()
ax2.set_yticks(time_ticks)
ax2.set_yticklabels(time_labels)
ax2.set_ylim(ylim)
plt.tight_layout()
plt.show()
Expand Down
2 changes: 1 addition & 1 deletion examples/01_call_theis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
time = [10, 100, 1000]
rad = np.geomspace(0.1, 10)

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

for i, step in enumerate(time):
plt.plot(rad, head[i], label="Theis(t={})".format(step))
Expand Down
24 changes: 12 additions & 12 deletions examples/02_call_ext_theis2d.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import theis, ext_theis2D
from anaflow import theis, ext_theis_2d


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
corr = 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
Qw = -1e-4 # pumping rate
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=time, rad=rad, T=TG, S=S, Qw=Qw)
head_TH = theis(time=time, rad=rad, T=TH, S=S, Qw=Qw)
head_ef = ext_theis2D(time=time, rad=rad, TG=TG, sig2=var, corr=corr, S=S, Qw=Qw)
head_TG = theis(time, rad, S, TG, rate)
head_TH = theis(time, rad, S, TH, rate)
head_ef = ext_theis_2d(time, rad, S, TG, var, len_scale, rate)
time_ticks=[]
for i, step in enumerate(time):
label_TG = "Theis($T_G$)" if i == 0 else None
Expand Down
30 changes: 15 additions & 15 deletions examples/03_call_ext_theis3d.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import theis, ext_theis3D
from anaflow import theis, ext_theis_3d
from anaflow.tools.special import aniso


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
corr = 10.0 # correlation length of the log-conductivity
e = 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(e))) # the effective conductivity for uniform flow
KH = KG*np.exp(-var/2.0) # the harmonic mean of the conductivity
S = 1e-4 # storage
Qw = -1e-4 # pumping rate
L = 1.0 # vertical extend of the aquifer
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=time, rad=rad, T=Kefu*L, S=S, Qw=Qw)
head_KH = theis(time=time, rad=rad, T=KH*L, S=S, Qw=Qw)
head_ef = ext_theis3D(time=time, rad=rad, KG=KG, sig2=var, corr=corr, e=e, S=S, Qw=Qw, L=1)
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
Expand Down
18 changes: 9 additions & 9 deletions examples/04_call_ext_theis_tpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
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
corr = 20.0 # upper bound for the length scale
len_scale = 20.0 # upper bound for the length scale
hurst = 0.5 # hurst coefficient
var = 0.5 # variance of the log-conductivity
Qw = -1e-4 # pumping rate
rate = -1e-4 # pumping rate
KH = KG * np.exp(-var / 2) # the harmonic mean of the conductivity

head_KG = theis(time=time, rad=rad, T=KG, S=S, Qw=Qw)
head_KH = theis(time=time, rad=rad, T=KH, S=S, Qw=Qw)
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,
S=S,
KG=KG,
corr=corr,
storage=S,
cond_gmean=KG,
len_scale=len_scale,
hurst=hurst,
sig2=var,
Qw=Qw,
var=var,
rate=rate,
)
for i, step in enumerate(time):
label_TG = "Theis($K_G$)" if i == 0 else None
Expand Down
8 changes: 4 additions & 4 deletions examples/05_call_neuman2004.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
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
Qw = -1e-4 # pumping rate
rate = -1e-4 # pumping rate

head_TG = theis(time=time, rad=rad, T=TG, S=S, Qw=Qw)
head_TH = theis(time=time, rad=rad, T=TH, S=S, Qw=Qw)
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=Qw,
rate=rate,
)
time_ticks = []
for i, step in enumerate(time):
Expand Down
6 changes: 3 additions & 3 deletions examples/06_compare_extthiem2d_grfsteady.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import ext_thiem2D, grf_steady
from anaflow import ext_thiem_2d, ext_grf_steady
from anaflow.tools.coarse_graining import T_CG


Expand All @@ -12,8 +12,8 @@
TG = 1e-4 # the geometric mean of the transmissivity
rate = -1e-4 # pumping rate

head1 = ext_thiem2D(rad, r_ref, TG, var, len_scale, rate)
head2 = grf_steady(rad, r_ref, T_CG, rate=rate, TG=TG, sig2=var, corr=len_scale)
head1 = ext_thiem_2d(rad, r_ref, TG, var, len_scale, rate)
head2 = ext_grf_steady(rad, r_ref, T_CG, rate=rate, trans_gmean=TG, var=var, len_scale=len_scale)

plt.plot(rad, head1, label="Ext Thiem 2D")
plt.plot(rad, head2, label="grf(T_CG)", linestyle="--")
Expand Down
8 changes: 4 additions & 4 deletions examples/07_compare_extthiem3d_grfsteady.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import ext_thiem3D, grf_steady
from anaflow import ext_thiem_3d, ext_grf_steady
from anaflow.tools.coarse_graining import K_CG


Expand All @@ -10,11 +10,11 @@
var = 0.5 # variance of the log-transmissivity
len_scale = 10.0 # correlation length of the log-transmissivity
KG = 1e-4 # the geometric mean of the transmissivity
e = 0.7 # aniso ratio
anis = 0.7 # aniso ratio
rate = -1e-4 # pumping rate

head1 = ext_thiem3D(rad, r_ref, KG, var, len_scale, e, rate, L=1)
head2 = grf_steady(rad, r_ref, K_CG, rate=rate, KG=KG, sig2=var, corr=len_scale, e=e)
head1 = ext_thiem_3d(rad, r_ref, KG, var, len_scale, anis, 1, rate)
head2 = ext_grf_steady(rad, r_ref, K_CG, rate=rate, cond_gmean=KG, var=var, len_scale=len_scale, anis=anis)

plt.plot(rad, head1, label="Ext Thiem 3D")
plt.plot(rad, head2, label="grf(K_CG)", linestyle="--")
Expand Down
4 changes: 2 additions & 2 deletions examples/08_compare_thiem_grfsteady.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import thiem, grf_steady
from anaflow import thiem, ext_grf_steady


rad = np.geomspace(0.05, 4) # radius from the pumping well in [0, 4]
Expand All @@ -10,7 +10,7 @@
rate = -1e-4 # pumping rate

head1 = thiem(rad, r_ref, T, rate)
head2 = grf_steady(rad, r_ref, T, rate=rate)
head2 = ext_grf_steady(rad, r_ref, T, rate=rate)

plt.plot(rad, head1, label="Thiem")
plt.plot(rad, head2, label="grf(T)", linestyle="--")
Expand Down
4 changes: 2 additions & 2 deletions examples/09_compare_extthiem2d_neuman.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import ext_thiem2D, neuman2004_steady
from anaflow import ext_thiem_2d, neuman2004_steady


rad = np.geomspace(0.05, 4) # radius from the pumping well in [0, 4]
Expand All @@ -11,7 +11,7 @@
TG = 1e-4 # the geometric mean of the transmissivity
rate = -1e-4 # pumping rate

head1 = ext_thiem2D(rad, r_ref, TG, var, len_scale, rate)
head1 = ext_thiem_2d(rad, r_ref, TG, var, len_scale, rate)
head2 = neuman2004_steady(rad, r_ref, TG, var, len_scale, rate)

plt.plot(rad, head1, label="extended Thiem 2D")
Expand Down

0 comments on commit 89e7964

Please sign in to comment.