Skip to main content

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Documentation Status PyPI version Python versions

PFAS - a package for semi-analytical modeling of PFAS transport in the vadose zone

PFAS Logo

A Python package for modeling the transport of per- and polyfluoroalkyl substances (PFAS) through the unsaturated zone.

Overview

PFAS is a toolkit for simulating the movement and fate of PFAS contaminants in the unsaturated zone. It provides a flexible, modular framework for constructing transport models with configurable preprocessing steps and analytical solvers. The package is designed for researchers and engineers studying PFAS contamination and remediation.

Features

  • Modular Architecture: Build complex transport models using pluggable preprocessors and solvers.
  • Flexible Configuration: Define simulations using intuitive TOML configuration files or directly in code.
  • Sorption Modeling: Support for linear and non-linear sorption processes to soil particles and Air-Water Interface, in combination with flexible approaches for defining these processes.
  • Vadose Zone Transport: Simulate PFAS movement through the unsaturated zone under steady-state flow conditions.
  • Embedded PFAS data: The package contains modules with sorption data for Air-Water interface computation, Air-Water interfacial sorption coefficients and solid phase sorption coefficients.
  • Grid Generation: Automatic mesh generation for spatial domains
  • Boundary Condition Management: Flexible handling of domain boundaries

Requirements

  • Python >= 3.9
  • NumPy >= 2
  • SciPy
  • Matplotlib
  • Pydantic
  • Marimo (for tutorials)

Installation

From PyPI

pip install pfas

From Source

git clone https://github.com/UU-PFAS-Living-Lab/pfas.git
cd pfas
pip install -e .

For Development

Install with additional testing, documentation, and example dependencies:

pip install -e ".[dev]"

Or install individual extras:

pip install -e ".[test]"      # For testing
pip install -e ".[docs]"      # For building documentation
pip install -e ".[examples]"  # For running examples

Quick Start

Here's a minimal example to get started:

from pfas.component import (
    BoundaryPreprocessor,
    EquilibriumSolver,
    GridGenerator,
    LinearSPsorption,
    Retardation,
    SWCsorption,
    WaterPreprocessor,
)
from pfas.model import Model

model = Model()

model.compute(
    GridGenerator,
    domain_length=60,
    spatial_resolution=1.0,
    time_resolution=100,
    time_total=10000,
)
model.compute(
    WaterPreprocessor,
    average_infiltration_rate=1.5,
    hydraulic_conductivity=6,
    porosity=0.34,
    dispersivity=1.5,
    van_genuchten_n=1.31,
    residual_water_content=0.04,
)
model.compute(BoundaryPreprocessor, C_list=[10.0, 0], T_list=[0, 2000])
model.compute(
    LinearSPsorption,
    sorption_solid={
        "kinetic_sorption": True,
        "sorption_isotherm": "linear",
        "linear": {"Kd_method": "direct_input", "Kd": 5.0},
    },
)
model.compute(
    SWCsorption,
    sigma0=71,
    scaling_factor_awi=1.0,
    van_genuchten_alpha=0.019,
)
model.compute(Retardation, Kaw=0.5, bulk_density=1.6)
model.compute(EquilibriumSolver)

# Access results
grid = model.grid
concentration = model.C_tot

Documentation

Full documentation is available at Read the Docs.

Examples

Several example scripts are provided in the examples/ directory, demonstrating:

  • data_structure.py - Data structure handling
  • initial_value_problem.py - Setting up initial value problems
  • Kd_sorption_component.py - Linear and component-based sorption modeling
  • gen_example.py - Basic PFAS transport simulation
  • kin_vs_eq.py - Kinetic versus equilibrium sorption
  • mass_balance.py - Mass-balance checking
  • RunningModelDifferentSoils.py - Running models for different soils
  • loop_for_Staring_soils_and_PFASs.py - Looping over soils and PFAS compounds

To run these examples, you need Marimo.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use PFAS in your research, please cite:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Contact

For questions and support, please contact: Valerie de Rijk (v.derijk@uu.nl)

Acknowledgments

This package was developed at Utrecht University as part of the PFAS Living Lab.

Metadata

Release files for pfas 0.3.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 pfas 0.3.0
File Size Uploaded Provenance Actions
pfas-0.3.0.tar.gz 116.7 kB Without provenance Details for pfas-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 154.1 kB

Release files / pfas-0.3.0.tar.gz

Download URL pfas-0.3.0.tar.gz
Size 116.7 kB
Tags Source
SHA-256 checksum
How to use checksums
725482a1b580be29881cf76736dcb18d3a39a73d4eb91c1473f8cdaf5c11821f
BLAKE2b-256 checksum
How to use checksums
5fd7c3e2b190f1050dc34f14fab38e74057dc1fa5be8ea13faec17f6094fb19c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / pfas-0.3.0-py3-none-any.whl

Download URL pfas-0.3.0-py3-none-any.whl
Size 37.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40a7dba2ddd215fdf979d6aa72c20178a0b1fa81a61d6280ee30d6000dd65afc
BLAKE2b-256 checksum
How to use checksums
41ba6c0ae9954e87581096c2e18f41474fa95a48e741270ecc4967248e7d83a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for pfas 0.3.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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