#calculate the specific humidity and dew temperature
#initialization of varaibles
Pg=0.4298 #steam tables psi
phi=0.5
P=14.7 #psi
#calculations
pw=phi*Pg
Pa=P-pw
gamma=0.622*pw/Pa
T=55 #F from dew point tables
#results
print '%s %.5f %s' %("Specific humidity =",gamma,"lb water/lb dry air")
print '%s %d %s' %("\n Dew temperature =",T,"F")
#Calculate the enthalpy, relative and specific humidities, Dew point temperature of the liquid
#initialization of varaibles
print '%s' %("From psychrometric chart ,")
hgdp=1061.8
cpw=0.44
tdb=72 #F
cp=0.24
g=0.0071
#calculations
rh=0.42
sp=g
tdp=58 #F
hw=hgdp+cpw*tdb
h=cp*tdb+g*hw
#results
print '%s %.2f %s' %("Enthalpy =",h," B/lb dry air")
print '%s %.2f' %("\n relative humidity = ",rh)
print '%s %.2f' %("\n specific humidity = ",sp)
print '%s %d %s' %("\n Dew point temperature =",tdp,"F")
#calculate the water and heat to be supplied
#initialization of varaibles
print '%s' %("From the psychrometric chart,")
ha=12.9 #B/lb
g1=0.0032 #lb water/ lb dry air
g2=0.0078 #lb water/ lb dry air
hl=13 #B/lb
hd=25.33 #B/lb
p=14.7 #psia
phi=0.6
cp=0.24
t2=70 #F
#calculations
wl=g2-g1
Q=hd-ha-wl*hl
pg=0.1217 #psia
pa=p-pg
G1=0.622*pg*phi/pa
G2=0.00788
wl2=G2-G1
t1=40 #F
hw1=1061.8 + 0.44*t1
hw2=1092.6 #B/lb
Q2=cp*(t2-t1) + G2*hw2 -G1*hw1 - wl2*hl
#results
print '%s' %("Method 1")
print '%s %.4f %s' %("\n Water to be supplied =",wl,"lb/lb of dry air")
print '%s %.1f %s' %("\n heat supplied =",Q,"B/lb of dry air")
print '%s' %("\n Method 2")
print '%s %.5f %s' %("\n Water to be supplied =",wl2,"lb/lb of dry air")
print '%s %.1f %s' %("\n heat supplied =",Q2,"B/lb of dry air")
#Calculate the air supplied, temperature and humidity of air
#initialization of varaibles
print '%s' %("From psychrometric charts,")
e=0.7
phi=0.5
g1=0.0131 #lb water/lb dry air
h1=32.36 #B/lb of dry air
g3=0.0073
h3=24.26 #B/lb
pg=0.3390 #psia
T3=528 #R
V3=1000
Rw=85.8
#calculations
pw3=phi*pg
ww3=pw3*144*V3/(Rw*T3)
wa3=ww3/g3
wa1=phi*wa3
wa2=phi*wa3
ww1=g1*wa1
ww2=ww3-ww1
g2=ww2/wa2
h2=(wa3*h3-wa1*h1)/wa2
tdb=61 #F
#results
print '%s %.3f %s' %("Air supplied =",ww2,"lb/min")
print '%s %d %s' %("\n temperature =",tdb,"F")
print '%s %.5f %s' %("\n Humidity =",g2,"lb water/lb dry air")
#Calculate the cooling temperature, heat transfer and fraction of heat removed
#initialization of varaibles
print '%s' %("From psychrometric charts,")
g1=0.0131 #lb water/lb dry air
g2=0.0093 #lb water/lb dry air
h1=32.36 #B/lb dry air
h2=27.03
hd2=23.4 #B/lb dry air
hf=23.4 #B/lb dry air
hw1=1094.5
#calculations
tdp=55.3 #F
wratio=g1-g2
Qc=hd2-h1+wratio*hf
Qh=h2-hd2
Heat=wratio*(hw1-hf)
frac=-Heat/Qc
#results
print '%s %.1f %s' %("Cooling temperature = ",tdp,"F")
print '%s %.2f %s' %("\n heat transfer = ",Heat,"B/lb dry air")
print '%s %.2f' %("\n Fraction of heat removed =",frac)