import math
# variables
nu = 0.00001; # sqft/sec
d = 1.; #in
R_c = 2100.;
# calculations
V = R_c*nu/(d/12);
Q = V*0.25*math.pi*(d/12)**2;
# results
print 'Q = %.6f cfs'%(Q);
import math
# calculations
e = 0.2/(1./0.33)
l2 = 0.2/(1.94 * (1/0.33)**2)
l = math.sqrt(l2)
k2 = 0.2/(1.94 * (1/0.33)**2 / (-1/(0.33**2)**0.5)**2)
k = math.sqrt(k2)
# results
print "E = %.3f lb-sec/sqft"%e
print "l = %.3f ft"%l
print "k = %.2f"%k
import math
# variables
G = 240.; #lb/sec
A1 = 4.; #sqft
A2 = 2.; #sqft
z1 = 30.; #ft
z2 = 80.; #ft
V1 = 600.; # fps
V2 = 800.; #fps
p1 = 20.; #psia
p2 = 35.; # psia
# calculations
gam1 = G/(A1*V1);
gam2 = G/(A2*V2);
T1 = p1*144/(53.3*gam1);
T2 = p2*144/(53.3*gam2);
del_H = 186.5*(T2-T1);
E_H1 = (V2**2)/(2*32.2) - (V1**2)/(2*32.2) +del_H+z2-z1;
E_H2 = (V2**2)/(2*32.2) - (V1**2)/(2*32.2) +del_H;
Q = G*E_H2/550.;
# results
print 'T1 = %d degreeR, T2 = %d degreeR'%(T1,T2);
print ' The net heat energy added = %d hp'%(round(Q,-1));
#answer differs due to rounding-off errors
import math
# variables
G = 50.; #cfs
Q = 400.; #hp
A1 = 4.; #sqft
A2 = 2.; #sqft
z1 = 30.; #ft
z2 = 80.; #ft
p1 = 20.; #psi
p2 = 10.; #psi
# calculations
V1 = G/A1;
V2 = G/A2;
E_p = Q*(550/62.4)/G;
h_L = (p1-p2)*144/62.4 + (V1**2 - V2**2)/(2*32.2) +(z1-z2)+E_p;
# results
print 'Head lost = %.1f ft'%(h_L);
import math
# variables
b = 3.; #ft
d = 2.; #ft
l = 200.; #ft
h_L = 30.; #ft
# calculations
tau_0 = h_L*62.4*b*d/(10*l); #0.00694
# results
print 'The resistance stress exerted between fluid and conduit walls = %.2f psf = %.3f psi'%(tau_0,tau_0*0.00694);
import math
# variables
h_L = 30.; #ft
l = 200.; #ft
d = 2.; #ft
r = 8.; #in
# calculations
#part (a)
tau_0 = h_L*62.4/(d*l);
#part(b)
tau = (0.5*r/12)*(tau_0*0.00694);
# results
print 'Parta): Shear stress = %.2f psf = %.4f psi '%(tau_0,tau_0*0.00694);
print 'Partb): Shear stress = %.4f psi '%(tau);