{{nav}}

What a meter's error is worth

An orifice gas meter carries a standard uncertainty of about a quarter of a per cent. Across a system of them, what that is worth depends less on how good each meter is than on which of their errors they share, and that is the one thing no open source settles.

An orifice meter measures gas by the strength of a pressure drop. The plate is a disc with a hole in it, clamped across a pipe; the gas speeds up through the hole, its pressure falls, and the fall says how fast it is going. Every term in that inference carries an error: the coefficient that turns a pressure drop into a flow, the transmitters that read the pressures and the temperature, the bore of the hole, the inside of the pipe, the analysis of the gas and the equation that says how far it is from ideal. Add them up for one well-kept meter and the answer is a fraction of a per cent.

A pipeline system is many such meters. Gas comes in through some and goes out through others, and the difference between the two totals is the system's imbalance. Part of any imbalance is real loss. Part of it is measurement, and this page asks how big that part is and what it costs. It answers with a model of a synthetic system in which no gas is lost at all, so that every unit of imbalance it finds is a measurement error.

Try it

Build a system and see what it does not balance by

Set the number and size of the receipt and delivery meters, choose which of their errors are shared and which are their own, and run it. The model is the one on this page, in the browser, propagated by Monte Carlo until the stopping rule of the international guide to it is met. It opens on this page's default system and the first row of the table below, with every meter's discharge-coefficient error its own.

Open the imbalance simulator Download code

What it finds

For one meter, the discharge coefficient is the whole story. On a {{one_D_mm}} mm run at a beta ratio of {{one_beta}} the meter's flow carries a standard uncertainty of {{one_u}}%, and the {{one_top}} on its own gives {{one_top_u}}% (the inputs combine as the square root of the sum of their squares, so the parts do not add up to the whole). The next largest input, the {{one_second}}, contributes {{one_second_u}}%; differential pressure {{one_dp_u}}%, temperature {{one_T_u}}%. A single meter's uncertainty lives in the equation, not in the instruments.

One meter's standard uncertainty by input. The discharge coefficient's bar, {{one_top_u}} per cent, is longer than every other input's put together; all inputs together give {{one_u}} per cent.

One receipt meter of the default system, each input alone and then all together, as standard uncertainty (one standard deviation) of its flow. Doubled, the combined figure is {{one_U95}}%, beside 0.55% at 95% confidence for the example station in a published uncertainty handbook; that was computed for another meter and is a scale, not a check.

In the meters modelled here that coefficient is not measured. It comes from an equation, Reader-Harris/Gallagher, fitted to laboratory data and written into ISO 5167-2, and its stated uncertainty comes from the data behind that fit and the manufacturing variation the standard permits. Whether one meter's error in it is the same as another's is the question that decides everything below, and no public source settles it for meters at different sites. A handbook on metering-station uncertainty treats the coefficient as uncorrelated between two runs side by side, because their inlet pipework is never the same; the equation's own bias, which every meter that uses it shares, points the other way. So the model runs three cases and does not choose between them.

The default system has {{n_r}} receipt meters on {{rec_D_mm}} mm runs feeding {{n_d}} delivery meters on larger ones, {{mmcfd}} million cubic feet a day in all. Its measured imbalance, receipts minus deliveries as a share of throughput, has a standard uncertainty of:

The discharge coefficient's error isImbalance, standard uncertainty95% of outcomesWorth, a year
independent at every meter{{imb0_u}}%{{imb0_lo}}% to {{imb0_hi}}%${{usd0}}
shared, receipts and deliveries alike{{imb1_u}}%{{imb1_lo}}% to {{imb1_hi}}%${{usd1}}
shared within each end, the ends apart{{imb2_u}}%{{imb2_lo}}% to {{imb2_hi}}%${{usd2}}

The middle row is the counter-intuitive one. An error every meter shares is the worst kind for the total a single meter or a group of them reports, because nothing averages it away. It is the best kind for a balance, because it inflates receipts and deliveries by the same factor and the difference does not move. Here receipts and deliveries run at beta ratios of {{beta_r}} and {{beta_d}}, which this model puts in one class sharing the equation's error (an assumption), and the imbalance left is {{imb1_u}}%, all of it from the rest of the budget. Make the ends' errors shared within each end but independent between them, and the same coefficient stops cancelling and roughly doubles in effect: in the bottom row it alone accounts for {{C2_u}}%, against {{C0_u}}% when every meter's error is its own.

Three distributions of the default system's measured imbalance in energy. The shared-and-alike case is a narrow spike around zero; the independent case is wider; the ends-apart case is widest.

The default system's measured imbalance in energy, as a share of throughput, over one year in which every transmitter is recalibrated {{n_ints_word}} times. Each curve is {{hist_n}} simulated years; the true imbalance is zero in all of them. The axis stops at plus and minus 1%, which leaves out {{hist_out_pct}}% of the ends-apart years.

In money, one standard uncertainty of imbalance on this system is between ${{usd1}} and ${{usd2}} a year at ${{price_med}} per million British thermal units, the median Henry Hub spot price from {{price_first}} to {{price_last}}. The mean over the same months is ${{price_mean}}, pulled up by one month at ${{price_max}}, which is why the median is used.

