# Chapter 2 : PVT Properties of Fluids - Equations of State¶

## Example 2.1 page : 13¶

In :

# Variables
basis  =  1 			#kmol n bumath.tane
P = 1.013*10**5 			#N/m**2
R = 8.3143*10**3 			#J/kmol K
T = 272.6 			#K

# Calculations
V = basis*R*T/P
Ts = 373.1 			#K
Vs = basis*R*Ts/P

# Results
print "Volume in case 1  =  %.2f m**3"%(V)
print " Volume in case 2  =  %.2f m**3"%(Vs)

Volume in case 1  =  22.37 m**3
Volume in case 2  =  30.62 m**3


## Example 2.2 page : 15¶

In :

# Variables
Vb = 30 			#m**3/kmol
P = 1.013*10**5 			#Pa
R = 8.3143*10**3 			#J/kmol K
T = 373.1 			#K

# Calculations
Z = P*Vb/(R*T)

# Results
print "Compressibility factor  =  %.3f"%(Z)

Compressibility factor  =  0.980


## Example 2.3 page : 21¶

In :
import math

# Variables
Pc = 22.12*10**6 			#Pa
Tc = 647.3 			#K
Vc = 0.05697 			#m**3/Kmol
R = 8.3143*10**3
Tr = 0.7

# Calculations
Zc = Pc*Vc/(R*Tc)
T = Tr*Tc
Ps = 10**6 			#Pa
w = -math.log10(Ps/Pc) -1

# Results
print "critical compressibility factor   =  %.3f"%(Zc)
print " Accentric factor  =  %.4f"%(w)

critical compressibility factor   =  0.234
Accentric factor  =  0.3448


## Example 2.4A page : 28¶

In :

# Variables
basis =  1 			#kmol ammonia
P = 10**6 			#pa
a = 4.19
b = 0.0373
R = 8314.3
Tc = 405.5
Pc = 11.28*10**6

# Calculations
print ("case a")
print ("Umath.sing vandwerwaals equation, ")
print ("(P+a/v**2)*(V-b)  =  R*T, on solving by trail and error method,")
V = 3
print "Volume  =  %d m**3/kmol"%(V)

case a
Umath.sing vandwerwaals equation,
(P+a/v**2)*(V-b)  =  R*T, on solving by trail and error method,
Volume  =  3 m**3/kmol


## Example 2.4B page : 28¶

In :

# Variables
basis =  1. 			#kmol ammonia
P = 10.**6 			#pa
a = 4.19
b = 0.0373
R = 8314.3
Tc = 405.5
Pc = 11.28*10**6

# Calculations
print ("part b")
an = 27*R**2*Tc**2 /(64*Pc)
bn = R*Tc/(8*Pc)
V = 3

# Results
print "Since an and bn are same as a and b, V is the same  =  %d m**3/kmol"%(V)

# note : rounding off error.

part b
Since an and bn are same as a and b, V is the same  =  3 m**3/kmol


## Example 2.4C page : 28¶

In :

# Variables
print ("part c")
print ("USing SRK equation, P =  RT/(V-b) -alph*a/(V*(V+b))")
print ("By trail and error method,")

# Calculations
v2 = 2.98

# Results
print "volume  =  %.2f m**3/kmol"%(v2)

part c
USing SRK equation, P =  RT/(V-b) -alph*a/(V*(V+b))
By trail and error method,
volume  =  2.98 m**3/kmol


## Example 2.5 page : 36¶

In :

# Variables
Pc = 22.12*10**6 			#Pa
Tc = 647.3 			#K
Zc = 0.234
T = 973.1 			#K
P = 25*10**6 			#Pa

# Calculations
Tr = T/Tc
Pr = P/Pc
Z = 0.916
Zn = Z+0.05*(Zc-0.27)

# Results
print "Compresson factor  =  %.3f "%(Zn)

Compresson factor  =  0.914


## Example 2.6 page : 39¶

In :

# Variables
w = 0.3448
Z0 = 0.898
Z1 = 0.08

# Calculations
Z = Z0 + Z1*w

# Results
print "Compression factor  =  %.3f "%(Z)

Compression factor  =  0.926