Determine the optimal pump specifications for your fluid system needs.
Pump Sizing Calculator
Enter the desired flow rate for your system.
Gallons Per Minute (GPM)
Liters Per Minute (LPM)
Cubic Meters Per Hour (m³/h)
Enter the total head the pump needs to overcome.
Feet (ft)
Meters (m)
Pounds Per Square Inch (PSI)
SG of water is 1.0. Adjust for other fluids (e.g., oil is ~0.9).
Enter the expected efficiency of the pump (e.g., 75%).
Enter the expected efficiency of the motor driving the pump (e.g., 90%).
Your Pump Sizing Results
—
Flow Rate: —
Total Head: —
Brake Horsepower (BHP): —
Pump Horsepower (PHP): —
Formula used: Brake Horsepower (BHP) = (Flow Rate (GPM) * Total Head (ft) * Specific Gravity) / (3960 * Pump Efficiency)
Key Assumptions:
Flow Rate Unit: —
Head Unit: —
Fluid Specific Gravity: —
Pump Efficiency: —
Motor Efficiency: —
Pump Performance Data
Pump Performance Table
Flow Rate (GPM)
Total Head (ft)
Brake Horsepower (BHP)
Pump Horsepower (PHP)
Pump Sizing Chart
Pump Performance Curve
■ Head vs. Flow Rate |
■ Power Consumption
What is Pump Sizing?
Pump sizing is the critical process of selecting a pump that meets the specific operational requirements of a fluid handling system. It involves calculating the necessary flow rate and the total dynamic head (TDH) the pump must overcome. Proper pump sizing ensures that the system operates efficiently, reliably, and economically. An undersized pump may fail to deliver the required flow or pressure, leading to system underperformance or complete failure. Conversely, an oversized pump can lead to excessive energy consumption, premature wear, cavitation, and potentially higher initial costs. This makes accurate pump sizing a foundational step in designing, installing, or upgrading any fluid transfer system, whether for industrial, commercial, or residential applications.
This pump sizing calculator is designed for engineers, facility managers, contractors, and anyone involved in fluid systems who needs to determine the appropriate pump specifications. It simplifies the complex calculations required to ensure your pump is not just functional, but optimal for its intended purpose.
A common misconception is that simply choosing the largest available pump is the safest bet. However, this often leads to inefficiencies and operational problems. Another misconception is that all pumps of the same type perform identically; pump efficiency can vary significantly between models and manufacturers, impacting energy usage and operational costs over time. Understanding these nuances is key to effective pump sizing.
Pump Sizing Formula and Mathematical Explanation
The core of pump sizing involves calculating the power required to move a fluid at a specific flow rate against a certain head. The primary metric we calculate is Brake Horsepower (BHP), which is the actual horsepower delivered to the pump shaft by the motor.
The formula for Brake Horsepower (BHP) is derived from fundamental fluid dynamics and power calculations. It accounts for the work done to lift the fluid (head), the volume of fluid moved (flow rate), the fluid's density (represented by specific gravity), and the inefficiencies in the pump and motor.
Formula for Brake Horsepower (BHP):
BHP = (Q * H * SG) / (3960 * η_pump * η_motor)
Where:
Q is the Flow Rate in Gallons Per Minute (GPM).
H is the Total Dynamic Head in Feet (ft).
SG is the Specific Gravity of the fluid (unitless).
3960 is a conversion factor to yield horsepower when Q is in GPM and H is in ft.
η_pump is the Pump Efficiency (as a decimal, e.g., 0.75 for 75%).
η_motor is the Motor Efficiency (as a decimal, e.g., 0.90 for 90%).
We also calculate Pump Horsepower (PHP), which is the hydraulic power output of the pump itself, before motor inefficiencies:
PHP = (Q * H * SG) / (3960 * η_pump)
The calculator first converts all input units (flow and head) to the standard units (GPM and ft) for the formula, then applies the calculation.
Variables and Their Meanings
Variable
Meaning
Unit
Typical Range
Flow Rate (Q)
Volume of fluid passing a point per unit time.
GPM, LPM, m³/h
1 – 10000+
Total Dynamic Head (TDH)
The total equivalent height that a fluid is to be pumped, accounting for friction losses and velocity head.
ft, m, PSI
1 – 1000+
Specific Gravity (SG)
Ratio of the fluid's density to the density of water at a specified temperature.
Unitless
0.7 – 2.0 (for common liquids)
Pump Efficiency (η_pump)
Ratio of hydraulic power output to mechanical power input to the pump.
%
50% – 90%
Motor Efficiency (η_motor)
Ratio of mechanical power output from the motor to electrical power input.
%
85% – 97%
Brake Horsepower (BHP)
Power required at the pump shaft.
HP
Calculated
Pump Horsepower (PHP)
Hydraulic power output of the pump.
HP
Calculated
Practical Examples (Real-World Use Cases)
Example 1: Residential Well Pump Sizing
Scenario: A homeowner needs to pump water from a well to their house. The system requires a flow rate of 15 GPM to meet peak demand for bathrooms and appliances. The vertical lift from the water level to the pressure tank is 80 feet, and friction losses in the piping add an additional 10 feet of head. The fluid is water (SG = 1.0). The selected submersible pump has an efficiency of 60%, and the associated motor has an efficiency of 85%.
Inputs:
Flow Rate: 15 GPM
Total Head: 90 ft (80 ft lift + 10 ft friction)
Fluid Specific Gravity: 1.0
Pump Efficiency: 60%
Motor Efficiency: 85%
Calculation:
PHP = (15 GPM * 90 ft * 1.0) / (3960 * 0.60) ≈ 0.57 HP
BHP = (15 GPM * 90 ft * 1.0) / (3960 * 0.60 * 0.85) ≈ 0.67 HP
Interpretation: The system requires approximately 0.67 HP at the pump shaft. A standard 3/4 HP motor would likely be suitable, providing a small buffer. The pump itself needs to be capable of delivering 15 GPM at 90 ft of head with 60% efficiency. Proper pump sizing ensures consistent water supply.
Example 2: Agricultural Irrigation System
Scenario: An agricultural farm needs to irrigate a field using a pump. The system requires a flow rate of 500 GPM to cover the irrigation area adequately. The total dynamic head, considering elevation changes and pipe friction, is calculated to be 120 ft. The fluid is water (SG = 1.0). A high-efficiency pump is chosen with 80% efficiency, coupled with a 92% efficient motor.
Inputs:
Flow Rate: 500 GPM
Total Head: 120 ft
Fluid Specific Gravity: 1.0
Pump Efficiency: 80%
Motor Efficiency: 92%
Calculation:
PHP = (500 GPM * 120 ft * 1.0) / (3960 * 0.80) ≈ 18.94 HP
BHP = (500 GPM * 120 ft * 1.0) / (3960 * 0.80 * 0.92) ≈ 20.59 HP
Interpretation: The pump requires approximately 20.59 HP delivered to its shaft. This means a motor of at least 25 HP would typically be selected to provide adequate power and a safety margin. The pump must be selected from a performance curve that shows it can deliver 500 GPM at 120 ft head while operating at 80% efficiency. This level of detail in pump sizing is crucial for sustained agricultural productivity.
How to Use This Pump Sizing Calculator
Using this pump sizing calculator is straightforward and designed to provide quick, accurate results. Follow these steps:
Determine Required Flow Rate: Identify the maximum volume of fluid (e.g., water, oil, chemicals) your system needs to move per unit of time. This is often dictated by the application, such as filling a tank, supplying a process, or irrigating an area.
Select Flow Rate Unit: Choose the unit that matches your requirement (GPM, LPM, or m³/h). The calculator will convert this to GPM for the internal calculations.
Calculate Total Dynamic Head (TDH): This is the total equivalent height the pump must overcome. It includes:
Static Lift: The vertical distance from the fluid source to the highest point of discharge.
Static Head: The vertical distance the fluid falls if discharging to a lower level.
Friction Head Loss: Resistance to flow within the pipes, fittings, and valves. This depends on pipe material, diameter, length, flow rate, and the number/type of fittings.
Pressure Head: If the discharge point is pressurized, this needs to be converted to an equivalent head (1 PSI ≈ 2.31 ft of water).
Sum these components to get your TDH.
Select Head Unit: Choose the unit for your TDH measurement (feet, meters, or PSI). The calculator will convert it to feet for the internal formula.
Input Fluid Specific Gravity (SG): For water, use 1.0. For other fluids, find their specific gravity relative to water. A higher SG means the fluid is denser, requiring more power.
Enter Efficiencies: Input the manufacturer's rated efficiency for the pump (as a percentage) and the motor (as a percentage). Higher efficiencies lead to lower energy consumption.
Click 'Calculate Pump Size': The calculator will instantly display the required Pump Horsepower (PHP), Brake Horsepower (BHP), and confirm your input flow rate and total head.
Reading Results:
Main Result (BHP): This is the critical value representing the actual power needed at the pump shaft. You'll use this to select an appropriately sized motor.
Intermediate Values: PHP shows the hydraulic power, useful for understanding pump efficiency. The displayed Flow Rate and Total Head confirm your inputs were processed correctly.
Key Assumptions: Review these to ensure the calculator used the correct units and fluid properties for your scenario.
Decision-Making: The BHP calculated is the minimum power required. It's standard practice to select a motor that is one size larger than the calculated BHP (e.g., if BHP is 18 HP, choose a 20 or 25 HP motor) to handle startup torque and ensure longevity. The calculated PHP helps in selecting a pump model that operates at its Best Efficiency Point (BEP) for your specific flow and head requirements. For more detailed analysis, consult pump performance curves and consider factors like system curves.
Key Factors That Affect Pump Sizing Results
Several factors significantly influence the outcome of pump sizing calculations and the ultimate selection of a pump. Understanding these is crucial for a reliable and efficient system:
Flow Rate Variability: Many systems do not operate at a single, constant flow rate. Demand can fluctuate throughout the day or seasonally. Your sizing should accommodate the peak required flow rate, but consider variable speed drives (VSDs) for systems with wide flow ranges to optimize energy use.
System Curve Accuracy: The accuracy of your calculated Total Dynamic Head (TDH) is paramount. Incorrect estimation of friction losses (due to wrong pipe length, diameter, fittings, or flow rate) or static head will lead to incorrect pump sizing. Always consult friction loss charts or use engineering software for precise calculations.
Fluid Properties: Beyond specific gravity, factors like viscosity, temperature, and the presence of solids or abrasives are critical. Highly viscous fluids require significantly more power and may necessitate different pump types (e.g., positive displacement pumps instead of centrifugal). Abrasive fluids can increase wear, reducing pump efficiency over time and requiring specific material selections.
Pump and Motor Efficiencies: Efficiencies vary greatly between pump models, operating points, and manufacturers. Always use the rated efficiencies for the specific pump and motor you are considering. Operating a pump far from its Best Efficiency Point (BEP) drastically reduces its efficiency, increasing energy costs and potentially causing operational issues like cavitation or recirculation.
NPSHa vs. NPSHr (Cavitation Potential): Net Positive Suction Head Available (NPSHa) is the absolute pressure available at the pump suction, while Net Positive Suction Head Required (NPSHr) is the minimum head the pump needs to avoid cavitation. If NPSHa is less than NPSHr, the pump will cavitate, leading to noise, vibration, and damage. Proper pump sizing includes ensuring adequate NPSHa, often influenced by fluid temperature and suction piping design.
Future System Modifications: Consider potential future changes to the system, such as increased flow requirements, higher discharge heads, or changes in fluid type. Sizing a pump with some future capacity or selecting a pump that can be easily upgraded can save costs in the long run. Consulting pump performance data helps assess this.
Operating Costs and Energy Consumption: While initial cost is a factor, the long-term energy consumption often dominates the total cost of ownership. A slightly more expensive, higher-efficiency pump can result in substantial savings over its operational life. Careful pump sizing based on accurate efficiency data is key to minimizing operational expenses.
Frequently Asked Questions (FAQ)
What is the difference between Pump Horsepower (PHP) and Brake Horsepower (BHP)?
Pump Horsepower (PHP) is the hydraulic power delivered by the pump to the fluid. Brake Horsepower (BHP) is the actual mechanical power required at the pump shaft, accounting for the pump's own internal inefficiencies. It's the power the motor must supply to the pump.
Can I use the calculator if my fluid is not water?
Yes, you can! You need to know the fluid's Specific Gravity (SG) relative to water. Enter this value in the 'Fluid Specific Gravity' field. For highly viscous fluids, this calculator might not be sufficient as viscosity significantly impacts friction losses and pump performance, potentially requiring different pump types and calculation methods.
What happens if I choose an oversized pump?
An oversized pump can lead to several issues: excessive energy consumption, reduced efficiency (especially if operating far from its Best Efficiency Point), increased wear and tear due to higher velocities, potential for cavitation if suction conditions are borderline, and higher initial purchase costs.
What happens if I choose an undersized pump?
An undersized pump will not deliver the required flow rate or meet the necessary head pressure. This results in system underperformance, inability to meet demand, and potential damage to the pump if it's forced to operate outside its design parameters for extended periods.
How do I calculate friction losses for the Total Dynamic Head?
Friction losses depend on flow rate, pipe diameter, pipe length, pipe material (roughness), and the number and type of fittings (elbows, valves, etc.). You can find friction loss charts or use online calculators specifically designed for fluid piping systems. Engineering handbooks like the Crane Technical Paper No. 410 are excellent resources.
What is the Best Efficiency Point (BEP)?
The BEP is the point on a pump's performance curve where the pump operates most efficiently. Ideally, your system's operating point (flow rate and head) should be close to the pump's BEP to minimize energy consumption and maximize pump lifespan. Proper pump sizing aims to match the system's needs to the pump's BEP.
Do I need to consider the motor size separately?
Yes. The calculator provides Brake Horsepower (BHP), which is the power required *at the pump shaft*. You use this BHP value to select an appropriately sized motor. It's standard practice to select a motor with a horsepower rating at least one standard size above the calculated BHP to ensure reliability and handle startup loads.
Can this calculator be used for gas or air systems?
This calculator is primarily designed for liquid systems (like water, oil, etc.). While principles of flow and pressure apply to gases, the calculation formulas, especially regarding compressible fluids and different efficiency metrics, differ significantly. For gas/air systems, you would need a specialized blower or compressor sizing tool.
Related Tools and Internal Resources
Fluid Friction Loss Calculator: Estimate the pressure drop due to friction in pipes, crucial for accurate TDH calculation. Learn More
System Curve Analysis Guide: Understand how to plot a system curve and pump curve to find the true operating point. Read Now
Cavitation Explained: Dive deeper into the causes, effects, and prevention of cavitation in pumping systems. Details Here
Pump Types Comparison: Explore the different types of pumps available (centrifugal, positive displacement, etc.) and their ideal applications. See Chart
Energy Efficiency in Pumping Systems: Tips and strategies for reducing energy consumption in fluid handling operations. Discover More
Variable Speed Drive (VSD) Benefits: Learn how VSDs can optimize performance and save energy in systems with variable demand. Full Article
var flowRateInput = document.getElementById("flowRate");
var flowUnitSelect = document.getElementById("flowUnit");
var totalHeadInput = document.getElementById("totalHead");
var headUnitSelect = document.getElementById("headUnit");
var fluidSgInput = document.getElementById("fluidSpecificGravity");
var pumpEffInput = document.getElementById("pumpEfficiency");
var motorEffInput = document.getElementById("motorEfficiency");
var flowRateError = document.getElementById("flowRateError");
var flowUnitError = document.getElementById("flowUnitError");
var totalHeadError = document.getElementById("totalHeadError");
var headUnitError = document.getElementById("headUnitError");
var fluidSgError = document.getElementById("fluidSpecificGravityError");
var pumpEffError = document.getElementById("pumpEfficiencyError");
var motorEffError = document.getElementById("motorEfficiencyError");
var mainResultDiv = document.getElementById("main-result");
var flowRateOutputDiv = document.getElementById("requiredFlowRateOutput");
var totalHeadOutputDiv = document.getElementById("totalHeadOutput");
var brakeHorsepowerOutputDiv = document.getElementById("brakeHorsepowerOutput");
var pumpHorsepowerOutputDiv = document.getElementById("pumpHorsepowerOutput");
var assumptionFlowRateDiv = document.getElementById("assumptionFlowRate");
var assumptionHeadDiv = document.getElementById("assumptionHead");
var assumptionFluidSGDiv = document.getElementById("assumptionFluidSG");
var assumptionPumpEffDiv = document.getElementById("assumptionPumpEff");
var assumptionMotorEffDiv = document.getElementById("assumptionMotorEff");
var performanceChart;
var chartContext;
function convertFlowRateToGPM(value, unit) {
if (unit === "lpm") {
return value * 0.264172;
} else if (unit === "m3h") {
return value * 4.40287;
}
return value; // Assume GPM
}
function convertHeadToFeet(value, unit) {
if (unit === "m") {
return value * 3.28084;
} else if (unit === "psi") {
return value * 2.31;
}
return value; // Assume Feet
}
function isValidNumber(value) {
return !isNaN(parseFloat(value)) && isFinite(value);
}
function validateInput(inputElement, errorElement, minValue = null, maxValue = null) {
var value = inputElement.value.trim();
var isValid = true;
if (value === "") {
errorElement.textContent = "This field is required.";
errorElement.style.display = "block";
isValid = false;
} else if (!isValidNumber(value)) {
errorElement.textContent = "Please enter a valid number.";
errorElement.style.display = "block";
isValid = false;
} else {
var numValue = parseFloat(value);
if (minValue !== null && numValue maxValue) {
errorElement.textContent = "Value cannot be greater than " + maxValue + ".";
errorElement.style.display = "block";
isValid = false;
} else {
errorElement.textContent = "";
errorElement.style.display = "none";
}
}
return isValid;
}
function calculatePumpSize() {
var errors = [];
errors.push(!validateInput(flowRateInput, flowRateError, 0.01));
errors.push(!validateInput(totalHeadInput, totalHeadError, 0.01));
errors.push(!validateInput(fluidSgInput, fluidSgError, 0.01));
errors.push(!validateInput(pumpEffInput, pumpEffError, 1, 100));
errors.push(!validateInput(motorEffInput, motorEffError, 1, 100));
if (errors.some(function(e) { return e === false; })) {
mainResultDiv.textContent = "Enter valid inputs";
return;
}
var flowRateGPM = convertFlowRateToGPM(parseFloat(flowRateInput.value), flowUnitSelect.value);
var totalHeadFeet = convertHeadToFeet(parseFloat(totalHeadInput.value), headUnitSelect.value);
var fluidSg = parseFloat(fluidSgInput.value);
var pumpEfficiencyPercent = parseFloat(pumpEffInput.value);
var motorEfficiencyPercent = parseFloat(motorEffInput.value);
var pumpEfficiencyDecimal = pumpEfficiencyPercent / 100;
var motorEfficiencyDecimal = motorEfficiencyPercent / 100;
// Calculate Pump Horsepower (PHP)
var php = (flowRateGPM * totalHeadFeet * fluidSg) / (3960 * pumpEfficiencyDecimal);
// Calculate Brake Horsepower (BHP)
var bhp = (flowRateGPM * totalHeadFeet * fluidSg) / (3960 * pumpEfficiencyDecimal * motorEfficiencyDecimal);
// Display results
mainResultDiv.textContent = bhp.toFixed(2) + " HP";
flowRateOutputDiv.textContent = "Flow Rate: " + parseFloat(flowRateInput.value).toFixed(2) + " " + flowUnitSelect.value;
totalHeadOutputDiv.textContent = "Total Head: " + parseFloat(totalHeadInput.value).toFixed(2) + " " + headUnitSelect.value;
brakeHorsepowerOutputDiv.textContent = "Brake Horsepower (BHP): " + bhp.toFixed(2) + " HP";
pumpHorsepowerOutputDiv.textContent = "Pump Horsepower (PHP): " + php.toFixed(2) + " HP";
// Display assumptions
assumptionFlowRateDiv.textContent = "Flow Rate Unit: " + flowUnitSelect.options[flowUnitSelect.selectedIndex].text;
assumptionHeadDiv.textContent = "Head Unit: " + headUnitSelect.options[headUnitSelect.selectedIndex].text;
assumptionFluidSGDiv.textContent = "Fluid Specific Gravity: " + fluidSg.toFixed(2);
assumptionPumpEffDiv.textContent = "Pump Efficiency: " + pumpEfficiencyPercent.toFixed(1) + "%";
assumptionMotorEffDiv.textContent = "Motor Efficiency: " + motorEfficiencyPercent.toFixed(1) + "%";
// Update tables and charts
updatePerformanceTable(flowRateGPM, totalHeadFeet, fluidSg, pumpEfficiencyDecimal, motorEfficiencyDecimal);
updateChart(flowRateGPM, totalHeadFeet, fluidSg, pumpEfficiencyDecimal, motorEfficiencyDecimal);
}
function resetCalculator() {
flowRateInput.value = "100";
flowUnitSelect.value = "gpm";
totalHeadInput.value = "50";
headUnitSelect.value = "ft";
fluidSgInput.value = "1.0";
pumpEffInput.value = "75";
motorEffInput.value = "90";
flowRateError.textContent = ""; flowRateError.style.display = "none";
totalHeadError.textContent = ""; totalHeadError.style.display = "none";
fluidSgError.textContent = ""; fluidSgError.style.display = "none";
pumpEffError.textContent = ""; pumpEffError.style.display = "none";
motorEffError.textContent = ""; motorEffError.style.display = "none";
mainResultDiv.textContent = "–";
flowRateOutputDiv.textContent = "Flow Rate: –";
totalHeadOutputDiv.textContent = "Total Head: –";
brakeHorsepowerOutputDiv.textContent = "Brake Horsepower (BHP): –";
pumpHorsepowerOutputDiv.textContent = "Pump Horsepower (PHP): –";
assumptionFlowRateDiv.textContent = "Flow Rate Unit: –";
assumptionHeadDiv.textContent = "Head Unit: –";
assumptionFluidSGDiv.textContent = "Fluid Specific Gravity: –";
assumptionPumpEffDiv.textContent = "Pump Efficiency: –";
assumptionMotorEffDiv.textContent = "Motor Efficiency: –";
// Clear table
document.getElementById("performanceTableBody").innerHTML = "";
// Clear chart
if (chartContext) {
chartContext.clearRect(0, 0, performanceChart.width, performanceChart.height);
}
}
function copyResults() {
var resultsText = "Pump Sizing Results:\n\n";
resultsText += "Required Flow Rate: " + flowRateOutputDiv.textContent + "\n";
resultsText += "Total Dynamic Head: " + totalHeadOutputDiv.textContent + "\n";
resultsText += "Brake Horsepower (BHP): " + brakeHorsepowerOutputDiv.textContent.replace("Brake Horsepower (BHP): ", "") + "\n";
resultsText += "Pump Horsepower (PHP): " + pumpHorsepowerOutputDiv.textContent.replace("Pump Horsepower (PHP): ", "") + "\n\n";
resultsText += "Key Assumptions:\n";
resultsText += assumptionFlowRateDiv.textContent + "\n";
resultsText += assumptionHeadDiv.textContent + "\n";
resultsText += assumptionFluidSGDiv.textContent + "\n";
resultsText += assumptionPumpEffDiv.textContent + "\n";
resultsText += assumptionMotorEffDiv.textContent + "\n";
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(resultsText).then(function() {
alert('Results copied to clipboard!');
}).catch(function(err) {
console.error('Could not copy text: ', err);
fallbackCopyTextToClipboard(resultsText);
});
} else {
fallbackCopyTextToClipboard(resultsText);
}
}
function fallbackCopyTextToClipboard(text) {
var textArea = document.createElement("textarea");
textArea.value = text;
textArea.style.position="fixed";
textArea.style.top = "0";
textArea.style.left = "0";
textArea.style.width = "2em";
textArea.style.height = "2em";
textArea.style.padding = "0";
textArea.style.border = "none";
textArea.style.outline = "none";
textArea.style.boxShadow = "none";
textArea.style.background = "transparent";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
alert('Results copied to clipboard! (' + msg + ')');
} catch (err) {
console.error('Fallback: Oops, unable to copy', err);
}
document.body.removeChild(textArea);
}
function updatePerformanceTable(currentFlowGPM, currentHeadFeet, fluidSg, pumpEffDecimal, motorEffDecimal) {
var tableBody = document.getElementById("performanceTableBody");
tableBody.innerHTML = ""; // Clear existing rows
var baseFlowGPM = currentFlowGPM;
var baseHeadFeet = currentHeadFeet;
var bhpFactor = 3960 * pumpEffDecimal * motorEffDecimal;
var phpFactor = 3960 * pumpEffDecimal;
// Generate points around the current operating point
var flowRates = [baseFlowGPM * 0.5, baseFlowGPM * 0.75, baseFlowGPM, baseFlowGPM * 1.25, baseFlowGPM * 1.5];
var headValues = [baseHeadFeet * 1.2, baseHeadFeet * 1.1, baseHeadFeet, baseHeadFeet * 0.9, baseHeadFeet * 0.8]; // Example relationship: head decreases as flow increases
for (var i = 0; i < flowRates.length; i++) {
var flow = flowRates[i];
var head = headValues[i];
if (flow <= 0 || head <= 0) continue; // Avoid division by zero or negative values
var php = (flow * head * fluidSg) / phpFactor;
var bhp = (flow * head * fluidSg) / bhpFactor;
var row = tableBody.insertRow();
row.innerHTML =
"
" + flow.toFixed(1) + " GPM
" +
"
" + head.toFixed(1) + " ft
" +
"
" + bhp.toFixed(2) + " HP
" +
"
" + php.toFixed(2) + " HP
";
}
}
function updateChart(currentFlowGPM, currentHeadFeet, fluidSg, pumpEffDecimal, motorEffDecimal) {
var canvas = document.getElementById('performanceChart');
if (!chartContext) {
chartContext = canvas.getContext('2d');
}
// Clear previous chart
chartContext.clearRect(0, 0, canvas.width, canvas.height);
var chartWidth = canvas.clientWidth;
var chartHeight = 400; // Default height, will be adjusted by CSS
// Dynamically adjust canvas size if needed (though CSS max-width is primary)
canvas.width = chartWidth;
canvas.height = chartHeight;
var bhpFactor = 3960 * pumpEffDecimal * motorEffDecimal;
var phpFactor = 3960 * pumpEffDecimal;
var flowPoints = [];
var headPoints = [];
var bhpPoints = [];
var phpPoints = [];
// Generate data points for the chart
var maxFlow = currentFlowGPM * 1.5; // Extend flow range for chart
var minFlow = currentFlowGPM * 0.2;
var flowStep = (maxFlow – minFlow) / 20; // Number of points
for (var flow = minFlow; flow <= maxFlow; flow += flowStep) {
if (flow 0) chartContext.fillText(maxHead.toFixed(0), margin – 5, margin);
// Y-axis for Power (using right side)
chartContext.beginPath();
chartContext.moveTo(chartWidth – margin, margin);
chartContext.lineTo(chartWidth – margin, margin + chartAreaHeight);
chartContext.stroke();
chartContext.textAlign = 'left';
chartContext.fillText('0', chartWidth – margin + 5, margin + chartAreaHeight);
if (maxPower > 0) chartContext.fillText(maxPower.toFixed(1) + " HP", chartWidth – margin + 5, margin);
// X-axis for Flow
chartContext.beginPath();
chartContext.moveTo(margin, margin + chartAreaHeight);
chartContext.lineTo(chartWidth – margin, margin + chartAreaHeight);
chartContext.stroke();
chartContext.textAlign = 'center';
chartContext.fillText('0', margin, margin + chartAreaHeight + 15);
if (maxFlowForAxis > 0) chartContext.fillText(maxFlowForAxis.toFixed(0) + " GPM", chartWidth – margin, margin + chartAreaHeight + 15);
// Draw Head Curve
chartContext.strokeStyle = '#004a99'; // Primary color for Head
chartContext.lineWidth = 2;
chartContext.beginPath();
for (var i = 0; i < flowPoints.length; i++) {
var xPos = margin + (flowPoints[i] / maxFlowForAxis) * chartAreaWidth;
var yPos = margin + chartAreaHeight – (headPoints[i] / maxHead) * chartAreaHeight;
if (i === 0) {
chartContext.moveTo(xPos, yPos);
} else {
chartContext.lineTo(xPos, yPos);
}
}
chartContext.stroke();
chartContext.textAlign = 'left';
chartContext.fillText('Head vs Flow', margin + 5, margin + 15);
// Draw BHP Curve
chartContext.strokeStyle = '#28a745'; // Success color for Power
chartContext.lineWidth = 2;
chartContext.beginPath();
for (var i = 0; i < flowPoints.length; i++) {
var xPos = margin + (flowPoints[i] / maxFlowForAxis) * chartAreaWidth;
// Power uses the right Y-axis
var yPos = margin + chartAreaHeight – (bhpPoints[i] / maxPower) * chartAreaHeight;
if (i === 0) {
chartContext.moveTo(xPos, yPos);
} else {
chartContext.lineTo(xPos, yPos);
}
}
chartContext.stroke();
chartContext.fillText('Power (BHP)', chartWidth – margin + 5, margin + 30);
// Draw PHP Curve (Optional, for comparison)
chartContext.strokeStyle = '#ffc107'; // Amber color for PHP
chartContext.lineWidth = 1.5;
chartContext.setLineDash([5, 3]); // Dashed line
chartContext.beginPath();
for (var i = 0; i f >= currentFlowGPM)] / maxPower) * chartAreaHeight; // find closest bhp value
chartContext.fillStyle = '#000';
chartContext.beginPath();
chartContext.arc(currentXPos, currentHeadYPos, 4, 0, 2 * Math.PI);
chartContext.fill();
chartContext.fillText('Operating Point', currentXPos + 10, currentHeadYPos – 10);
}
// Initialize calculation on load
document.addEventListener('DOMContentLoaded', function() {
calculatePumpSize();
// Initialize chart canvas
var canvas = document.getElementById('performanceChart');
chartContext = canvas.getContext('2d');
// Add event listeners for real-time updates
flowRateInput.addEventListener('input', calculatePumpSize);
flowUnitSelect.addEventListener('change', calculatePumpSize);
totalHeadInput.addEventListener('input', calculatePumpSize);
headUnitSelect.addEventListener('change', calculatePumpSize);
fluidSgInput.addEventListener('input', calculatePumpSize);
pumpEffInput.addEventListener('input', calculatePumpSize);
motorEffInput.addEventListener('input', calculatePumpSize);
// Toggle FAQ answers
var faqQuestions = document.querySelectorAll('.faq-question');
faqQuestions.forEach(function(question) {
question.addEventListener('click', function() {
var answer = this.nextElementSibling;
if (answer.style.display === 'block') {
answer.style.display = 'none';
} else {
answer.style.display = 'block';
}
});
});
});