Contents

AnaFlow Quickstart

_images/Anaflow.png

AnaFlow provides several analytical and semi-analytical solutions for the groundwater-flow equation.

Installation

The package can be installed via pip. On Windows you can install WinPython to get Python and pip running.

pip install anaflow

Provided Functions

The following functions are provided directly

  • 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 from Barker 1988

  • ext_grf the transient extended GRF model

  • ext_grf_steady the steady extended GRF model

  • ext_thiem_tpl extended Thiem solution for truncated power laws

  • ext_theis_tpl extended Theis solution for truncated power laws

  • ext_thiem_tpl_3d extended Thiem solution in 3D for truncated power laws

  • ext_theis_tpl_3d extended Theis solution in 3D for truncated power laws

Laplace Transformation

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

  • get_lap Get the laplace transformation of a function

  • get_lap_inv Get the inverse laplace transformation of a function

License

MIT

AnaFlow Tutorial

In the following you will find several Tutorials on how to use AnaFlow to explore its whole beauty and power.

AnaFlow API

Purpose

Anaflow provides several analytical and semi-analytical solutions for the groundwater-flow-equation.

Subpackages

flow

Anaflow subpackage providing flow-solutions for the groundwater flow equation.

tools

Anaflow subpackage providing miscellaneous tools.

Solutions

Homogeneous

Solutions for homogeneous aquifers

thiem(rad, r_ref, transmissivity[, rate, h_ref])

The Thiem solution.

theis(time, rad, storage, transmissivity[, …])

The Theis solution.

grf(time, rad, storage, conductivity[, dim, …])

The general radial flow (GRF) model for a pumping test.

Heterogeneous

Solutions for heterogeneous aquifers

ext_thiem_2d(rad, r_ref, trans_gmean, var, …)

The extended Thiem solution in 2D.

ext_thiem_3d(rad, r_ref, cond_gmean, var, …)

The extended Thiem solution in 3D.

ext_thiem_tpl(rad, r_ref, cond_gmean, …[, …])

The extended Thiem solution for truncated power-law fields.

ext_thiem_tpl_3d(rad, r_ref, cond_gmean, …)

The extended Theis solution for truncated power-law fields in 3D.

ext_theis_2d(time, rad, storage, …[, …])

The extended Theis solution in 2D.

ext_theis_3d(time, rad, storage, cond_gmean, …)

The extended Theis solution in 3D.

ext_theis_tpl(time, rad, storage, …[, …])

The extended Theis solution for truncated power-law fields.

ext_thiem_tpl_3d(rad, r_ref, cond_gmean, …)

The extended Theis solution for truncated power-law fields in 3D.

neuman2004(time, rad, storage, trans_gmean, …)

The transient solution for the apparent transmissivity from [Neuman2004].

neuman2004_steady(rad, r_ref, trans_gmean, …)

The steady solution for the apparent transmissivity from [Neuman2004].

Extended GRF

The extended general radial flow model.

ext_grf(time, rad, S_part, K_part, R_part[, …])

The extended “General radial flow” model for transient flow.

ext_grf_steady(rad, r_ref, conductivity[, …])

The extended “General radial flow” model for steady flow.

Laplace

Helping functions related to the laplace-transformation

get_lap(func[, arg_dict])

Callable Laplace transform.

get_lap_inv(func[, method, method_dict, …])

Callable Laplace inversion.

Tools

Helping functions.

step_f(rad, r_part, f_part)

Callalbe step function.

specialrange(val_min, val_max, steps[, typ])

Calculation of special point ranges.

specialrange_cut(val_min, val_max, steps[, …])

Calculation of special point ranges.

anaflow.flow

Anaflow subpackage providing flow-solutions for the groundwater flow equation.

Subpackages

laplace

Anaflow subpackage providing flow solutions in laplace space.

Solutions

Homogeneous

Solutions for homogeneous aquifers

thiem(rad, r_ref, transmissivity[, rate, h_ref])

The Thiem solution.

theis(time, rad, storage, transmissivity[, …])

The Theis solution.

grf(time, rad, storage, conductivity[, dim, …])

The general radial flow (GRF) model for a pumping test.

Heterogeneous

Solutions for heterogeneous aquifers

ext_thiem_2d(rad, r_ref, trans_gmean, var, …)

The extended Thiem solution in 2D.

ext_thiem_3d(rad, r_ref, cond_gmean, var, …)

The extended Thiem solution in 3D.

ext_thiem_tpl(rad, r_ref, cond_gmean, …[, …])

The extended Thiem solution for truncated power-law fields.

ext_thiem_tpl_3d(rad, r_ref, cond_gmean, …)

The extended Theis solution for truncated power-law fields in 3D.

ext_theis_2d(time, rad, storage, …[, …])

The extended Theis solution in 2D.

ext_theis_3d(time, rad, storage, cond_gmean, …)

The extended Theis solution in 3D.

