The hydraulic analysis of looped pipe networks is a core yet computationally intensive task in civil and water resources engineering. Although the Hardy Cross method is valued for its simplicity, manual application becomes inefficient and error-prone for complex multi-loop systems. This study presents a modular Python-based framework for automated hydraulic flow balancing using an enhanced Hardy Cross algorithm. The model incorporates both Darcy–Weisbach and Hazen–Williams equations, with friction factors computed dynamically via the Swamee–Jain equation, removing the need for predefined resistance coefficients. It systematically handles multi-loop interactions and shared pipe corrections through an iterative convergence scheme with user-defined tolerance. Validation was performed using four benchmark pipe network cases and comparison with established solutions. Results show strong agreement, with coefficients of determination (R²) above 0.999 and minimal errors. The framework demonstrates improved efficiency, scalability, and flexibility, making it valuable for engineering applications and academic use.
Moses et al. (Sun,) studied this question.