Rebreathers
What it's for
Closed-circuit rebreather (CCR) loop maths, semi-closed (SCR) mass balance, and O₂ cell health classification.
Formulas
CCR loop
The loop ppO₂ a CCR can hold is the setpoint, but never above ambient (pure O₂) and never below the diluent's ppO₂:
The loop O₂ fraction is
: absolute pressure at depth, ata. : setpoint, ata. , : diluent fractions. , : loop fractions.
SCR
Steady-state loop O₂ fraction from an oxygen mass balance:
Fresh-gas addition of a passive SCR, where a fixed
: fresh-gas supply, surface L/min. : supply O₂ fraction. : metabolic O₂ uptake, surface L/min. : respiratory minute volume, L/min. : bellows ratio. : absolute pressure, ata.
O₂ cells
A healthy galvanic cell reads about 4.78 times its air reading in pure oxygen:
Deviation of the measured pure-O₂ reading from that theoretical value sets the verdict:
| Deviation | Verdict |
|---|---|
| above +2.5% | FAIL (high-deviation) |
| −2.5% to +2.5% | PASS (within-spec) |
| −5% to −2.5% | QUALIFIED_PENDING (low-deviation) |
| below −5% | FAIL (ratio-collapse) |
Assumptions and limits
- Loop gas is a steady-state idealisation. Real loops lag the setpoint.
hypoxicFloorusesHYPOXIC_PPO2 = 0.16ata by default. Some agencies use 0.18. It returns the shallowest depth where the diluent is breathable, or 0 at the surface.scrLoopFo2throws if the supply rate does not exceed the metabolic rate, and is floored at 0.- Cell classification has ambient limits per brand: Aii 10 to 14 mV and AST 9 to 14 mV. Above the ceiling is a
FAIL. Below the manufacturer floor is anambientFlag: 'low'caution and the verdict still comes from the ratio. Below an absolute floor of 8 mV is aFAIL. - Greenflash is a solid-state optical sensor, so the ratio test does not apply and
classifyO2Cellreturnsnull.
Sources
- SCR mass balance: the standard steady-state SCR mass balance (for example Nuckols et al., US Navy SCR analyses).
- Hypoxic floor: a commonly cited floor in IANTD and TDI trimix standards (some agencies use 0.18).
- O₂ cell classification: implemented from the maintainer's classification rules. The 8 mV floor reflects a known end-of-life dropout signature.
Examples
ts
import { AIR, gas } from 'dive-math/gas'
import { effectivePpo2, loopInertFractions, hypoxicFloor, scrLoopFo2, classifyO2Cell } from 'dive-math/ccr'
effectivePpo2({ setpoint: 1.3, diluent: AIR, depthM: 2 }) // => 1.2
loopInertFractions({ setpoint: 1.3, diluent: gas(0.18, 0.45), depthM: 30 }).fhe // => 0.3704
hypoxicFloor(gas(0.1, 0.7)) // => 6
scrLoopFo2({ supplyFo2: 0.5, supplyRateLpm: 15, vo2Lpm: 1 }) // => 0.4643
classifyO2Cell({ brand: 'Aii', ambientMv: 11, o2Mv: 50 })?.status === 'QUALIFIED_PENDING' // => trueAPI
See the ccr API reference.