Chapter 16: Chemical and Phase Equilibrium

Example 16-1 ,Page No.798

In [22]:
from math import exp

#given data
T=298.15;#reaction temperature in K

#from Table A-26
g=455510;

#constants used
R=8.314;#in kJ/kmol K

#calculations
# N2 = 2N
dG=2*g;
logKp=-dG/(R*T);
Kp=exp(logKp);
print('Kp = ',Kp)
print'in comparison to Table A-28 ln Kp value of -367.5 our result is %i'%logKp;
('Kp = ', 2.4396097259977668e-160)
in comparison to Table A-28 ln Kp value of -367.5 our result is -367

Example 16-2 ,Page No.798

In [11]:
#given data
P=10;#pressure in atm

#constants
vH2=1;
vH=2;

#calculations
# H2 = 0.9H2 + 0.2H
NH=0.2;
NH2=0.9;
Nt=NH+NH2;
#from Eq. 16-15
Kp=((NH**vH)/(NH2**vH2))*(P/Nt)**(vH-vH2);
#at this value of Kp from Table A-28
T=3535;
print'temperature %i K is'%T;
temperature 3535 K is

Example 16-6 ,Page No.807

In [13]:
from math import log

#reaction
# H2 + 0.5O2 = H2O
#enthalpy datas in kJ/kmol 
#of H2
hfH=-241820;
h2000H=82593;
h298H=9904;
#of O2
hfO=0;
h2000O=61400;
h298O=8468;
#of H2O
hfw=0;
h2000w=67881;
h298w=8682;
#Kp data from A-28
Kp2=869.6;
Kp1=18509;
T1=1800;
T2=2200;

#constants used
Ru=8.314;#in kJ/kmol K

#calculations
#part - a
hR=1*(hfH+h2000H-h298H)-1*(hfO+h2000O-h298O)-0.5*(hfw+h2000w-h298w);
print'enthalpy of the reaction %i kJ/kmol using enthalpy data'%round(hR);
#part - b
hR=Ru*(T1*T2)/(T2-T1)*log(Kp2/Kp1);
print'enthalpy of the reaction %i kJ/kmol using enthalpy data'%round(hR);
enthalpy of the reaction -251663 kJ/kmol using enthalpy data
enthalpy of the reaction -251698 kJ/kmol using enthalpy data

Example 16-7 ,Page No.809

In [16]:
#given data
T=120+273.15;#temperature of saturated water in K

#from Table A-4
hf=503.81;
hg=2706;
sf=1.5279;
sg=7.1292;

#calculations
print('liquid phase');
gf=hf-T*sf;
print'gf value %f kJ/kg'%round(gf,1);
print('vapour phase');
gg=hg-T*sg;
print'gg value %f kJ/kg'%round(gg,1);
liquid phase
gf value -96.900000 kJ/kg
vapour phase
gg value -96.800000 kJ/kg

Example 16-8 ,Page No.813

In [20]:
#given data
T=15;#lake temperature in C
P=92.0;#atmospheric pressure in kPa

#from Table A-4
Pv=1.7057;

#calculations
yv=Pv/P;
print'mole fraction of water vapor at the surface is %f'%round(yv,4);
yw=1-yv;
print'mole fraction of water in the lake is %f percent'%(round(yw)*100)
mole fraction of water vapor at the surface is 0.018500
mole fraction of water in the lake is 100.000000 percent

Example 16-9 ,Page No.214

In [21]:
#given data
T=17.0;#lake temperature in C
P=92.0;#atmospheric pressure in kPa

#from Table A-4
Pv=1.96;

#constants from Table 16-2
H=62000.0;

#calculations
Pda=P-Pv;#dry air
yda=Pda/H/100;#in bar
print'mole fraction of air is %f'%(yda)
mole fraction of air is 0.000015

Example 16-10 ,Page No.814

In [22]:
#given data
T=358;#hydrogen gas temperature in K
P=300/100;#pressure of hydrogen gas in bar

#constants used
M=2;
s=0.00901;#solubility in kmol/m^3 bar
p=0.027;

#calculations
pH2=s*P;
print'molar density of H2 %f kmol/m^3'%round(pH2,3);
pH2=p*M;
print'mass density of H2 %f kg/m^3'%round(pH2,3)
molar density of H2 0.027000 kmol/m^3
mass density of H2 0.054000 kg/m^3

Example 16-11 ,Page No.815

In [25]:
#given data
yw=0.30;#water mole fraction
ya=0.70;#ammonia mole fraction
T=40;#mixture temperature in C

#saturation pressure
pw=7.3851;
pa=1554.33;
#calulations
Pw=yw*pw;
Pa=ya*pa;
Pt=Pw+Pa;
yw=Pw/Pt;
ya=Pa/Pt;
print'mole fraction of water vapour %f'%round(yw,4);
print'mole fraction of ammonia %f'%round(ya,4);
mole fraction of water vapour 0.002000
mole fraction of ammonia 0.998000