Don’t measure gas use as pressure drop per time

Here is an email I wrote to the Subsurface mailing list in response to the suggestion to offer the option to display gas use (SAC or RMV) in units of pressure drop per time even when you use only a single cylinder size:

There are two separate issues:

One is if you measure the gas consumption in units of

a) pressure drop per time

or

b) volume of gas at some reference pressure (typically surface pressure) consumed per time

the other is which term or abbreviation you use for a) or b).

Both discussions are very old already and Subsurface decided to call the measurement of b) „SAC“ or surface air consumption. It seems some other people call that RMV (respiratory minute volume) and maybe the latter ones are in a majority and Subsurface took a poor choice. I don’t know, maybe. In German, it is called AMV (Atemminutenvolumen which translates to breathing minute volume which is as stupid in German as it sounds in English but at least everybody uses it so there is no discussion). I don’t really care what you want to call it, maybe ABC is also an option or XYZ and I am open to changing the name in Subsurface if a large majority of English speakers say that one is the preferred term (but so far my impression is that there are people in both camps).

But the first issue is not up to discussion, the correct way do express it is b)! The only reason some people might think a) is a viable option is because in the water you have a gauge that measures pressure but you don’t measure amount of gas (as mols or volume at reference pressure) directly. So if you know how much your pressure gauge dropped in the last five minutes (assuming constant depth) you have a rough idea how many more minutes you can stay at the current depth and not running into gas problems. It gives you a rue of thumbs estimate but not more since future consumption depends on many other factors.

Once you are out of the water and write your log you can let your computer do the calculation to convert this into volume (amount of gas) units which is a much more meaningful way of expressing things. Others have mentioned that it makes no sense to compare pressure units if you you have different cylinder sizes. But even if you say you only have a single cylinder and will always use the same you should realise the conversion between pressure drop and amount of gas used is only simple in a world that knows only about ideal gases. Subsurface takes great proud in the fact it is aware this is only an approximation and takes into account the pressure dependent compressibility of breathing gases. And if you do that a pressure drop only translates to an amount of gas when you also know the starting pressure.

Let me show you in an example that this difference is actually relevant: I am diving in a world that uses metric units so my numbers come from common sizes an pressures in metric units but for your convenience I will translate those to imperial units (I guess you are using those because only in imperial units people have the idea that a) might be a meaningful thing):

Let’s do an air dive to 66ft for 22 minutes (i computed this in the planner) using D12 tanks (two 12 litre cylinder) with a total volume of 167cft. 

If the pressure drops from 2900psi to 2320psi (200bar to 160bar)  the SAC is 0.48cft/min.

If however the pressure drops from 1450psi to 870psi (100bar to 60bar), obviously the same difference in pressure, the SAC is 0.54cft/min.

So the difference in SAC (amount of gas used) is more than 10% if you start from a full cylinder or from a half empty cylinder and drop by the same amount of pressure. This difference in invisible if you measure it in pressure units but it is probably much higher than what you worry about when you look in trends of your gas consumption over time. (The reason is that at higher pressure air is significantly less compressible than at lower pressures).

You will not be able to seriously monitor your gas consumption over time if you use pressure/time units unless you always use the same cylinder and always start your dive with an identical starting pressure.

For this reason I am convinced that option a) is simply wrong (or for a less aggressive term: uninformed) and I will veto using it in Subsurface or even offering it as an option to the used (just as I would veto offering to turn off the real gas corrections even though we get many complaints about Subsurface getting gas calculations „wrong“).

Blending real gases

As mentioned before, gases in diving cylinders are not only not sufficiently well approximated by the real gas equation but also the van der Waals equation, despite its prominence in thermodynamics teaching, is not doing much better.

Subsurface does better than this using a polynomial fit to table data for the compressibility of the three relevant gases. In a discussion at ScubaBoard, the question came up how to use this in gas blending. After an initial version using Mathematica, I sat down and implemented it as a perl script and hooked it up to this web page for everybody’s use and enjoyment. Here it is:

