Introduction
The Darcy friction factor
()
is a key parameter for calculating head loss. The hf
package uses a functional programming approach, allowing users to
“inject” different calculation methods into the Darcy-Weisbach
functions.
Available Equations
1. Colebrook-White (calc_friction_cw)
The industry standard for turbulent flow in rough pipes. Being an
implicit equation, hf solves it using numerical
root-finding (uniroot).
2. Swamee-Jain (calc_friction_sj)
A highly accurate explicit approximation of the Colebrook-White
equation. Recommended for high-performance calculations where numerical
iteration is too slow.
3. Blasius (calc_friction_blasius)
An empirical formula for smooth pipes and Reynolds numbers up to
.
It provides a simpler alternative when relative roughness is
negligible.