Connect two cylinders and gas flows from the fuller one, the donor, into the other until both gauges read the same. The calculator finds that end pressure and the new mix in the receiving cylinder, for nitrox and trimix, with the real properties of oxygen, helium and nitrogen.
It also shows how much gas moved and how much is left in each cylinder, as mass and as free gas. The simple rule, averaging by cylinder size, sits beside it. Real gases don’t follow that rule exactly at cylinder pressures, and the gap can reach several bar.
Background
Equalising
When the two cylinders are connected, gas flows from the donor into the receiving cylinder until both read the same pressure. The gas that moves has the donor’s mix, so the receiving cylinder ends with a new mix. For oxygen:
x_n = \frac{x_r \cdot n_r + x_d \cdot \Delta n}{n_r + \Delta n}x_nOxygen fraction of the new mixx_rOxygen fraction in the receiving cylinder beforen_rAmount of gas in the receiving cylinder before, in molx_dOxygen fraction of the donor\Delta nAmount of gas moved, in molThe same holds for helium and nitrogen. The calculator searches for the \Delta n at which both cylinders read the same.
Real gas
The amount of gas in a cylinder follows from its pressure:
n = \frac{(p + p_0) \cdot V}{Z \cdot R \cdot T}nAmount of gas in a cylinder, in molpPressure (gauge) in barp_0Atmospheric pressure, 1.013 barVWater capacity in LZCompressibility factor of the mix at that pressure and temperatureRGas constant, 0.08314 L·bar/(mol·K)TGas temperature in KZ depends on the mix: helium-rich mixes have Z well above 1, so a bar of helium holds less gas than a bar of air.
Ideal-gas rule: with Z = 1 the end pressure is the volume-weighted mean of the two pressures.
p_e = \frac{p_r \cdot V_r + p_d \cdot V_d}{V_r + V_d}p_ePressure both cylinders end at, in bar (absolute)p_rPressure in the receiving cylinder before, in bar (absolute)V_rWater capacity of the receiving cylinder in Lp_dPressure in the donor before, in bar (absolute)V_dWater capacity of the donor in LMass and free gas
Every amount of gas becomes a mass and a free-gas volume:
m = n \cdot MmMass of the gas in kgnAmount of gas in molMMolar mass of its mix in kg/mol, from oxygen 0.0320, helium 0.0040, nitrogen 0.0282V_\text{free} = \frac{n \cdot R \cdot T}{p_0}V_\text{free}Free-gas volume at atmospheric pressure and the temperature entered, in LnAmount of gas in molRGas constant, 0.08314 L·bar/(mol·K)TGas temperature in Kp_0Atmospheric pressure, 1.013 barAir
Air is taken as 20.9 % oxygen and 79.1 % nitrogen; its argon is counted with the nitrogen, as an oxygen analyser sees it (and with its weight, for the masses).
Limits
All pressures are at the temperature entered, once the gas has settled in both cylinders. CoolProp’s mixture model for oxygen, helium and nitrogen is used up to 500 bar.