*Calculated using the Weymouth Equation for high-pressure gas flow. Assumes standard conditions of 14.73 psia and 60°F base temperature.
function calculateNaturalGasFlow() {
// Get Elements
var diameterInput = document.getElementById('pipeDiameter');
var lengthInput = document.getElementById('pipeLength');
var p1Input = document.getElementById('upstreamPressure');
var p2Input = document.getElementById('downstreamPressure');
var gravityInput = document.getElementById('specificGravity');
var tempInput = document.getElementById('flowTemp');
var errorDiv = document.getElementById('ngError');
var resultDiv = document.getElementById('ngResult');
// Reset display
errorDiv.style.display = 'none';
resultDiv.style.display = 'none';
errorDiv.innerHTML = ";
// Parse Float Values
var D = parseFloat(diameterInput.value); // inches
var L_ft = parseFloat(lengthInput.value); // feet
var P1_g = parseFloat(p1Input.value); // psig
var P2_g = parseFloat(p2Input.value); // psig
var S = parseFloat(gravityInput.value); // Specific Gravity
var T_f = parseFloat(tempInput.value); // Fahrenheit
// Validation
if (isNaN(D) || isNaN(L_ft) || isNaN(P1_g) || isNaN(P2_g) || isNaN(S) || isNaN(T_f)) {
errorDiv.innerHTML = "Please enter valid numbers in all fields.";
errorDiv.style.display = 'block';
return;
}
if (D <= 0 || L_ft <= 0 || S = P1_g) {
errorDiv.innerHTML = "Upstream Pressure must be higher than Downstream Pressure to generate flow.";
errorDiv.style.display = 'block';
return;
}
// Constants and Conversions
var P_base = 14.73; // Standard Pressure Base (psia)
var T_base = 520; // Standard Temperature Base (Rankine)
var T_abs = T_f + 460; // Flowing Temp in Rankine
var P1_abs = P1_g + 14.7; // Convert psig to psia (using 14.7 atm)
var P2_abs = P2_g + 14.7; // Convert psig to psia
var L_miles = L_ft / 5280; // Convert feet to miles for Weymouth Formula
var efficiency = 1.0; // Assuming new pipe condition
// Weymouth Equation Calculation
// Q_scfd = 433.5 * E * (Tb/Pb) * [ (P1^2 – P2^2) / (L_miles * S * T_abs) ]^0.5 * D^(8/3)
// Note: D^(8/3) is approx D^2.667
var term1 = 433.5 * efficiency * (T_base / P_base);
var pressureDiffSquared = (Math.pow(P1_abs, 2) – Math.pow(P2_abs, 2));
var denominator = (L_miles * S * T_abs);
// Avoid division by zero (already handled by validation, but double check)
if (denominator === 0) {
denominator = 0.0001;
}
var sqrtTerm = Math.pow((pressureDiffSquared / denominator), 0.5);
var diameterTerm = Math.pow(D, 2.667);
var Q_scfd = term1 * sqrtTerm * diameterTerm;
var Q_scfh = Q_scfd / 24;
var pressureDrop = P1_g – P2_g;
// Formatting Results
document.getElementById('resultSCFH').innerHTML = Q_scfh.toLocaleString(undefined, {maximumFractionDigits: 0});
document.getElementById('resultSCFD').innerHTML = Q_scfd.toLocaleString(undefined, {maximumFractionDigits: 0});
document.getElementById('resultDrop').innerHTML = pressureDrop.toFixed(2) + " psi";
// Show Results
resultDiv.style.display = 'block';
}
How to Calculate Natural Gas Flow Rate Based on Pressure and Diameter
Determining the capacity of a natural gas pipeline is a critical task in engineering and facilities management. Whether you are sizing a pipe for a new industrial burner, designing a transmission line, or evaluating pressure drops across an existing system, understanding the relationship between pipe diameter, pressure differential, and flow rate is essential.
This calculator utilizes the Weymouth Equation, a standard industry formula used for sizing natural gas lines, particularly in high-pressure, high-flow applications. Unlike simple incompressible flow formulas used for water, natural gas is compressible, meaning its density changes significantly with pressure.
Key Factors Affecting Gas Flow
Pipe Diameter: The most influential factor. Flow capacity increases exponentially with diameter. A small increase in diameter can result in a massive increase in flow volume.
Pressure Differential (ΔP): Gas flows from high pressure to low pressure. The greater the difference between the upstream (inlet) and downstream (outlet) pressure, the higher the potential flow rate.
Pipe Length: Friction reduces flow energy. The longer the pipe, the lower the flow rate for a given pressure drop.
Specific Gravity: Natural gas is lighter than air (approx. 0.60 specific gravity). Heavier gases require more energy to move, reducing flow rates.
The Weymouth Equation Explained
The Weymouth equation is widely accepted for estimating flow in pipelines ranging from 2 inches to 24 inches or larger. It assumes turbulent flow conditions which are typical in most commercial and industrial gas lines.
Q: Flow rate in Standard Cubic Feet per Day (SCFD)
D: Inside diameter of the pipe (inches)
P1 & P2: Upstream and Downstream absolute pressure (psia)
L: Length of pipe segment (miles)
S: Specific gravity of gas (0.60 for Natural Gas)
T: Absolute flowing temperature (Rankine)
Example Calculation
Consider a scenario where you need to verify if a 4-inch pipe can supply a specific load over a distance of 1,000 feet.
Pipe Size: 4 inches (ID)
Inlet Pressure: 100 psig
Acceptable Outlet Pressure: 90 psig
Length: 1,000 feet (0.189 miles)
Using the calculator above, you would input these values to determine the maximum flow rate the pipe can sustain before the pressure drops below 90 psig. This helps ensure that downstream equipment receives adequate fuel pressure to operate safely and efficiently.
Why Accurate Sizing Matters
Undersizing gas pipes can lead to starvation of equipment, causing flame instability in boilers or shutdown of generators. Conversely, oversizing pipes increases material and installation costs unnecessarily. Using a precise calculation based on pressure and diameter ensures optimal system performance and safety compliance with codes like NFPA 54 or ASME B31.8.