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;
}
.calculator-container {
background-color: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 8px;
padding: 30px;
margin-bottom: 40px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.calc-header {
text-align: center;
margin-bottom: 25px;
color: #2c3e50;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #495057;
}
.input-group {
display: flex;
gap: 10px;
}
input[type="number"] {
flex: 2;
padding: 12px;
border: 1px solid #ced4da;
border-radius: 4px;
font-size: 16px;
}
select {
flex: 1;
padding: 12px;
border: 1px solid #ced4da;
border-radius: 4px;
background-color: white;
font-size: 16px;
}
button.calc-btn {
width: 100%;
padding: 15px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 18px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s;
margin-top: 10px;
}
button.calc-btn:hover {
background-color: #0056b3;
}
#result-area {
margin-top: 25px;
padding: 20px;
background-color: #fff;
border-left: 5px solid #007bff;
border-radius: 4px;
display: none;
}
.result-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #eee;
}
.result-row:last-child {
border-bottom: none;
margin-bottom: 0;
padding-bottom: 0;
}
.result-label {
font-weight: 600;
color: #6c757d;
}
.result-value {
font-size: 24px;
font-weight: bold;
color: #212529;
}
.result-unit {
font-size: 16px;
font-weight: normal;
color: #6c757d;
margin-left: 5px;
}
.article-content h2 {
color: #2c3e50;
margin-top: 40px;
border-bottom: 2px solid #eee;
padding-bottom: 10px;
}
.article-content p {
margin-bottom: 20px;
}
.article-content ul {
margin-bottom: 20px;
padding-left: 20px;
}
.article-content li {
margin-bottom: 10px;
}
.formula-box {
background-color: #eef2f7;
padding: 15px;
border-radius: 4px;
font-family: monospace;
text-align: center;
margin: 20px 0;
font-size: 1.2em;
}
.highlight {
background-color: #fff3cd;
padding: 2px 4px;
border-radius: 2px;
}
function calculateShearRate() {
// Get input values
var flowRateInput = document.getElementById('flowRate').value;
var flowUnit = document.getElementById('flowUnit').value;
var diameterInput = document.getElementById('pipeDiameter').value;
var diameterUnit = document.getElementById('diameterUnit').value;
// Validate inputs
if (flowRateInput === "" || diameterInput === "" || parseFloat(flowRateInput) < 0 || parseFloat(diameterInput) <= 0) {
alert("Please enter valid positive numbers for Flow Rate and Diameter.");
return;
}
var q = parseFloat(flowRateInput);
var d = parseFloat(diameterInput);
// 1. Convert Flow Rate to Cubic Meters per Second (m³/s)
var q_si = 0;
if (flowUnit === 'm3s') {
q_si = q;
} else if (flowUnit === 'gpm') {
q_si = q * 0.0000630901964;
} else if (flowUnit === 'lmin') {
q_si = q * 0.0000166667;
} else if (flowUnit === 'm3h') {
q_si = q / 3600;
} else if (flowUnit === 'cfs') {
q_si = q * 0.0283168;
}
// 2. Convert Diameter to Meters (m)
var d_si = 0;
if (diameterUnit === 'm') {
d_si = d;
} else if (diameterUnit === 'inch') {
d_si = d * 0.0254;
} else if (diameterUnit === 'mm') {
d_si = d / 1000;
} else if (diameterUnit === 'cm') {
d_si = d / 100;
}
// 3. Calculate Mean Velocity (v = Q / A)
// Area = pi * r^2 = pi * (d/2)^2 = (pi * d^2) / 4
var area = Math.PI * Math.pow(d_si, 2) / 4;
var velocity = q_si / area;
// 4. Calculate Shear Rate (gamma_dot = 8v / d) for Newtonian Laminar Flow
// Also equivalent to (32 * Q) / (pi * d^3)
var shearRate = (8 * velocity) / d_si;
// 5. Display Results
document.getElementById('result-area').style.display = 'block';
document.getElementById('shearRateResult').innerText = shearRate.toFixed(2);
document.getElementById('velocityResult').innerText = velocity.toFixed(3);
}
How to Calculate Shear Rate in a Pipe
Understanding the shear rate within a pipe is critical for engineers dealing with fluid transport, particularly when handling non-Newtonian fluids, sensitive polymers, or food products. Shear rate describes the rate at which fluid layers slide past one another.
In pipe flow, the velocity of the fluid is not uniform across the pipe's cross-section. The fluid moves fastest at the center and slowest (zero velocity) at the pipe wall. This gradient of velocity creates shear.
The Newtonian Shear Rate Formula
For a Newtonian fluid flowing in a laminar regime within a circular pipe, the shear rate is highest at the pipe wall. This is often the critical value used for engineering calculations. The formula relates the mean velocity of the fluid and the pipe diameter.
γ̇ = 8v / D
Where:
- γ̇ (Gamma dot) = Shear Rate (measured in reciprocal seconds, s⁻¹)
- v = Mean flow velocity (m/s or ft/s)
- D = Pipe internal diameter (m or ft)
Calculating with Flow Rate (Q)
In many industrial applications, you might not know the velocity directly, but you do know the volumetric flow rate (e.g., Gallons Per Minute or m³/hr). By substituting the velocity equation (v = 4Q / πD²) into the shear rate formula, we get:
γ̇ = 32Q / (π · D³)
This version of the formula allows you to calculate shear rate directly from your pump specifications and pipe size, which is exactly what the calculator above does.
Why is Shear Rate Important?
Calculating shear rate is vital for several reasons:
- Viscosity Determination: Non-Newtonian fluids change viscosity depending on the shear rate. To size a pump correctly for a polymer or slurry, you must calculate the shear rate in the pipe to determine the effective viscosity of the fluid.
- Shear Sensitivity: Some fluids (like ketchup, yogurt, or long-chain polymers) can be permanently degraded if the shear rate is too high. Engineers must ensure the pipe diameter is large enough to keep the shear rate below a critical threshold.
- Scouring and Erosion: High shear rates at the pipe wall can accelerate corrosion or erosion of the pipe material.
Example Calculation
Let's say you are pumping a fluid at 100 Gallons Per Minute (GPM) through a pipe with an internal diameter of 3 inches.
- Convert Inputs to SI Units:
100 GPM ≈ 0.00631 m³/s
3 inches = 0.0762 meters
- Calculate Velocity:
Area = π · (0.0762/2)² ≈ 0.00456 m²
Velocity = 0.00631 / 0.00456 ≈ 1.38 m/s
- Calculate Shear Rate:
γ̇ = (8 · 1.38) / 0.0762
γ̇ ≈ 145 s⁻¹
Using the calculator above provides an instant conversion and calculation without needing to perform manual unit conversions.