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.32.0.tar.gz (6.6 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.32.0-py3-none-any.whl (173.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gwtransport-0.32.0.tar.gz
Algorithm Hash digest
SHA256 acfcba31079b2a62238e9b2056f184ca0e9ea9d7e86aead4b3e03ee9b88c329c
MD5 47ba20ff917b8a40714e4b740c02f985
BLAKE2b-256 fcaa5590d37ee48f31d2d802d193bec6b0a60ec35bdf920670697bb791e3e65c

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for gwtransport-0.32.0-py3-none-any.whl
Algorithm Hash digest
SHA256 509103cfdb483ad40656361df6cdd9a2cf50f9d91e46b7012fbeaa2ba7533e30
MD5 0bbf28f7ebe495577f4cac8f370e3930
BLAKE2b-256 4058fde2c6c50c3cd44ebfb8d8777923cf85079d011dcd4061e6017ca7267fab

See more details on using hashes here.

Provenance

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