#calculate the flow rate
#Initalization of variables
import math
p2=190. #psia
p1=110. #psia
v1=2.456
k=1.3
J=778.
A2=1.2 #in^2
#calculations
v2=v1*math.pow(p2/p1,(1/k))
dh=k/(k-1) *144/J *(p2*v1-p1*v2)
Vex=223.8*math.sqrt(dh)
m=A2*Vex/(144.*v2)
#results
print '%s %.2f %s' %("Rate of flow =",m,"lb/sec")
#calculate the rate of flow
#Initalization of variables
import math
h1=1205.8 #Btu/lb
s2=1.5594
sf=1.5948
sfg=1.1117
hf=1188.9 #Btu/lb
hfg=883.2 #Btu/lb
vf=4.049
vfg=vf-0.018
k=1.3
J=778
A2=1.2 #in^2
#calculations
x2=-(s2-sf)/sfg
h2=hf-x2*hfg
v2=vf-x2*vfg
dh=h1-h2
Vex=223.8*math.sqrt(dh)
m=A2*Vex/(144*v2)
#results
print '%s %.2f %s' %("Rate of flow =",m,"lb/sec")
#calculate the blade work, angle and efficiency
#Initalization of variables
import math
alp=14*math.pi/180. #degrees
vb=900. #ft/s
v1=2200. #ft/s
g=32.17 #ft/s^2
#calculations
vrc=v1*math.cos(alp) - vb
W=(2*vrc)/g *vb
eta=W/(v1*v1/ (2*g)) *100.
bet=math.atan(v1*math.sin(alp) /vrc)*180/math.pi
#results
print '%s %d %s' %("Blade work =",W," ft-lb/lb")
print '%s %.1f %s' %("\n Efficiency =",eta," percent")
print '%s %.1f %s' %("\n Blade angle =",bet," degrees")
print '%s' %('The answers are a bit different due to rounding off error')
#calculate the blade work and efficiency
#Initalization of variables
import math
v1=1234. #ft/s
v2=532. #ft/s
kb=0.92
alp=20. #degrees
ve=900. #ft/s
r=2200. #ft/s
g=32.17 #ft/s^2
#calculations
vr=math.sqrt(v1*v1 +v2*v2)
vr2=vr*kb
vrc=vr2*math.cos(alp*math.pi/180.)
W=(v1+vrc)*ve/g
eta=W/(r*r /(2*g)) *100.
#results
print '%s %d %s' %("Blade work =",W,"ft-lb/lb")
print '%s %.1f %s' %("\n Efficiency =",eta," percent")
print '%s' %('The answers are a bit different due to rounding off error')
#calculate the blade reheat in both cases
#Initalization of variables
import math
v1=1234.
v2=532.
kb=0.92
alp=20*math.pi/180. #degrees
ve=900.
r=2200. #ft/s
g=32.17 #ft/s^2
J=778.
w=67000.
#calculations
vr=math.sqrt(v1*v1 +v2*v2)
vr2=vr*kb
vrc=vr2*math.cos(alp)
reheat=(vr*vr - vr2*vr2 )/(2*g*J)
v22=math.sqrt((vrc-ve)*(vrc-ve) +(vr2*math.sin(alp))*(vr2*math.sin(alp)))
ein=r*r /(2*g*J)
eout=w/J + v22*v22 /(2*g*J)
re2=ein-eout
#results
print '%s %.2f %s' %("\n In case 1, Blade reheat =",reheat,"Btu/lb")
print '%s %.1f %s' %("\n In case 2, Blade reheat =",re2," Btu/lb")
#calculate the intermediate pressure
#Initalization of variables
h1=1416.4
s1=1.6842
sf=1.7319
sfg=1.3962
fac=1.05
x2=0.7
#calculations
x6=-(s1-sf)/sfg
h6=1156.3 - x6*960.1
dh6=h1-h6
drop= fac*h6/2
h2=h1-drop
first=(1-x2)*drop
h3=1264.1 +first
h4=1157 #Btu/lb
fac2=(drop+153)/dh6
print '%s' %("From air charts,")
p2=107 #psia
#results
print '%s %d %s' %("Intermediate pressure =",p2,"psia")
#calculate the shaft ouput and engine efficiency
#Initalization of variables
import math
reh=1.047
dh6=292.8
x2=0.7
flow=98000 #lb/hr
loss=200 #hp
#calculations
intwork=reh*dh6*x2
inthp=intwork*flow/2544
sout=inthp-loss
swork=sout*2544/flow
seff=swork/290.1 *100
#results
print '%s %d %s' %("Shaft output =",sout,"hp")
print '%s %.1f %s' %("\n Shaft engine efficiency =",seff,"percent")
#calculate the exit temperature and pressure
#Initalization of variables
h1=1416.4 #Btu/lb
h2=214.5 #Btu/lb
#calculations
hexa=h1-h2
print '%s' %("From Air tables,")
pe=20 #psia
te=321.5 #F
#results
print '%s %d %s' %("Exit Pressure =",pe,"psia")
print '%s %.1f %s' %("\n Exit temperature =",te," F")
#calculate the steam rate required
#Initalization of variables
flow=98000. #lb/hr
loss=200. #hp
x= 0.11 #percent
shp=3000. #hp
#calculations
sflow = x*flow
sflow2= sflow + (flow-sflow)*shp/8060.
srate=sflow2/shp
#results
print '%s %.2f %s' %("Steam rate required =",srate," lb/hp-hr")