Calculate Flow Rate of Pipe

Pipe Flow Rate Calculator /* Base Styles */ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #333; max-width: 100%; margin: 0; padding: 0; } .calculator-wrapper { max-width: 800px; margin: 20px auto; padding: 20px; background-color: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); } .calc-title { text-align: center; color: #2c3e50; margin-bottom: 25px; font-size: 24px; font-weight: 700; } /* Input Grid */ .input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; } @media (max-width: 600px) { .input-grid { grid-template-columns: 1fr; } } /* Form Elements */ .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #555; } .input-group { display: flex; } .form-control { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; transition: border-color 0.3s; } .form-control:focus { border-color: #0073aa; outline: none; } .unit-select { width: 120px; margin-left: -1px; border-radius: 0 4px 4px 0; background-color: #eee; border: 1px solid #ccc; padding: 12px; font-size: 14px; } .input-with-unit { border-radius: 4px 0 0 4px; } /* Button */ .btn-calculate { display: block; width: 100%; background-color: #0073aa; color: white; border: none; padding: 15px; font-size: 18px; font-weight: bold; border-radius: 4px; cursor: pointer; transition: background-color 0.3s; margin-top: 10px; } .btn-calculate:hover { background-color: #005177; } /* Results */ .results-container { margin-top: 25px; background-color: #ffffff; border: 1px solid #ddd; border-radius: 6px; padding: 20px; display: none; /* Hidden by default */ } .results-header { text-align: center; margin-bottom: 15px; font-weight: 700; font-size: 18px; color: #2c3e50; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; } .result-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0f0; } .result-row:last-child { border-bottom: none; } .result-label { color: #666; font-size: 15px; } .result-value { font-weight: 700; color: #2c3e50; font-size: 18px; } .primary-result { background-color: #e8f4fc; padding: 15px; border-radius: 6px; text-align: center; margin-bottom: 15px; } .primary-result .result-value { font-size: 28px; color: #0073aa; } /* Content Styles */ .content-section { max-width: 800px; margin: 40px auto; padding: 0 20px; } .content-section h2 { color: #2c3e50; margin-top: 30px; } .content-section p, .content-section ul { color: #444; margin-bottom: 15px; } .content-section li { margin-bottom: 8px; } .formula-box { background: #f1f1f1; padding: 15px; border-left: 4px solid #0073aa; font-family: monospace; margin: 20px 0; font-size: 16px; }
Pipe Flow Rate Calculator
Inches (in) Millimeters Centimeters Meters
m/s ft/s
Calculation Results
Volumetric Flow Rate (GPM)
0.00 GPM
Liters per Minute 0.00 L/min
Cubic Meters per Hour 0.00 m³/h
Cubic Feet per Second 0.00 cfs
Pipe Cross-Section Area 0.00 cm²
function calculatePipeFlow() { // 1. Get Input Values var diameterInput = document.getElementById("innerDiameter").value; var diameterUnit = document.getElementById("diameterUnit").value; var velocityInput = document.getElementById("fluidVelocity").value; var velocityUnit = document.getElementById("velocityUnit").value; // 2. Validate Inputs if (diameterInput === "" || velocityInput === "" || isNaN(diameterInput) || isNaN(velocityInput)) { alert("Please enter valid numerical values for both Pipe Diameter and Fluid Velocity."); return; } var diameter = parseFloat(diameterInput); var velocity = parseFloat(velocityInput); if (diameter <= 0 || velocity < 0) { alert("Diameter must be greater than 0 and velocity cannot be negative."); return; } // 3. Normalize Inputs to Standard Units (Meters for length, m/s for velocity) // Convert Diameter to Meters var diameterInMeters = 0; if (diameterUnit === "mm") { diameterInMeters = diameter / 1000; } else if (diameterUnit === "cm") { diameterInMeters = diameter / 100; } else if (diameterUnit === "m") { diameterInMeters = diameter; } else if (diameterUnit === "in") { diameterInMeters = diameter * 0.0254; } // Convert Velocity to Meters per Second (m/s) var velocityInMPS = 0; if (velocityUnit === "m/s") { velocityInMPS = velocity; } else if (velocityUnit === "ft/s") { velocityInMPS = velocity * 0.3048; } // 4. Calculate Area (A = pi * r^2) var radius = diameterInMeters / 2; var areaM2 = Math.PI * Math.pow(radius, 2); // 5. Calculate Flow Rate (Q = A * v) in Cubic Meters per Second (m³/s) var flowMPS = areaM2 * velocityInMPS; // 6. Convert Results to Target Units // Cubic Meters per Hour (m³/h) var flowCMH = flowMPS * 3600; // Liters per Minute (L/min) // 1 m³/s = 60,000 L/min var flowLPM = flowMPS * 60000; // US Gallons per Minute (GPM) // 1 m³/s = 15,850.32314 GPM var flowGPM = flowMPS * 15850.32314; // Cubic Feet per Second (cfs) // 1 m³/s = 35.3147 cfs var flowCFS = flowMPS * 35.3147; // Area in cm² for display var areaCM2 = areaM2 * 10000; // 7. Display Results with Formatting document.getElementById("resultGPM").innerHTML = flowGPM.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) + " US GPM"; document.getElementById("resultLPM").innerHTML = flowLPM.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) + " L/min"; document.getElementById("resultCMH").innerHTML = flowCMH.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) + " m³/h"; document.getElementById("resultCFS").innerHTML = flowCFS.toLocaleString(undefined, {minimumFractionDigits: 3, maximumFractionDigits: 3}) + " ft³/s"; document.getElementById("resultArea").innerHTML = areaCM2.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) + " cm²"; // Show result container document.getElementById("resultsArea").style.display = "block"; }

How to Calculate Flow Rate in a Pipe

Understanding the flow rate of fluids through a pipe is critical for engineering, plumbing, irrigation, and industrial processes. Whether you are sizing a pump for a swimming pool or designing a municipal water system, knowing how to determine the volumetric flow rate ensures your system operates efficiently and safely.

This calculator determines the Volumetric Flow Rate (Q) based on the physical dimensions of the pipe and the speed at which the fluid is traveling.

The Flow Rate Formula

The fundamental equation for calculating the flow rate of fluid moving through a pipe is derived from the continuity equation:

Q = A × v

Where:

  • Q = Volumetric Flow Rate (e.g., m³/s, GPM)
  • A = Cross-Sectional Area of the pipe
  • v = Average Velocity of the fluid

Step-by-Step Calculation Logic

To perform this calculation manually, follow these steps:

  1. Determine the Inner Diameter (ID): Always use the inner diameter of the pipe, not the outer diameter (OD). The wall thickness of the pipe reduces the available area for flow.
  2. Calculate the Cross-Sectional Area (A): Since pipes are circular, the area is calculated using the formula A = π × r² or A = π × (d/2)².
    Note: Ensure your units match. If diameter is in inches, convert to feet or meters first for easier calculation.
  3. Measure Fluid Velocity (v): This is the speed at which the water or fluid travels through the pipe, typically measured in meters per second (m/s) or feet per second (ft/s).
  4. Multiply Area by Velocity: The result will be your flow volume per unit of time.

Why Inner Diameter Matters

A common mistake when calculating flow rate is using the "Nominal Pipe Size" (NPS) without accounting for the pipe schedule (wall thickness). For example, a "2-inch" Schedule 40 pipe actually has an inner diameter of approximately 2.067 inches, while a Schedule 80 pipe of the same nominal size has a thicker wall and an inner diameter of approximately 1.939 inches. This calculator allows you to input the exact inner diameter for precision.

Common Unit Conversions

Flow rate is expressed in many different units depending on the industry:

  • GPM (Gallons Per Minute): Standard in the US for plumbing and pumps.
  • L/min (Liters Per Minute): Common in Europe and scientific applications.
  • m³/h (Cubic Meters per Hour): Often used for large-scale industrial water treatment or HVAC systems.

Our tool automatically converts the base calculation into these standard units to save you time and prevent conversion errors.

Leave a Comment