Water Branch

A self-organizing pipe-routing optimizer for shipboard cooling — minimizing pumping loss and weight. Built for MIT Sea Grant and the U.S. Navy.

2023 Python · NumPy github.com/osbo/piping-branch

Self-Organizing Water Branch

A self-organizing pipe-routing optimizer for shipboard cooling systems.

Given a set of heat-generating components and the cooling headers that serve them, PipingBranch.py generates a branching pipe network that connects every component in parallel — and optimizes that network's geometry to minimize both pumping pressure loss and total system weight.

Built for the MIT Sea Grant / U.S. Navy ESRDC electric-warship cooling-design effort.

How it works

Input — port and starboard cooling headers, plus a list of components, each with a 3-D location and a heat load in kilowatts (see sample_input.txt).

Routing

  1. Components are split into two groups by a plane whose normal points along their greatest spatial spread.
  2. A branch pipe is routed from one header, through each group's midpoint, to the opposite header — built axis-by-axis so the layout stays orthogonal under any orientation.
  3. Each component is connected to the nearest point on the branch by a service pipe; tees and elbows are inserted automatically at every junction.

Physics — the network is a tree of pipe / tee / bend objects. For each pipe:

  • mass flow rate from the heat load (ṁ = Q / cₚ ΔT),
  • diameter sized from flow rate via U.S. Navy fluid-velocity-limit curve fits,
  • pressure drop from the Darcy–Weisbach equation with a Moody friction factor, plus k-factors through every fitting,
  • weight from 70/30 copper-nickel pipe datasheets, including the water inside.

Optimization — a coordinate-descent loop perturbs the routing's control points one axis at a time, recomputing weight and pressure at each step and reversing direction when the score worsens. An optimizationfactor (0–100) trades weight against pressure; both candidate routings — over-then-down and down-then-over — are evaluated and the better one kept.

Output — a 3-D plot of the optimized network, pipe diameters drawn to scale, with the system's total weight and pressure drop.

Stack

  • Python — NumPy, Matplotlib (3-D)

License

MIT — see LICENSE.