What averages away

The intuition that more meters means a better total is right for errors that are each meter's own and wrong for errors they share. With the discharge coefficient independent, the total of the receipt meters' readings goes from {{sw_tot0_1}}% uncertain with one meter to {{sw_tot0_100}}% with a hundred. With it shared, a hundred meters are barely better than one: {{sw_tot1_1}}% to {{sw_tot1_100}}%. The imbalance follows neither rule on its own, because it is a difference, and whether a shared error survives a difference depends on whether both sides share it.

Two panels against the number of receipt meters, one to one hundred. Top: total measured throughput, whose uncertainty falls steadily when errors are independent and stays flat when they are shared. Bottom: the imbalance, lowest when a shared error cancels and, from two meters up, largest when the two ends carry different shared errors.

N receipt meters into one delivery meter sized to take them, in the same three cases. Panel A is what a seller's total is good to; panel B is what the balance between seller and buyer is good to.

For scale, the U.S. Energy Information Administration's national figure for natural gas "lost and unaccounted for" in {{a1_year}} was {{a1_pct}}% of consumption. That number is not a measurement error and should not be read as one. Of it, {{a1_loss_pct}} points are losses the companies know of, from leaks, damage and blowdown; the other {{a1_uaf_pct}} are "unaccounted for", the residual between what companies report as supply and what they report as disposition, which the agency's note says may come from quantities lost or from "differences in company accounting systems in terms of scope and definition." Distribution utilities report a percentage of their own to the Pipeline and Hazardous Materials Safety Administration each year; across {{ph_n}} natural gas reports for {{ph_year}} the median was {{ph_median}}%, and {{ph_neg}} of them were negative, more gas out than in.

Method

Each meter's mass flow follows ISO 5167-2: the Reader-Harris/Gallagher discharge coefficient, iterated with the Reynolds number it depends on, and the standard's expansibility factor. The open implementation used is the Python library fluids, checked against an independent transcription of the equation. Compressibility, the isentropic exponent and the heating value come from NIST's reference implementation of AGA Report No. 8, the GERG-2008 equation of state, compiled from its published source and checked against NIST's own test points. Volume is reported at {{p_base}} psia and {{t_base}} °F, and energy from the gas's ideal gross heating value, so a composition error moves the molar mass, the compressibility and the heating value together.

Every input's error is drawn in the unit its source states it in: transmitter errors as a fraction of span, which becomes a larger fraction of reading the lower a meter runs in its range; temperature in kelvin, for the sensor, its transmitter and its installation; the compressibility equation's error in proportion to how far the gas is from ideal at each meter's pressure. Each error has a shared fraction between zero and one, the correlation between any two meters' errors in that input. By default the transmitters are independent from meter to meter, as the handbook classifies them for runs at one station; the diameters and the gas analysis, which it classes as correlated within a station, are also independent here, because these meters are taken to sit at different sites (an assumption the simulator lets a reader change). The compressibility equation is shared by construction, since every meter uses the same one. Transmitter errors are redrawn at each of {{n_ints_word}} calibrations a year; the plate, the pipe, the coefficient and the equation keep theirs for the year. In the model the true gas is one composition and balances exactly in moles.

Uncertainty is propagated by Monte Carlo after JCGM 101:2008, the supplement to the international guide on expressing measurement uncertainty, with its adaptive stopping rule: batches of {{batch_k}} trials until every reported figure has stabilised to the precision it is printed with. A test suite checks the model against cases with known answers: zero input uncertainty gives zero imbalance, independent errors average as one over the square root of the number of meters, and each shared error cancels or survives exactly as the algebra says. Each check has been run against a deliberately broken model and seen to fail.

Limits

This is an explainer. It gives no engineering advice and states no uncertainty for any real installation. The system is synthetic, sized and set by assumption. The discharge coefficient's uncertainty is the ISO 5167-2 figure as quoted by a manufacturer's technical note, because the standard's text is not openly published; the pipe diameter's {{u_pipe}}% is an assumption; the bore's {{u_bore}}% is the standard's roundness limit used as a bound; and the gas analysis uncertainties come from one published example budget for one chromatograph. Scatter about each transmitter's offset within a calibration interval is taken to average out; the uncertainty of the expansibility factor is left out because its formula is not openly published; and nothing here models a damaged plate, a liquid-laden stream, a pulsating flow or any of the faults that move a real meter further than its stated uncertainty.


The code

model.py holds the meter equation, the error model and the Monte Carlo; build_meter.py runs every case on this page and writes the payload; fig_meter.py draws the three figures; test_meter.py holds the known-answer tests and their deliberate breaks, and checks/ the checks of fluids and of the compiled NIST code against their published answers. aga8/ is NIST's source, public domain, which build_aga8.py compiles; engine.js is the browser port the simulator runs, held to the Python by a parity test. The fetchers download and hash-check the public data; the archive carries none of it.

Download source All code