from __future__ import division
from math import cos, sin, atan, acos, sqrt
#initialisation of variables
c=400 #steam speed in m/s
alpla=12 #angle in degrees
cwo=0
pi=(22/7)
#CALCULATIONS
u=c*cos(12*(pi/180))/2
cwi=c*cos(12*(pi/180))
cfi=c*sin(12*(180/pi))
thetha=atan(cfi/(cwi-u))*(pi/180)
cro=sqrt((cfi)**2+(cwi-u)**2)
phi=acos(u/cro)*(180/pi)
wo=(cwi-cwo)*u
ke=(c)**2/2
eff=wo/ke
#RESULTS
print 'blade efficiency is %0.3f'%(eff)
from math import asin
#initialisation of variables
hd=159 #heat drop in kj/kg
eff=0.89 #and its corresponding efficiency is mentioned
ra=0.4 #ratio of blade speed to steam speed
sp=3000 #rotational speed of an impulse turbine wheel in revolutions
a=20 #angle is 20 degrees
beff=0.76 #blade efficiency
cwo=5.4 #m/s
pi=(22/7)
bvc=0.82 #blade velocity coefficient
m=15 #mass is 15 kgs
#CALCULATIONS
ci=44.72*sqrt(eff*hd)
u=ci*ra
dm=(60*u)/(sp*0.3184)
cfi=ci*sin(20*(pi/180))
cwi=ci*cos(20*(pi/180))
cri=sqrt((cwi-u)**2+(cfi)**2)
cro=bvc*cri
x=(beff*(ci)**2)/(2*u) #x=cwi-cwo
theta=atan((cfi/(cwi-u)))*(180/pi)
cfo=sqrt((cro)**2-(cwo+u)**2)
co=sqrt((cwo)**2+(cfo)**2)
bet=(asin(cfo/co))*(180/pi)
pd=(m*x*u)/1000
re=hd-(pd/15)
phi=asin((cfo/cro))*(180/pi)
#RESULTS
print 'mean blade ring diameter is %0.3fm'%(dm) #textbook answer is wrong
print '\npower developed is %0.2f kW'%(pd)
print '\nresidual energy at out let foe friction and nozzle efficiency is %0.1f kW/kg'%(re)
print '\nblade angles are %0.1f, %0.1f, %0.1f'%(theta,bet,phi)
from math import tan
#initialisation of variables
alpha=20 #angle in degrees
theta=27 #angle in degrees
m=10 #kgs
vs=0.4799 #specific volume in m*m*m/kg
pi=(22/7)
u=100 #blade speed in m/s
#CALCULATIONS
ci=u*tan(27*(pi/180))/(cos(20*(pi/180))*tan(27*(pi/180))-sin(20*(pi/180)))
x=2*ci*cos(20*(pi/180))-u
pd=m*x*u
cf=ci*sin(20*(pi/180))
a=(m*vs)/cf
dm=sqrt(a/(0.08*pi))
h=0.08*dm
#RESULTS
print 'power developed is %0.f KW'%(pd/1e3)
print '\narea of flow is %0.5f m*m'%(a)
print '\nblade height is %0.f mm'%(h*1e3)
#initialisation of variables
sp=1500 #rotational speed of an impulse turbine wheel in revolutions
pi=(22/7)
dm=1.5 #diameter in m
ra=0.8 #ratio of blade speed to steam speed
x=159 #x=cwi-cwo in m/s
m=10 #kgs mass
cf=50.4 #m*m*m/kg
vs=1.159 #
#CALCULATIONS
u=(pi*dm*sp)/60
ci=u/ra
pd=(m*x*u)/1000
a=(m*vs)/cf
h=a/(pi*dm)
#RESULTS
print 'power developed for steam flow is %0.1f kW'%(pd)
print '\nheight of the blade is %0.4f m'%(h)
#initialisation of variables
u=170 #blade velocity in m/s
ra=0.2 #ratio of blade speed to steam speed
cril=696 #m/s
co1=0.84 #velocity coefficient
co2=0.87 #velocity coefficient
co3=0.90 #velocity coefficient
cri2=232 #m/s
#CALCULATIONS
ci=u/ra
crol=cril*co1
ci2=crol*co2
cro2=cri2*co3
wd=(1176+344)*u*10**-3
beff=wd*1000*2/(ci**2)
#RESULTS
print 'work developed in the blade is %0.1f kJ/kg'%(wd)
print '\nblading efficiency is %0.3f '%(beff)
#initialisation of variables
u=250 #blade speed in m/s
theta=80 #angle in degrees
alpha=20 #angle in degrees
oed=786.7 #overall enthalpic drop in kj/kg
sp=3000 #rotational speed of an impulse turbine wheel in revolutions
p=6000 #power developed in kw
rf=1.04 #reheat factor
ie=2993.4 #kj/kg
vs=9.28 #m*m*m/kg
pi=(22/7)
#CALCULATIONS
ci=(u*sin(100*(pi/180)))/sin(60*(pi/180))
x=(2*ci*cos(20*(pi/180)))-u #x=cwi-cwo
wd=x*u*10**-3
ed=wd*10
teff=ed/oed
seff=teff/rf
m=p/ed
ae=ie-ed
cf=ci*sin(20*(pi/180))
a=(m*vs)/cf
dm=(60*u)/(pi*sp)
h=a/(pi*dm)
#RESULTS
print 'enthalpy drop is %0.f kJ/kg'%(ed)
print '\nturbine efficiency is %0.3f'%(teff)
print '\nstage efficiency is %0.3f'%(seff)
print '\nmass flow of steam is %0.2f kg/s'%(m)
print '\nblade height is %0.3f m'%(h)
#initialisation of variables
x1=3025 # according to 20 bar pressure and 300 degrees temp
x2=2262 #according to 20 bar pressure and 300 degrees temp
x3=2039 #according to 20 bar pressure and 300 degrees temp
x4=2896 #according to 20 bar pressure and 300 degrees temp
x5=2817 #according to 20 bar pressure and 300 degrees temp
x6=2728 #according to 20 bar pressure and 300 degrees temp
x7=2699 #according to 20 bar pressure and 300 degrees temp
x8=2592 #according to 20 bar pressure and 300 degrees temp
x9=2525 #according to 20 bar pressure and 300 degrees temp
x10=2430 #according to 20 bar pressure and 300 degrees temp
x11=2398 #according to 20 bar pressure and 300 degrees temp
x12=2262 #according to 20 bar pressure and 300 degrees temp
x13=2192 #according to 20 bar pressure and 300 degrees temp
#CALCULATIONS
ieff=(x1-x2)/(x1-x3)
feff=(x1-x4)/(x1-x5)
seff=(x4-x6)/(x4-x7)
teff=(x6-x8)/(x6-x9)
oeff=(x8-x10)/(x8-x11)
yeff=(x10-x12)/(x10-x13)
ced=(x1-x5)+(x4-x7)+(x6-x9)+(x8-x11)+(x10-x13)
rf=ced/(x1-x3)
#RESULTS
print 'cumulative enthaloy drop is %.f'%(ced)
print '\nreheat factor is %.2f'%(rf)