Chapter 7 : Solution Properties and Physical Equilibria¶

Example 7.2 page : 268¶

In [1]:
import math

# Variables
T = 154.5 			#C
P = 8620.*10**3 			#Pa
Tc = 135. 			#C
T0 = 273.1 			#C
Pc = 3648.*10**3 			#Pa
w = 0.1756
V = 0.154
R = 8.3143*10**3

# Calculations
Tr = (T+T0)/(T0+Tc)
Pr =  P/Pc
Z = P*V/(R*(T+T0))
a =  0.42747*R**2 *(Tc+T0)**2 /Pc *(1+ (0.48508 + 1.55171*w - 0.15613*w**2)*(1-math.sqrt(Tr)))**2
b = 0.08664*R*(Tc+T0)/Pc
A =  a*P/(R**2 *(T+T0)**2)
B = b*P/(R*(T+T0))
lnphi =  (Z-1) - math.log(Z-B) - A/B *math.log((Z+B)/Z)
phi = math.exp(lnphi)
f = phi*P

# Results
print "fugacity  =  %d kPa"%(f/10**3)
#The answer is a bit different due to rounding off error in textbook

fugacity  =  3824 kPa


Example 7.3 page : 273¶

In [3]:

# Variables
T = 154.5 			#C
P = 8620.*10**3 			#Pa
Tc = 135. 			#C
T0 = 273.1 			#C
Pc = 3648.*10**3 			#Pa
w = 0.1756
V = 0.154
R = 8.3143*10**3
D = 0.35
Vc = 0.263 			#m**3/kmol

# Calculations
Tr = (T+T0)/(T0+Tc)
Pr =  P/Pc
Zc = Pc*Vc/(R*(Tc+T0))
phi1 = 0.44
phi2 = phi1*10**(D*(Zc-0.27))
f = phi2*P

# Results
print "fugacity  =  %d kPa"%(f/10**3)

# rounding off error.

fugacity  =  3832 kPa


Example 7.4 page : 277¶

In [4]:
import math

# Variables
f0 = 0.7
V = 5.1e-2
P1 = 0.77 			#Mpa
P2 = 10. 			#Mpa
R = 8.3143*10**3
T = 298. 			#K

# Calculations
lnr =  V/(R*T) *(P2-P1)*10**6
f = math.exp(lnr) *f0

# Results
print "Fugacity  =  %.3f Mpa"%(f)

Fugacity  =  0.846 Mpa


Example 7.5 page : 280¶

In [5]:
import math

# Variables
Pt = 0.1013
ya = 0.605
P1 = 0.1373
P2 = 0.06
xa = 0.4

# Calculations
if ya*Pt == xa*Pt and (1-ya)*Pt == (1-xa)*Pt:
print "The system is ideal"
else:
print "The system is not ideal"

The system is not ideal


Example 7.6 page : 282¶

In [6]:

# Variables
Y = 0.06
X = 0.0012
P = 2.53 			#Mpa

# Calculations
y = Y/(1+Y)
x = X/(1+X)
H = y*P/x

# Results
print "Henrys law constant  =  %.2f Mpa"%(H)

Henrys law constant  =  119.48 Mpa


Example 7.7 page : 285¶

In [7]:

# Variables
Hi = 55.
Pi = 11.8
xi = 0.514
H2 = 18.1
H3 = 26.9
Pi2 = 17.4

# Calculations
ai = Pi/Hi
gam = ai/xi
a2 = Pi/H2
gam2 = a2/xi
a3 = Pi2/H3
gam3 = a3/(1-xi)

# Results
print ("part a")
print "Activity of acetic acid  =  %.4f "%(ai)
print " Activity coefficient   =  %.4f "%(gam)

print ("part b")
print "Activity of acetic acid  =  %.4f "%(a2)
print " Activity coefficient   =  %.4f "%(gam2)

print ("part c")
print "Activity of toluene  =  %.4f "%(a3)
print " Activity coefficient   =  %.4f "%(gam3)

part a
Activity of acetic acid  =  0.2145
Activity coefficient   =  0.4174
part b
Activity of acetic acid  =  0.6519
Activity coefficient   =  1.2684
part c
Activity of toluene  =  0.6468
Activity coefficient   =  1.3309