Pipe Velocity Calculation

Pipe Velocity Calculator & Guide – Fluid Dynamics :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –card-background: #fff; –shadow: 0 2px 5px rgba(0,0,0,0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } h1, h2, h3 { color: var(–primary-color); text-align: center; } h1 { margin-bottom: 10px; } h2 { margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } h3 { margin-top: 20px; margin-bottom: 10px; } .calculator-wrapper { background-color: var(–card-background); padding: 25px; border-radius: 8px; box-shadow: var(–shadow); margin-bottom: 30px; } .input-group { margin-bottom: 15px; text-align: left; } .input-group label { display: block; margin-bottom: 5px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1rem; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: var(–primary-color); outline: none; box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85rem; color: #666; margin-top: 5px; } .error-message { color: red; font-size: 0.8rem; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { text-align: center; margin-top: 20px; } button { background-color: var(–primary-color); color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-size: 1rem; margin: 5px; transition: background-color 0.3s ease; } button:hover { background-color: #003366; } button.reset-button { background-color: #ffc107; color: #212529; } button.reset-button:hover { background-color: #e0a800; } button.copy-button { background-color: #6c757d; } button.copy-button:hover { background-color: #5a6268; } .results-container { margin-top: 30px; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); text-align: center; } .results-container h3 { margin-top: 0; color: var(–primary-color); } .primary-result { font-size: 2.5rem; font-weight: bold; color: var(–success-color); margin: 15px 0; padding: 10px; background-color: #e6f7ff; border-radius: 5px; display: inline-block; } .intermediate-results div { margin-bottom: 10px; font-size: 1.1rem; } .intermediate-results span { font-weight: bold; color: var(–primary-color); } .formula-explanation { font-size: 0.9rem; color: #555; margin-top: 15px; padding: 10px; background-color: #f0f0f0; border-radius: 4px; } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: var(–shadow); } th, td { padding: 10px; text-align: left; border: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1rem; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; caption-side: top; text-align: left; } .chart-container { margin-top: 30px; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); text-align: center; } .chart-container canvas { max-width: 100%; height: auto; } .chart-caption { font-size: 1rem; color: #555; margin-top: 10px; } .article-content { margin-top: 40px; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); text-align: left; } .article-content p, .article-content ul, .article-content ol { margin-bottom: 15px; } .article-content ul, .article-content ol { padding-left: 20px; } .article-content li { margin-bottom: 8px; } .article-content a { color: var(–primary-color); text-decoration: none; } .article-content a:hover { text-decoration: underline; } .faq-item { margin-bottom: 15px; border-bottom: 1px dashed #eee; padding-bottom: 10px; } .faq-item:last-child { border-bottom: none; } .faq-item strong { color: var(–primary-color); display: block; margin-bottom: 5px; } .related-links ul { list-style: none; padding: 0; } .related-links li { margin-bottom: 10px; } .related-links a { font-weight: bold; } .related-links span { font-size: 0.9rem; color: #666; display: block; margin-top: 3px; } .highlight { background-color: var(–success-color); color: white; padding: 2px 5px; border-radius: 3px; } .formula-table { margin-top: 15px; width: 100%; border-collapse: collapse; } .formula-table th, .formula-table td { border: 1px solid #ddd; padding: 8px; text-align: left; } .formula-table th { background-color: #f2f2f2; font-weight: bold; } .formula-table td:first-child { font-weight: bold; } .formula-table td:nth-child(2), .formula-table td:nth-child(3) { text-align: center; } .formula-table td:nth-child(4) { font-style: italic; color: #555; }

Pipe Velocity Calculator

Calculate the speed of fluid flow within a pipe based on flow rate and pipe dimensions.

Pipe Velocity Calculator

Enter the volumetric flow rate (e.g., gallons per minute, liters per second).
Enter the inner diameter of the pipe (e.g., inches, centimeters).
GPM (US) and Inches LPS (Metric) and Centimeters CFM (US) and Inches m³/s and Meters
Select the units for flow rate and diameter.

Calculation Results

