#Calculate the final temperature and heat transferred from the steam
#initialization of varaibles
P1=100. #psia
T1=500+460. #R
v=10. #cu ft
P2=50. #psia
cv=0.172
R=53.34
m=2.81 #lb
#calculations
T2=T1*P2/P1
Q1=P1*144*v*cv*(T2-T1)/(R*T1)
u1=165.26 #Btu/lb
u2=81.77 #Btu/lb
du=u2-u1
Q2=m*du
#results
print '%s' %("Case 1,")
print '%s %d %s' %("\n Final temperature of the steam = ",T2,"R")
print '%s %.1f %s' %("\n Heat transferred =",Q1,"Btu")
print '%s %.1f %s' %("\n Heat transferred in case 2 =",Q2,"Btu")
print '%s' %("\n The answer may be a bit different due to rounding off error in the textbook")
#Calculate the final temperature and heat transferred
#initialization of varaibles
P1=100. #psia
T1=500.+460 #R
V=10. #cu ft
P2=50. #psia
cv=0.172
R=53.34
v=5.589 #cu ft/lb
#calculations
m=V/v
x2=(v-0.017)/8.498
print '%s' %("From table 2,")
T2=281.01 #F
h1=1279.1
u1=h1-144*P1*v/778.
uf=249.93
ufg=845.4
u2=uf+x2*ufg
Q=m*(u2-u1)
#results
print '%s %.2f %s' %("Final temperature =",T2,"F")
print '%s %d %s' %("\n Heat transferred =",Q,"Btu")
#Calculate the final temperature, Enthalpy and heat transferred in the process
#initialization of varaibles
T1=350+460 #R
v1=6 #cu ft/lb
m=1 #lb
R=53.34
v2=2*v1
cp=0.24
#calculations
P=R*T1/(v1*144)
W=P*144*(v2-v1)
T2=T1*v2/v1
Q=cp*(T2-T1)
h1=194.25
h2=401.09
dh=h2-h1
#results
print '%s %d %s' %("Final temperature =",T2-460,"F")
print '%s %.2f %s' %("\n Enthalpy =",dh,"B/lb")
print '%s %d %s' %("\n Heat =",Q,"B/lb")
#Calculate the final temperature, Enthalpy and heat transferred in the process
#initialization of varaibles
T1=350+460. #R
v1=6 #cu ft/lb
m=1 #lb
R=53.34
v2=2*v1
cp=0.24
#calculations
print '%s' %("From steam tables,")
vg=3.342 #cu ft/lb
P1=77.5 #psia
P2=P1
h1=1204.8 #B/lb
v2=2*v1
T2=1106 #F
h2=1586.7 #B/lb
Q=h2-h1
W=P1*144*(v2-v1)
#results
print '%s %d %s' %("Final temperature =",T2,"F")
print '%s %d %s' %("\n Work =",W,"ft lb/lb")
print '%s %.1f %s' %("\n Heat =",Q,"B/lb")
#calculate the final pressure, work done and change in internal energy of the process
#initialization of varaibles
import math
T1=400+460. #R
P1=50. #psia
ratio=1/10.
R=53.34
#calculations
P2=P1/ratio
W=R*T1*math.log(ratio)
du=0
#results
print '%s %d %s' %("Final pressure =",P2,"psia")
print '%s %.1f %s' %("\n Work done =",W,"B/lb")
print '%s %d %s' %("\n Change in Internal energy ",du,"Btu/lb")
#calculate the final pressure, work done and change in internal energy of the process
#initialization of varaibles
T1=400+460. #R
P1=50. #psia
ratio=1/10.
R=53.34
v1=10.065 #cu ft/lb
vfg=1.8447 #cu ft/lb
vg=1.8633 #cu ft/lb
#calculations
v2=v1*ratio
dx=(v2-vg)/vfg
P2=247.3 #psia
print '%s' %("From steam tables,")
u2=773. #B/lb
u1=1141.6 #B/lb
du=u2-u1
s1=1.7349 #B/lb R
s2=1.082 #B/lb R
W=T1*(s2-s1) - du
#results
print '%s %.1f %s' %("Final pressure = ",P2,"psia")
print '%s %d %s' %("\n Work done =",W,"B/lb")
print '%s %d %s' %("\n Change in Internal energy = ",du,"B/lb ")
#Calculate final specific volume and work per pound of fluid in the problem
#initialization of varaibles
import math
P1=150. #psia
T1=400.+460 #R
P2=15. #psia
g=1.4
R=53.34
#calculations
Tratio=math.pow((P2/P1),((g-1)/g))
W=53.34*T1*(Tratio-1)/(1-g)
T2=T1*Tratio
v2=R*T2/(P2*144)
u1=147.50
Pr1=7.149
Pr2=Pr1*P2/P1
print '%s' %("From tables,")
Pr=0.7149
T2=447. #R
u2=76.13 #B/lb
W=-(u2-u1)
v2=R*T2/(P2*144)
#results
print '%s %.1f %s' %("Final specific volume =",v2,"cu ft/lb")
print '%s %.1f %s' %("\n Work per pound of fluid =",W,"B/lb")
#Calculate final specific volume and work per pound of fluid in the problem
#initialization of varaibles
print '%s' %("From Steam tables,")
h1=1219.4
P1=150 #psia
v1=0.59733 #cu ft/lb
s1=1.5995 #B/lb R
#calculations
u1=h1-P1*v1
sg=1.7549
sfg=1.4415
s2=s1
dx=(sg-s2)/sfg
u2=981.3
W=u1-u2
v2=23.48
#results
print '%s %.2f %s' %("Final specific volume =",v2,"cu ft/lb")
print '%s %.1f %s' %("\n Work per pound of fluid = ",W,"B/lb")
#calculate the final specific volume, temperature and the net heat transferred in the process
#initialization of varaibles
import math
P1=150. #psia
T1=400.+460 #R
P2=15. #psia
n=1.15
cv=0.172
R=53.34
#calculations
v2=R*T1*math.pow((P1/P2),(1/n)) /(P1*144.)
v1=R*T1/(P1*144.)
T2=T1*P2*v2/(P1*v1)
Q=(cv - 0.458)*(T2-T1)
#results
print '%s %.1f %s' %("Final specific volume = ",v2,"cu ft/lb")
print '%s %d %s' %("\n Final temperature =",T2,"R")
print '%s %.1f %s' %("\n Heat transferred =",Q,"B/lb")
#calculate the final specific volume, temperature and the net heat transferred in the process
#initialization of varaibles
import math
print '%s' %("From table 3,")
v1=3.223 #cu ft/lb
P1=150. #psia
T1=400.+460 #R
P2=15. #psia
n=1.15
#calculations
v2=v1*math.pow((P1/P2),(1/n))
T2=213 #F
W=144*(P2*v2-P1*v1)*0.00129/(1-n)
u1=1129.8 #B/lb
v2=23.9
vg=26.29
vfg=26.27
dx=(vg-v2)/vfg
u2=996.1
Q=(u2-u1)+W
#results
print '%s %.1f %s' %("Final specific volume =",v2,"cu ft/lb")
print '%s %d %s' %("\n Final temperature =",T2," F")
print '%s %.1f %s' %("\n Heat transferred =",Q,"B/lb")
#calculate the final specific volume, temperature and the net work done in the process
#initialization of varaibles
v2=15.7 #cu ft/lb
T2=640 #R
cv=0.172
T1=400+460. #R
#calculations
du=cv*(T2-T1)
W=-du
#results
print '%s %.1f %s' %("Final specific volume =",v2,"cu ft/lb")
print '%s %d %s' %("\n Final temperature =",T2,"R ")
print '%s %.1f %s' %("\n Work done =",W,"B/lb")
#calculate the final specific volume, temperature and the net work done in the process
#initialization of varaibles
print '%s' %("From steam tables,")
T2=213 #F
v2=23.9 #cu ft/lb
W=133.7 #B/lb
#results
print '%s %.1f %s' %("Final specific volume =",v2,"cu ft/lb")
print '%s %d %s' %("\n Final temperature =",T2,"F")
print '%s %.1f %s' %("\n Work done = ",W," B/lb")