Visualize the friction factor f of pipe flow on the Moody chart from Reynolds number and relative roughness. The Swamee-Jain explicit formula gives f for turbulent flow, then the Darcy-Weisbach equation yields pressure drop and head loss.
Parameters
log10 Re
log
Re = 1.00e+5
log10 epsilon/D
log
epsilon/D = 1.00e-3
Length/Diameter L/D
—
Mean velocity V
m/s
The fluid is assumed to be water (rho = 1000 kg/m^3, g = 9.81 m/s^2). Re and epsilon/D sliders use a log scale.
Results
—
Friction factor f
—
Pressure drop ΔP
—
Head loss h_L
—
Flow regime
Moody chart (f vs Re)
X = Re (log) / Y = f (log) / curves = friction factor for various epsilon/D / yellow dot = current operating point
Velocity V vs pressure drop ΔP
Pressure drop curve when V is varied while Re, epsilon/D, and L/D are held at the current values (yellow dot = current V)
Theory & Key Formulas
The Darcy-Weisbach equation gives a unified expression for the frictional pressure drop in pipe flow. The friction factor $f$ is a function of the Reynolds number $Re$ and the relative roughness $\varepsilon/D$. Use the analytical formula in the laminar regime and the Swamee-Jain explicit formula in the turbulent regime.
Darcy-Weisbach equation (pressure drop and head loss):
$$\Delta P = f\,\frac{L}{D}\,\frac{\rho V^2}{2},\qquad h_L = \frac{\Delta P}{\rho g}$$
Friction factor in the laminar regime ($Re \lt 2300$):
$$f = \frac{64}{Re}$$
Swamee-Jain formula in the turbulent regime ($Re \geq 4000$):
Here $\rho$ is density [kg/m^3], $V$ is the mean velocity [m/s], $L$ is the pipe length, $D$ is the pipe diameter, $\varepsilon$ is the wall roughness [m], and $g$ is gravity [m/s^2].
What is the Moody Diagram Simulator?
🙋
I want to compute the pressure drop in a pipe, but my textbook just says "read f from the Moody chart." Reading off a graph is tedious — is there a closed-form expression?
🎓
The original equation is the Colebrook formula, $\frac{1}{\sqrt{f}} = -2\log_{10}\!\left(\frac{\varepsilon/D}{3.7}+\frac{2.51}{Re\sqrt{f}}\right)$, but f appears on both sides, so it needs iteration. In practice we use the Swamee-Jain explicit formula instead: it gives f directly in one shot, with about 1% error. That is what this tool uses.
🙋
Got it. And what about the laminar regime?
🎓
Laminar (Re < 2300) is much simpler: $f = 64/Re$, the analytical Hagen-Poiseuille result. It is set entirely by viscous stress, so the roughness epsilon/D plays no role at all. Try setting log10(Re) below 3 in the simulator — you will see the operating point lock onto the orange line on the chart, which has slope -1 in log-log.
🙋
How is the transitional band (Re = 2300 to 4000) handled?
🎓
Honestly, in the transitional band f is not even uniquely defined — the flow flips between laminar and turbulent intermittently. For design we usually take the conservative route and apply the turbulent formula (Colebrook or Swamee-Jain). This tool also applies the turbulent formula in the band and shades the transition zone in red on the chart.
🙋
What values of "relative roughness epsilon/D" should I use in practice?
🎓
Typical roughness epsilon: drawn copper or PVC about 1.5 micrometers, commercial steel about 45 micrometers, galvanized steel about 150 micrometers, old cast iron about 260 micrometers. Divide by the inside diameter D to get epsilon/D. For example, a 100 mm steel pipe gives epsilon/D about 4.5e-4, so set log10(epsilon/D) to about -3.35 and you land on the right curve.
Frequently Asked Questions
The Swamee-Jain formula (1976) is an explicit approximation of the Colebrook equation and stays within roughly 1% of the Colebrook solution over its valid range of 5e3 ≤ Re ≤ 1e8 and 1e-6 ≤ epsilon/D ≤ 1e-2. That is more than accurate enough for pressure-drop calculations and removes the need to iterate the implicit Colebrook equation, so it is widely used in pump sizing and pipe design and works directly in spreadsheets.
This tool reports the Darcy friction factor f_D (also called the Moody friction factor), which is related to the Fanning friction factor f_F (used in chemical engineering) by f_D = 4 f_F. For example, in laminar flow f_D = 64/Re but f_F = 16/Re. When reading literature, always check whether the formulas are written in the Darcy convention (matched to the Darcy-Weisbach equation) or in the Fanning convention.
Not exactly, but the standard approximation is to replace the circular diameter D with the hydraulic diameter D_h = 4A/P (A = flow area, P = wetted perimeter). With this substitution the Moody diagram applies to rectangular ducts, annular passages, and so on. It works well in turbulent flow; in laminar flow a shape correction factor is needed (about 0.89 for rectangular ducts). It is the standard approximation used for HVAC ducts and tube-side heat exchanger calculations.
This tool computes only the straight-pipe friction loss (major loss). Local losses (minor losses) from elbows, tees, valves, sudden expansions, and so on are not included. In practice you either add Delta P_minor = K (rho V^2 / 2) using a loss coefficient K for each fitting, or convert each fitting to an equivalent length L_eq and add it to the straight-pipe length L. In long pipelines friction dominates, but in short systems with many fittings the minor losses cannot be ignored.
Real-World Applications
Pump and liquid-transfer system sizing: When you size a pump's required head and power, you read f from the Moody diagram and compute the system friction loss with the Darcy-Weisbach equation. This is the starting point for almost every "fluid transfer" calculation: long process pipelines, building water and chilled-water loops, and even the primary cooling loop of a nuclear plant. Doubling f roughly doubles the pump power, so pipe sizing and roughness control directly drive operating cost.
HVAC and ventilation duct design: Air ducts use the same Moody diagram via the hydraulic diameter substitution. It is used to estimate fan static pressure, and the ASHRAE Handbook tabulates roughness epsilon for various duct materials (about 0.15 mm for galvanized sheet steel, for example). Making a long duct narrower causes a sharp drop in airflow and a sharp jump in fan power, so designers compare equivalent friction losses on the chart while choosing the route and dimensions.
Oil and natural-gas pipelines: In long-distance transport, friction losses dominate operating cost, so designers cut epsilon/D by an order of magnitude with low-roughness internal coatings (epoxy, etc.), reducing the number of pumping or compression stations required. Transport-efficiency studies combine the Colebrook (or Swamee-Jain) formula with a temperature correction for viscosity, exploiting the fully rough plateau of f at high Re for a robust design.
Thermal-hydraulics in nuclear and fossil power plants: Reactor primary loops, steam generators, and condensers have many parallel tube bundles, where the flow split among branches is set by friction loss. The f read from the Moody diagram is built into one-dimensional thermal-hydraulics codes (RELAP, TRACE, etc.). In coolant transient analyses for accidents, f as a function of Re and epsilon/D is also a key parameter for safety evaluation.
Common Misconceptions and Pitfalls
The most common misconception is to think that "a rougher pipe always has more friction." If you look at the Moody diagram, in the low-Re region (laminar and transitional) the influence of epsilon/D is almost negligible, and all roughnesses collapse onto the single line f = 64/Re. Roughness only matters in the turbulent regime, and its effect grows with Re. Try setting log10(Re) low (e.g. 3.0) in the simulator and varying epsilon/D — you will see f barely move. This is the "hydraulically smooth" regime, where the viscous sublayer covers the roughness peaks.
The next most common is to assume that f is uniquely defined in the transitional band (Re = 2300 to 4000). In reality the flow is unstable in this region, switching between laminar and turbulent in a poorly reproducible way, so f varies in time. Classic Moody diagrams often show this band as a dashed strip or leave it blank. In design, the rule of thumb is to evaluate it with the turbulent formula on the safe side, or — if possible — choose the pipe diameter and velocity so that the operating point avoids the transitional band entirely.
Finally, watch out for the confusion between the Darcy-Weisbach f and the "Fanning friction factor." Chemical-engineering textbooks often write equations in the Fanning convention with f_F = f_D/4, so the laminar formula reads f_F = 16/Re. Plugging an f-value into the wrong formula produces a factor-of-four error. Always check the f and the equation as a pair — that is the iron rule when reading across fluid mechanics texts. This tool is consistently in the Darcy convention.