Introduction & Context

Pipe-flow energy-balance calculations are the backbone of process-plant hydraulics. They determine how much liquid will flow by gravity between two vessels, how large a pump must be to hit a target rate, or whether a given line can handle a future throughput. The balance couples elevation, pressure, velocity, and all resistances (friction plus fittings) into a single scalar equation that must be satisfied. Because the friction factor itself depends on the unknown velocity, the problem is implicit and must be solved iteratively. The sheet below gives the compact theory and the algebraic forms used in the companion Python module.

Methodology & Formulas

  1. Control-volume energy balance (steady, incompressible, single-phase)
    \[ \frac{p_1}{\rho g} + z_1 + \frac{V_1^2}{2g} + h_p = \frac{p_2}{\rho g} + z_2 + \frac{V_2^2}{2g} + h_L \] where \(h_p\) is the head added by a pump (zero for gravity-driven cases) and \(h_L\) is the total head loss between 1 and 2.
  2. Head-loss decomposition
    \[ h_L = \left(f\frac{L}{D} + \sum K\right)\frac{V^2}{2g} \] with \(V = \frac{4Q}{\pi D^{2}}\) giving \[ h_L(Q) = \left(f\frac{L}{D} + K_{\text{tot}}\right)\frac{8Q^{2}}{\pi^{2}D^{4}g} \]
  3. Reynolds number
    \[ Re = \frac{4\rho Q}{\pi D\mu} \]
    Flow regime Reynolds range
    Laminar \(Re \le 2300\)
    Transition \(2300 \lt Re \lt 4000\)
    Turbulent \(Re \ge 4000\)
  4. Haaland explicit approximation of Colebrook friction factor
    \[ \frac{1}{\sqrt{f}} = -1.8\log_{10}\left(\frac{\varepsilon/D}{3.7} + \frac{6.9}{Re}\right) \] The Python code iterates this expression five times starting from \(f_0=0.02\) to obtain the turbulent \(f\) to within 0.1 %.
  5. Residual form for solver
    Define the residual \[ R(Q) = (z_1 - z_2) + h_L(Q) \] For gravity-driven flow with both reservoirs open to atmosphere (\(p_1=p_2=0\), \(V_1=V_2\), \(h_p=0\)) the energy balance collapses to \(R(Q)=0\). Any 1-D root-finder (e.g. Brent) can be used to obtain the unknown \(Q\).