Gas material balance turns a pressure history into a volume. Plot P/Z against cumulative production: for a closed, volumetric gas reservoir the points fall on a straight line whose x-intercept is the original gas in place. Every other feature of this tool exists either to build that plot correctly, or to explain what to do when the points refuse to be straight.
The workflow in one line
Load pressure history → ① Reservoir & PVT → ② Composition → ③ Z-method → ④ Abandonment P → ▶ Solve Material Balance → read the P/Z shape.
If the trend curves the work is not finished: go to the diagnostics tabs, calibrate the aquifer in ⑤, and — on a water drive — read the recovery from the Agarwal panel rather than the headline cards.
Inputs are in the left sidebar, results on the right. Everything computes in your browser.
Access
The lock badge on the ▶ Solve Material Balance button shows session state. If it reads 🔒, click once and sign in; the badge turns 🔓. Sessions are shared across tools in the same browser.
Getting data in — three routes
| Route | How | Use for |
| Worked example | Buttons A–D at the top | Learning the tool and checking behaviour against a known signature |
| File upload | ⑤ Upload Data — CSV, XLSX or XLS, or drag and drop | Real field histories |
| Manual entry | + Add row in the survey history table | A handful of points, or editing after import |
The four worked examples are benchmark cases, not illustrations. Each was forward-generated from a declared true gas-in-place using the same PVT correlations this tool runs, so the correct answer is known exactly and the workflow can be scored against it. Loading one opens a reference panel stating the true volume, which method should recover it, and what your run produced.
| Case | True OGIP | What it teaches |
| A · Volumetric | 50 Bcf | Closed tank. The linear P/Z fit is the correct estimator and returns 50.0 Bcf. |
| B · Water drive | 140 Bcf | The linear fit returns about 395 Bcf — nearly three times too high. Only the Cole plot, with the aquifer calibrated, recovers 140. |
| C · Geopressured | 250 Bcf | The linear fit returns about 282 Bcf. The Roach correction recovers 249. |
| D · Connected | 80 Bcf surveyed 220 Bcf system | The linear fit returns about 211 Bcf. That number is not wrong — it is the connected system, not the tank the wells can drain. |
Three of the four are cases where the obvious answer is the wrong one. That is the point: run each, watch the naive estimate fail, and see which diagnostic rescues it.
For upload, use ↓ Sample CSV to get the expected layout. Columns are time, P, Gp, Wp — time in years, pressure in psi, cumulative gas in Bcf, cumulative water in MMbbl and optional. Column names are case-insensitive and lines starting with # are ignored.
⚠ Pressure must be static bottomhole pressure
Use build-up or shut-in pressures referenced to a common datum. Surface pressures carry wellbore hydrostatics that corrupt the P/Z signal and produce a confidently wrong OGIP. If a survey is suspect, exclude it rather than including it and hoping the regression absorbs it.
Step by step
1
① Reservoir & PVT
Initial pressure Pi, reservoir temperature Tr, TVD to the datum used for the pressure gradient, and initial water saturation Swi. Pi anchors the fitted line and Swi feeds the connate-water expansion term — both matter more than they look.
2
② Gas Composition
Gas specific gravity relative to air, plus H₂S, CO₂ and N₂ as mol percent. These drive the Z-factor, and Z sits directly in the P/Z ordinate, so composition errors propagate straight into OGIP.
Corrections are applied automatically: Wichert-Aziz for sour gas above roughly 2% H₂S or 5% CO₂, Carr-Kobayashi-Burrows above roughly 2% N₂, with pseudo-criticals from a Standing/Sutton blend.
3
③ Z-Method & Compressibility
Choose the Z correlation: DAK is the general-purpose default; Beggs-Brill is the faster explicit alternative. Formation and water compressibility, cf and cw, are only second-order for a normally pressured reservoir — but they become first-order in a geopressured one, which is exactly what the Roach diagnostic tests.
4
④ Forecast — abandonment pressure
Pab converts OGIP into recoverable reserves, so it is an economic input as much as a technical one. Set it from facility minimums or the economic limit, and allow an extra margin when converting from a wellhead constraint to a reservoir datum.
5
Solve, then look at the plot before the numbers
Click ▶ Solve Material Balance. Read the shape of the P/Z trend first. The KPI cards are only meaningful once the shape confirms which model applies.
Reading the P/Z shape — the central diagnostic
| Shape | Interpretation | Next step |
| Straight | Volumetric depletion, closed tank | Linear OGIP is valid. Confirm with the OGIP vs Time tab. |
| Curves upward | Pressure supported: water influx, or a connected compartment feeding in | Cole and Havlena-Odeh tabs, then aquifer calibration. Linear OGIP is optimistic — in worked example B it is 2.8 times the true volume. |
| Shallow then steepening | Geopressured — early rock and connate-water expansion supports pressure, inflating the apparent OGIP | Roach tab. Linear OGIP is optimistic; the Roach correction pulls it down. |
| Curves downward | Compartmentalisation, or production not fully accounted for | Audit the Gp record and check whether the pressure points share a common datum. |
▣ How the shape is judged
Concavity is measured from a quadratic fit of P/Z on Gp, scored by the parabola's sagitta — its greatest departure from the straight chord — normalised by Pi/Zi. A mechanism is only claimed when that departure exceeds 0.8% of Pi/Zi and the curve explains materially more variance than the line. A high R² on the straight fit does not rule curvature out: a convex trend over a narrow depletion range can still return R² above 0.99.
▣ Plot interactions
Click any point to exclude it from the fit and click again to restore it. Drag the centre of the fitted line to translate it, use the slope controls to rotate it, and drag the dashed line to reposition abandonment pressure. Use these to test how much the answer depends on one questionable survey — if excluding a single point moves OGIP substantially, say so in the report.
Key outputs
- OGIP from linear P/Z — the x-intercept of the fit. Valid only when the trend is genuinely straight.
- Fit quality R² — a high value confirms linearity, not correctness. A curved trend fitted over a narrow depletion range can still return a high R².
- Fitted Pi/Zi — compare against the value implied by your entered Pi. A large discrepancy means the early history and the entered initial condition disagree.
- Current recovery — produced volume as a fraction of estimated OGIP.
- Swept fraction Ev — the share of the original hydrocarbon pore volume now occupied by net water influx, computed from the material balance rather than assumed. It reads near zero on a closed reservoir and on a geopressured one, and climbs steadily under aquifer support, so it is a cleaner statement of what the water is doing than the drive indices alone.
- Recoverable Gp,ab, recovery factor, remaining volume — the forecast at your abandonment pressure, with a bound check flagging physically implausible recovery factors.
- Drive index breakdown — Pirson indices apportioning support between depletion, water influx, and rock/water expansion. Water influx is back-calculated from the material balance, so the indices sum to unity by construction — the real diagnostic is a negative water-drive index, which means the balance cannot close at the current OGIP (usually because it is too large).
▣ Two forecasts, shown side by side
The headline cards extrapolate the straight P/Z line to the abandonment pressure you entered. That is the right calculation for a volumetric reservoir and the wrong one for a water drive, so when the swept fraction is material a second panel appears with the Agarwal recovery beside it. Neither replaces the other — the gap between them is the thing worth looking at.
Recovery under water drive
A volumetric reservoir abandons when pressure reaches an economic floor. A water-drive reservoir does not get that far: the aquifer holds pressure up, and the wells are lost to water first. Two things then go wrong with the straight-line forecast at once, and they pull in opposite directions.
| Error | Effect on RF |
| Abandonment pressure is never reached — the reservoir stops far above it | Overstates |
| Gas trapped at residual saturation behind the front, and gas left in the unswept volume, are both ignored | Understates |
Correcting only one makes the answer worse. The tool corrects both, using Agarwal, Al-Hussainy & Ramey (1965):
▣ RF = 1 − (Bgi/Bga) · [ Ev·Sgr/(1−Swi) + (1−Ev) ]
Ev is the fraction of the original hydrocarbon pore volume invaded by water at abandonment, and Sgr the residual gas saturation behind the front. At Ev = 0 the expression collapses to 1 − Bgi/Bga, which is exactly the volumetric result — so the two forecasts agree when they should.
Where the swept fraction comes from
It is not an assumption. Rearranging the material balance gives
▣ Ev = 1 − (1 − Gp/G)·(Bg/Bgi) − ce·ΔP
so the swept fraction follows from pressure and cumulative production alone — no aquifer model, no dependence on J or Wei. The ce·ΔP term is not optional: without it an abnormally pressured reservoir containing no water at all reports an apparent sweep of exactly ce·ΔP, and every number built on top of that is meaningless.
The three inputs
| Input | Guidance |
| Sgr | Residual gas saturation, typically 0.25–0.40 in sandstone. The recovery is sensitive to it: on worked example B, moving from 0.20 to 0.40 shifts RF from 69% to 52%. |
| Sweep at abandonment | The fraction of pore volume invaded when the last well waters out. 0.6–0.9 depending on heterogeneity and geometry. The panel reports the swept fraction reached so far, which anchors the choice. |
| Pab, water drive | Leave blank and it is estimated by extrapolating the fitted P/Z trend to the sweep target. Better, fix it from a nodal liquid-loading check — the pressure at which the wells stop lifting water is a measurement of the abandonment condition rather than a guess at it. Send one across from the nodal tool and it appears here as an offer, with its age and the completion it assumed; nothing is applied until you accept it. |
⚠ What worked example B shows
The volumetric forecast reports RF 85% and 37 Bcf remaining. The Agarwal calculation, abandoning at the estimated 2,807 psia, reports RF 61% and under 3 Bcf remaining — more than a tenfold difference in what is left to produce. Pressure after ten years is still 75% of initial, which is precisely why the volumetric route was never going to work here.
Advanced diagnostics — four tabs
| Tab | What it tests | How to read it |
| Cole | Water drive, with influx from a Fetkovich finite-aquifer model | Adjust J and Wei until F/Eg against We/Eg is linear with slope near 1. The y-intercept then gives OGIP. On worked example B the calibrated fit reaches slope 1.000 at R² 1.0000 and returns the true 140 Bcf. |
| Roach | Geopressured behaviour — abnormal rock and water expansion | Reports initial gradient, effective compressibility ce, the uplift over the volumetric case, and a corrected OGIP. The correction lowers the estimate: early rock and connate-water expansion inflate the naive trend, so the linear fit overstates OGIP. |
| Havlena-Odeh | Whether the assumed drive mechanism is self-consistent | F against Eg should be linear through the origin for a volumetric reservoir. Systematic curvature means a term is missing. |
| OGIP vs Time | Stability of the answer over the history | Compute OGIP from each pressure point individually. A flat trend means the reservoir is correctly characterised; upward drift indicates unmodelled influx or connectivity; downward drift indicates missing production or compartmentalisation. |
OGIP vs Time is the cheapest honesty check in the tool. Run it on every case, including ones that look convincingly linear.
⑤ Aquifer calibration
When the P/Z trend curves upward, quantify the aquifer rather than ignoring it. Two parameters control the Fetkovich model: aquifer productivity index J, which sets how quickly water enters, and initial encroachable volume Wei, which sets how much is ultimately available.
- Move the sliders manually and watch the Cole slope, or
- Click ◎ Auto-fit Aquifer to run a grid search maximising the linearity of F/Eg against We/Eg.
Target a Cole slope near 1. After fitting, re-read the drive indices — they now reflect the calibrated aquifer, and the water-drive index tells you how much of the pressure support is external. Report the calibrated OGIP rather than the linear one, and state J and Wei alongside it: an aquifer fit is non-unique, and the parameters are part of the answer.
Uncertainty — what to measure better
The diagnostics tabs answer "which mechanism is this". The uncertainty study answers what is left afterwards: given that the PVT, the pressure survey and the aquifer are all uncertain, how wide is the OGIP, and which of those uncertainties is worth going to spend money on.
Two questions get asked, and they are not the same question. Which parameter moves the answer most? and which parameter is worth spending money to pin down? A parameter can be enormously influential and still not worth measuring, because it is already known well. The tool answers both and shows where they disagree.
| Method | What it does | What it is good for |
| Tornado | Swings one parameter across its range with everything else at base. Exact, two evaluations per parameter. | Ranking raw influence. Reading how asymmetric or non-linear each response is. |
| Monte Carlo | Samples every parameter at once from triangular distributions on the same ranges, then reports P90/P50/P10 and a contribution ranking. | How uncertain the answer actually is, and which uncertainty owns the spread once everything moves together. |
Both rest on the same stated ranges, so the two views can be compared directly rather than resting on two different sets of assumptions. Ranges are editable; the defaults are starting points, not claims about your data.
▣ Contribution to spread
Computed as the squared Spearman rank correlation between each sampled input and the output, normalised across parameters. Rank rather than linear correlation, so a monotonic but curved response is still credited properly. It approximates the first-order variance share — roughly, the fraction of the spread that would disappear if that one parameter were known exactly. That is the number to read when deciding where to spend on data.
⚠ Two things the study will tell you if you let it
A bar marked † means one bound broke the model — at that value the material balance produced no usable answer. The bar shows the side that solved, doubled. A bound that breaks the calculation is not a reason to leave the parameter off the chart — it is the strongest evidence the parameter matters, and the reason the marker exists rather than the bar being silently dropped.
A rejection warning means some fraction of the sampled cases did not evaluate. Those draws are absent from the percentiles, so P90 and P10 are conditional on the region where the model works rather than on the full ranges you stated. The warning names the parameter the failures cluster in. Narrow that range until the rate falls below a few percent, or read the percentiles as bounds on a censored sample.
How many samples
The default is 2,000. A single evaluation here costs well under a millisecond, so the run completes in a second or two. There is no reason to reduce it, and raising it costs little.
⚠ On a water drive, initial pressure runs the answer
Worth knowing before you start: under the Cole estimator, OGIP is extraordinarily sensitive to Pi, because Pi sets the driving pressure of the Fetkovich aquifer. On worked example B a ±3% change in Pi moves OGIP from about 391 Bcf down to 56, and beyond that the calculation stops converging. Under the linear estimator the same change moves it by nothing at all, because the intercept comes from the data rather than from Pi. So the parameter most worth pinning down depends on which mechanism you are in — and on a water drive it is Pi and the quality of the pressure surveys, not the PVT.
▣ What this does not cover
The distribution reflects only the parameters listed. It says nothing about whether the model itself is right — whether the drive mechanism has been diagnosed correctly, whether the pressures are true static bottomhole values at a common datum, or whether the production record is complete. A tight P90–P10 band around the wrong model is worse than a wide band around the right one, because it looks like knowledge.
Saving and reporting
- ↓ Export at the top writes the full case state — inputs, data table, exclusions, aquifer settings — to JSON; ↑ Import restores it.
- ↓ Table CSV in the sidebar exports only the computed data table, for use in a spreadsheet.
- 📂 File → 📄 Report builds a self-contained HTML report — inputs, method, curvature diagnostic, results, charts and a written interpretation matched to the diagnosed drive mechanism — and opens it in a new tab rather than dropping it into the downloads folder. Solve first; the report requires valid results.
- The report carries its own toolbar: Save as PDF opens the print dialog (choose Save as PDF as the destination and enable background graphics, or the charts and shading are lost), and Download HTML saves the file without that toolbar. If the browser blocks the popup the report is downloaded instead and says so.
- A report generated from a worked example carries a provenance banner stating that the data is synthetic, naming the declared true OGIP, and reporting how far your run landed from it. That banner is there so a benchmark report cannot be mistaken for a field study.
- If an uncertainty study has been run, the report carries it too: the stated ranges, the tornado ranking, P90/P50/P10, the contribution to spread, and any rejection warning. A report that quotes a single volume where a range was measured is not a shorter report, only a less honest one.
- ↺ Reset clears everything and cannot be undone.
QC checklist before you quote a number
- All pressures are static bottomhole values at a common datum.
- Cumulative production is complete and consistent in units with the pressure record.
- Composition and Z-method reflect the actual gas, with sour or inert corrections triggered where appropriate.
- Depletion range is wide enough to define a trend — a few percent of depletion cannot determine an intercept.
- The P/Z shape has been classified before any OGIP number was accepted.
- OGIP vs Time is stable, or the drift has been explained.
- If an aquifer was fitted, J and Wei are reported with the OGIP.
- Abandonment pressure reflects real facility or economic limits.
- Excluded points are documented with the reason for exclusion.
- The OGIP being quoted is the one from the diagnosed mechanism — Cole for water drive, Roach for geopressured — not the linear fit.
- On a water drive, the recovery quoted is the Agarwal figure, with Sgr and the sweep assumption stated alongside it.