Pipe Area:
Flow Rate (Base):
Pipe Diameter (Base):
Formula Used: Velocity (V) = Flow Rate (Q) / Area (A)
Where Area (A) = π * (Diameter/2)²

Velocity vs. Flow Rate

This chart visualizes how pipe velocity changes with varying flow rates for a fixed pipe diameter.

Understanding Pipe Velocity Calculation

What is Pipe Velocity Calculation?

The pipe velocity calculation is a fundamental concept in fluid dynamics and engineering. It refers to the process of determining the speed at which a fluid (liquid or gas) is moving through a pipe. This calculation is crucial for designing and operating various systems, including water supply networks, industrial pipelines, HVAC systems, and even blood flow in biological contexts. Understanding pipe velocity helps engineers ensure efficient flow, prevent issues like erosion or sedimentation, and maintain system integrity.

Who should use it:

  • Mechanical Engineers
  • Civil Engineers
  • Plumbing Designers
  • HVAC Technicians
  • Process Engineers
  • Students of Fluid Dynamics
  • Anyone involved in fluid transport systems

Common misconceptions:

  • Velocity is constant everywhere: Fluid velocity can vary across the pipe's cross-section due to friction with the pipe walls (boundary layer effect). The calculated velocity is typically an average velocity.
  • Flow rate and velocity are the same: Flow rate (volume per unit time) and velocity (distance per unit time) are related but distinct. A higher flow rate in the same pipe will result in higher velocity.
  • Pipe size doesn't matter much: Pipe diameter significantly impacts velocity. For a constant flow rate, a smaller diameter pipe leads to much higher velocity, and vice versa.

Pipe Velocity Calculation Formula and Mathematical Explanation

The core principle behind pipe velocity calculation is the conservation of mass, specifically applied to incompressible fluids in steady flow. The fundamental relationship is derived from the definition of volumetric flow rate.

The Formula:
Velocity (V) = Flow Rate (Q) / Area (A)

Let's break down the variables and the derivation:

  1. Volumetric Flow Rate (Q): This is the volume of fluid that passes through a given cross-section of the pipe per unit of time. It's often measured in units like gallons per minute (GPM), liters per second (LPS), cubic feet per minute (CFM), or cubic meters per second (m³/s).
  2. Cross-Sectional Area (A): This is the area of the pipe's inner opening through which the fluid flows. For a standard circular pipe, the area is calculated using the inner diameter (D) or radius (r). The formula for the area of a circle is A = π * r², or substituting r = D/2, we get A = π * (D/2)².
  3. Velocity (V): This is the average speed at which the fluid moves along the pipe's axis. It's typically measured in units like feet per second (fps), meters per second (m/s), or inches per second (ips).

By rearranging the flow rate definition (Q = V * A), we arrive at the formula V = Q / A. The calculator handles unit conversions to ensure accurate results regardless of the input units.

Variables Table:

Variable Meaning Unit Typical Range
V Average Fluid Velocity fps, m/s, ips 0.1 – 10 fps (common for water)
Q Volumetric Flow Rate GPM, LPS, CFM, m³/s Varies widely based on application
A Pipe Cross-Sectional Area in², cm², m² Varies widely based on pipe size
D Pipe Inner Diameter inches, cm, m 0.5 inches to several feet
π (Pi) Mathematical Constant Unitless ~3.14159

Practical Examples (Real-World Use Cases)

Example 1: Residential Water Supply

A homeowner is installing a new faucet and wants to ensure adequate water pressure. The main water line entering the house has a 3/4-inch inner diameter pipe. During peak usage, the flow rate to the house is measured at 15 GPM. What is the average velocity of the water in the main line?

Inputs:

  • Flow Rate (Q): 15 GPM
  • Pipe Inner Diameter (D): 0.75 inches
  • Units: GPM and Inches

