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
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).
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.
Haaland (calc_friction_haaland)
The Haaland equation is an excellent explicit alternative to the
Colebrook-White equation. It provides highly accurate results for
turbulent flows without the need for numerical iteration.
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.