scuba-gas-calculator
v1.0.0
Published
Calculator for inline nitrox- and trimix blending, and for gas limits
Readme
DISCLAIMER
IMPORTANT: This is published under the MIT licence, and the authors, owners and publishers of this library take NO RESPONSIBILITY for the risks it's uses impose.
When diving and mixing gas it's always important to use ones own knowledge and thinking to make sure things are set correctly.
Using the wrong gas mixture at the wrong depth be fatal. If the numbers seem off, double check and report it. Blending diving gases incorrectly can also be fatal. An incorrect mix may kill its user. ALWAYS measure the gas that is mixed.
- DO NOT Use this to dive with mixtures with which you have no training otherwise.
- DO NOT Use this to mix gases without proper blender-training.
- DO Forward these warnings if you ever build an app using this library
Usage
gas-limits
This can be used to calculate the maximum operational depth (MOD) and maximum narcotic depth (MND) for a given mixture of oxygen, nitrogen and helium. By default, the nitrogen-fraction is set to whatever fraction is left after oxygen and helium.
Basic usage:
const limits = calculateGasLimits({oxygen: 0.21});
console.log(limits.maxNarcoticDepthMeters) // 30
console.log(limits.maxNarcoticDepthAta) // 4
console.log(limits.maxOperationalDepthMeters) // 56.67
console.log(limits.maxOperationalDepthAta) // 6.667Use helium for a trimix-dive
const limits = calculateGasLimits({oxygen: 0.21, helium: 0.35});Use a more conservative ppO2 for a deco-dive bottom-phase
const limits = calculateGasLimits({oxygen: 0.21}, {maxPPO2: 1.2});Use a more aggressive ppO2 for a deco-dive deco-phase
const limits = calculateGasLimits({oxygen: 0.21}, {maxPPO2: 1.6});Assume oxygen is not narcotic
const limits = calculateGasLimits({oxygen: 0.21}, {oxygenIsNarcotic: false});
// Note: Default is true, as this is the most convervative optiongas-blender
This can be used to calculate the setpoints to use when mixing a new gas using an inline blender. Here you input your current mix and pressure, and the desired mix and pressure. Then you will get the percentages of oxygen and helium you need to achieve that mix.
Basic usage
const result = calculateBlenderSettings({
fillPressureBar: 90,
oxygenFraction: 0.21, //Air
}, {
fillPressureBar: 232,
oxygenFraction: 0.32, // Nitrox 32
})
console.log(result.oxygenSetpoint) //39Trimix blending
const result = calculateBlenderSettings({
fillPressureBar: 100,
oxygenFraction: 0.32, // Nitrox 32
}, {
// Trimix 21
fillPressureBar: 232,
oxygenFraction: 0.21,
heliumFraction: 0.35,
})
console.log(result.oxygenSetpoint) //12.7
console.log(result.heliumSetpoint) //61.5