Calculating the gas flow rate through a pipe is a critical task in fluid mechanics, petroleum engineering, and natural gas transmission. Whether sizing a new pipeline or analyzing the performance of an existing network, understanding the relationship between pressure drop, pipe diameter, and flow rate is essential for safety and efficiency.
This calculator utilizes the Weymouth Equation, one of the most widely accepted formulas for sizing high-pressure gas gathering and transmission lines. It is particularly effective for turbulent flow in pipes ranging from 2 inches to large transmission sizes.
The Weymouth Equation Explained
The Weymouth equation relates the volume of gas flow to the pressure drop across the pipeline, the pipe's physical dimensions, and the properties of the gas itself. The standard formula used is:
Q: Flow rate in Standard Cubic Feet per Day (SCFD)
E: Pipeline Efficiency factor (typically 0.92 for average conditions)
P1: Upstream pressure (psia)
P2: Downstream pressure (psia)
D: Inside diameter of the pipe (inches)
L: Length of pipe (miles)
G: Specific gravity of gas (Air = 1.0, Natural Gas ≈ 0.6)
Tf: Average flowing temperature (Rankine)
Z: Gas compressibility factor (assumed constant in simplified calculations)
Key Input Parameters
To ensure accurate results, it is important to understand the input variables required for the calculation:
Upstream vs. Downstream Pressure: Gas moves from areas of high pressure to low pressure. The "driving force" of the flow is the difference between the inlet ($P_1$) and outlet ($P_2$) pressures squared. If $P_2$ equals $P_1$, flow ceases.
Pipe Inner Diameter (ID): This is arguably the most sensitive variable. Because the diameter is raised to the power of 2.667 in the Weymouth equation, a small increase in pipe size results in a massive increase in flow capacity. Always use the Internal diameter, not the Nominal Pipe Size (NPS).
Specific Gravity: This compares the density of the gas to air. Natural gas varies by composition but usually falls between 0.55 and 0.65. Heavier gases flow more slowly for the same pressure drop.
Example Calculation
Consider a scenario involving a natural gas transmission line:
Parameter
Value
Pipe Size
6 inch Nominal (6.065″ ID)
Length
10 Miles
Inlet Pressure
500 PSIG
Outlet Pressure
400 PSIG
Temperature
60°F
Using these values in the calculator, we convert gauge pressure to absolute (PSIA), temperature to Rankine, and apply the specific gravity of natural gas (0.6). The resulting flow capacity would be approximately 13.5 Million SCFD (MMCFD), assuming standard efficiency.
Applications
This calculation is vital for:
Pipeline Sizing: Determining the minimum pipe diameter required to transport a specific volume of gas over a set distance.
Compressor Station Spacing: Calculating how far gas can travel before pressure drops below operational limits, requiring re-compression.
Leak Detection: Comparing theoretical flow rates against measured flow rates to identify discrepancies indicating leaks or blockages.
function calculateGasFlow() {
// Clear errors and hide result initially
var errorDiv = document.getElementById("gf_error");
var resultDiv = document.getElementById("gf_result");
errorDiv.style.display = "none";
resultDiv.style.display = "none";
errorDiv.innerHTML = "";
// Get Inputs
var p1_val = parseFloat(document.getElementById("gf_p1").value);
var p1_unit = document.getElementById("gf_p1_unit").value;
var p2_val = parseFloat(document.getElementById("gf_p2").value);
var p2_unit = document.getElementById("gf_p2_unit").value;
var diameter = parseFloat(document.getElementById("gf_diameter").value);
var length_val = parseFloat(document.getElementById("gf_length").value);
var length_unit = document.getElementById("gf_length_unit").value;
var sg = parseFloat(document.getElementById("gf_sg").value);
var temp_f = parseFloat(document.getElementById("gf_temp").value);
var eff = parseFloat(document.getElementById("gf_eff").value);
// Validation
if (isNaN(p1_val) || isNaN(p2_val) || isNaN(diameter) || isNaN(length_val) || isNaN(sg) || isNaN(temp_f) || isNaN(eff)) {
errorDiv.innerHTML = "Please enter valid numeric values for all fields.";
errorDiv.style.display = "block";
return;
}
if (diameter <= 0 || length_val <= 0 || sg <= 0 || eff = p1_abs) {
errorDiv.innerHTML = "Upstream Pressure (P1) must be greater than Downstream Pressure (P2) to generate flow.";
errorDiv.style.display = "block";
return;
}
// Convert Length to Miles
var length_miles = (length_unit === "feet") ? length_val / 5280 : length_val;
// Convert Temp to Rankine
var temp_r = temp_f + 459.67;
// Constants for Weymouth Equation (Standard Conditions: Pb = 14.73 psia, Tb = 520 R)
var Tb = 520;
var Pb = 14.73;
var Z = 0.90; // Compressibility factor approximation for standard natural gas conditions
// Weymouth Equation Calculation
// Q = 433.5 * E * (Tb/Pb) * sqrt( (P1^2 – P2^2) / (G * T * L * Z) ) * D^(8/3)
// D is raised to 2.667 (approx 8/3)
var pressure_term = (Math.pow(p1_abs, 2) – Math.pow(p2_abs, 2));
var denominator = sg * temp_r * length_miles * Z;
var sqrt_term = Math.sqrt(pressure_term / denominator);
var diameter_term = Math.pow(diameter, 2.667);
var constant_term = 433.5 * eff * (Tb / Pb);
var q_scfd = constant_term * sqrt_term * diameter_term;
// Formatting results
var q_mcfd = q_scfd / 1000;
// Display Logic
document.getElementById("gf_output_scfd").innerText = Math.round(q_scfd).toLocaleString();
document.getElementById("gf_output_mcfd").innerText = q_mcfd.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
resultDiv.style.display = "block";
}