ext_theis_tpl(time, rad, storage, …[, …])

The extended Theis solution for truncated power-law fields.

ext_theis_tpl_3d(time, rad, storage, …[, …])

The extended Theis solution for truncated power-law fields in 3D.

neuman2004(time, rad, storage, trans_gmean, …)

The transient solution for the apparent transmissivity from [Neuman2004].

neuman2004_steady(rad, r_ref, trans_gmean, …)

The steady solution for the apparent transmissivity from [Neuman2004].

Extended GRF

The extended general radial flow model.

ext_grf(time, rad, S_part, K_part, R_part[, …])

The extended “General radial flow” model for transient flow.

ext_grf_steady(rad, r_ref, conductivity[, …])

The extended “General radial flow” model for steady flow.

anaflow.flow.laplace

Anaflow subpackage providing flow solutions in laplace space.

The following functions are provided

grf_laplace(s[, rad, S_part, K_part, …])

The extended GRF-model for transient flow in Laplace-space.

grf_laplace(s, rad=None, S_part=None, K_part=None, R_part=None, dim=2, lat_ext=1.0, rate=None, K_well=None, cut_off_prec=1e-20, cond=0, cond_kw=None)[source]

The extended GRF-model for transient flow in Laplace-space.

The General Radial Flow (GRF) Model allowes fractured dimensions for transient flow under a pumping condition in a confined aquifer. The solutions assumes concentric annuli around the pumpingwell, where each annulus has its own conductivity and storativity value.

Parameters
  • s (numpy.ndarray) – Array with all Laplace-space-points where the function should be evaluated

  • rad (numpy.ndarray) – Array with all radii where the function should be evaluated

  • S_part (numpy.ndarray of length N) – Given storativity values for each disk

  • K_part (numpy.ndarray of length N) – Given conductivity values for each disk

  • R_part (numpy.ndarray of length N+1) – Given radii separating the disks as well as starting- and endpoints

  • dim (float) – Flow dimension. Default: 3

  • lat_ext (float) – The lateral extend of the flow-domain, used in L^(3-dim). Default: 1

  • rate (float) – Pumpingrate at the well

  • K_well (float, optional) – Conductivity at the well. Default: K_part[0]

  • cut_off_prec (float, optional) – Define a cut-off precision for the calculation to select the disks included in the calculation. Default 1e-20

  • cond (int, optional) –

    Type of the pumping condition:

    • 0 : constant

    • 1 : periodic (needs “w” as cond_kw)

    • 2 : slug (rate will be interpreted as slug-volume)

    • 3 : interval (needs “t” as cond_kw)

    • callable: laplace-transformation of the transient pumping-rate

    Default: 0

  • cond_kw (dict optional) – Keyword args for the pumping condition. Default: None

Returns

grf_laplace – Array with all values in laplace-space

Return type

numpy.ndarray

Examples

>>> grf_laplace([5,10],[1,2,3],[1e-3,1e-3],[1e-3,2e-3],[0,2,10], 2, 1, -1)
array([[-2.71359196e+00, -1.66671965e-01, -2.82986917e-02],
       [-4.58447458e-01, -1.12056319e-02, -9.85673855e-04]])

anaflow.tools

Anaflow subpackage providing miscellaneous tools.

Subpackages

laplace

Anaflow subpackage providing functions concerning the laplace transformation.

mean

Anaflow subpackage providing several mean calculating routines.

special

Anaflow subpackage providing special functions.

coarse_graining

Anaflow subpackage providing helper functions related to coarse graining.

Functions

Annular mean

Functions to calculate dimension dependent annular means of a function.

annular_fmean(func, val_arr, f_def, f_inv[, …])

Calculating the annular generalized f-mean.

annular_amean(func, val_arr[, ann_dim, arg_dict])

Calculating the annular arithmetic mean.

annular_gmean(func, val_arr[, ann_dim, arg_dict])

Calculating the annular geometric mean.

annular_hmean(func, val_arr[, ann_dim, arg_dict])

Calculating the annular harmonic mean.

annular_pmean(func, val_arr[, p, ann_dim, …])

Calculating the annular p-mean.

Coarse Graining solutions

Effective Coarse Graining conductivity/transmissivity solutions.

T_CG(rad, trans_gmean, var, len_scale[, …])

The coarse-graining Transmissivity.

K_CG(rad, cond_gmean, var, len_scale, anis)

The coarse-graining conductivity.

TPL_CG(rad, cond_gmean, len_scale, hurst[, …])

The gaussian truncated power-law coarse-graining conductivity.

Special

Special functions.

step_f(rad, r_part, f_part)

Callalbe step function.

specialrange(val_min, val_max, steps[, typ])

Calculation of special point ranges.

specialrange_cut(val_min, val_max, steps[, …])

Calculation of special point ranges.

neuman2004_trans(rad, trans_gmean, var, …)

The apparent transmissivity from Neuman 2004.

aniso(e)

The anisotropy function.