Calculation Steps (as performed by the calculator):

  1. Convert diameter to radius: r = D / 2 = 0.75 in / 2 = 0.375 in
  2. Calculate pipe area: A = π * r² = π * (0.375 in)² ≈ 0.4418 in²
  3. Convert GPM to cubic inches per second: 1 GPM ≈ 231 in³/min / 60 s/min ≈ 3.85 in³/s. So, Q = 15 GPM * 3.85 in³/s/GPM ≈ 57.75 in³/s.
  4. Calculate velocity: V = Q / A = 57.75 in³/s / 0.4418 in² ≈ 130.7 inches per second (ips).

Result: The average velocity is approximately 130.7 ips. This is equivalent to about 10.9 feet per second (130.7 / 12). This velocity is on the higher side for residential plumbing, suggesting potential for noise or erosion over time, especially if the flow rate increases or the pipe diameter is smaller than specified.

Example 2: Industrial Cooling System

An engineer is designing a closed-loop cooling system using water. The pipe selected has an inner diameter of 5 cm. The system needs to circulate 20 liters per second (LPS) of water. What is the required average velocity in the pipe?

Inputs:

  • Flow Rate (Q): 20 LPS
  • Pipe Inner Diameter (D): 5 cm
  • Units: LPS and Centimeters

Calculation Steps:

  1. Convert diameter to radius: r = D / 2 = 5 cm / 2 = 2.5 cm
  2. Calculate pipe area: A = π * r² = π * (2.5 cm)² ≈ 19.63 cm²
  3. Convert LPS to cm³/s: 1 LPS = 1000 cm³/s. So, Q = 20 LPS * 1000 cm³/s/LPS = 20,000 cm³/s.
  4. Calculate velocity: V = Q / A = 20,000 cm³/s / 19.63 cm² ≈ 1018.8 cm/s.

Result: The average velocity is approximately 1018.8 cm/s. This is equivalent to about 10.19 meters per second (m/s). This velocity is very high for water in industrial systems and could lead to significant erosion, noise, and high pressure drop. The engineer might need to reconsider using a larger diameter pipe or multiple parallel pipes to reduce the velocity. A typical target velocity for water in industrial pipes is often in the range of 1-3 m/s.

How to Use This Pipe Velocity Calculator

Using this pipe velocity calculation tool is straightforward. Follow these steps to get your results quickly and accurately:

  1. Enter Flow Rate: Input the volumetric flow rate of the fluid in the designated field. Ensure you know the correct units (e.g., GPM, LPS, CFM, m³/s).
  2. Enter Pipe Diameter: Input the *inner* diameter of the pipe. It's crucial to use the inner diameter as this is the actual space the fluid flows through.
  3. Select Units: Choose the units that correspond to your flow rate and diameter measurements from the dropdown menu. This ensures the calculator uses the correct conversion factors.
  4. Calculate: Click the "Calculate Velocity" button.

How to read results:

  • Primary Result (Velocity): This is the main output, showing the calculated average fluid velocity in a standard unit (e.g., fps or m/s, depending on the input units).
  • Pipe Area: This intermediate result shows the calculated cross-sectional area of the pipe.
  • Flow Rate (Base) & Pipe Diameter (Base): These show your inputs converted to a consistent base unit system for calculation clarity.
  • Formula Explanation: A brief reminder of the formula used (V = Q / A).

Decision-making guidance:

  • Low Velocity: May indicate an oversized pipe or insufficient flow, potentially leading to sedimentation or inefficient system operation.
  • High Velocity: Can cause noise, erosion, increased pressure drop, and potential damage to the pipe and fittings. Target velocities vary by fluid and application, but common guidelines exist (e.g., 1-3 m/s for water in many industrial settings).
  • Compare with Standards: Use the calculated velocity to compare against industry standards and design guidelines for your specific application.

Key Factors That Affect Pipe Velocity Results

