Back-calculate the inlet pressure of a gas line
A 4-in, 1-mile line carrying 16 MMscf/d of 0.65-gravity gas into a 969 psia header: the inlet pressure by the Weymouth, Panhandle A and Panhandle B equations, the drop along the line, the compressor discharge with a 1.1 safety factor, the gas velocity at each end, and the Weymouth inlet pressure as the rate grows.
- UC-SF-011
Engineering use case UC-SF-011 (Back-Calculate the Inlet Pressure of a Gas Line), on Guo et al. (2007) Example 13.2, the gas lift distribution line.
Each equation relates p1² − p2² to the rate: Weymouth's q = 433.5 E (Tb / pb) √((p1² − p2²) / (γ T z L)) D^2.667 with a diameter-only friction factor, and Panhandle A and B with Reynolds-number friction factors and their own exponents, at the efficiencies Guo quotes (0.92 and 0.95). Inverting for p1 starts from the pressure the far end must deliver.
What an engineer learns from it: Weymouth needs 1,063 psia at the inlet, the line pressure Guo's Table 13.1 prints, and a 1,169 psia compressor discharge with the 1.1 factor (the book's 1,170). Panhandle A needs 1,018 psia and Panhandle B 1,011 psia, because their clean-line equations carry more gas than Weymouth's for the same drop; Weymouth is the conservative choice for a short, small-diameter line, which is where it was fitted. The drop goes as the square of the rate: 6 psi at 4 MMscf/d, 94 psi at 16, 201 psi at 24. The gas runs at 25 to 27 ft/s, well under an erosional limit.
Units: Mscf/d, psia, inches, miles, °F; Z = 0.8278 at the line conditions, as in the example.
Source
using System;
using System.Linq;
using Team76.Engineering.SF.Pipeline.SinglePhase;
public class S : ICalcScript
{
public ScriptResult Run(ICalcContext ctx)
{
// Guo et al. (2007) Example 13.2: the gas lift distribution line, 16 MMscf/d of 0.65-gravity gas through a 4-in ID,
// 1-mile line at 70 °F and Z = 0.8278, delivering into a 969 psia header.
const double rate = 16000; // Mscf/d
const double outlet = 969; // psia
const double diameter = 4; // in
const double length = 1; // mi
const double gravity = 0.65, temperature = 70, z = 0.8278;
const double safetyFactor = 1.1;
double weymouth = GasPipeline.InletPressureWeymouth(rate, outlet, diameter, length, gravity, temperature, z); // E = 1
double panhandleA = GasPipeline.InletPressurePanhandleA(rate, outlet, diameter, length, gravity, temperature, z); // E = 0.92
double panhandleB = GasPipeline.InletPressurePanhandleB(rate, outlet, diameter, length, gravity, temperature, z); // E = 0.95
var rows = new[] { ("Weymouth", weymouth), ("Panhandle A", panhandleA), ("Panhandle B", panhandleB) }
.Select(r => new object[] { r.Item1, Math.Round(r.Item2), Math.Round(r.Item2 - outlet), Math.Round(safetyFactor * r.Item2) })
.ToList();
// The rate the same line carries from Weymouth's inlet pressure, and the gas velocity at each end.
double check = GasPipeline.FlowRateWeymouth(weymouth, outlet, diameter, length, gravity, temperature, z);
double inletVelocity = GasPipeline.Velocity(rate, diameter, weymouth, temperature, z);
double outletVelocity = GasPipeline.Velocity(rate, diameter, outlet, temperature, z);
// The Weymouth inlet pressure as the line carries more gas.
double[] rates = [4000, 8000, 12000, 16000, 20000, 24000];
var curve = new ScriptSeries("Weymouth", rates,
rates.Select(q => Math.Round(GasPipeline.InletPressureWeymouth(q, outlet, diameter, length, gravity, temperature, z), 1)).ToArray());
return ctx.Result()
.Set("Inlet pressure by equation", new ScriptTable(["Equation", "Inlet (psia)", "Drop (psi)", "Compressor discharge x1.1 (psia)"], rows))
.Set("Weymouth inlet pressure (psia)", Math.Round(weymouth, 1))
.Set("Book line pressure, Guo Table 13.1 (psia)", 1063)
.Set("Rate back from the Weymouth inlet (Mscf/d)", Math.Round(check, 1))
.Set("Gas velocity at the inlet (ft/s)", Math.Round(inletVelocity, 1))
.Set("Gas velocity at the outlet (ft/s)", Math.Round(outletVelocity, 1))
.Set("Inlet pressure against rate", new ScriptChart([curve], title: "4-in, 1-mile line into 969 psia", xLabel: "Gas rate (Mscf/d)", yLabel: "Inlet pressure (psia)"));
}
}