PSA-Dyna
PSA-Dyna: A Physics-Based Dynamic Pressure Swing Adsorption Model
PSA-Dyna is a Python implementation of a one-dimensional, non-isothermal, multicomponent pressure swing adsorption (PSA/VPSA) model. It is intended for transparent research, numerical experiments, independent-case generation and carefully gated coupling to steady-state process simulators.
Research status: the numerical engine and a figure-level single-bed breakthrough benchmark are available. The repository does not claim a validated industrial cyclic PSA design. Results must pass the explicit numerical, source-domain and release gates before they are used in DWSIM, process optimization, TEA/LCA or machine-learning datasets.
Why this repository exists
Steady-state process simulators usually represent PSA as a component splitter. That approximation cannot reproduce adsorption fronts, pressure equalization, thermal waves, valve switching or cycle-to-cycle convergence. PSA-Dyna solves these transient effects in Python and then, only after qualification, converts a converged cycle to audited cycle-average streams.
The project keeps three questions separate:
- Does the numerical model run and conserve mass and energy?
- Does it reproduce an independent experiment within declared limits?
- Is a particular adsorbent, geometry and cycle qualified for process design?
A positive answer to one question is not treated as evidence for the others.
Main capabilities
| Capability | Implementation |
|---|---|
| Spatial model | 1D finite-volume packed-bed discretization |
| Gas transport | Advective flux, optional axial dispersion, Ergun pressure-flow closure |
| Adsorption equilibrium | Competitive dual-site Langmuir plus source-local model adapters |
| Adsorption rate | Loading-LDF or pellet partial-pressure-LDF formulations |
| Energy | Gas/solid inventory, adsorption heat, axial conduction, dynamic wall and ambient exchange |
| Gas properties | Ideal gas; optional Peng-Robinson density and departure-energy path |
| Valves | One-way compressible orifice flow with critical choking and near-zero regularization |
| Cycle topology | Independent bed count and step count; four-step and eight-step schedules included |
| Numerics | SciPy stiff ODE integration, sparse Jacobian structure, checkpoint/restart |
| Quality control | Positivity, mass/energy ledgers, full-state CSS, source-domain and release gates |
| Parallel work | Independent-case subprocess execution locally or through an HPC array |
| Process bridge | Guarded cycle-average FEED/PRODUCT/TAIL JSON contract for DWSIM |
See Physics and numerical formulation for the equations and implementation choices.
Installation
Python 3.11 or newer is required.
python -m venv .venv
python -m pip install --upgrade pip
python -m pip install -e .[dev]
Windows PowerShell with an existing Conda environment:
& "C:\path\to\python.exe" -m pip install -e ".[dev]"
Check the command-line interface:
& "C:\path\to\python.exe" -m psa_dynamic --help
Three-minute smoke test
Create a small four-step hydrogen PSA case:
& "C:\path\to\python.exe" -m psa_dynamic make-case --source s015 --schedule skarstrom_4step --cells 4 --output "examples\user_s015_4step_4cell.json"
Audit the input without solving the ODE system:
& "C:\path\to\python.exe" -m psa_dynamic audit-case --case "examples\user_s015_4step_4cell.json" --output "runs\user_s015_input_audit.json"
Run one cycle as an execution and bookkeeping test:
& "C:\path\to\python.exe" -m psa_dynamic run --case "examples\user_s015_4step_4cell.json" --output "runs\user_s015_smoke" --cycle-budget 1
One cycle is a smoke test only. It does not establish cyclic steady state.
Run to cyclic steady state
Generate a four-bed, eight-step pressure-equalization case:
& "C:\path\to\python.exe" -m psa_dynamic make-case --source s015 --schedule equalized_8step --cells 8 --output "examples\user_s015_8step_8cell.json"
Run until CSS or the case's maximum_cycles limit:
& "C:\path\to\python.exe" -m psa_dynamic run --case "examples\user_s015_8step_8cell.json" --output "runs\user_s015_8step_css"
Repeat the same command to resume from the last committed checkpoint. A changed input hash or source-code hash is rejected to prevent mixed-version results.
--cells 32 means 32 axial finite volumes per bed. It does not mean 32
runs, 32 beds or 32 cycle steps.
Input and output contract
Cases use the versioned dynamic-psa-case/v1 JSON schema. The important input
groups are:
- species properties;
- bed geometry, voidage, thermal properties and adsorbent layers;
- feed composition, flow, pressure and temperature;
- high, low and product pressure;
- valve areas or source-specific controller data;
- cycle schedule and step durations;
- ODE, trace and CSS tolerances;
- provenance and claim boundary.
Each run produces a self-contained directory with frozen input, materialized
schedule, engineering screen, alternating checkpoints, cycle and step ledgers,
the final cycle trace, a source snapshot and a terminal result.json or
structured failure.json.
See Input and output reference.
Validation status
The current public claim is deliberately narrow.
| Evidence track | Current conclusion |
|---|---|
| Wang et al. H2-rich, single-bed breakthrough | Figure-level comparison passed the declared composition, temperature, mesh, time-step and conservation gates |
| Wang cyclic four-bed VPSA | Not experimentally validated by the single-bed result |
| S-015 four/eight-step process candidate | Numerical design screen only; industrial design gate remains closed |
| Boer et al. CO2/CH4 biogas VPSA | Public figure data were insufficient to identify the apparatus response within the preregistered early-rise gate |
| DWSIM cycle-average transfer | Contract implemented; automatic release currently closed |
For the exact metrics and interpretation, read Validation evidence and claim
boundaries. A machine-readable, copyright-safe summary is
provided in validation/validation_summary.json.
DWSIM interface
The dynamic solver and DWSIM remain separate programs. PSA-Dyna does not copy a single instantaneous purity into a steady-state flowsheet. It integrates the converged cycle and prepares three mean streams:
FEED;PRODUCT;TAIL.
Each stream carries molar flow, composition, phase-aligned pressure and temperature, and enthalpy flow. The payload also records the qualified property package and release blockers. Missing thermodynamic state or evidence closes the transfer automatically.
See DWSIM bridge.
Parallel independent cases
PSA-Dyna parallelizes independent cases rather than splitting one small stiff ODE system across processors:
& "C:\path\to\python.exe" -m psa_dynamic.batch --manifest "C:\absolute\path\manifest.json" --workers 2 --require-python 3.11.17
Every manifest row has a frozen input SHA-256 and a unique output directory. One worker cannot overwrite another worker's result.
Tests
python -m pytest -q
The public suite checks equilibrium derivatives, Peng-Robinson behavior, vectorized/scalar agreement, schedule topology, input qualification, batch isolation, restart-related contracts and DWSIM payload rejection behavior.
Repository layout
PSA-Dyna/
├── src/psa_dynamic/ numerical engine and interfaces
├── examples/ small, cited case definitions
├── tests/ public regression tests
├── validation/ copyright-safe result summary
├── docs/ scientific and user documentation
└── .github/workflows/ continuous integration
Documentation
- Getting started
- Physics and numerical formulation
- Input and output reference
- Validation evidence
- DWSIM bridge
- Known limitations
- References
- Data and copyright policy
Data and copyright
Publisher PDFs, article figures, proprietary software files and source data without explicit redistribution permission are intentionally excluded. The repository cites DOI records and official data repositories and reports only the derived metrics needed to describe the model's evidence boundary. Users must obtain any restricted source material from the publisher or author.
Citation
Please cite the archived software release described in CITATION.cff.
The DOI will be added to the main branch after Zenodo completes the first
release archive. No ORCID is asserted by this repository.
License
The original code and documentation in this repository are released under the MIT License. Third-party articles, datasets and trademarks remain under their respective owners' terms and are not relicensed by this project.
Metadata
Release files for psa-dyna 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| psa_dyna-0.1.0.tar.gz | 140.1 kB | With provenance | Details for psa_dyna-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| psa_dyna-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for psa_dyna-0.1.0-py3-none-any.whl |
Total release size: 259.1 kB
Release files / psa_dyna-0.1.0.tar.gz
| Download URL | psa_dyna-0.1.0.tar.gz |
|---|---|
| Size | 140.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc01200051eceb61622834ec4a18b94688a2176b528b5ec55e85c962d509488f
|
|
BLAKE2b-256 checksum How to use checksums |
7291ec9edcde450003a78adedf8306a3b6c8da83df79683c89e2dbc3ac57b75b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 24, 2026.
Transparency logRelease files / psa_dyna-0.1.0-py3-none-any.whl
| Download URL | psa_dyna-0.1.0-py3-none-any.whl |
|---|---|
| Size | 119.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6db2a014a4e5f8da1ccd76e279d3ec0f5267aab52e61813f89627bbfc9fc3291
|
|
BLAKE2b-256 checksum How to use checksums |
ccd6bd70262be99507de6b7d906b8be8b290d1086ee2bb409f84bcc853e1c76e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 24, 2026.
Transparency logSecurity for psa-dyna 0.1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for psa_dyna-0.1.0.tar.gz
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 Oct 24, 2026.
Transparency logA 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.