m/s (Meters per second)
ft/s (Feet per second)
km/h (Kilometers per hour)
mph (Miles per hour)
Please enter valid positive numbers for all fields.
Calculated Flow Velocity:–
Cross-Sectional Area:–
Volumetric Flow Rate:–
function calculateFlowVelocity() {
// 1. Get DOM Elements
var massFlowInput = document.getElementById("massFlow");
var massFlowUnit = document.getElementById("massFlowUnit");
var densityInput = document.getElementById("density");
var densityUnit = document.getElementById("densityUnit");
var diameterInput = document.getElementById("diameter");
var diameterUnit = document.getElementById("diameterUnit");
var outputUnit = document.getElementById("outputUnit");
var resultBox = document.getElementById("resultBox");
var errorMsg = document.getElementById("errorMsg");
var finalVelocityDisplay = document.getElementById("finalVelocity");
var calcAreaDisplay = document.getElementById("calcArea");
var calcVolFlowDisplay = document.getElementById("calcVolFlow");
// 2. Get Values
var m_dot = parseFloat(massFlowInput.value);
var rho = parseFloat(densityInput.value);
var d = parseFloat(diameterInput.value);
// 3. Validation
if (isNaN(m_dot) || isNaN(rho) || isNaN(d) || m_dot <= 0 || rho <= 0 || d <= 0) {
errorMsg.style.display = "block";
resultBox.style.display = "none";
return;
} else {
errorMsg.style.display = "none";
resultBox.style.display = "block";
}
// 4. Normalize to SI Units (kg, m, s)
// Convert Mass Flow to kg/s
var massFlowSI = 0; // kg/s
switch(massFlowUnit.value) {
case 'kg_s': massFlowSI = m_dot; break;
case 'kg_h': massFlowSI = m_dot / 3600; break;
case 'lb_s': massFlowSI = m_dot * 0.45359237; break;
case 'lb_h': massFlowSI = (m_dot * 0.45359237) / 3600; break;
case 'ton_h': massFlowSI = (m_dot * 1000) / 3600; break;
}
// Convert Density to kg/m³
var densitySI = 0; // kg/m³
switch(densityUnit.value) {
case 'kg_m3': densitySI = rho; break;
case 'lb_ft3': densitySI = rho * 16.018463; break;
case 'g_cm3': densitySI = rho * 1000; break;
}
// Convert Diameter to meters
var diameterSI = 0; // m
switch(diameterUnit.value) {
case 'm': diameterSI = d; break;
case 'mm': diameterSI = d / 1000; break;
case 'cm': diameterSI = d / 100; break;
case 'inch': diameterSI = d * 0.0254; break;
case 'ft': diameterSI = d * 0.3048; break;
}
// 5. Perform Calculations
// Area = pi * (d/2)^2 = (pi * d^2) / 4
var areaSI = Math.PI * Math.pow(diameterSI, 2) / 4; // m²
// Volumetric Flow Rate (Q) = Mass Flow / Density
// Q = m_dot / rho
var volFlowSI = massFlowSI / densitySI; // m³/s
// Velocity (v) = Volumetric Flow Rate / Area
var velocitySI = volFlowSI / areaSI; // m/s
// 6. Convert Output to Desired Unit
var finalVelocity = 0;
var unitLabel = "";
switch(outputUnit.value) {
case 'm_s':
finalVelocity = velocitySI;
unitLabel = "m/s";
break;
case 'ft_s':
finalVelocity = velocitySI * 3.28084;
unitLabel = "ft/s";
break;
case 'km_h':
finalVelocity = velocitySI * 3.6;
unitLabel = "km/h";
break;
case 'mph':
finalVelocity = velocitySI * 2.23694;
unitLabel = "mph";
break;
}
// 7. Display Results
// Format numbers to decent precision
finalVelocityDisplay.innerHTML = finalVelocity.toFixed(4) + " " + unitLabel;
// Show intermediate values in scientific notation if very small/large, else fixed
var areaDisplayVal = (areaSI < 0.001) ? areaSI.toExponential(4) : areaSI.toFixed(6);
calcAreaDisplay.innerHTML = areaDisplayVal + " m²";
var volFlowDisplayVal = (volFlowSI < 0.001) ? volFlowSI.toExponential(4) : volFlowSI.toFixed(6);
calcVolFlowDisplay.innerHTML = volFlowDisplayVal + " m³/s";
}
How to Calculate Velocity from Mass Flow Rate
Understanding fluid dynamics is essential for engineering applications ranging from HVAC systems and pipelines to chemical processing plants. One of the most common calculations required is determining the velocity of a fluid flowing through a pipe when the mass flow rate is known. This calculator simplifies that process, but understanding the underlying physics is equally important.
The Physics Formula
The relationship between mass flow rate, fluid density, pipe area, and velocity is derived from the principle of conservation of mass. The fundamental equation is:
ṁ = ρ × A × v
Where:
ṁ (m-dot): Mass Flow Rate (e.g., kg/s or lb/s)
ρ (rho): Fluid Density (e.g., kg/m³ or lb/ft³)
A: Cross-sectional Area of the pipe (e.g., m² or ft²)
v: Flow Velocity (e.g., m/s or ft/s)
Solving for Velocity
To find the velocity, we rearrange the formula:
v = ṁ / (ρ × A)
Since pipes are usually circular, the Area (A) is calculated using the internal diameter (D):
A = π × (D/2)² OR A = (π × D²) / 4
Therefore, the complete formula using diameter is:
v = (4 × ṁ) / (ρ × π × D²)
Example Calculation
Let's say you have water flowing through a pipe with the following parameters:
Mass Flow Rate: 10 kg/s
Fluid Density: 1000 kg/m³ (Standard water density)
Pipe Diameter: 100 mm (0.1 meters)
Step 1: Calculate the Area
A = π × (0.1 / 2)² = 0.007854 m²