AdePy
AdePy contains analytical solutions for the advection-dispersion equation (ADE) describing solute transport in groundwater, written in Python.
Currently, all solutions shown in Wexler (1992) are provided as separate Python functions. These simulate 1D, 2D or 3D solute transport in uniform background flow for a variety of boundary conditions and source geometries. The solute may be subjected to linear equilibrium sorption and first-order decay. Additionally, solutions for instantaneous point pulse sources ("tracer slugs") are also provided for 1D, 2D and 3D transport, as well as the Multi-Process Non-Equilibrium (MPNE) 1D transport model described in Neville et al. (2000).
Since all equations are linear, superposition in time and space can be applied to create complex source geometries with time-varying source concentrations. Gauss-Legendre quadrature is used to solve the integrals which require numerical integration. Sequential or parallel first-order parent-daughter chain reactions are supported using the method described by Sun & Clement (1999).
To install
The released version can be installed using pip:
pip install adepy
To install the development version, download or git clone the GitHub repository locally. Then install using:
pip install -e <path/to/local/clone>
AdePy depends on NumPy, SciPy and Numba.
Documentation
Coming soon.
Available solutions
| Module | Function | Dimensionality | Source geometry | Boundary type | Aquifer geometry | Reference |
|---|---|---|---|---|---|---|
uniform |
finite1() |
1D | Inlet | Dirichlet | Finite | Wexler (1992) |
finite3() |
1D | Inlet | Cauchy | Finite | Wexler (1992) | |
seminf1() |
1D | Inlet | Dirichlet | Semi-infinite | Wexler (1992) | |
seminf3() |
1D | Inlet | Cauchy | Semi-infinite | Wexler (1992) | |
point1() |
1D | Point | Cauchy | Infinite | Bear (1979) | |
pulse1() |
1D | Point | Pulse | Infinite | Bear (1979) | |
mpne() |
1D | Inlet | Dirichlet/Cauchy | Semi-infinite/finite | Neville et al (2000) | |
point2() |
2D | Point | Cauchy | Infinite | Wexler (1992) | |
stripf() |
2D | Finite Y at X=0 | Dirichlet | Finite Y | Wexler (1992) | |
stripi() |
2D | Finite Y at X=0 | Dirichlet | Semi-infinite | Wexler (1992) | |
gauss() |
2D | Gaussian along Y at X=0 | Dirichlet | Semi-infinite | Wexler (1992) | |
pulse2() |
2D | Point | Pulse | Infinite | Bear (1979) | |
point3() |
3D | Point | Cauchy | Infinite | Wexler (1992) | |
patchf() |
3D | Finite Y and Z at X=0 | Dirichlet | Finite Y and Z | Wexler (1992) | |
patchi() |
3D | Finite Y and Z at X=0 | Dirichlet | Semi-infinite | Wexler (1992) | |
pulse3() |
3D | Point | Pulse | Infinite | Wexler (1992) |
Example
The fate of a contaminant plume generated by continuous injection of a point source in an aquifer with uniform background flow is simulated. The source generates a plume which extends in three dimensions and migrates due to advection and mechanical dispersion. Molecular diffusion, linear sorption and first-order decay are neglected in this example.
More examples are available in the examples folder.
import numpy as np
import matplotlib.pyplot as plt
# 3D ADE solution of a continuous point source in uniform background flow
from adepy.uniform import point3
# Source parameters ----
xc = 0 # x-coordinate of point source, m
yc = 0 # y-coordinate of point source, m
zc = 0 # z-coordinate of point source, m
c0 = 100 # injection concentration, mg/L
Q = 1 # injection rate, m³/d
# Aquifer parameters ----
v = 0.05 # uniform groundwater flow velocity in x-direction, m/d
al = 5 # longitudinal dispersivity, m
ah = 1 # horizontal transverse dispersivity, m
av = 0.1 # vertical transverse dispersivity, m
n = 0.2 # porosity, -
# Calculate and plot the concentration field after 1 year at z = 0 ----
t = 365 # output time, d
x, y = np.meshgrid(np.linspace(-10, 20, 100),
np.linspace(-7.5, 7.5, 100)) # output grid x-y coordinates, m
z = 0 # output grid z-coordinate, m
c = point3(c0, x, y, z, t, v, n, al, ah, av, Q, xc, yc, zc) # simulated concentration, mg/L
plt.contour(x, y, c, levels=np.arange(100, 2501, 100))
plt.xlabel('x (m)')
plt.ylabel('y (m)')
plt.gca().set_aspect("equal")
plt.grid()
# Calculate and plot the concentration time series for 5 years at a location downstream ----
obs = (40, 0, 0) # x-y-z coordinates of observation point, m
t = np.linspace(1, 5 * 365, 100) # output times, d
cobs = point3(c0, obs[0], obs[1], obs[2], t, v, n, al, ah, av, Q, xc, yc, zc)
plt.plot(t, cobs)
plt.xlabel('Time (d)')
plt.ylabel('Concentration (mg/L)')
References
Metadata
Release files for adepy 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| adepy-0.2.0.tar.gz | 25.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| adepy-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.4 kB
Release files / adepy-0.2.0.tar.gz
| Download URL | adepy-0.2.0.tar.gz |
|---|---|
| Size | 25.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b94a72e5bf917eac340df290c6efb473de58fb49b74f5a153c28c3c51dec279e
|
|
BLAKE2b-256 checksum How to use checksums |
6651488af4d3cd89ac8f285d796c1ff648ab0cad2b3fa12c2cdf3430781bcae6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2025.
Transparency logRelease files / adepy-0.2.0-py3-none-any.whl
| Download URL | adepy-0.2.0-py3-none-any.whl |
|---|---|
| Size | 29.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d76188f72c84e2773d5a76c97815f66d7bfb2992ec4e97da093a61ee48e0220
|
|
BLAKE2b-256 checksum How to use checksums |
c77e0e55af9d903d6aaeb10a5e2f5420c5e5d4743d67877ac578b23a00078658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2025.
Transparency log