Skip to main content

h2physics

Composable Python models for hydrogen production, storage, transfer and safety research.

h2physics supplies calculation objects, explicit physical state and time-series contracts, and optional adapters to specialist engines. Parameters and providers can be replaced through ordinary Python objects, functions and arrays. A web service or serialization layer is not required.

This is a research software release. Implementation, software verification, experimental comparison and application qualification have separate evidence. Start with the quickstart, Korean overview, or Python API index.

Version 0.2.0 is Alpha research software. Find downloads and citations through PyPI, GitHub releases, and the Zenodo version series. Publication status records service-confirmed versions and file identities.

This version adds eight model-level extensions: indoor HyRAM accumulation/conditional peaks, FA/DDT screening, mechanical expansion energy and weak-wave loads, linear structural dynamics, native thermal cycles/exergy, solid redox equilibrium, electrode measurement analysis and a coupled PAR device. Each manual states its numerical evidence and remaining experimental limits. The scoped campaign completed 92 new and 47 related existing checks across the main and separately selected native runtime profiles.

What is included

Area Selected capabilities Important boundary
Thermodynamic state CoolProp pure fluids, fixed-composition mixtures, reference-aware reaction enthalpies, qualified table interfaces Native properties or explicitly qualified tables; no silent substitute EOS
Equipment and transfer Tank inventories, valves, pumps, pipes, heat exchange, insulation, compression, relief, recovery and finite transfer Each selected level declares its geometry, boundary conditions and native dependency
Storage Hydride equilibrium/kinetics and finite beds, adsorption, carrier conversion, microspheres, porous reservoirs Model levels and material coefficients are explicit; a material fit is not a whole-vessel qualification
Production and separation Electrolyzer/fuel-cell core, PV coupling, photochemistry, finite reactions, membrane and PSA interfaces Optional engines and measured parameter evidence are installed/supplied separately
Materials Solubility, permeation, conservative diffusion, trapping, thermal/mechanical fields and integrity interfaces Carrier definition, specimen geometry, stress/temperature references and units must agree
Releases and safety Gas/liquid/two-phase nozzle, finite source histories, parcels, impact/pool boundaries, dispersion/fire/exposure interfaces Source prediction, field prediction and receptor response are separate stages
Facility and research Networks, sensors, alarms, isolation, detector voting, conditional risk, uncertainty and cost projections Inputs must state clocks, assumptions, evidence and any frequency or economic basis

The catalog contains 82 catalog entries. The recent verification campaigns use 78 scoped topic families. Neither number counts independent equations or proves complete physical qualification. Several entries expose native engines, supporting accounting, or narrower selectable model levels. Use model selection and the individual manuals to choose the actual callable and its limits.

Installation

Python 3.12 is the recorded reference interpreter. The package metadata permits Python 3.12 or later; optional native providers can impose narrower compatibility requirements.

For a source checkout:

git clone https://github.com/lyullee/h2physics.git
cd h2physics
python -m venv .venv
# Activate .venv with the command appropriate to your shell.
python -m pip install --upgrade pip
python -m pip install -e ".[thermo,hydraulics,test]"

The distribution and import name are currently h2physics. The command below installs the selected optional capabilities from the package index. See the publication status:

python -m pip install "h2physics[thermo,hydraulics]"

Core installation provides NumPy/SciPy-based functionality. Install thermo for the CoolProp-backed fluid calculations. Production fluid properties must use CoolProp or a table qualified against that provider. An optional extra does not install every specialist engine or clear its license. See dependencies, native integration, and rights/provenance.

First calculation: a hydrogen pipe

This example uses a real-fluid upstream state from CoolProp and a separately selected friction correlation. It is a frozen-property steady reference, not a transient or thermal pipe model.

from fluids.friction import friction_factor
from h2physics.hydraulics import DarcyGeometry, solve_darcy_flow
from h2physics.thermo import CoolPropProperties

properties = CoolPropProperties("Hydrogen")
upstream = properties.state_pt(200_000.0, 300.0)  # Pa absolute, K

result = solve_darcy_flow(
    DarcyGeometry(length_m=10.0, diameter_m=0.01, roughness_m=1e-6),
    density_kg_m3=upstream.density_kg_m3,
    viscosity_pa_s=upstream.viscosity_pa_s,
    driving_pressure_pa=1_000.0,
    friction_law=lambda reynolds, relative_roughness: friction_factor(
        reynolds, relative_roughness
    ),
)
print(result.mass_flow_kg_s)       # kg/s
print(result.velocity_m_s)         # m/s
print(result.momentum_residual_pa) # Pa

The quickstart continues with electrochemistry, parameter replacement, error handling, representative runs and reproducible analysis. The API guide explains shared object contracts; the symbol index lists actual modules and definitions.

Physical contracts

  • Use SI values: Pa absolute, K, kg, m and s. Convert gauge pressure, Celsius, normal-volume flow and engineering units explicitly at the input boundary.
  • Keep fluid/species, H versus H₂ carrier, phase, spin composition and enthalpy reference identifiable. A property-library enthalpy zero is not automatically a reaction formation reference.
  • A shared time label does not establish aligned clocks. Declare the source interval, sampling/interpolation rule and support explicitly.
  • A mass-flow rate is not a complete accident scenario. An accident source needs its opening, location, phase, inventory, event clock and termination.
  • Result objects retain diagnostics and, where supported, issuing provider/source bindings. Read the selected API's require_current() contract before reusing a result.
  • Failures and out-of-domain results are retained or rejected. Preferred-provider failure does not silently switch physics.

Optional engines

