Gas Flow Rate Calculation Through Pipe

Gas Flow Rate Calculator body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; } .calculator-container { background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin-bottom: 40px; } .calculator-title { text-align: center; color: #2c3e50; margin-bottom: 25px; font-size: 1.5rem; font-weight: 700; } .input-group { margin-bottom: 20px; } .input-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #495057; } .input-group input { width: 100%; padding: 12px; border: 1px solid #ced4da; border-radius: 4px; font-size: 16px; box-sizing: border-box; transition: border-color 0.15s ease-in-out; } .input-group input:focus { border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0,123,255,0.25); } .row { display: flex; flex-wrap: wrap; margin: 0 -10px; } .col { flex: 1; padding: 0 10px; min-width: 200px; } .btn-calculate { display: block; width: 100%; padding: 14px; background-color: #007bff; color: white; border: none; border-radius: 4px; font-size: 18px; font-weight: 600; cursor: pointer; transition: background-color 0.2s; margin-top: 10px; } .btn-calculate:hover { background-color: #0056b3; } .result-box { background-color: #e8f4fd; border: 1px solid #b8daff; border-radius: 4px; padding: 20px; margin-top: 25px; text-align: center; display: none; } .result-label { font-size: 14px; color: #004085; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; } .result-value { font-size: 32px; font-weight: 700; color: #0056b3; } .result-sub { font-size: 14px; color: #6c757d; margin-top: 5px; } .error-msg { color: #dc3545; font-size: 14px; margin-top: 5px; display: none; } article { background: #fff; padding: 20px 0; } article h2 { color: #2c3e50; margin-top: 30px; border-bottom: 2px solid #eee; padding-bottom: 10px; } article p, article ul { color: #555; font-size: 16px; } article li { margin-bottom: 10px; } .info-tooltip { font-size: 12px; color: #888; font-weight: normal; }

Gas Flow Rate Calculator (Weymouth Equation)

Estimated Gas Flow Rate
0
Standard Cubic Feet per Day (SCFD)

Understanding Gas Flow Rate Calculations

Calculating the flow rate of natural gas through a pipeline is a critical task in fluid mechanics and petroleum engineering. Accurate calculations ensure pipeline efficiency, safety, and proper sizing of equipment. This calculator utilizes the Weymouth Equation, a standard formula widely used for sizing compressed air and natural gas pipelines in high-pressure turbulent flow regimes.

The Weymouth Equation Explained

The Weymouth equation is an empirical formula used to estimate the flow rate of gas in a pipe based on the pressure drop between the inlet and outlet. It is particularly effective for high-pressure transmission lines with large diameters.

The general formula logic implemented here considers:

  • Pressure Differential: The driving force of flow is the difference between the squared upstream pressure ($P_1$) and the squared downstream pressure ($P_2$).
  • Pipe Dimensions: Flow rate is directly proportional to the pipe diameter raised to the power of 2.667 and inversely proportional to the square root of the pipe length.
  • Gas Properties: The specific gravity (relative density compared to air) and temperature of the gas affect its compressibility and friction, influencing the flow rate.

Key Input Parameters

  • Upstream Pressure (P₁): The gauge pressure at the inlet of the pipe section. Higher inlet pressure increases the flow potential.
  • Downstream Pressure (P₂): The gauge pressure at the outlet. This must be lower than the upstream pressure for flow to occur.
  • Internal Diameter: The actual inside diameter of the pipe in inches. Small changes in diameter have a significant exponential impact on flow capacity.
  • Pipe Length: The distance the gas travels. Longer pipes result in greater friction loss and reduced flow rate.
  • Specific Gravity: For natural gas, this value is typically around 0.60 to 0.70. Air has a specific gravity of 1.0.

Factors Affecting Efficiency

While this calculator provides a robust theoretical estimate, real-world flow rates can be influenced by pipeline efficiency factors. Old pipes with corrosion or debris (scale) will have higher friction factors, reducing the actual flow compared to the theoretical maximum. Additionally, elevation changes along the pipeline route can introduce static pressure heads that affect the final flow rate.

Common Applications

This calculation is essential for:

  • Sizing gathering lines in natural gas fields.
  • Designing distribution networks for municipal gas supply.
  • Evaluating pressure drops across existing transmission lines.
  • Optimizing compressor station spacing and power requirements.
function calculateGasFlow() { // Clear previous errors var errorDiv = document.getElementById('errorDisplay'); var resultDiv = document.getElementById('result'); errorDiv.style.display = 'none'; errorDiv.innerHTML = "; resultDiv.style.display = 'none'; // 1. Get Input Values var p1_g = parseFloat(document.getElementById('p1').value); // psig var p2_g = parseFloat(document.getElementById('p2').value); // psig var d = parseFloat(document.getElementById('pipeDia').value); // inches var l_ft = parseFloat(document.getElementById('pipeLen').value); // feet var sg = parseFloat(document.getElementById('specGrav').value); // Specific Gravity var t_f = parseFloat(document.getElementById('temp').value); // Fahrenheit // 2. Validate Inputs if (isNaN(p1_g) || isNaN(p2_g) || isNaN(d) || isNaN(l_ft) || isNaN(sg) || isNaN(t_f)) { errorDiv.style.display = 'block'; errorDiv.innerHTML = "Please fill in all fields with valid numbers."; return; } if (d <= 0 || l_ft <= 0 || sg <= 0) { errorDiv.style.display = 'block'; errorDiv.innerHTML = "Diameter, Length, and Specific Gravity must be greater than zero."; return; } if (p1_g <= p2_g) { errorDiv.style.display = 'block'; errorDiv.innerHTML = "Upstream Pressure (P₁) must be greater than Downstream Pressure (P₂) for flow to occur."; return; } // 3. Convert Units for Weymouth Equation // Pressure: Convert psig to psia (Absolute Pressure) var patm = 14.7; // Atmospheric pressure var p1_abs = p1_g + patm; var p2_abs = p2_g + patm; // Temperature: Convert Fahrenheit to Rankine var t_r = t_f + 460; // Length: Convert feet to miles var l_miles = l_ft / 5280; // Constants for Standard Conditions (60F, 14.73 psia) var tb = 520; // Base temperature (Rankine) var pb = 14.73; // Base pressure (psia) var e = 1.0; // Efficiency factor (assumed 1.0 for new pipe) var z = 0.9; // Compressibility factor (average approximation) // 4. Calculate using Weymouth Equation // Formula: Q = 433.5 * E * (Tb/Pb) * sqrt( (P1^2 – P2^2) / (G * T * L * Z) ) * D^2.667 var pressureTerm = (Math.pow(p1_abs, 2) – Math.pow(p2_abs, 2)); var denominatorTerm = sg * t_r * l_miles * z; var radicalTerm = Math.sqrt(pressureTerm / denominatorTerm); var diameterTerm = Math.pow(d, 2.667); var constantTerm = 433.5 * e * (tb / pb); var q_scfd = constantTerm * radicalTerm * diameterTerm; // 5. Format and Display Result var formattedResult = Math.round(q_scfd).toLocaleString('en-US'); document.getElementById('flowResult').innerHTML = formattedResult; resultDiv.style.display = 'block'; }

Leave a Comment