Skip to main content

Timeseries analysis for groundwater transport of solutes and heat

Project description

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

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 aquifer

This efficiently computes cout with 1D transport for every aquifer pore volume and then averages over the aquifer pore volumes. Diffusion is demonstrated in example notebook 5.

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. Diffusion and dispersion in solute transport
  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.

Project details


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.30.0.tar.gz (6.5 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.30.0-py3-none-any.whl (163.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gwtransport-0.30.0.tar.gz
Algorithm Hash digest
SHA256 b9a81f49b8cc097b3ba20951e093ec6e58a578ae443ba3e87474e729ecb34dcd
MD5 c3d327010753315680bf505da4d70646
BLAKE2b-256 3b6b4dea07797b51d73b847052d6759ff83a70c9e12d6f2c4b3928cc2275ed67

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwtransport-0.30.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.30.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for gwtransport-0.30.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af69bcc904f84215c6fce926929e499b6c40355339e44100b884d032293c24d6
MD5 2c9028e4e8d91cbc0a5dd9fdb66e2aa1
BLAKE2b-256 1d1983527e4b7c7daac0a85a5984df03385a387688169c8fb83001116e9fc4b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwtransport-0.30.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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page