Fluid Mechanics Calculator

Friction Factor / Moody Calculator

Calculate the Darcy friction factor using the Moody chart relationships. Supports laminar flow, Swamee-Jain, Haaland and iterative Colebrook-White equations.

Darcy Friction Factor

Moody chart region determined by Reynolds number and relative roughness ε/D

Flow Regime

TURBULENT

Laminar (Re < 2300) · Transitional · Turbulent (Re > 4000)

Input Parameters

SI units preferred

m/s

Mean flow velocity in the pipe.

mm

Internal diameter of the pipe.

m²/s

For water at 20 °C ≈ 1.0×10⁻⁶ m²/s.

mm

Pipe wall absolute roughness.

Common materials (click to apply)

Darcy Friction Factor f

0.01830

Regime: turbulent

Reynolds Number

250,000

Relative Roughness ε/D

4.500e-4

Formulas Used

Laminar (Re < 2300)

f = 64 / Re

Swamee-Jain (turbulent)

f = 0.25 / [log₁₀(ε/D / 3.7 + 5.74 / Re0.9)]²

Colebrook-White

1/√f = −2 log₁₀(ε/(3.7D) + 2.51/(Re√f))

Notes

  • Darcy friction factor (not Fanning)
  • Laminar automatically detected
  • Three turbulent methods available
  • Common roughness presets included
  • Valid for circular pipes flowing full
  • Transitional zone flagged

Engineering Code

Python
import math

def friction_factor_swamee_jain(Re, rel_rough):
    """
    Swamee-Jain explicit approximation of Colebrook-White
    """
    if Re < 2300:
        return 64 / Re
    term = rel_rough / 3.7 + 5.74 / Re**0.9
    return 0.25 / (math.log10(term))**2


# Example
V = 2.5          # m/s
D = 100 / 1000   # m
nu = 1.0e-6       # m²/s
eps = 0.045 / 1000  # m

Re = V * D / nu
rel_rough = eps / D
f = friction_factor_swamee_jain(Re, rel_rough)

print(f"Reynolds number: {Re:.0f}")
print(f"Relative roughness: {rel_rough:.6f}")
print(f"Friction factor f: {f:.5f}")
MATLAB
function f = friction_factor_sj(Re, rel_rough)
    if Re < 2300
        f = 64 / Re;
    else
        term = rel_rough/3.7 + 5.74/Re^0.9;
        f = 0.25 / (log10(term))^2;
    end
end

% Example
V = 2.5;
D = 100/1000;
nu = 1.0e-6;
eps = 0.045/1000;

Re = V*D/nu;
rr = eps/D;
f = friction_factor_sj(Re, rr);
fprintf('Re = %.0f, f = %.5f\n', Re, f);
Excel Formula (Swamee-Jain)
=IF(Re<2300,64/Re,0.25/(LOG10(epsD/3.7+5.74/Re^0.9))^2)

Technical Explanation: Darcy Friction Factor

Technical Introduction

The Darcy friction factor is a dimensionless quantity used in the Darcy-Weisbach equation to describe friction losses in pipe flow. It is a fundamental parameter in fluid mechanics and hydraulic engineering. Engineers calculate it to determine pressure drop, pump head requirements, and flow rates in piping systems. The friction factor depends on the flow regime (laminar or turbulent), the Reynolds number, and the relative roughness of the pipe's internal surface. The Moody chart is the classic graphical representation of these relationships.

Governing Formula

This calculator provides multiple methods to determine the Darcy friction factor (f), depending on the flow regime and desired precision.

For Laminar Flow (Re < 2300):
f = 64 / Re

For Turbulent Flow, the implicit Colebrook-White equation is the most widely accepted standard:
1 / √f = -2.0 log₁₀ [ (ε/D)/3.7 + 2.51 / (Re √f) ]

Because the Colebrook-White equation is implicit (f appears on both sides), explicit approximations are often used for practical calculations:

  • Swamee-Jain Equation: f = 0.25 / [ log₁₀ ( (ε/D)/3.7 + 5.74 / Re^0.9 ) ]²
  • Haaland Equation: 1 / √f = -1.8 log₁₀ [ ( (ε/D)/3.7 )^1.11 + 6.9 / Re ]

Where Re is the Reynolds number, ε is the absolute pipe roughness, and D is the internal pipe diameter.

Calculation Method / Derivation

The laminar flow formula (f = 64 / Re) is derived analytically from the Hagen-Poiseuille equation for fully developed, steady, incompressible flow in a circular pipe.

For turbulent flow, the Colebrook-White equation is an empirical synthesis of the Prandtl-von Kármán equation for smooth pipes and Nikuradse's experimental data for fully rough pipes. Because it cannot be solved algebraically for f, numerical methods (such as Newton-Raphson or fixed-point iteration) are required. The Swamee-Jain and Haaland equations were developed by curve-fitting the Colebrook-White equation, providing explicit formulas that yield results within 1–2% of the exact iterative solution, making them ideal for spreadsheet calculations and preliminary design.

