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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gwtransport-0.37.0.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gwtransport-0.37.0-py3-none-any.whl (331.9 kB view details)

Uploaded Python 3

File details

Details for the file gwtransport-0.37.0.tar.gz.

File metadata

  • Download URL: gwtransport-0.37.0.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for gwtransport-0.37.0.tar.gz
Algorithm Hash digest
SHA256 255a250345302e36ebbabc3c06fca9bebc1a7898fd07c4dcf6b10bb01617fb3f
MD5 1ac7da3b8892dab2b660b6ba8911d24b
BLAKE2b-256 3603241ec713f484f8f2c1a7c77d3548339e6f4c700cc3855021d291612881a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwtransport-0.37.0.tar.gz:

Publisher: release.yml on gwtransport/gwtransport

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gwtransport-0.37.0-py3-none-any.whl.

File metadata

  • Download URL: gwtransport-0.37.0-py3-none-any.whl
  • Upload date:
  • Size: 331.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for gwtransport-0.37.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af2fb0c2a092e878f5815ceb7ece35f5d57125bb44d07ed9b4b7fbed3c7b7b16
MD5 8b036d0928cc5e54b2320bc2dd038f1d
BLAKE2b-256 7b3efd7ffe7a7037fe6d0096621d31c955a3bb580c430419936b4f6cdf15cf7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwtransport-0.37.0-py3-none-any.whl:

Publisher: release.yml on gwtransport/gwtransport

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.37.0 This release

2 files

0.36.0

2 files

0.35.0

2 files

0.34.0

2 files

0.33.0

2 files

0.32.0

2 files

0.31.0

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.1

2 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