In each node (with 3 or 4 tubes) the tubes are viewed as pairs. 


For each pair applies: 

A tee is only assigned if the two pipes are perpendicular to each other and the water flows in one pipe

towards the node and in the other pipe away from the node.

Position of the T-piece (if one is assigned):

the pipe with the smaller diameter gets the tee or if the two diameters are identical, the pipe in which the water flows away from the node receives the tee.