Laplace

Helping functions related to the laplace-transformation

get_lap(func[, arg_dict])

Callable Laplace transform.

get_lap_inv(func[, method, method_dict, …])

Callable Laplace inversion.

anaflow.tools.laplace

Anaflow subpackage providing functions concerning the laplace transformation.

The following functions are provided

get_lap(func[, arg_dict])

Callable Laplace transform.

get_lap_inv(func[, method, method_dict, …])

Callable Laplace inversion.

lap_trans(func, phase[, arg_dict])

The laplace transform.

stehfest(func, time[, bound, arg_dict])

The stehfest-algorithm for numerical laplace inversion.

get_lap(func, arg_dict=None, **kwargs)[source]

Callable Laplace transform.

Get the Laplace transform of a given function as a callable function.

Parameters
  • func (callable) –

    function that shall be transformed. The first argument needs to be the time-variable: func(t, **kwargs)

    func should be capable of taking numpy arrays as input for s and the first shape component of the output of func should match the shape of s.

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs This is designed for overlapping keywords. Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict.

Returns

The Laplace transformed of the given function.

Return type

callable

Raises

ValueError – If func is not callable.

get_lap_inv(func, method='stehfest', method_dict=None, arg_dict=None, **kwargs)[source]

Callable Laplace inversion.

Get the Laplace inversion of a given function as a callable function.

Parameters
  • func (callable) –

    function in laplace-space that shall be inverted. The first argument needs to be the laplace-variable: func(s, **kwargs)

    func should be capable of taking numpy arrays as input for s and the first shape component of the output of func should match the shape of s.

  • method (str) –

    Method that should be used to calculate the inverse. One can choose between

    • "stehfest": for the stehfest algorithm

    Default: "stehfest"

  • method_dict (dict or None, optional) – Keyword arguments for the used method.

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs This is designed for overlapping keywords. Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict.

Returns

The Laplace inverse of the given function.

Return type

callable

Raises
lap_trans(func, phase, arg_dict=None, **kwargs)[source]

The laplace transform.

Parameters
  • func (callable) –

    function that shall be transformed. The first argument needs to be the time-variable: func(s, **kwargs)

    func should be capable of taking numpy arrays as input for s and the first shape component of the output of func should match the shape of s.

  • phase (float or numpy.ndarray) – phase-points to evaluate the transformed function at

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs This is designed for overlapping keywords in stehfest and func.Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict

Returns

Array with all evaluations in phase-space.

Return type

numpy.ndarray

Raises

ValueError – If func is not callable.

stehfest(func, time, bound=12, arg_dict=None, **kwargs)[source]

The stehfest-algorithm for numerical laplace inversion.

The Inversion was derivide in ‘’Stehfest 1970’’[R1] and is given by the formula

f\left(t\right) &=\frac{\ln2}{t}\sum_{n=1}^{N}c_{n}\cdot\tilde{f}
\left(n\cdot\frac{\ln2}{t}\right)\\
c_{n} &=\left(-1\right)^{n+\frac{N}{2}}\cdot
\sum_{k=\left\lfloor \frac{n+1}{2}\right\rfloor }
^{\min\left\{ n,\frac{N}{2}\right\} }
\frac{k^{\frac{N}{2}+1}\cdot\binom{2k}{k}}
{\left(\frac{N}{2}-k\right)!\cdot\left(n-k\right)!
\cdot\left(2k-n\right)!}

In the algorithm N corresponds to bound, \tilde{f} to func and t to time.

Parameters
  • func (callable) –

    function in laplace-space that shall be inverted. The first argument needs to be the laplace-variable: func(s, **kwargs)

    func should be capable of taking numpy arrays as input for s and the first shape component of the output of func should match the shape of s.

  • time (float or numpy.ndarray) – time-points to evaluate the function at

  • bound (int, optional) – Here you can specify the number of interations within this algorithm. Default: 12

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs This is designed for overlapping keywords in stehfest and func.Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict

Returns

Array with all evaluations in Time-space.

Return type

numpy.ndarray

Raises

References

R1

Stehfest, H., ‘’Algorithm 368: Numerical inversion of laplace transforms [d5].’’ Communications of the ACM, 13(1):47-49, 1970

Notes

The parameter time needs to be strictly positiv.

The algorithm gets unstable for bound values above 20.

Examples

>>> f = lambda x: x**-1
>>> stehfest(f, [1,10,100])
array([ 1.,  1.,  1.])

anaflow.tools.mean

Anaflow subpackage providing several mean calculating routines.

The following functions are provided

annular_fmean(func, val_arr, f_def, f_inv[, …])

Calculating the annular generalized f-mean.

annular_amean(func, val_arr[, ann_dim, arg_dict])

Calculating the annular arithmetic mean.

annular_gmean(func, val_arr[, ann_dim, arg_dict])

Calculating the annular geometric mean.

annular_hmean(func, val_arr[, ann_dim, arg_dict])

