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)

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.