HyRAM+ is the preferred high-pressure gaseous-hydrogen dispersion provider; SLABx-LH2 is preferred for liquid-hydrogen-origin dispersion. Other selectable integrations include Cantera, LH2DT, PSA-Dyna, HELPR and further specialist modules. These are not bundled copies of external solvers.

Each native adapter has its own installation, revision, runtime and applicability requirements. Read the relevant guide before calling it. A missing optional provider can legitimately prevent that operation while unrelated core models remain usable. A generic pip install h2physics is not a full native-engine installation. The preferred dispersion guide documents provider ownership and rejection boundaries.

Recorded verification and measured-data comparisons

The following results describe specific recorded campaigns, not a release-wide accuracy guarantee. Detailed reports retain exact scope, limitations, commands and evidence references.

Campaign Recorded result Interpretation
Input contracts 78/78 topic families; 162 passing cases Representative invalid inputs and one manifest check
Nominal calculations 67 passing cases across 66 families 30 model equations, 35 supporting calculations, one thermodynamic identity; 12 selected native cores excluded
Extreme/boundary checks 108 passing cases across 66 families Includes numerical, mapping and domain-edge checks of different depths
Module connections 72 normal families, 2 rejection-only, 2 blocked, 2 terminal The final selected batch has 55 positive and 2 rejection-gate cases; historical deeper checks are identified
Existing regression and representative runs 50 selected original tests and 6 input-to-output examples passed Basic selected regression/examples, not 78 complete operating envelopes
Measured-data comparison Four conditional held-out comparisons Calibration and evaluation data separated; full physical qualification remains unestablished

The measured comparisons gave effective permeance mean relative errors of 2.15–4.06%, normalized hydride curve RMSE of approximately 4.49/4.86 percentage points, PEM polarization voltage RMSE of 23.1 mV, and a fixed-coefficient nozzle flow mean relative error of 29.8%. These are different metrics and physical quantities; they must not be pooled into one accuracy score. Missing conditions and parameter-identifiability limits are recorded in the comparison report.

Known normal-connection gaps remain explicit: jet fire and outdoor dispersion have rejection-only evidence; underground storage is blocked by a native scalar-input compatibility issue; obstacle dispersion lacks an executed FDS runtime; biological and gasification results currently have no selected downstream consumer. These are not six interchangeable implementation omissions.

Running checks

A small existing test selection for a core/thermo development environment is:

python -m pytest tests/test_core_thermo.py tests/test_electrochemistry.py tests/test_hydride.py tests/test_materials.py tests/test_reactions.py tests/test_hydraulics.py -q

Representative examples are in examples/. The six recorded basic representative runs use:

python -m pytest tests/test_representative_run_equipment.py -q
python -m pytest tests/test_representative_run_production_safety.py -q

Run those two suites in separate processes with their documented optional providers. Some research tests require independently acquired observations or installed native packages. Running every test from a core-only environment does not reproduce the recorded native campaigns. Use the per-campaign commands and source pins instead of treating skipped dependencies as passing evidence.

Documentation and continuing the research

Need Entry point
Start using Python APIs Quickstart, API guide, public symbol index
Detailed Korean instructions Korean overview, user/research guide
Choose model level and provider Model selection, catalog, architecture
Reproduce measured comparisons Physical comparison report, data qualification, source ledger
Understand changes and resume Development history, research continuation, handoff, checkpoint
Review limitations and extensions Progress evidence, implementation requirements, receiving-engine requests
Prepare a public artifact Rights/provenance, release readiness

Local acquisition caches, native installations and detailed execution artifacts are excluded from distributions. Public scripts, source metadata and aggregate documentation provide the route to reproduce them. Exact source versions, parameter choices and data availability still matter.

License, attribution and release boundaries

Original project code is licensed under Apache-2.0; see LICENSE and NOTICE. External libraries, mechanisms, observations and publications retain their own terms. An optional import does not authorize bundling its source or data. Keep the original attribution and check the terms of any combined distribution.

Public releases exclude original reference documents, private inputs, raw/normalized external observations, native binaries, local environments and credentials. Comments and manuals are authored descriptions of implemented contracts and methods. Rewording alone does not establish rights clearance; primary scientific references, dependency license records and dataset-specific attribution remain necessary.

For a new issue or research result, include the selected callable/provider, package/native versions, parameters with units, input source/version, relevant clocks, exact command and original diagnostic. Preserve a failing case before changing coefficients or tolerances.

Metadata

Release files for h2physics 0.2.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 h2physics 0.2.0
File Size Uploaded Provenance Actions
h2physics-0.2.0.tar.gz 5.1 MB With provenance Details for h2physics-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 6.8 MB

Release files / h2physics-0.2.0.tar.gz

Download URL h2physics-0.2.0.tar.gz
Size 5.1 MB
Tags Source
SHA-256 checksum
How to use checksums
7ae907cd2ca2b5ef39b7dc70469aeaa0e1d1645f32478a89508ee9ba8d3dda50
BLAKE2b-256 checksum
How to use checksums
a3ed0abdd1092f2db64011cfd3f956d6fe87c3725d757a150d40cffa723e66f1
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 Nov 2, 2026.

Transparency log

Release files / h2physics-0.2.0-py3-none-any.whl

Download URL h2physics-0.2.0-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c1a9eab69156a4b45ec0379318184047cf275fadf12258b976a843692faf2df2
BLAKE2b-256 checksum
How to use checksums
6d53a7b534a8f904f8d9a6e62c08e39d3dd9f1728df7e635e91cd8146848288b
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 Nov 2, 2026.

Transparency log

Security for h2physics 0.2.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for h2physics-0.2.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 Nov 2, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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