Skip to contents

Introduction

The Darcy friction factor (ff) 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).

1f=2log10(ϵ3.7D+2.51Ref) \frac{1}{\sqrt{f}} = -2 \log_{10} \left( \frac{\epsilon}{3.7D} + \frac{2.51}{Re\sqrt{f}} \right)

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.

f=0.25[log10(ϵ3.7D+5.74Re0.9)]2f = \frac{0.25}{\left[ \log_{10} \left( \frac{\epsilon}{3.7D} + \frac{5.74}{Re^{0.9}} \right) \right]^2}

3. Blasius (calc_friction_blasius)

An empirical formula for smooth pipes and Reynolds numbers up to 10510^5. It provides a simpler alternative when relative roughness is negligible.

f=0.3164Re0.25 f = \frac{0.3164}{Re^{0.25}}