A 4" schedule 40 tee with equal leg diameters has 300 gpm of water at 60 deg F flowing into a straight leg, and 100 gpm converging in from the 90 degree branch leg.

Find the loss coefficients for the straight leg and the branch leg, and the head loss across each flow path.

```
In [1]:
```from fluids.units import *
from math import pi
NPS, Di, Do, t = nearest_pipe(NPS=4, schedule='40')
A = 0.25*pi*Di**2
beta = 1 # same diameters
rho = 998*u.kg/u.m**3
Q_tot = 400*u.gal/u.min
Q_main = 300*u.gal/u.min
Q_leg = 100*u.gal/u.min
v_combined = Q_tot/A
print('The combined velocity is %s' %(v_combined.to(u.ft/u.s)))
branch_flow_ratio = Q_leg/Q_tot
v_main = Q_main/A
v_leg = Q_leg/A
K_branch = K_branch_converging_Crane(D_run=Di, D_branch=Di, Q_run=Q_main, Q_branch=Q_leg, angle=90.0*u.degrees)
print('The branch loss coefficient is %s' %(K_branch))
K_run = K_run_converging_Crane(D_run=Di, D_branch=Di, Q_run=Q_main, Q_branch=Q_leg, angle=90.0*u.degrees)
print('The run loss coefficient is %s' %(K_run))
head_loss_branch = 0.5*rho*v_combined**2*K_branch/(1*u.gravity*rho)
print('The branch head loss is %s' %(head_loss_branch.to(u.ft)))
head_loss_run = 0.5*rho*v_combined**2*K_run/(1*u.gravity*rho)
print('The run head loss is %s' %(head_loss_run.to(u.ft)))

```
```