Real Blender

source code is on GitHub. Right now, it does only nitrox. But it computes instructions to up up partly filled cylinders with any pre-existing nitrox mix.

Let me know if you think extending it to trimix would be useful for actual use. I am not sure what the best user interface would be in that case: For nitrox, specifying the initial and target mix and pressure and two top up mixes, the blending problem generally has a solution. But with three gas components to get right, it is in general impossible with only two top up mixes. So you either have to use three (linearly independent) top up mixes or let one thing unspecified. That could be either the oxygen or helium fraction of the final mix or you have to leave open one of the gas fractions of the top up gases.

So what do you do in practice, which component do you leave unspecified?

Update: I updated the script so it can now also handle blending trimix (starting from a partially filled cylinder, you can specify three top up gases it will now calculated the intermediate pressures you have to fill up to). To blend nitrox, specify the target mix as containing no helium and leave one of the top up mixes empty.

Update: I discovered an error in the calculation (I calculated the mix according to pressures rather than volumes at 1 bar) that should be fixed now (April 10, 2022)

Equalizing real gases

As for filling cylinders real gas corrections do matter, we try to take the compressibility factor into account in Subsurface. As the theoretical physicist I thought (as I was taught) this is handled by the van der Waals equations. Turns out, in the pressure/temperature range relevant for diving cylinders is very far from getting the corrections to the ideal gas equations right. There are errors at least in the 30% range. This is probably since we are quite far away from the tri-critical point where it is supposed to be a good approximation.

In the end, we found a cubic approximation with coefficients read off from tables of compressibility factors to be an economic way to do these computations. You can find the source here.

When today somebody asked in a diving forum for a spreadsheet to calculate the resulting pressure when streaming between two cylinders, I thought I could use these interpolations to do the calculations for real gases with different compositions. Here is what I came up with.

When real gas corrections matter

We have all learned that most of the time the ideal gas law (maybe in its isothermal version known as Boyle-Mariotte law) is sufficiently accurate to calculate the amount of gas in cylinders. At least as long as we restrict to pressures not exceeding about 200bar (and of course we all know it’s a beginner’s mistake to assume 300 bar cylinders give you a 50% advantage in gas carried with respect to 200 bar cylinders even forgetting the problems of actually getting those filled to nominal pressure or attempting to mix in at those pressures).

But let’s look at this a bit more quantitatively: You can parametrize the error of the ideal gas law by a “compressibility factor” Z so that it becomes

\(pV = ZnRT\)

and then tabulate Z as for example done here. In the table for a realistic temperature of 300K you read off 1.0326 at 200 bar while only 1.0074 at 150 bar. So, at 200 bar, you overestimate the amount of gas in your cylinder by 3% or put differently, the amount of gas is that of an ideal gas but only at (1-3%) 200 bar = 194 bar while the amount calculated at 150bar is almost correct.

What is 3% amongst friends I hear you complain, that is likely less than the accuracy of your pressure gauge. That is of course correct but lets see how this relative error multiplies as soon as you take differences: Let’s say you want to compute your surface air consumption (SAC) for a dive in which you breath your cylinder down from 200 bar to 150 bar. Wrongly assuming the ideal gas law to hold lets you compute the amount of gas to be 50 bar times the volume of your cylinders. But as we saw, due to the compressibility factor, we should rather use 194 bar – 150 bar which is only 44 bar. Compared to the 50 bar of the ideal gas, we now have a 12% error, something that I would already consider significant. In particular when I use this value to extrapolate the gas use to other dives.

We see that suddenly the relative error multiplied by a factor of four and for the momentary gas use one needs to look at \(\partial Z/\partial p\) as well.

The upshot is that even for 200 bar one should better use a real gas replacement to the ideal gas law. Anybody who had been in an undergraduate physics class would now probably go to van der Waal equation but as it turns out for typical diving gases in the commonly used pressure ranges that gets 1-Z rather poorly. So for Subsurface we had to use a more ad hoc approximation. But that is the topic of a future post.