Skip to main content

gwtransport

gwtransport enables timeseries analysis of groundwater transport of solutes and temperature. 1) Estimate aquifer properties either from temperature tracer tests or streamline analysis. 2) Predict residence times and solute transport, and assess pathogen removal efficiency in bank filtration systems. All without heavy numerical modeling!

Testing of source code Functional Testing Test Coverage Linting Build and release package
Testing of examples Testing of examples
Package PyPI - Python Version PyPI - Version GitHub commits since latest release

What you can do with a calibrated model

Calibration refers to the estimation of the aquifer pore volume distribution. Once you have estimated this, you can:

  • Predict residence time distributions under varying flow conditions
  • Forecast contaminant arrival times and extracted concentrations
  • Design treatment systems with quantified pathogen removal efficiency, compatible with tracer dating decay rates
  • Assess groundwater vulnerability to contamination with a retardation that may depend on its concentration (non-linear sorption)
  • Enable early warning systems as digital twins for drinking water protection
  • Backwards model to estimate infiltration concentrations from extracted concentrations

Various conceptual models are available, depending on how the solute enters the aquifer and dominant transport mechanisms: full overview.

Two ways to obtain model parameters

The aquifer pore volume distribution is constant over time and can be obtained using:

1. Streamline Analysis

You already have computed the groundwater flow with an analytical solution or a numerical groundwater flow model. Compute the area between streamlines from flow field data to directly estimate the discrete aquifer pore volume distribution.

from gwtransport.advection import infiltration_to_extraction

# Measurements
cin = [1.0, 2.0, 3.0]  # Concentration infiltrated water [g/l]
flow = [100.0, 150.0, 100.0]  # Flow rates [m3/day]
tedges = pd.date_range(start="2020-01-05", end="2020-01-08", freq="D")  # Time edges for cin and flow bins

# Information from groundwater flow model
areas_between_streamlines = np.array([100.0, 90.0, 110.0])  # [m2]
depth_aquifer = 2.0  # [m] Convert areas between 2D streamlines to 3D aquifer pore volumes
porosity = 0.35  # [-]
aquifer_pore_volumes = areas_between_streamlines * depth_aquifer * porosity  # [m3]

cout = infiltration_to_extraction(
    cin=cin,
    flow=flow,
    tedges=tedges,
    cout_tedges=tedges,
    aquifer_pore_volumes=aquifer_pore_volumes,
    retardation_factor=1.0,
)  # [g/l] same units as cin

# Note: Initial output values are NaN until the first cin value has fully passed the smallest aquifer pore volume.

This efficiently computes cout with 1D transport for every aquifer pore volume and then averages over the aquifer pore volumes.

2. Temperature/Electrical conductivity Tracer Test

Approximate the aquifer pore volume distribution with a two-parameter gamma distribution. Estimate these parameters from measured temperatures of infiltrated and extracted water. Temperature acts as a natural tracer, revealing flow paths through heterogeneous aquifers via calibration. No groundwater model is required.

from gwtransport.advection import gamma_infiltration_to_extraction

# Measurements
cin = [11.0, 12.0, 13.0]  # [degC] Measured temperature infiltrated water
flow = [100.0, 150.0, 100.0]  # Flow rates
tedges = pd.date_range(start="2020-01-05", end="2020-01-08", freq="D")  # Time edges for cin and flow bins

cout_measured = [10.5, 11.0, 11.5]  # [degC] Measured temperature extracted water (required for calibration only)

cout_model = gamma_infiltration_to_extraction(
    cin=cin,
    flow=flow,
    tedges=tedges,
    cout_tedges=tedges,
    mean=200.0,  # [m3] Adjust such that cout_model matches the measured cout
    std=16.0,    # [m3] Adjust such that cout_model matches the measured cout
    retardation_factor=2.0,  # [-] Retardation factor for the temperature tracer
)

# Compare model output with measured data to calibrate gamma mean and std parameters (see example notebook 1)

Here, the continuous gamma distribution for the aquifer pore volume distribution is discretized into bins. For every bin, 1D transport is computed and then averaged over all bins.

Installation

pip install gwtransport

Examples and Documentation

See Core Concepts for an in-depth discussion of the core modeling approach. To determine when gwtransport is appropriate for your application and understand the underlying assumptions, see Assumptions.

Examples:

  1. Estimate aquifer pore volume from temperature response
  2. Estimate the residence time distribution
  3. Log removal efficiency analysis
  4. Deposition analysis
  5. Bank filtration with TIMFlow: streamtubes to APVD
  6. Advection with non-linear sorption

Full documentation: gwtransport.github.io/gwtransport

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0), a strong copyleft license that requires making source code of any modifications available. This ensures improvements remain available to the community.

Permissions Conditions Limitations
✓ Commercial use ℹ Disclose source ✗ Liability
✓ Distribution ℹ License and copyright notice ✗ Warranty
✓ Modification ℹ Network use is distribution
✓ Patent use ℹ Same license
✓ Private use ℹ State changes

For more details about this license, see the full AGPL-3.0 license text.

Metadata

Release files for gwtransport 0.37.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gwtransport 0.37.0
File Size Uploaded
gwtransport-0.37.0.tar.gz 3.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for gwtransport 0.37.0
File Interpreter ABI Platform
gwtransport-0.37.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.6 MB

Release files / gwtransport-0.37.0.tar.gz

Download URL gwtransport-0.37.0.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
255a250345302e36ebbabc3c06fca9bebc1a7898fd07c4dcf6b10bb01617fb3f
BLAKE2b-256 checksum
How to use checksums
3603241ec713f484f8f2c1a7c77d3548339e6f4c700cc3855021d291612881a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 28, 2026.

Transparency log

Release files / gwtransport-0.37.0-py3-none-any.whl

Download URL gwtransport-0.37.0-py3-none-any.whl
Size 331.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af2fb0c2a092e878f5815ceb7ece35f5d57125bb44d07ed9b4b7fbed3c7b7b16
BLAKE2b-256 checksum
How to use checksums
7b3efd7ffe7a7037fe6d0096621d31c955a3bb580c430419936b4f6cdf15cf7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.37.0 This release

2 release files

0.36.0

2 release files

0.34.0

2 release files

0.33.0

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.0

2 release files

0.28.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.9.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page