Pipe Pressure Drop API
Darcy-Weisbach pipe pressure-drop and head-loss as an API, computed locally and deterministically. The friction endpoint gives the Darcy friction factor: laminar flow uses f = 64/Re, and turbulent flow uses the explicit Swamee-Jain approximation of the Colebrook-White equation, f = 0.25/[log₁₀(ε/3.7D + 5.74/Re⁰·⁹)]², from a Reynolds number (given directly, or computed from velocity, diameter and fluid) and the relative roughness, classifying the flow as laminar, transitional or turbulent. The headloss endpoint computes the major head loss hf = f·(L/D)·v²/(2g) from a friction factor (given or derived) and the pipe length, diameter and velocity, and — given the fluid density — the pressure drop Δp = ρ·g·hf in pascals, kilopascals and bar. The pipe endpoint does the whole calculation end to end: from a flow rate or velocity, the pipe diameter, length, fluid (water, seawater, air, oil and more, or a custom density and viscosity) and roughness material, it returns the velocity, Reynolds number, friction factor, head loss, pressure drop and the pumping power needed to overcome friction. Everything is computed locally and deterministically, so it is instant and private. Ideal for plumbing, HVAC and process-piping tools, hydraulics and pump-sizing apps, irrigation and fire-protection design, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is pipe friction pressure drop; for the continuity relation and Reynolds number use a pipe-flow API and for pump power and head use a pump API.
api.oanor.com/darcy-api