Input Parameters

  • Reynolds Number (Re): Represents the ratio of inertial forces to viscous forces. It dictates the flow regime. Re < 2300 is laminar, 2300 < Re < 4000 is transitional, and Re > 4000 is turbulent.
  • Relative Roughness (ε/D): The ratio of the average height of surface irregularities (ε) to the pipe diameter (D). It is critical for turbulent flow, as it dictates the interaction between the viscous sublayer and the pipe wall.
  • Absolute Roughness (ε): A material-dependent constant. For example, drawn copper or glass is ~0.0015 mm, new commercial steel is ~0.045 mm, and aged cast iron can exceed 0.25 mm.

Engineering Interpretation

The calculated friction factor is directly proportional to the major head loss in a piping system via the Darcy-Weisbach equation: h_f = f · (L/D) · (v² / 2g). A higher friction factor indicates greater energy loss due to fluid friction. Engineers use this value to size pumps, select pipe diameters, and ensure that the available pressure is sufficient to overcome system resistance. It is important to note that the friction factor alone does not constitute a complete system design; it must be combined with minor loss coefficients (valves, fittings) and pump performance curves for a full hydraulic analysis.

Units and Unit Conversion

The friction factor (f) and Reynolds number (Re) are dimensionless. However, the relative roughness (ε/D) requires consistent length units.

  • If ε is in millimeters (mm), D must also be in millimeters (mm).
  • If ε is in meters (m), D must be in meters (m).
  • Common conversion: 1 mm = 0.001 m.

Mixing units (e.g., ε in mm and D in inches) will yield a drastically incorrect relative roughness and, consequently, an invalid friction factor.

Alternative / General Case

This calculator assumes fully developed flow in a straight, circular pipe. It does not account for:

  • Transitional flow (2300 < Re < 4000): The friction factor is highly unpredictable in this zone; conservative design usually assumes turbulent flow.
  • Non-circular conduits: These require the use of the hydraulic diameter (D_h = 4A/P) as an approximation, though this is less accurate for highly irregular shapes.
  • Compressible flow: Gases at high velocity experience significant density changes along the pipe length, requiring more complex Fanno flow or isothermal flow equations.

Assumptions and Limitations

  • Steady, incompressible flow: Fluid density and viscosity are assumed constant throughout the pipe section.
  • Fully developed flow: The calculation assumes the flow profile is fully established, ignoring entrance region effects (typically negligible in pipes longer than 50 diameters).
  • Constant roughness: The absolute roughness ε is treated as a uniform, static value. In reality, scaling, corrosion, or biological growth can increase roughness over the pipe's service life.
  • Newtonian fluid: The formulas apply to fluids with constant viscosity (e.g., water, air, light oils), not non-Newtonian fluids like slurries or polymer melts.

Practical Engineering Use

Accurate friction factor calculation is essential across multiple engineering disciplines:

  • Water Distribution Networks: Sizing municipal water mains and calculating pump station head requirements.
  • HVAC Systems: Determining pressure drops in chilled water or condenser water piping to select appropriate circulation pumps.
  • Oil and Gas Pipelines: Estimating friction losses in long-distance crude oil or natural gas transmission lines.
  • Process Engineering: Designing chemical plant piping networks where precise pressure drop calculations are critical for reactor feed rates and safety relief systems.

Real-World Engineering Cases

Undersized Pump Due to Wrong Friction Factor

An engineer used a smooth-pipe friction factor for a 20-year-old cast-iron main. Actual friction was almost twice as high, causing the selected pump to deliver far less flow than required.

Engineering Lesson

Always use realistic roughness values that account for pipe age, scaling and material. When in doubt, be conservative.

Laminar vs Turbulent Misidentification

A viscous oil line was designed assuming turbulent flow. At the actual operating temperature the Reynolds number dropped into the laminar regime, completely changing the pressure-drop calculation.

Engineering Lesson

Always calculate Reynolds number first. The friction-factor formula changes dramatically between laminar and turbulent regimes.

Frequently Asked Questions

What is the difference between Darcy and Fanning friction factor?

The Darcy friction factor is four times the Fanning friction factor (f_Darcy = 4 × f_Fanning). This calculator returns the Darcy factor used in the classic Darcy-Weisbach equation.

Which method should I use?

Swamee-Jain is excellent for most engineering work. Haaland is slightly more accurate near the smooth-pipe limit. Use Colebrook-White when maximum precision is required.

What roughness value should I use for steel pipe?

New commercial steel ≈ 0.045 mm. Aged or corroded steel can be 0.15–0.5 mm or higher. Always consider the expected condition of the pipe over its service life.

Engineering calculations provided by this tool are for educational and preliminary design purposes. Always verify fluid properties, pipe condition and applicable standards before final design.