Calculating the annular harmonic mean.

annular_pmean(func, val_arr[, p, ann_dim, …])

Calculating the annular p-mean.

annular_amean(func, val_arr, ann_dim=2, arg_dict=None, **kwargs)[source]

Calculating the annular arithmetic mean.

Calculating the annular arithmetic mean of a radial symmetric function for given consecutive radii defining annuli by the following formula

\varphi_i=\frac{d}{r_{i+1}^d-r_i^d}
\intop^{r_{i+1}}_{r_i} r^{d-1}\cdot \varphi(r)\, dr

Parameters
  • func (callable) – Function that should be used (\varphi in the formula). The first argument needs to be the radial variable: func(r, **kwargs)

  • val_arr (numpy.ndarray) – Radii defining the annuli.

  • ann_dim (float, optional) – The dimension of the annuli. Default: 2.0

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs. This is designed for overlapping keywords in annular_amean and func. Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict

Returns

Array with all calculated arithmetic means

Return type

numpy.ndarray

Raises
  • ValueError – If func is not callable.

  • ValueError – If val_arr has less than 2 values.

  • ValueError – If val_arr is not sorted in incresing order.

Notes

If the last value in val_arr is “inf”, the given function should provide a value for “inf” as input: func(float("inf"))

annular_fmean(func, val_arr, f_def, f_inv, ann_dim=2, arg_dict=None, **kwargs)[source]

Calculating the annular generalized f-mean.

Calculating the annular generalized f-mean of a radial symmetric function for given consecutive radii defining annuli by the following formula

\varphi_i=f^{-1}\left(\frac{d}{r_{i+1}^d-r_i^d}
\intop^{r_{i+1}}_{r_i} r^{d-1}\cdot f(\varphi(r))\, dr \right)

Parameters
  • func (callable) – Function that should be used (\varphi in the formula). The first argument needs to be the radial variable: func(r, **kwargs)

  • val_arr (numpy.ndarray) – Radii defining the annuli.

  • ann_dim (float, optional) – The dimension of the annuli. Default: 2.0

  • f_def (callable) – Function defining the f-mean.

  • f_inv (callable) – Inverse of the function defining the f-mean.

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs. This is designed for overlapping keywords in annular_fmean and func. Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict

Returns

Array with all calculated arithmetic means

Return type

numpy.ndarray

Raises

Notes

If the last value in val_arr is “inf”, the given function should provide a value for “inf” as input: func(float("inf"))

annular_gmean(func, val_arr, ann_dim=2, arg_dict=None, **kwargs)[source]

Calculating the annular geometric mean.

Calculating the annular geometric mean of a radial symmetric function for given consecutive radii defining annuli by the following formula

\varphi_i=\exp\left(\frac{d}{r_{i+1}^d-r_i^d}
\intop^{r_{i+1}}_{r_i} r^{d-1}\cdot \ln(\varphi(r))\, dr \right)

Parameters
  • func (callable) – Function that should be used (\varphi in the formula). The first argument needs to be the radial variable: func(r, **kwargs)

  • val_arr (numpy.ndarray) – Radii defining the annuli.

  • ann_dim (float, optional) – The dimension of the annuli. Default: 2.0

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs. This is designed for overlapping keywords in annular_gmean and func. Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict

Returns

Array with all calculated geometric means

Return type

numpy.ndarray

Raises
  • ValueError – If func is not callable.

  • ValueError – If val_arr has less than 2 values.

  • ValueError – If val_arr is not sorted in incresing order.

Notes

If the last value in val_arr is “inf”, the given function should provide a value for “inf” as input: func(float("inf"))

Examples

>>> f = lambda x: x**2
>>> annular_gmean(f, [1,2,3])
array([ 2.33588885,  6.33423311])
annular_hmean(func, val_arr, ann_dim=2, arg_dict=None, **kwargs)[source]

Calculating the annular harmonic mean.

Calculating the annular harmonic mean of a radial symmetric function for given consecutive radii defining annuli by the following formula

\varphi_i=\left(\frac{d}{r_{i+1}^d-r_i^d}
\intop^{r_{i+1}}_{r_i} r^{d-1}\cdot \varphi(r)^{-1}\, dr \right)^{-1}

Parameters
  • func (callable) – Function that should be used (\varphi in the formula). The first argument needs to be the radial variable: func(r, **kwargs)

  • val_arr (numpy.ndarray) – Radii defining the annuli.

  • ann_dim (float, optional) – The dimension of the annuli. Default: 2.0

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs. This is designed for overlapping keywords in annular_hmean and func. Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict

Returns

Array with all calculated geometric means

Return type

numpy.ndarray

Raises
  • ValueError – If func is not callable.

  • ValueError – If val_arr has less than 2 values.

  • ValueError – If val_arr is not sorted in incresing order.

Notes

If the last value in val_arr is “inf”, the given function should provide a value for “inf” as input: func(float("inf"))