While the core pipe velocity calculation is simple (V=Q/A), several real-world factors influence the actual fluid behavior and the interpretation of the calculated average velocity:

  • Flow Rate (Q): This is the most direct factor. Higher flow rates inherently lead to higher velocities in a pipe of a given size. Fluctuations in demand or system operation directly impact Q.
  • Pipe Inner Diameter (D): As the formula shows, velocity is inversely proportional to the area (which depends on D²). A small change in diameter has a significant impact on velocity. Using the correct *inner* diameter is critical.
  • Fluid Properties (Viscosity & Density): While not directly in the V=Q/A formula, viscosity affects the flow profile (how velocity changes across the pipe radius) and pressure drop. Denser fluids require more energy to move at the same velocity. These properties are crucial for more advanced friction loss calculations.
  • Pipe Roughness: The internal surface texture of the pipe affects friction. Rougher pipes increase turbulence and pressure drop, and can slightly alter the velocity profile near the walls. This is a key factor in calculating pressure drop.
  • System Components (Valves, Fittings, Bends): These introduce localized constrictions, expansions, and changes in flow direction, causing turbulence and temporary increases or decreases in velocity, as well as pressure losses. The calculated velocity is an average along a straight section.
  • Elevation Changes & Pressure: Gravity (due to elevation changes) and system pressure drive the flow. A higher upstream pressure or lower downstream pressure (or elevation) will generally increase flow rate, thus increasing velocity, assuming the pipe size remains constant. Understanding pressure drop is vital.
  • Temperature: Temperature affects fluid density and viscosity, which in turn can influence flow rate and pressure drop, indirectly affecting the practical velocity and system performance.

Frequently Asked Questions (FAQ)

Q1: What is the difference between flow rate and velocity?

Flow rate (Q) is the volume of fluid passing a point per unit time (e.g., GPM, LPS). Velocity (V) is the speed of the fluid's movement (e.g., fps, m/s). Velocity is calculated by dividing the flow rate by the pipe's cross-sectional area (V = Q/A).

Q2: Should I use the inner or outer diameter of the pipe?

Always use the inner diameter (ID) for pipe velocity calculation. The ID defines the actual space through which the fluid flows.

Q3: What are typical acceptable velocities for water in pipes?

Acceptable velocities vary by application. For general water distribution, 5-15 fps (1.5-4.5 m/s) is often cited, but lower velocities (e.g., 3-6 fps or 1-2 m/s) are preferred in residential systems to minimize noise and erosion. High-velocity systems (like fire suppression) may operate at higher speeds. Always consult relevant industry standards.

Q4: Does the calculator account for friction loss?

No, this calculator provides the basic average velocity based on flow rate and pipe dimensions. It does not calculate friction loss or pressure drop, which require additional information like pipe length, material roughness, and fluid properties. You can explore friction loss calculators for that.

Q5: What happens if I enter inconsistent units?

The calculator is designed to handle common unit combinations (GPM/inch, LPS/cm, CFM/inch, m³/s/m). Ensure the units you select in the dropdown match the units you entered for flow rate and diameter. Entering, for example, GPM for flow rate but selecting "LPS/cm" for units will lead to incorrect results.

Q6: Can this calculator be used for gases?

Yes, the fundamental formula V=Q/A applies to gases as well. However, gases are compressible, meaning their density changes significantly with pressure and temperature. For accurate gas flow calculations, especially where pressure changes are involved, more complex compressible flow equations are needed. This calculator assumes incompressible flow or conditions where compressibility effects are negligible.

Q7: How does pipe velocity affect erosion?

Higher fluid velocities, especially with entrained solids or abrasive fluids, increase the kinetic energy impacting the pipe walls. This can accelerate erosion, leading to material degradation, thinning of the pipe wall, and potential failure over time. Maintaining velocities within recommended limits is crucial for pipe longevity.

Q8: What is the relationship between velocity and pressure drop?

Velocity is a key component in calculating pressure drop due to friction. Generally, higher velocities lead to significantly higher frictional pressure losses (often proportional to V²). This is why controlling velocity is important for system efficiency and pump sizing. Understanding pressure drop is essential for system design.

© 2023 Your Company Name. All rights reserved.

