Please enter valid positive numbers for diameter and velocity.
Calculated Flow Rate
Liters per Minute:–
Cubic Meters per Hour:–
US Gallons per Minute (GPM):–
Liters per Second:–
function calculatePipeFlow() {
// 1. Get DOM elements
var idInput = document.getElementById('pipe_id');
var idUnit = document.getElementById('id_unit');
var velInput = document.getElementById('velocity');
var velUnit = document.getElementById('vel_unit');
var errorDiv = document.getElementById('flow_error');
var resultBox = document.getElementById('flow_results');
// 2. Parse values
var d = parseFloat(idInput.value);
var v = parseFloat(velInput.value);
// 3. Validation
if (isNaN(d) || isNaN(v) || d <= 0 || v < 0) {
errorDiv.style.display = 'block';
resultBox.style.display = 'none';
return;
}
errorDiv.style.display = 'none';
resultBox.style.display = 'block';
// 4. Normalize to SI Units (Meters and Meters/Second)
var diameterInMeters = 0;
if (idUnit.value === 'mm') {
diameterInMeters = d / 1000;
} else if (idUnit.value === 'cm') {
diameterInMeters = d / 100;
} else if (idUnit.value === 'inch') {
diameterInMeters = d * 0.0254;
} else if (idUnit.value === 'm') {
diameterInMeters = d;
}
var velocityInMs = 0;
if (velUnit.value === 'ms') {
velocityInMs = v;
} else if (velUnit.value === 'fts') {
velocityInMs = v * 0.3048;
}
// 5. Calculate Area (A = pi * r^2 = pi * (d/2)^2)
var radius = diameterInMeters / 2;
var area = Math.PI * Math.pow(radius, 2);
// 6. Calculate Flow Rate (Q = A * v) in Cubic Meters per Second (m3/s)
var flowM3s = area * velocityInMs;
// 7. Conversions
var flowLps = flowM3s * 1000; // Liters per second
var flowLpm = flowLps * 60; // Liters per minute
var flowM3h = flowM3s * 3600; // Cubic meters per hour
var flowGpm = flowLpm / 3.78541178; // US Gallons per minute
// 8. Output Results with formatting
document.getElementById('res_lpm').innerText = flowLpm.toFixed(2) + " L/min";
document.getElementById('res_m3h').innerText = flowM3h.toFixed(2) + " m³/h";
document.getElementById('res_gpm').innerText = flowGpm.toFixed(2) + " GPM";
document.getElementById('res_lps').innerText = flowLps.toFixed(4) + " L/s";
}
How to Calculate Flow Rate from Pipe Size
Calculating the flow rate of a fluid through a pipe is a fundamental task in hydraulic engineering, plumbing, and irrigation. By knowing the pipe's size (specifically its inner diameter) and the velocity at which the fluid is traveling, you can determine exactly how much volume is being moved over time.
The Flow Rate Formula
The calculation relies on the continuity equation for incompressible fluids. The formula is simple but powerful:
Q = A × v
Q = Volumetric Flow Rate (e.g., m³/s, GPM)
A = Cross-sectional Area of the pipe
v = Velocity of the fluid
Step-by-Step Calculation Guide
To perform this calculation manually, follow these steps used by our calculator above:
Determine the Inner Diameter (ID): It is crucial to use the inner diameter, not the outer diameter (OD). Pipe schedules (like Schedule 40 or 80) affect wall thickness and consequently the ID.
Calculate the Cross-Sectional Area (A):
Using the diameter (d), the area formula is: A = π × (d / 2)² or A = (π × d²) / 4. Note: Ensure your diameter is converted to the same base unit as your velocity (e.g., meters).
Multiply Area by Velocity:
If your Area is in square meters (m²) and Velocity is in meters per second (m/s), the result is cubic meters per second (m³/s).
Convert to Desired Units:
Flow rates are often more readable in Liters per Minute (L/min) or Gallons per Minute (GPM) rather than cubic meters per second.
Example Calculation
Let's say you have a pipe with an inner diameter of 50mm (approx 2 inches) and water flowing at 2 m/s.
Convert 50mm to meters: 0.05 m.
Calculate Radius: 0.05 / 2 = 0.025 m.
Calculate Area: π × 0.025² ≈ 0.001963 m².
Calculate Flow (Q): 0.001963 m² × 2 m/s ≈ 0.003927 m³/s.
Convert to Liters/min: 0.003927 × 60,000 ≈ 235.6 L/min.
Why Velocity Matters
While you can increase flow rate by increasing pipe size, velocity is limited by physical constraints. High velocities cause:
Increased Friction Loss: More energy is required to push the fluid.
Water Hammer: Risk of damage when valves close suddenly.
Pipe Erosion: Physical wear on the pipe walls.
Typical design velocities for water are often kept between 1.5 m/s and 2.5 m/s (approx 5 to 8 ft/s) to balance efficiency and safety.