annular_pmean(func, val_arr, p=2.0, ann_dim=2, arg_dict=None, **kwargs)[source]

Calculating the annular p-mean.

Calculating the annular p-mean of a radial symmetric function for given consecutive radii defining annuli by the following formula

\varphi_i=\left(\frac{d}{r_{i+1}^d-r_i^d}
\intop^{r_{i+1}}_{r_i} r^{d-1}\cdot\varphi(r)^p\, dr
\right)^{\frac{1}{p}}

Parameters
  • func (callable) – Function that should be used (\varphi in the formula). The first argument needs to be the radial variable: func(r, **kwargs)

  • val_arr (numpy.ndarray) – Radii defining the annuli.

  • p (float, optional) – The potency defining the p-mean. Default: 2.0

  • ann_dim (float, optional) – The dimension of the annuli. Default: 2.0

  • arg_dict (dict or None, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given in func. Will be merged with **kwargs. This is designed for overlapping keywords in annular_pmean and func. Default: None

  • **kwargs – Keyword-arguments that are forwarded to the function given in func. Will be merged with arg_dict

Returns

Array with all calculated p-means

Return type

numpy.ndarray

Raises
  • ValueError – If func is not callable.

  • ValueError – If val_arr has less than 2 values.

  • ValueError – If val_arr is not sorted in incresing order.

Notes

If the last value in val_arr is “inf”, the given function should provide a value for “inf” as input: func(float("inf"))

anaflow.tools.special

Anaflow subpackage providing special functions.

The following functions are provided

Shaper([time, rad, struc_grid])

A class to reshape radius-time input-output in a good way.

step_f(rad, r_part, f_part)

Callalbe step function.

sph_surf(dim)

Surface of the d-dimensional sphere.

specialrange(val_min, val_max, steps[, typ])

Calculation of special point ranges.

specialrange_cut(val_min, val_max, steps[, …])

Calculation of special point ranges.

aniso(e)

The anisotropy function.

well_solution(time, rad, storage, transmissivity)

The classical Theis solution.

grf_solution(time, rad, storage, conductivity)

The general radial flow (GRF) model for a pumping test.

inc_gamma(s, x)

The (upper) incomplete gamma function.

tpl_hyp(rad, dim, hurst, corr, prop)

Hyp_2F1 for the TPL CG model.

neuman2004_trans(rad, trans_gmean, var, …)

The apparent transmissivity from Neuman 2004.

class Shaper(time=0, rad=0, struc_grid=True)[source]

Bases: object

A class to reshape radius-time input-output in a good way.

Parameters
  • time (numpy.ndarray or float, optional) – Array with all time-points where the function should be evaluated. Default: 0

  • rad (numpy.ndarray or float, optional) – Array with all radii where the function should be evaluated. Default: 0

  • struc_grid (bool, optional) – If this is set to False, the rad and time array will be merged and interpreted as single, r-t points. In this case they need to have the same shapes. Otherwise a structured t-r grid is created. Default: True

Methods

reshape(result)

Reshape a time-rad result according to the input shape.

reshape(result)[source]

Reshape a time-rad result according to the input shape.

aniso(e)[source]

The anisotropy function.

Known from ‘’Dagan (1989)’’[R2].

Parameters

e (float) – Anisotropy-ratio of the vertical and horizontal corralation-lengths

Returns

aniso – Value of the anisotropy function for the given value.

Return type

float

Raises

ValueError – If the Anisotropy-ratio e is not within 0 and 1.

References

R2

Dagan, G., ‘’Flow and Transport on Porous Formations’’, Springer Verlag, New York, 1989.

Examples

>>> aniso(0.5)
0.2363998587187151
grf_solution(time, rad, storage, conductivity, dim=2, lat_ext=1.0, rate=- 0.0001, h_bound=0.0, struc_grid=True)[source]

The general radial flow (GRF) model for a pumping test.

Parameters
  • time (numpy.ndarray) – Array with all time-points where the function should be evaluated.

  • rad (numpy.ndarray) – Array with all radii where the function should be evaluated.

  • storage (float) – Storage coefficient of the aquifer.

  • conductivity (float) – Conductivity of the aquifer.

  • dim (float, optional) – Fractional dimension of the aquifer. Default: 2.0

  • lat_ext (float, optional) – Lateral extend of the aquifer. Default: 1.0

  • rate (float, optional) – Pumpingrate at the well. Default: -1e-4

  • h_bound (float, optional) – Reference head at the outer boundary at infinity. Default: 0.0

  • struc_grid (bool, optional) – If this is set to “False”, the “rad” and “time” array will be merged and interpreted as single, r-t points. In this case they need to have the same shapes. Otherwise a structured r-t grid is created. Default: True

Returns

head – Array with all heads at the given radii and time-points.

Return type

numpy.ndarray

Raises
inc_gamma(s, x)[source]

The (upper) incomplete gamma function.

Given by: \Gamma(s,x) = \int_x^{\infty} t^{s-1}\,e^{-t}\,{\rm d}t

Parameters
neuman2004_trans(rad, trans_gmean, var, len_scale)[source]

The apparent transmissivity from Neuman 2004.

Parameters
  • rad (numpy.ndarray) – Array with all radii where the function should be evaluated

  • trans_gmean (float) – Geometric-mean transmissivity.

  • var (float) – Variance of log-transmissivity.

  • len_scale (float) – Correlation-length of log-transmissivity.

specialrange(val_min, val_max, steps, typ='exp')[source]

Calculation of special point ranges.

Parameters
  • val_min (float) – Starting value.

  • val_max (float) – Ending value

  • steps (int) – Number of steps.

  • typ (str or float, optional) –

    Setting the kind of range-distribution. One can choose between

    • "exp": for exponential behavior

    • "log": for logarithmic behavior

    • "geo": for geometric behavior

    • "lin": for linear behavior

    • "quad": for quadratic behavior

    • "cub": for cubic behavior

    • float: here you can specifi any exponent (“quad” would be equivalent to 2)

    Default: "exp"

Returns

Array containing the special range

Return type

numpy.ndarray

Examples

>>> specialrange(1,10,4)
array([ 1.        ,  2.53034834,  5.23167968, 10.        ])
specialrange_cut(val_min, val_max, steps, val_cut=None, typ='exp')[source]

Calculation of special point ranges.

Calculation of special point ranges with a cut-off value.

Parameters
  • val_min (float) – Starting value.

  • val_max (float) – Ending value

  • steps (int) – Number of steps.

  • val_cut (float, optional) – Cutting value, if val_max is bigger than this value, the last interval will be between val_cut and val_max. Default: 100.0

  • typ (str or float, optional) –

    Setting the kind of range-distribution. One can choose between

    • "exp": for exponential behavior

    • "log": for logarithmic behavior

    • "geo": for geometric behavior

    • "lin": for linear behavior

    • "quad": for quadratic behavior

    • "cub": for cubic behavior

    • float: here you can specifi any exponent (“quad” would be equivalent to 2)

    Default: "exp"

Returns

Array containing the special range

Return type

numpy.ndarray

Examples

>>> specialrange_cut(1,10,4)
array([ 1.        ,  2.53034834,  5.23167968, 10.        ])
sph_surf(dim)[source]

Surface of the d-dimensional sphere.

step_f(rad, r_part, f_part)[source]

Callalbe step function.

tpl_hyp(rad, dim, hurst, corr, prop)[source]

Hyp_2F1 for the TPL CG model.

well_solution(time, rad, storage, transmissivity, rate=- 0.0001, h_bound=0.0, struc_grid=True)[source]

The classical Theis solution.

The classical Theis solution for transient flow under a pumping condition in a confined and homogeneous aquifer.

This solution was presented in ‘’Theis 1935’’[R9].

Parameters
  • time (numpy.ndarray) – Array with all time-points where the function should be evaluated.

  • rad (numpy.ndarray) – Array with all radii where the function should be evaluated.

  • storage (float) – Storage of the aquifer.

  • transmissivity (float) – Transmissivity of the aquifer.

  • rate (float, optional) – Pumpingrate at the well. Default: -1e-4

  • h_bound (float, optional) – Reference head at the outer boundary at infinity. Default: 0.0

  • struc_grid (bool, optional) – If this is set to “False”, the “rad” and “time” array will be merged and interpreted as single, r-t points. In this case they need to have the same shapes. Otherwise a structured r-t grid is created. Default: True

Returns

head – Array with all heads at the given radii and time-points.

Return type

numpy.ndarray

Raises

References

R9

Theis, C., ‘’The relation between the lowering of the piezometric surface and the rate and duration of discharge of a well using groundwater storage’’, Trans. Am. Geophys. Union, 16, 519-524, 1935

Notes

The parameters rad, T and S will be checked for positivity. If you want to use cartesian coordiantes, just use the formula r = sqrt(x**2 + y**2)

Examples

>>> well_solution([10,100], [1,2,3], 0.001, 0.001, -0.001)
array([[-0.24959541, -0.14506368, -0.08971485],
       [-0.43105106, -0.32132823, -0.25778313]])

anaflow.tools.coarse_graining

Anaflow subpackage providing helper functions related to coarse graining.

The following functions are provided

T_CG(rad, trans_gmean, var, len_scale[, …])

The coarse-graining Transmissivity.

T_CG_inverse(T, trans_gmean, var, len_scale)

The inverse coarse-graining Transmissivity.

T_CG_error(err, trans_gmean, var, len_scale)

Calculating the radial-point for given error.

K_CG(rad, cond_gmean, var, len_scale, anis)

The coarse-graining conductivity.

K_CG_inverse(K, cond_gmean, var, len_scale, anis)

The inverse coarse-graining conductivity.

K_CG_error(err, cond_gmean, var, len_scale, anis)

Calculating the radial-point for given error.

TPL_CG(rad, cond_gmean, len_scale, hurst[, …])

The gaussian truncated power-law coarse-graining conductivity.

TPL_CG_error(err, cond_gmean, len_scale, hurst)

Calculating the radial-point for given error.

K_CG(rad, cond_gmean, var, len_scale, anis, K_well='KH', prop=1.6)[source]

The coarse-graining conductivity.

This solution was presented in ‘’Zech 2013’’[R8].

This functions gives an effective conductivity for 3D pumpingtests in heterogenous aquifers, where the conductivity is following a log-normal distribution and a gaussian correlation function and taking vertical anisotropy into account.

Parameters
  • rad (numpy.ndarray) – Array with all radii where the function should be evaluated

  • cond_gmean (float) – Geometric-mean conductivity.

  • var (float) – Variance of the log-conductivity.

  • len_scale (float) – Corralation-length of log-conductivity.

  • anis (float) – Anisotropy-ratio of the vertical and horizontal corralation-lengths.

  • K_well (string/float, optional) – Explicit conductivity value at the well. One can choose between the harmonic mean ("KH"), the arithmetic mean ("KA") or an arbitrary float value. Default: "KH"

  • prop (float, optional) – Proportionality factor used within the upscaling procedure. Default: 1.6

Returns

K_CG – Array containing the effective conductivity values.

Return type

numpy.ndarray

References

R8

Zech, A. ‘’Impact of Aqifer Heterogeneity on Subsurface Flow and Salt Transport at Different Scales: from a method determine parameters of heterogeneous permeability at local scale to a large-scale model for the sedimentary basin of Thuringia.’’ PhD thesis, Friedrich-Schiller-Universität Jena, 2013

Examples

>>> K_CG([1,2,3], 0.001, 1, 10, 1, 2)
array([0.00063008, 0.00069285, 0.00077595])
K_CG_error(err, cond_gmean, var, len_scale, anis, K_well='KH', prop=1.6)[source]

Calculating the radial-point for given error.

Calculating the radial-point where the relative error of the farfield value is less than the given tollerance. See: K_CG()

Parameters
  • err (float) – Given relative error for the farfield conductivity

  • cond_gmean (float) – Geometric-mean conductivity.

  • var (float) – Variance of the log-conductivity.

  • len_scale (float) – Corralation-length of log-conductivity.

  • anis (float) – Anisotropy-ratio of the vertical and horizontal corralation-lengths.

  • K_well (string/float, optional) – Explicit conductivity value at the well. One can choose between the harmonic mean ("KH"), the arithmetic mean ("KA") or an arbitrary float value. Default: "KH"

  • prop (float, optional) – Proportionality factor used within the upscaling procedure. Default: 1.6

Returns

rad – Radial point, where the relative error is less than the given one.

Return type

float

Examples

>>> K_CG_error(0.01, 0.001, 1, 10, 1, 2)
19.612796453639845
K_CG_inverse(K, cond_gmean, var, len_scale, anis, K_well='KH', prop=1.6)[source]

The inverse coarse-graining conductivity.

See: K_CG()

Parameters
  • K (numpy.ndarray) – Array with all conductivity values where the function should be evaluated

  • cond_gmean (float) – Geometric-mean conductivity.

  • var (float) – Variance of the log-conductivity.

  • len_scale (float) – Corralation-length of log-conductivity.

  • anis (float) – Anisotropy-ratio of the vertical and horizontal corralation-lengths.

  • K_well (string/float, optional) – Explicit conductivity value at the well. One can choose between the harmonic mean ("KH"), the arithmetic mean ("KA") or an arbitrary float value. Default: "KH"

  • prop (float, optional) – Proportionality factor used within the upscaling procedure. Default: 1.6

Returns

rad – Array containing the radii belonging to the given conductivity values

Return type

numpy.ndarray

Examples

>>> K_CG_inverse([7e-4,8e-4,9e-4], 0.001, 1, 10, 1, 2)
array([2.09236867, 3.27914996, 4.52143956])
TPL_CG(rad, cond_gmean, len_scale, hurst, var=None, c=1.0, anis=1, dim=2.0, K_well='KH', prop=1.6)[source]

The gaussian truncated power-law coarse-graining conductivity.

Parameters
  • rad (numpy.ndarray) – Array with all radii where the function should be evaluated

  • cond_gmean (float) – Geometric-mean conductivity

  • len_scale (float) – upper bound of the corralation-length of conductivity-distribution

  • hurst (float) – Hurst coefficient of the TPL model. Should be in (0, 1).

  • var (float or None, optional) – Variance of log-conductivity If given, c will be calculated accordingly. Default: None

  • c (float, optional) – Intensity of variation in the TPL model. Is overwritten if var is given. Default: 1.0

  • anis (float, optional) – Anisotropy-ratio of the vertical and horizontal corralation-lengths. This is only applied in 3 dimensions. Default: 1.0

  • dim (float, optional) – Dimension of space. Default: 2.0

  • K_well (str or float, optional) – Explicit conductivity value at the well. One can choose between the harmonic mean ("KH"), the arithmetic mean ("KA") or an arbitrary float value. Default: "KH"

  • prop (float, optional) – Proportionality factor used within the upscaling procedure. Default: 1.6

Returns

TPL_CG – Array containing the effective conductivity values.

Return type

numpy.ndarray

TPL_CG_error(err, cond_gmean, len_scale, hurst, var=None, c=1.0, anis=1, dim=2.0, K_well='KH', prop=1.6)[source]

Calculating the radial-point for given error.

Calculating the radial-point where the relative error of the farfield value is less than the given tollerance. See: TPL_CG()

Parameters
  • err (float) – Given relative error for the farfield conductivity

  • cond_gmean (float) – Geometric-mean conductivity

  • len_scale (float) – upper bound of the corralation-length of conductivity-distribution

  • hurst (float) – Hurst coefficient of the TPL model. Should be in (0, 1).

  • var (float or None, optional) – Variance of log-conductivity If given, c will be calculated accordingly. Default: None

  • c (float, optional) – Intensity of variation in the TPL model. Is overwritten if var is given. Default: 1.0

  • anis (float, optional) – Anisotropy-ratio of the vertical and horizontal corralation-lengths. This is only applied in 3 dimensions. Default: 1.0

  • dim (float, optional) – Dimension of space. Default: 2.0

  • K_well (str or float, optional) – Explicit conductivity value at the well. One can choose between the harmonic mean ("KH"), the arithmetic mean ("KA") or an arbitrary float value. Default: "KH"

  • prop (float, optional) – Proportionality factor used within the upscaling procedure. Default: 1.6

Returns

rad – Radial point, where the relative error is less than the given one.

Return type

float

T_CG(rad, trans_gmean, var, len_scale, T_well=None, prop=1.6)[source]

The coarse-graining Transmissivity.

This solution was presented in ‘’Schneider & Attinger 2008’’[R3].

This functions gives an effective transmissivity for 2D pumpingtests in heterogenous aquifers, where the transmissivity is following a log-normal distribution and a gaussian correlation function.

Parameters
  • rad (numpy.ndarray) – Array with all radii where the function should be evaluated

  • trans_gmean (float) – Geometric-mean transmissivity.

  • var (float) – Variance of log-transmissivity.

  • len_scale (float) – Correlation-length of log-transmissivity.

  • T_well (float, optional) – Explicit transmissivity value at the well. Harmonic mean by default.

  • prop (float, optional) – Proportionality factor used within the upscaling procedure. Default: 1.6

Returns

T_CG – Array containing the effective transmissivity values.

Return type

numpy.ndarray

References

R3

Schneider, C. and Attinger, S., ‘’Beyond thiem: A new method for interpreting large scale pumping tests in heterogeneous aquifers.’’ Water resources research, 44(4), 2008

Examples

>>> T_CG([1,2,3], 0.001, 1, 10, 2)
array([0.00061831, 0.00064984, 0.00069236])
T_CG_error(err, trans_gmean, var, len_scale, T_well=None, prop=1.6)[source]

Calculating the radial-point for given error.

Calculating the radial-point where the relative error of the farfield value is less than the given tollerance. See: T_CG()

Parameters
  • err (float) – Given relative error for the farfield transmissivity

  • trans_gmean (float) – Geometric-mean transmissivity.

  • var (float) – Variance of log-transmissivity.

  • len_scale (float) – Correlation-length of log-transmissivity.

  • T_well (float, optional) – Explicit transmissivity value at the well. Harmonic mean by default.

  • prop (float, optional) – Proportionality factor used within the upscaling procedure. Default: 1.6

Returns

rad – Radial point, where the relative error is less than the given one.

Return type

float

Examples

>>> T_CG_error(0.01, 0.001, 1, 10, 2)
34.91045016779039
T_CG_inverse(T, trans_gmean, var, len_scale, T_well=None, prop=1.6)[source]

The inverse coarse-graining Transmissivity.

See: T_CG()

Parameters
  • T (numpy.ndarray) – Array with all transmissivity values where the function should be evaluated

  • trans_gmean (float) – Geometric-mean transmissivity.

  • var (float) – Variance of log-transmissivity.

  • len_scale (float) – Correlation-length of log-transmissivity.

  • T_well (float, optional) – Explicit transmissivity value at the well. Harmonic mean by default.

  • prop (float, optional) – Proportionality factor used within the upscaling procedure. Default: 1.6

Returns

rad – Array containing the radii belonging to the given transmissivity values

Return type

numpy.ndarray

Examples

>>> T_CG_inverse([7e-4,8e-4,9e-4], 0.001, 1, 10, 2)
array([3.16952925, 5.56935826, 9.67679026])