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;
background-color: #f9f9f9;
}
.calculator-container {
background: #ffffff;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 25px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
margin-bottom: 30px;
}
.calculator-title {
margin-top: 0;
margin-bottom: 20px;
color: #0056b3;
text-align: center;
font-size: 24px;
border-bottom: 2px solid #0056b3;
padding-bottom: 10px;
}
.input-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
@media (max-width: 600px) {
.input-grid {
grid-template-columns: 1fr;
}
}
.input-group {
margin-bottom: 15px;
}
.input-group label {
display: block;
margin-bottom: 5px;
font-weight: 600;
font-size: 14px;
color: #444;
}
.input-group input, .input-group select {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
}
.input-group input:focus {
border-color: #0056b3;
outline: none;
}
.calc-btn {
width: 100%;
padding: 12px;
background-color: #0056b3;
color: white;
border: none;
border-radius: 4px;
font-size: 18px;
font-weight: bold;
cursor: pointer;
transition: background 0.3s;
margin-top: 10px;
}
.calc-btn:hover {
background-color: #004494;
}
.results-area {
margin-top: 25px;
background-color: #f0f7ff;
border: 1px solid #cce5ff;
border-radius: 4px;
padding: 20px;
display: none;
}
.result-row {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
border-bottom: 1px solid #e0ecf8;
padding-bottom: 5px;
}
.result-row:last-child {
border-bottom: none;
margin-bottom: 0;
font-weight: bold;
color: #0056b3;
font-size: 1.1em;
}
.result-label {
color: #555;
}
.result-value {
font-weight: bold;
color: #333;
}
.article-content h2 {
color: #2c3e50;
margin-top: 30px;
border-left: 5px solid #0056b3;
padding-left: 15px;
}
.article-content p {
margin-bottom: 15px;
}
.article-content ul {
margin-bottom: 20px;
padding-left: 20px;
}
.note {
font-size: 12px;
color: #666;
margin-top: 5px;
}
function calculateHead() {
// 1. Get Inputs
var flowRate = parseFloat(document.getElementById('flowRate').value);
var staticHead = parseFloat(document.getElementById('staticHead').value);
var pipeDia = parseFloat(document.getElementById('pipeDiameter').value);
var pipeLen = parseFloat(document.getElementById('pipeLength').value);
var cFactor = parseFloat(document.getElementById('pipeMaterial').value);
var numElbows = parseFloat(document.getElementById('elbows').value);
var pressurePsi = parseFloat(document.getElementById('dischargePressure').value);
// Validation
if (isNaN(flowRate) || isNaN(staticHead) || isNaN(pipeDia) || isNaN(pipeLen) || pipeDia <= 0) {
alert("Please enter valid numeric values. Pipe diameter must be greater than 0.");
return;
}
if (isNaN(numElbows)) numElbows = 0;
if (isNaN(pressurePsi)) pressurePsi = 0;
// 2. Calculate Velocity (ft/sec)
// Formula: V = (0.4085 * GPM) / d^2
var velocity = (0.4085 * flowRate) / (pipeDia * pipeDia);
// 3. Calculate Equivalent Length of Fittings
// Rule of thumb: Standard elbow length approx 30 diameters
// L_eq = (numElbows * 30 * diameter_in_inches) / 12 (to convert to feet)
var elbowEqLen = (numElbows * 30 * pipeDia) / 12;
var totalEqLen = pipeLen + elbowEqLen;
// 4. Calculate Friction Head Loss (Hazen-Williams Equation)
// hf = 0.2083 * (100/C)^1.85 * (Q^1.85 / d^4.8655) per 100 ft
var coeff = 0.2083 * Math.pow((100 / cFactor), 1.85);
var flowPart = Math.pow(flowRate, 1.85);
var diaPart = Math.pow(pipeDia, 4.8655);
var frictionPer100 = coeff * (flowPart / diaPart);
var totalFrictionLoss = (frictionPer100 / 100) * totalEqLen;
// 5. Convert PSI to Head
// 1 PSI = 2.31 Feet of Head (for water/sg=1.0)
var pressureHead = pressurePsi * 2.31;
// 6. Total Dynamic Head (TDH)
var tdh = staticHead + totalFrictionLoss + pressureHead;
// 7. Power Calculation
// Water Horsepower (WHP) = (GPM * TDH) / 3960
var whp = (flowRate * tdh) / 3960;
// Brake Horsepower (BHP) estimating 70% pump efficiency
var bhp = whp / 0.70;
// 8. Display Results
document.getElementById('resVelocity').innerText = velocity.toFixed(2) + " ft/s";
document.getElementById('resFriction').innerText = totalFrictionLoss.toFixed(2) + " ft";
document.getElementById('resPressure').innerText = pressureHead.toFixed(2) + " ft";
document.getElementById('resTDH').innerText = tdh.toFixed(1) + " ft";
document.getElementById('resWHP').innerText = whp.toFixed(3) + " HP";
document.getElementById('resBHP').innerText = bhp.toFixed(3) + " HP";
document.getElementById('results').style.display = 'block';
}
Understanding Pump Head and Flow Rate
Selecting the right pump for your plumbing, irrigation, or HVAC system requires understanding two critical variables: Flow Rate (measured in GPM) and Total Dynamic Head (TDH, measured in feet). A pump does not simply create pressure; it creates flow by overcoming the resistance (head) in the system.
This calculator determines the Total Dynamic Head required to push a specific volume of water through your piping system, taking into account gravity, friction, and pressure requirements.
Key Concepts in Pump Sizing
1. Static Head (Elevation)
Static head is the vertical distance the water must be lifted. It is the measurement from the surface of the water source to the highest point of discharge. Horizontal distance does not affect static head, though it does contribute to friction loss.
2. Friction Head Loss
As water moves through pipes, it encounters resistance against the pipe walls. This resistance is known as friction loss. Several factors influence this:
- Flow Rate: The faster the water moves, the higher the friction.
- Pipe Diameter: Smaller pipes create significantly more resistance than larger pipes.
- Pipe Material: Smooth PVC has less friction (C-Factor 150) than old rusty steel (C-Factor 100).
- Fittings: Elbows and valves create turbulence, adding "equivalent length" to your pipe run.
3. Pressure Head
If your system requires a specific pressure at the end (e.g., for sprinkler heads or a pressure tank), this PSI must be converted into feet of head. For water, 1 PSI = 2.31 feet of head. This calculator automatically performs this conversion.
How to Read a Pump Curve
Once you calculate your TDH and know your desired Flow Rate (GPM), you can consult a manufacturer's Pump Curve.
- Find your calculated TDH on the vertical axis (Y-axis) of the chart.
- Move horizontally to the right until you intersect the curve.
- Look down to the horizontal axis (X-axis) to see the Flow Rate that pump can deliver at that specific head.
If the intersection point is below your desired flow rate, the pump is undersized. If it is significantly above, the pump may be oversized, leading to inefficiency or cavitation.
Example Calculation
Imagine you need to pump 50 GPM of water up a hill with a vertical rise of 20 feet.
- Pipe: 100 feet of 2-inch PVC.
- Fittings: 4 elbows.
- Pressure: Open discharge (0 PSI).
Using the calculator above, you would find that friction adds approximately 7.5 feet of head (depending on exact fittings). The Total Dynamic Head would be roughly 27.5 feet. You would then look for a pump capable of 50 GPM at 28 feet of head.