A Python library over NASA CEA (via RocketCEA) for mixture performance, O/F sweeps, density impulse, and fair multi-propellant trades. Typed results. Mostly SI. Numbers you can re-run next semester.
You name a fuel and oxidizer, set O/F, chamber pressure, and expansion ratio. propwrap runs CEA and returns Isp, c*, temperatures, γ, densities — as typed objects you can print, plot, or dump to CSV.
Propellant thermochemistry only. Ideal shifting and frozen performance. Sweeps over O/F, Pc, and ε. Density impulse. Fair multi-pair trades at each pair’s own optimum. Blends, registry, SI converters, CLI, student lab packs.
This is not a full engine code. No turbopumps, no cooling channels, no trajectory. Those tools can sit on top and pull γ, c*, T, and Isp from one place.
CEA is fine. The mess around it is not — Rankine next to pascals, the same O/F forced onto hydrogen and kerosene, string dumps scraped into nozzles six months later.
Import it, pin a release, re-run the same case next semester. No more “which notebook was the good one?”
RocketCEA still speaks psia and Rankine. propwrap converts once. Outside that wall: Pa, K, m/s, kg/m³. Isp stays in seconds; ve is m/s.
compare_propellants
optimizes mixture ratio per pair before ranking.
Forcing O/F = 2.5 on LOX/LH₂ and LOX/RP-1 is wrong — and no longer the easy path.
Bit-level Isp match to RocketCEA goldens. ve = Isp·g0. Cf = ve/c*. Written validation report that also lists what we refuse to claim.
Point performance, sweeps, trades, density impulse, gas state, registry, SI converters, CLI, and student homework tooling — all wired through one API.
Fuel + ox name (or blend). Registry resolves aliases and densities.
O/F, Pc (Pa / bar / MPa), ε. Optional η knock-downs.
RocketCEA call. English units stop here. SI comes out.
Typed fields, print-friendly, CSV / markdown export.
Same case again? Hit disk under ~/.propwrap/
Vac/SL Isp, ve, c*, Cf, temperatures, γ, Mw, Pe. O/F, Pc, ε scans with optimum().
LiveBulk liquid density vs O/F. Rank pairs by Isp and ρ·Isp — the volume-limited stage cares about both.
LiveAliases (RP-1→RP1), cryo defaults, typical O/F hints, multi-component wt% fuels and oxidizers.
LiveChamber / throat / exit: T, P [Pa], ρ, γ, cp, μ, k, Pr, major species.
Liveconvert(70,"bar","Pa"), Isp↔ve, density helpers. pc_bar / pc_mpa / pc inputs.
homework CLI, Case presets, markdown tables, captions, cheat sheet, sample lab assignment.
LiveLocked in tests. Partly re-checked at evaluation time. One real bug found on the physics pass: gamma_and_temp_at_eps used to return exit T twice.
pc means pascals.
Use pc_bar=70 for homework.
Passing pc=70 looks like vacuum and the library refuses it on purpose.
Not “Isp looks about right.” Same inputs as CEA → same Isp. SI identities hold. Gaps written down, not hand-waved.
| Source | What it secures |
|---|---|
| NASA RP-1311 — Gordon & McBride, CEA ntrs.nasa.gov · Parts I & II |
Equilibrium / frozen rocket performance methodology under RocketCEA |
| RocketCEA QuickStart LOX/LH₂ table rocketcea.readthedocs.io |
Published Isp; propwrap matches get_Isp at machine precision (O/F 2…8, Pc=100 psia, ε=40) |
| g₀ = 9.80665 m/s² · CGPM / BIPM | ve and Cf definitions |
| 1 bar = 10⁵ Pa exactly | pc_bar conversion |
| Direct CEA_Obj checks · RP-1, CH₄, MMH | propwrap path ≡ raw RocketCEA for locked cases |
| O/F | Isp vac [s] | Role |
|---|---|---|
| default | 374.30… | install smoke |
| 2 | 424.36 | fuel-rich |
| 4 | 453.13 | |
| 5 | 453.24 | near peak |
| 6 | 448.19 | |
| 8 | 424.70 | ox-rich |
Regression matrix covers LOX/RP-1, LOX/CH₄, N₂O₄/MMH, UDMH, A-50, ethanol at documented Pc/ε. Full write-up in docs/validation.md and validation_catalog.json.
$ pytest tests/test_physics_identities.py \ tests/test_validation_suite.py -v $ pytest -q # 132+ passed on last full run
Propulsion software often assumes you already know venvs and bar vs pascals. Coursework usually doesn’t. So the repo includes the boring useful layer.
One command builds a report folder: summary, assumptions, CSVs, O/F and density-Isp plots, optional multi-pair trade figure.
Python 3.10+ (3.11 / 3.12 fine). Windows, Linux, or macOS. Cantera and matplotlib install with the package.
$ python -m venv .venv # Windows: .venv\Scripts\activate # macOS/Linux: source .venv/bin/activate $ pip install propwrap $ propwrap run RP-1 LOX --of 2.56 --pc-bar 70 --eps 20 # from source: pip install -e ".[dev]"
from propwrap import Mixture, compare_propellants, convert m = Mixture("RP-1", "LOX") r = m.evaluate(of=2.56, pc_bar=70, eps=20) print(r) sw = m.scan_of((2.0, 3.2, 0.1), pc_bar=70, eps=20) print(sw.optimum().of_ratio) print(compare_propellants( ["RP-1/LOX", "CH4/LOX", "LH2/LOX"], pc_bar=70, eps=40, )) print(convert(70, "bar", "Pa")) # 7000000.0
Longer walkthrough: docs/how_to_use.md · API fields: docs/api_reference.md · Validation: docs/validation.md
No kinetics, multiphase losses, or injector efficiency baked in. Shifting and frozen bracket chemistry; flight has more losses than either.
Optional efficiency multipliers are knobs, not a validated engine model. Custom propellant cards are structure-checked, not thermodynamically certified.
This repo’s code is MIT. RocketCEA is GPL-family — check both if you ship proprietary work. Not flight-qualified software. Don’t treat it as such.
Independent open source · not affiliated with ISRO, DRDO, NAL, HAL, NASA, or any agency.