pifira
Pressure-based Inverse Fire-heat-flux and Radiative-Area analysis, with evidence-gated liquid-hydrogen utilities.
pifira is a research toolkit for two related process-safety workflows:
- estimating heat input and effective flame-contact area from pressure and wall-temperature histories of pressurized LPG tanks; and
- evaluating traceable liquid-hydrogen (LH2) ortho-para thermodynamics, state-point and pathwise composition screens, published Milenko/Petitpas kinetics, and a CoolProp HEOS nozzle closure.
No experimental or validation data are distributed in the repository, source archive, or wheel. The validation material belongs to its original publishers and depositors.
VALIDATION_SOURCES.mdidentifies the original DOI or official download page, the evidence used, and the limits of each comparison.
Installation
python -m pip install pifira
Python 3.10 or newer is required. Plotting support is optional:
python -m pip install "pifira[plot]"
LPG inverse-analysis example
import pifira
tank = pifira.TankSpec(
volume=0.619,
fluid="HEOS::Propane[0.95]&n-Butane[0.05]",
fill=0.70,
)
heat_W = pifira.heat_input(
P1_bar=10.83,
P2_bar=16.30,
dt=544.5,
tank=tank,
)
arc = pifira.effective_arc(
angles_deg=[0, 90, 180, -90],
T_wall_C=[271, 49, 39, 46],
T_amb_C=35.0,
)["arc_deg"]
height = pifira.effective_height(flame_height_m=0.767, liquid_height_m=0.885)
area = pifira.effective_area(diameter_m=0.75, arc_deg=arc, height_m=height)
print(pifira.heat_flux(heat_W, area), "kW/m2")
The pressure-rise calculation uses a closed-vessel interval before relief
venting. The internal energy is evaluated with CoolProp while total mass and
vessel volume remain fixed. The effective circumferential width is obtained
from a Gaussian fit to the radiative driving force
T_wall^4 - T_ambient^4.
LH2 evidence-gated example
from pifira.lh2 import MilenkoCorrelation, RigidRotorSpinThermo
thermo = RigidRotorSpinThermo()
print(thermo.equilibrium_ortho(20.3))
print(thermo.conversion_energy_J_per_kg(20.3))
kinetics = MilenkoCorrelation()
k = kinetics.forward_rate_per_s(
temperature_K=20.3,
density_kg_m3=70.0,
phase="liquid",
)
print(k, "1/s")
The LH2 functions enforce the reported temperature, density, phase and composition domains by default. They do not constitute a certified relief valve sizing method. In particular, the package does not infer a discharge coefficient, effective area, lift law or two-phase capacity for a commercial PSV from pressure cycling alone.
State-point and full-path OP criteria
The state at relief and the complete warming path are deliberately separate claims. The following data-free calculation reproduces the 50 psia landmarks used in the associated method paper:
from pifira.lh2 import (
apply_para_composition_allowance,
equilibrium_path_ledger,
required_para_fraction_for_nonheating,
required_para_fraction_for_pathwise_nonheating,
)
pressure_Pa = 50.0 * 6894.757293168
state_point = required_para_fraction_for_nonheating(pressure_Pa)
full_path = required_para_fraction_for_pathwise_nonheating(
pressure_Pa, initial_temperature_K=20.3
)
adjusted, feasible = apply_para_composition_allowance(full_path, 0.1)
ledger = equilibrium_path_ledger(0.003, pressure_Pa) # 99.7% para
print(100 * state_point) # 98.9565% para at the relief state
print(100 * full_path) # 99.7951% para over the declared path
print(100 * adjusted, feasible)
print(ledger["crossover_pressure_kPa_abs"]) # 134.6 kPa(abs)
The ledger is an equilibrium-direction accounting result. It neither predicts
realized conversion heat without a kinetic path nor authorizes a reduction in
standards-required or certified relief capacity. See
examples/lh2_pathwise_credit.py.
Public API
| Area | Public objects |
|---|---|
| LPG pressure rise | TankSpec, internal_energy, liquid_height, heat_input, heat_input_series |
| Effective area | radiative_driving_force, effective_arc, effective_height, effective_area, heat_flux |
| Representative values | heat_input_weighted_mean, simple_mean, coverage_fraction, normalized_flux, pressurization_number, orientation_factor |
| File input | load_pressure_csv, load_temperature_csv |
| LH2 spin thermodynamics | pifira.lh2.RigidRotorSpinThermo |
| LH2 composition credit screens | required_para_fraction_for_nonheating, required_para_fraction_for_pathwise_nonheating, apply_para_composition_allowance, equilibrium_path_ledger |
| LH2 published kinetics | pifira.lh2.MilenkoCorrelation, pifira.lh2.CorrelationDomainError |
| LH2 nozzle utility | pifira.lh2.HEOSNozzleLookup, pifira.lh2.heos_nozzle_lookup |
Validation-data policy
Only source metadata and acquisition instructions are versioned. The project
does not redistribute source PDFs, spreadsheets, presentation files, figure
rasters, digitized traces, or derived validation tables. Users who reproduce a
comparison must obtain the material from the original source, comply with its
terms, and keep it outside version control. See
VALIDATION_SOURCES.md.
Package releases are checked automatically for common third-party data and document formats before PyPI publication.
Scope and safety
pifira is research software. It is not an ISO 21013, API 520/521, ASME or
KGS design implementation, and it must not replace certified sizing,
manufacturer capacity data, or engineering review. A successful numerical
reproduction means that the code regenerated a reported result; it does not by
itself establish physical validation or fitness for safety-critical use.
Citation and release history
Use CITATION.cff
and cite the archived Zenodo release. The
badge above uses the concept DOI, which resolves to the newest archived
version. Changes are listed in
CHANGELOG.md.
License
The software is released under the MIT License. Third-party source material is not covered by that license and is not included.
Metadata
Release files for pifira 0.3.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 | |
|---|---|---|---|
| pifira-0.3.0.tar.gz | 34.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pifira-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.9 kB
Release files / pifira-0.3.0.tar.gz
| Download URL | pifira-0.3.0.tar.gz |
|---|---|
| Size | 34.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
265e9b42822f18f63c2b2686a46fcd4d5c248aa9b2421043f3fbf935606f8eb0
|
|
BLAKE2b-256 checksum How to use checksums |
b3eae67b88388b4c18ccac9593700ca5339c8ff7e14896d718cb87d1d4b996f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 4, 2026.
Transparency logRelease files / pifira-0.3.0-py3-none-any.whl
| Download URL | pifira-0.3.0-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66d53e8301aec0d4381e0d791188e62794f0b4a7fa438310bd0871b627cf8ea4
|
|
BLAKE2b-256 checksum How to use checksums |
1f95bbfcdeb6e2505b95998a09d1656981ad199e5a390a8b7d0463fff09e37e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 4, 2026.
Transparency log