var flowRateInput = document.getElementById('flowRate'); var pipeDiameterInput = document.getElementById('pipeDiameter'); var unitsSelect = document.getElementById('units'); var velocityResultDiv = document.getElementById('velocityResult'); var pipeAreaResultDiv = document.getElementById('pipeAreaResult').querySelector('span'); var flowRateBaseResultDiv = document.getElementById('flowRateInBaseUnits').querySelector('span'); var pipeDiameterBaseResultDiv = document.getElementById('pipeDiameterInBaseUnits').querySelector('span'); var resultsContainer = document.getElementById('results-container'); var velocityChartCanvas = document.getElementById('velocityChart').getContext('2d'); var velocityChartInstance = null; var GPM_TO_IN3_PER_SEC = 231 / 60; // GPM to cubic inches per second var LPS_TO_CM3_PER_SEC = 1000; // LPS to cubic centimeters per second var CFM_TO_FT3_PER_SEC = 1 / 60; // CFM to cubic feet per second var M3S_TO_M3_PER_SEC = 1; // m³/s is already in base SI units var INCH_TO_CM = 2.54; var METER_TO_CM = 100; function validateInput(value, id, errorId, minValue = null, maxValue = null) { var errorElement = document.getElementById(errorId); errorElement.style.display = 'none'; errorElement.textContent = "; if (value === null || value === ") { errorElement.textContent = 'This field is required.'; errorElement.style.display = 'block'; return false; } var numberValue = parseFloat(value); if (isNaN(numberValue)) { errorElement.textContent = 'Please enter a valid number.'; errorElement.style.display = 'block'; return false; } if (minValue !== null && numberValue maxValue) { errorElement.textContent = 'Value out of range.'; errorElement.style.display = 'block'; return false; } return true; } function calculateVelocity() { var flowRate = parseFloat(flowRateInput.value); var pipeDiameter = parseFloat(pipeDiameterInput.value); var units = unitsSelect.value; var validFlowRate = validateInput(flowRateInput.value, 'flowRate', 'flowRateError', 0); var validPipeDiameter = validateInput(pipeDiameterInput.value, 'pipeDiameter', 'pipeDiameterError', 0); if (!validFlowRate || !validPipeDiameter) { resultsContainer.style.display = 'none'; return; } var flowRateBase = 0; var pipeDiameterBase = 0; var areaUnits = "; var velocityUnits = "; switch (units) { case 'gpm_inch': flowRateBase = flowRate * GPM_TO_IN3_PER_SEC; // in³/s pipeDiameterBase = pipeDiameter; // inches areaUnits = 'in²'; velocityUnits = 'ips'; break; case 'lps_cm': flowRateBase = flowRate * LPS_TO_CM3_PER_SEC; // cm³/s pipeDiameterBase = pipeDiameter; // cm areaUnits = 'cm²'; velocityUnits = 'cm/s'; break; case 'cfm_inch': flowRateBase = flowRate * CFM_TO_FT3_PER_SEC; // ft³/s pipeDiameterBase = pipeDiameter / 12.0; // inches to feet areaUnits = 'ft²'; velocityUnits = 'fps'; break; case 'm3s_m': flowRateBase = flowRate * M3S_TO_M3_PER_SEC; // m³/s pipeDiameterBase = pipeDiameter; // meters areaUnits = 'm²'; velocityUnits = 'm/s'; break; } var pipeRadiusBase = pipeDiameterBase / 2.0; var pipeAreaBase = Math.PI * Math.pow(pipeRadiusBase, 2); var velocity = 0; if (pipeAreaBase > 0) { velocity = flowRateBase / pipeAreaBase; } // Format results var formattedVelocity = velocity.toFixed(2); var formattedArea = pipeAreaBase.toFixed(4); var formattedFlowRateBase = flowRateBase.toFixed(4); var formattedPipeDiameterBase = pipeDiameterBase.toFixed(4); // Display results velocityResultDiv.textContent = formattedVelocity + ' ' + velocityUnits; pipeAreaResultDiv.textContent = formattedArea + ' ' + areaUnits; flowRateBaseResultDiv.textContent = formattedFlowRateBase + ' (base units)'; pipeDiameterBaseResultDiv.textContent = formattedPipeDiameterBase + ' (base units)'; resultsContainer.style.display = 'block'; updateChart(flowRate, pipeDiameter, units); return { velocity: formattedVelocity + ' ' + velocityUnits, pipeArea: formattedArea + ' ' + areaUnits, flowRateBase: formattedFlowRateBase + ' (base units)', pipeDiameterBase: formattedPipeDiameterBase + ' (base units)', formula: "Velocity (V) = Flow Rate (Q) / Area (A), where Area (A) = π * (Diameter/2)²" }; } function resetCalculator() { flowRateInput.value = '100'; pipeDiameterInput.value = '4'; unitsSelect.value = 'gpm_inch'; resultsContainer.style.display = 'none'; document.getElementById('flowRateError').style.display = 'none'; document.getElementById('pipeDiameterError').style.display = 'none'; if (velocityChartInstance) { velocityChartInstance.destroy(); velocityChartInstance = null; } // Optionally call calculateVelocity() to show initial state or clear results // calculateVelocity(); } function copyResults() { var results = calculateVelocity(); // Ensure results are up-to-date if (!results) return; var copyText = "Pipe Velocity Calculation Results:\n\n"; copyText += "Velocity: " + results.velocity + "\n"; copyText += "Pipe Area: " + results.pipeArea + "\n"; copyText += "Flow Rate (Base): " + results.flowRateBase + "\n"; copyText += "Pipe Diameter (Base): " + results.pipeDiameterBase + "\n\n"; copyText += "Formula Used: " + results.formula + "\n"; copyText += "Assumptions: Based on average velocity in a straight, circular pipe."; var textArea = document.createElement("textarea"); textArea.value = copyText; textArea.style.position = "fixed"; textArea.style.left = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Copy failed!'; // Optionally show a temporary message to the user console.log(msg); } catch (err) { console.log('Unable to copy results', err); } document.body.removeChild(textArea); } function updateChart(currentFlowRate, currentDiameter, currentUnits) { var dataPoints = 10; var flowRates = []; var velocities = []; var baseFlowRate = parseFloat(currentFlowRate); var baseDiameter = parseFloat(currentDiameter); var units = currentUnits; var flowRateMultiplier = 1; var diameterMultiplier = 1; var velocityUnit = "; switch (units) { case 'gpm_inch': flowRateMultiplier = GPM_TO_IN3_PER_SEC; diameterMultiplier = 1; // inches velocityUnit = 'ips'; break; case 'lps_cm': flowRateMultiplier = LPS_TO_CM3_PER_SEC; diameterMultiplier = 1; // cm velocityUnit = 'cm/s'; break; case 'cfm_inch': flowRateMultiplier = CFM_TO_FT3_PER_SEC; diameterMultiplier = 1 / 12.0; // inches to feet velocityUnit = 'fps'; break; case 'm3s_m': flowRateMultiplier = M3S_TO_M3_PER_SEC; diameterMultiplier = 1; // meters velocityUnit = 'm/s'; break; } var minFlow = baseFlowRate / 2; var maxFlow = baseFlowRate * 1.5; if (minFlow <= 0) minFlow = 1; // Ensure positive flow for (var i = 0; i 0) { velocity = flowRateBase / pipeAreaBase; } velocities.push(velocity); } if (velocityChartInstance) { velocityChartInstance.destroy(); } velocityChartInstance = new Chart(velocityChartCanvas, { type: 'line', data: { labels: flowRates.map(function(f) { return f.toFixed(1); }), // Labels are flow rates datasets: [{ label: 'Velocity (' + velocityUnit + ')', data: velocities, borderColor: 'var(–primary-color)', backgroundColor: 'rgba(0, 74, 153, 0.1)', fill: true, tension: 0.1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { x: { title: { display: true, text: 'Flow Rate (Input Units)' } }, y: { title: { display: true, text: 'Average Velocity (' + velocityUnit + ')' } } }, plugins: { legend: { position: 'top', }, title: { display: true, text: 'Pipe Velocity vs. Flow Rate' } } } }); } // Initial calculation and chart setup on load document.addEventListener('DOMContentLoaded', function() { // Set default values and trigger calculation flowRateInput.value = '100'; pipeDiameterInput.value = '4'; unitsSelect.value = 'gpm_inch'; calculateVelocity(); });

Leave a Comment