#calculate work done, axial thrust and nozzle bucket efficiency
#initialization of varaibles
import math
drop=50. #B/lb
cv=0.95
Vb=700. #fps
alpha=20.*math.pi/180. #radians
beta=30.*math.pi/180. #radians
Cb=0.95
#calculations
V1=cv*math.sqrt(2*32.2*778*drop)
y1=V1*math.cos(alpha)
z1=V1*math.sin(alpha)
y1R=y1-Vb
V1R=math.sqrt(y1R*y1R + z1*z1)
V2R=Cb*V1R
y2R=-V2R*math.cos(beta)
z2=V2R*math.sin(beta)
Wx=(y1R-y2R)*Vb/32.2
Fa=(z1-z2)/32.2
Vc=1582.77
etanb=Wx/(Vc*Vc /(2*32.2))
#results
print '%s %d %s' %("Work per pound of fluid =",Wx,"ft lbf/lbm")
print '%s %.1f %s' %("\n Axial thrust =",Fa,"lbf/lbm/sec")
print '%s %.2f' %("\n Nozzle bucket efficiency = ",etanb)
#Calculate the internal efficiency and the reheat factor
#initialization of varaibles
ha=1187.2 #B/lb
sa=1.6026 #B/lb R
h3s=895 #B/lb
h1s=1090 #B/lb
p1=28 #psia
h2s=993 #B/lb
p2=6.2 #psia
n=0.65
#calculations
print '%s' %("From Table 3,")
h1=ha-n*(ha-h1s)
s1=1.65 #B/lb R
h2dash=1024 #B/lb
h2=h1-n*(h1-h2dash)
s2=1.706 #B/lb R
h3dash=953. #B/lb
h3=h2-n*(h2-h3dash)
etaT=(ha-h3)/(ha-h3s)
reheat=etaT/n
#results
print '%s %.3f' %("Internal efficiency = ",etaT)
print '%s %.2f' %("\n Reheat factor = ",reheat)