Standard Cubic Meters, Actual Cubic Meters, and the Gas Total Nobody Agrees On
Pressure and temperature compensation for gas flow: which meters need it, the absolute-pressure trap, where the math belongs, and a failed P transmitter.
Maintenance billed the paint shop for 1.9 million m³ of compressed air last quarter. The paint shop's own submeter said 1.6 million. Same air, same pipe, two meters about forty metres apart, and a 19% gap that turned into a three-week argument about which instrument was broken. Neither was. The header meter reported flow at line conditions — 7 barg, whatever the aftercooler left the air at — and the submeter reported it corrected back to a reference condition. Both were reading correctly. They were just reporting different quantities with the same unit label on the tag.
That's the whole problem with gas flow in SCADA. "m³" is not a measurement until you say at what pressure and temperature, and a tag called FT_1201_FLOW with m3/h in the engineering-units field says nothing about it.
What your meter actually hands you
Before writing any compensation math, find out what the primary element measures. This determines whether you compensate at all, and with which exponent.
- Turbine, vortex, ultrasonic, rotary/diaphragm — these count volume passing through at line conditions. Actual m³/h (am³/h, ACFM in imperial). They need a full density correction to reach standard conditions, and it's linear in pressure and in absolute temperature.
- Orifice, venturi, nozzle, averaging pitot — differential producers. Mass flow goes as √(ΔP·ρ), so density already enters under a square root. The correction from design density to actual density is a square-root term, not a linear one. Getting this exponent wrong is the single most common compensation bug I run into.
- Coriolis and thermal mass — these measure mass (or standard volume derived from mass) directly. They need no pressure/temperature compensation. Applying it anyway double-corrects, and I've seen exactly that on a thermal mass meter feeding a nitrogen purge total: someone wrapped the already-standardized output in a PT correction block and the total came out 30% high at winter temperatures. Thermal mass meters have a different sensitivity — the calibration gas. A meter K-factored for air reading argon is wrong by a large factor no compensation fixes.
So: half the meters in a plant need this math and half are actively harmed by it. Write the meter type on the loop sheet.
The math, and the base conditions nobody writes down
For a volumetric meter, correcting line-condition flow to standard conditions:
Q_std = Q_actual · (P_abs / P_base) · (T_base / T_abs) · (Z_base / Z)
For a DP meter, correcting for a density that differs from the one the meter was sized at:
Q_corrected = Q_design · √( (P_abs · T_design · Z_design) / (P_design · T_abs · Z) )
Every symbol there is absolute. Every one.
Now the part that causes more disputes than the formula: what is P_base and T_base? There is no single answer, and the abbreviations lie.
- 101.325 kPa and 0 °C — "normal", Nm³, common in European industrial gas practice (DIN 1343).
- 101.325 kPa and 15 °C — used across natural gas and much of ISO practice.
- 100 kPa and 20 °C, 0% RH — ISO 8778 reference for compressed air; also where a lot of compressor datasheets live.
- 14.696 psia and 60 °F — US custody transfer.
Between 0 °C and 20 °C base, the same real flow differs by about 7%. Someone will write "Nm³/h" on a P&ID meaning the 20 °C compressed-air convention, and someone else will read it as 0 °C, and the totals will disagree forever by a fixed ratio that looks like a meter error. Put the base conditions in the tag description, not in a design document nobody opens: Natural gas flow, std m3/h @ 101.325 kPa, 15 C.
Absolute pressure is where the field goes wrong
The transmitter on the line is almost certainly a gauge pressure transmitter. The formula wants absolute. So:
P_abs = P_gauge + P_atm
Three ways this goes bad:
- The addition is missing. Somebody drops the gauge reading straight into
P_abs. At 6 barg, the correct absolute is ~7.01 bara, so the total comes out roughly 14% low. Steady, plausible, invisible — it just makes your plant look 14% more efficient than it is. P_atmis hardcoded to 101.325 kPa at a site that isn't at sea level. Atmospheric pressure falls roughly 12 kPa per 1000 m. At a 1,500 m site, real barometric is around 85 kPa. On a low-pressure line — a flare header at 0.3 barg, a boiler gas train — that 16 kPa error is over 10% of the absolute pressure. On a 40 barg line nobody would notice. Use the site's actual barometric constant, and if you have a barometer, read it.- Bad units and bad zero. Mixing kPa and bar in one expression, or a transmitter reading a small negative gauge on a suction line, which yields a sub-atmospheric absolute that is entirely correct and looks like a fault to whoever wrote the range check.
And temperature: kelvin, always. T_abs = T_C + 273.15. Celsius in the ratio produces nonsense in general and a divide-by-zero at exactly 0 °C. A related trap is the ratio direction — temperature is inverted relative to pressure (T_base / T_abs), because hotter gas is less dense. Half the hand-built compensation blocks I've reviewed had the temperature ratio upside down, which passes any test done at one temperature.
Compressibility: when Z stops being 1
Z is the compressibility factor, the correction for the gas not being ideal. For air or natural gas at a few barg and ambient temperature, Z sits close enough to 1 that dropping it costs well under a percent, and I do drop it on utility metering. For natural gas at transmission pressures — tens of bar — Z falls meaningfully below 1, and ignoring it is a several-percent error on a stream you're paying for. That's when you stop hand-rolling the math in a PLC and use a device that implements AGA Report No. 8 (or ISO 12213) for Z from composition, pressure, and temperature, with AGA 3 or AGA 7 for the meter itself.
Line in the sand: if the number appears on an invoice, it belongs in a flow computer with those standards implemented and an audit trail per API MPMS Chapter 21.1 — not in ladder logic. If it feeds an energy dashboard or a plantwide balance, PLC math is fine and you should say so out loud in the design so nobody later cites it in a contract dispute.
Compensate the rate, then integrate — not the other way round
The totalizer must accumulate already-compensated flow, every scan:
Total += Q_std(this scan) · Δt
What you must never do is accumulate uncompensated volume and multiply the running total by the current pressure ratio. That applies this instant's conditions retroactively to eight hours of gas that flowed at different conditions. It's a tempting shortcut when you're bolting compensation onto an existing uncompensated totalizer, and it produces a total that visibly jumps whenever line pressure moves — which at least makes it easy to spot in a trend.
Same rule for where the math lives: put it as close to the raw samples as you can. A historian calculated tag that multiplies a compressed flow tag by a compressed pressure tag is sampling both after deadband compression has thrown away the correlation between them, so it will not equal the PLC's totalizer. It'll be close. It'll be close in a way that costs you a day of investigation.
Also make sure P, T, and flow are read in the same scan, from the same scan class. If flow polls at 1 s and pressure at 10 s, every pressure step gets applied to up to ten seconds of flow it didn't belong to. On a compressor that unloads every couple of minutes, that error doesn't average out — it correlates with the cycle.
When the pressure transmitter dies
Whatever your compensation block does on bad input, decide it deliberately, because the default is usually catastrophic. A failed analog channel reading 0 gives P_abs = P_atm, so a 7 barg line suddenly computes about one-eighth of its true standard flow. A channel that fails upscale does the opposite. Neither raises an alarm, because the flow value stays in range.
What I do:
- On bad quality or out-of-range P or T, substitute the design value and hold it — not zero, not last-good-forever.
- Raise a distinct alarm: "FT-1201 flow compensation on fallback values". Not a generic instrument fault buried in the list.
- Set a
FlowCompDegradedboolean, historize it alongside the flow, and drive a visible badge on the faceplate. Later, when someone questions the monthly total, that tag tells you exactly which hours were computed on substitutes. - Keep totalizing. Stopping the totalizer on a sensor fault creates a hole that's harder to reconcile than a flagged estimate.
Falling back to design values is an estimate and should be labelled one — but it's a bounded estimate, whereas letting a 4 mA reading into the pressure ratio is an unbounded one.
Prove it once, by hand
At commissioning, take a single operating point and compute it in a spreadsheet: raw meter output, measured P and T, barometric, base conditions, the ratio, the result. Compare against the PLC tag and the SCADA tag. They should match to well within a percent. If they don't, you've found the extra square root, or the missing 273.15, or the sea-level barometric.
Then do it again at a different pressure. One point can't catch an inverted ratio; two at different conditions can. Keep the spreadsheet with the loop folder — the next person to touch this needs to know which convention won.
Next thing to check while you're in there: whether the meter is even in a valid flow regime. All of this math assumes the primary element is inside its rated range and has the upstream straight-pipe run it was specified with. Compensating a vortex meter that's below its minimum Reynolds number just gives you a precisely corrected wrong number.