Analytical solutions for solute transport in groundwater with Python
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file adepy-0.2.0.tar.gz.
File metadata
- Download URL: adepy-0.2.0.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b94a72e5bf917eac340df290c6efb473de58fb49b74f5a153c28c3c51dec279e
|
|
| MD5 |
bbf41e017691452a296746d68beb8049
|
|
| BLAKE2b-256 |
6651488af4d3cd89ac8f285d796c1ff648ab0cad2b3fa12c2cdf3430781bcae6
|
Provenance
The following attestation bundles were made for adepy-0.2.0.tar.gz:
Publisher:
python_publish.yml on cneyens/adepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adepy-0.2.0.tar.gz -
Subject digest:
b94a72e5bf917eac340df290c6efb473de58fb49b74f5a153c28c3c51dec279e - Sigstore transparency entry: 418345603
- Sigstore integration time:
-
Permalink:
cneyens/adepy@50b028af748aae2e0cfd0448161a629426dc6b99 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/cneyens
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@50b028af748aae2e0cfd0448161a629426dc6b99 -
Trigger Event:
release
-
Statement type:
File details
Details for the file adepy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: adepy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d76188f72c84e2773d5a76c97815f66d7bfb2992ec4e97da093a61ee48e0220
|
|
| MD5 |
bd7dcc0896f187a27982af380a00a91a
|
|
| BLAKE2b-256 |
c77e0e55af9d903d6aaeb10a5e2f5420c5e5d4743d67877ac578b23a00078658
|
Provenance
The following attestation bundles were made for adepy-0.2.0-py3-none-any.whl:
Publisher:
python_publish.yml on cneyens/adepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adepy-0.2.0-py3-none-any.whl -
Subject digest:
0d76188f72c84e2773d5a76c97815f66d7bfb2992ec4e97da093a61ee48e0220 - Sigstore transparency entry: 418345627
- Sigstore integration time:
-
Permalink:
cneyens/adepy@50b028af748aae2e0cfd0448161a629426dc6b99 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/cneyens
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@50b028af748aae2e0cfd0448161a629426dc6b99 -
Trigger Event:
release
-
Statement type: