function toggleFlowInputs() {
var method = document.getElementById('calcMethod').value;
var volDiv = document.getElementById('volumeTimeInputs');
var pipeDiv = document.getElementById('pipeVelocityInputs');
if (method === 'volume') {
volDiv.style.display = 'block';
pipeDiv.style.display = 'none';
} else {
volDiv.style.display = 'none';
pipeDiv.style.display = 'block';
}
// Hide result when switching to avoid confusion
document.getElementById('flowResult').style.display = 'none';
}
function calculateFlowRate() {
var method = document.getElementById('calcMethod').value;
var gpm = 0;
var details = "";
var resultBox = document.getElementById('flowResult');
var resultText = document.getElementById('resultGPM');
var resultDetails = document.getElementById('resultDetails');
if (method === 'volume') {
var volume = parseFloat(document.getElementById('inputVolume').value);
var seconds = parseFloat(document.getElementById('inputTime').value);
if (isNaN(volume) || isNaN(seconds) || seconds <= 0) {
alert("Please enter a valid volume and a time greater than zero.");
return;
}
// Formula: GPM = (Volume / Time in Seconds) * 60
gpm = (volume / seconds) * 60;
details = volume + " gallons in " + seconds + " seconds.";
} else {
var diameter = parseFloat(document.getElementById('inputDiameter').value);
var velocity = parseFloat(document.getElementById('inputVelocity').value);
if (isNaN(diameter) || isNaN(velocity) || diameter <= 0) {
alert("Please enter a valid pipe diameter and velocity.");
return;
}
// Formula: GPM = 2.448 * Diameter^2 * Velocity
// Diameter in inches, Velocity in ft/sec
gpm = 2.448 * Math.pow(diameter, 2) * velocity;
details = diameter + "\" pipe at " + velocity + " ft/sec.";
}
// Display results rounded to 2 decimal places
resultBox.style.display = 'block';
resultText.innerHTML = gpm.toFixed(2) + " GPM";
resultDetails.innerHTML = "Based on: " + details;
}
Understanding Flow Rate (GPM)
Flow rate is a critical measurement in fluid dynamics, plumbing, irrigation, and industrial applications. It represents the volume of fluid that passes through a specific point within a given timeframe. In the United States, this is most commonly measured in Gallons Per Minute (GPM).
How to Calculate Flow Rate
There are two primary ways to determine the flow rate of a liquid, depending on the data you have available. Our calculator above handles both scenarios.
Method 1: The Bucket Test (Volume & Time)
This is the most practical method for measuring flow rate from a faucet, hose, or showerhead. By measuring how long it takes to fill a container of known volume, you can determine the average flow rate.
If measuring time in seconds (as our calculator allows), the formula becomes:
GPM = (Volume / Seconds) × 60
Example: If it takes 15 seconds to fill a 5-gallon bucket, the calculation is: (5 / 15) × 60 = 20 GPM.
Method 2: Pipe Dimensions & Velocity
In engineering and system design, flow rate is often calculated theoretically based on the size of the pipe and the velocity at which the fluid is moving. This assumes the pipe is flowing full.
Formula:
$$ \text{GPM} = 2.448 \times d^2 \times v $$
d: The inner diameter of the pipe in inches.
v: The velocity of the fluid in feet per second (ft/sec).
2.448: A constant conversion factor derived from converting cubic feet per second to gallons per minute.
Example: A 2-inch pipe with water flowing at 4 ft/sec would deliver approximately:
2.448 × (2)² × 4 = 39.17 GPM.
Typical Flow Rates for Common Applications
Bathroom Faucet: 0.5 to 1.5 GPM
Showerhead: 1.5 to 2.5 GPM
Garden Hose: 9 to 17 GPM
Fire Hose (1.5″): 95 to 125 GPM
Fire Hydrant: 500 to 1,500+ GPM
Why is Flow Rate Important?
Irrigation: Knowing your GPM ensures you don't install more sprinkler heads than your water supply can support, which would lead to low pressure and poor coverage.
Plumbing Sizing: Correctly estimating peak flow rate demand is essential for sizing pipes to prevent excessive pressure loss and noise (water hammer).
Pump Selection: When buying a sump pump or pool pump, the GPM rating determines how quickly the pump can move water against gravity and friction.