Part III: Reservoir & Production Engineering
Chapter 15
Natural Gas Engineering with Python
Why This Chapter Exists
Natural gas accounts for roughly a quarter of global energy consumption, and that share is growing. Unlike oil, which is valued primarily as a liquid fuel, gas serves as feedstock for power generation, petrochemicals, fertiliser production, and increasingly as a transition fuel in decarbonisation strategies. The engineering challenges of gas are distinct from oil: gas is compressible, its properties change dramatically with pressure and temperature, and transporting it requires either pipelines under high pressure or liquefaction at -162°C.
Every calculation in gas engineering starts with one fundamental reality: gas does not behave like an ideal gas. The ideal gas law () is a useful approximation at low pressures, but at the pressures found in reservoirs (3,000–15,000 psi) and pipelines (500–2,000 psi), real gas behaviour deviates significantly. The compressibility factor captures that deviation, and getting right is the foundation on which every other gas calculation rests.
This chapter builds the core gas engineering toolkit: gas property calculations, well deliverability analysis, and pipeline hydraulics. Each calculation is implemented from the underlying physics so you understand what the equations assume and when they break down.
infoWhat You Will Learn
- Calculate gas properties: Z-factor, formation volume factor, compressibility, viscosity, and density
- Implement the Standing-Katz correlation and the Dranchuk-Abou-Kassem (DAK) equation of state
- Perform gas well deliverability analysis (AOF, IPR)
- Size gas pipelines using the General Flow Equation and its simplified forms
- Calculate compression requirements for gas gathering and transmission
Gas Properties
The Compressibility Factor (Z)
The real gas equation of state is:
where is the compressibility factor — a dimensionless number that corrects the ideal gas law for the behaviour of real gas molecules. At standard conditions (14.7 psia, 60°F), . At reservoir conditions, can range from 0.3 to 1.2 depending on pressure, temperature, and gas composition.
is calculated using reduced properties --- the ratio of actual conditions to the gas's critical conditions:
where and are the pseudo-critical pressure and temperature of the gas mixture, estimated from gas specific gravity using the Sutton correlations:
Dranchuk-Abou-Kassem (DAK) Z-Factor Correlation
The Standing-Katz chart is the industry-standard graphical method for determining from reduced properties. The DAK correlation is an eleven-coefficient equation that fits the Standing-Katz chart to within 1% accuracy for most conditions:
Gas Formation Volume Factor and Density
Once is known, the gas formation volume factor (reservoir volume per standard volume) and gas density follow directly:
Gas Well Deliverability
Gas well deliverability testing determines a well's ability to produce against a given back-pressure. The two standard test methods are the backpressure (flow-after-flow) test and the isochronal test.
The deliverability equation has two common forms:
Simplified (backpressure) equation:
Forchheimer (quadratic) equation:
where represents laminar (Darcy) flow resistance and represents turbulent (non-Darcy) flow resistance near the wellbore.
Gas Pipeline Hydraulics
The steady-state flow of gas through a horizontal pipeline is governed by the General Flow Equation:
where:
- = flow rate at standard conditions (scf/day)
- , = base temperature (°R) and pressure (psia)
- , = inlet and outlet pressures (psia)
- = pipe internal diameter (inches)
- = Moody friction factor
- = gas specific gravity
- = average temperature (°R)
- = average Z-factor
- = pipeline length (miles)
Several simplified forms exist for practical use. The Weymouth equation assumes a specific friction factor relationship and is conservative (underpredicts capacity). The Panhandle A equation is commonly used for large-diameter, high-pressure transmission lines.
Gas Compression
When pipeline pressure drop exceeds the available upstream pressure, or when gathering low-pressure gas for transmission, compression is required. The key calculations are compression ratio, number of stages, power requirement, and discharge temperature.
Exercises
-- Z-Factor Sensitivity
Calculate and plot Z vs. pressure (100–10,000 psia) for gas gravities of 0.55, 0.65, 0.75, and 0.85 at 200°F. How does gas composition (heavier = high...
-- Gas Property Module
Build a gas_properties module with functions for Z, Bg, density, viscosity, and compressibility. Include a gas_property_table(P_range, T, gamma_g) fun...
-- Gas Material Balance
For a volumetric gas reservoir (no water influx), the P/Z plot is linear: P/Z = (Pi/Zi)(1 - Gp/G). Given initial pressure 4,500 psia, temperature 220°...
-- Gas Well Deliverability
A gas well was tested at four rates. Fit both the backpressure equation and the Forchheimer equation. Calculate AOF using both methods and compare. Wh...
-- Pipeline Pressure Profile
For a 100-mile, 24-inch pipeline operating at 1,200 psia inlet and 800 psia outlet, calculate and plot the pressure at every mile along the pipeline. ...
-- Looped Pipeline
An existing 20-inch pipeline can deliver 120 MMscf/d. Demand has increased to 180 MMscf/d. Calculate the diameter of a parallel (looped) line that, co...
-- Compression Staging
For a compression ratio of 20:1, compare the total horsepower required for 1, 2, 3, and 4 stages. Plot HP vs. number of stages. Why does adding stages...
-- Gas Gathering System
Design a gas gathering system for four wells producing 10, 15, 8, and 22 MMscf/d at wellhead pressures of 400, 350, 300, and 450 psia respectively. Al...
-- Gas Dehydration
Gas must be dehydrated before entering a pipeline to prevent hydrate formation and corrosion. Calculate the water content of a 0.65 gravity gas at 1,0...
-- Integrated Gas Field Development
A gas field has estimated reserves of 500 Bscf. Design a development plan that includes: well deliverability (number of wells needed for a plateau rat...
Summary
- Gas does not behave ideally. The compressibility factor Z corrects the ideal gas law for real gas behaviour and is the foundation of every gas engineering calculation.
- The DAK correlation provides an analytical method to calculate Z from reduced pressure and temperature, replacing graphical methods with code.
- Gas properties — formation volume factor, density, viscosity, and compressibility — all depend on Z and change significantly with pressure and temperature.
- Gas well deliverability is characterised by the backpressure equation () or the Forchheimer equation. The deliverability exponent indicates the degree of turbulence near the wellbore.
- Pipeline capacity depends on the fifth power of diameter, making pipe sizing the single most important decision in gas transmission. The General Flow, Weymouth, and Panhandle equations provide different levels of conservatism.
- Compression is required when natural pressure is insufficient. Staging reduces power requirements significantly for high compression ratios.
- The tools built in this chapter —
z_factor_DAK(),gas_properties(),pipeline_capacity(),compression_power()— form a complete gas engineering calculation library.