# Chapter 13 : Ideal Gases¶

### Example 13.1 Page No. 404¶

In :
# Variables
m_CO2 = 40. ;			# Mass of CO2-[kg]
mol_wt_CO2 = 44. ;			# Molecular mass of 1kmol CO2 -[kg]
mol_V = 22.42 ;			# Molar of ideal gas at standard condition-[cubic metre/kg mol]

# Calculations
V_CO2 = (m_CO2 * mol_V)/(mol_wt_CO2);			# volume of CO2-[cubic metre]

# Results
print 'Volume occupied by 40 kg CO2 at standard condition is  %.1f cubic metre.'%V_CO2

Volume occupied by 40 kg CO2 at standard condition is  20.4 cubic metre.


### Example 13.2 Page No. 405¶

In :
# Variables
p =1. ;			# Pressure -[atm]
V = 22415. ;			# Molar valume -[cubic centimetre/g mol]
T = 273.15 ;			# Temperature-[K]

# Calculations
R = (p*V/T);			# Universal gas constant-[(cubic centimetre.atm)/(K.g mol)]

# Results
print 'Universal gas constant is  %.2f (cubic centimetre*atm)/(K*g mol). '%R

Universal gas constant is  82.06 (cubic centimetre*atm)/(K*g mol).


### Example 13.3 Page No.406¶

In :
# Variables
m_CO2 = 88. ;			#   Mass of CO2-[lb]
mol_wt_CO2 = 44.  ;		#   Molecular mass of 1 lb mol CO2 -[lb]
mol_V = 359. ; 			#   Molar volume-[cubic feet]

#  State 1-standard condition
P1 = 33.91 ; 			#   Pressure -[ft of water]
T1 = 273.  ;			#  Temperature-[K]

#   State 2
P2 = 32.2  ;			#   Pressure -[ft of water]
Tc = 15.  ;			    #   Temperature-[degree C]
T2 = Tc+273  ;			#  Temperature-[K]

# Calculations
V1 = (m_CO2 * mol_V) / (mol_wt_CO2);
V2 = (V1 * T2 * P1) / (T1 * P2);

# Results
print 'The volume occupied 88 lb of CO2 at given condition is  %.0f cubic feet.'%V2

The volume occupied 88 lb of CO2 at given condition is  798 cubic feet.


### Example 13.4 Page No. 408¶

In :
# Variables
mol_wt_N2 = 28. ;	# Molecular mass of 1 kg mol N2 -[kg]
mol_V = 22.42 ;		# Molar of ideal gas at standard condition-[cubic metre/kg mol]
Tc =  27. ;			# Temperature-[degree C]
T = Tc + 273. ;		#Temperature-[K]
P = 100. ;			#Pressure-[kPa]

Ps = 101.3 ;		# Pressure -[kPa]
Ts = 273. ;			#Temperature-[K]

# Calculations
V = (T *  Ps *  mol_V)/(Ts *  P) ;			# Volume occupied by N2-[cubic metre]
D_N2 = mol_wt_N2/V ;			            # Density of N2 at given condition-[kg/cubic metre]

# Results
print ' Density of N2 at given condition is  %.3f kg/cubic metre.'%D_N2

 Density of N2 at given condition is  1.122 kg/cubic metre.


### Example 13.5 Page No. 409¶

In :
# Variables
mol_wt_N2 = 28. ;			# Molecular mass of 1 lb mol N2 -[lb]
mol_wt_air = 29. ;			# Molecular mass of 1 lb mol air -[lb]
mol_V = 359. ;			    # Molar volume of ideal gas-[cubic feet]

Tf =  80. ;			# Temperature-[degree F]
T = Tf + 460. ;		#Temperature-[degree Rankine]
P = 745. ;			#Pressure-[mm of Hg]

Ps = 760. ;			# Pressure -[mm of Hg]
Ts = 492. ;			#Temperature-[degree Rankine]

# Calculations
D_air = (Ts *  P *  mol_wt_air)/(T *  Ps *  mol_V) ;		# Density of air at given condition-[lb/cubic feet]
D_N2 = (Ts *  P *  mol_wt_N2)/(T *  Ps *  mol_V) ;			# Density of N2 at given condition-[lb/cubic feet]
sg_N2 = D_N2/D_air ;			                            # Specific gravity of N2 compared to air at given condition

# Results
print ' Specific gravity of N2 compared to air at given condition  is  %.3f .'%sg_N2

 Specific gravity of N2 compared to air at given condition  is  0.966 .


### Example 13.6 Page No. 414¶

In :
# Variables
F_gas =  1. ;			    # Flue gas [kg mol]
mf_CO2 = 14./100 ;			# [mol fraction]
mf_O2 = 6./100 ;			# [mol fraction]
mf_N2 = 80./100 ;			# [mol fraction]
P = 765. ;			        #Pressure-[mm of Hg]
T =  400. ;			        # Temperature-[degree F]

# Calculations
p_CO2 = P * mf_CO2 ;		# Partial pressure of CO2-[mm of Hg]
p_O2 = P * mf_O2 ;			# Partial pressure of O2-[mm of Hg]
p_N2 = P * mf_N2 ;			# Partial pressure of N2-[mm of Hg]

# Results
print ' Component            pi(Partial pressure-[mm of Hg]) '
print '  CO2                  %.1f mm of Hg '%p_CO2
print ' O2                   %.1f mm of Hg '%p_O2
print ' N2                   %.1f mm of Hg '%p_N2

 Component            pi(Partial pressure-[mm of Hg])
CO2                  107.1 mm of Hg
O2                   45.9 mm of Hg
N2                   612.0 mm of Hg


### Example 13.7 Page no. 416¶

In :
# Variables
G = 100. ;			# Basis: Pyrolysis Gas-[lb mol]
ub_CO = 10./100 ;	# fraction of CO left unburnt
ex_air = 40./100 ;	# fraction of excess air
m_vol = 359. ;		# molar volume of gas at std. cond.-[cubic feet]
Ts = 492. ;			# Standard temperature -[degree Rankine]
Ps = 29.92 ;		#Standard pressure -[in. Hg]

# Calculations
# Analysis of entering gas of entering gas
Tf1 =  90. ;			# Temperature of gas-[degree F]
T_gas = Tf1 +  460. ;	#Temperature of gas-[degree Rankine]
P_gas = 35. ;			#Pressure-[in. Hg]
CO2 = 6.4/100 ;			# mol fraction of CO2
O2 = 0.1/100 ;			# mol fraction of O2
CO = 39./100 ;			# mol fraction of CO
H2 = 51.8/100 ;			# mol fraction of H2
CH4 = 0.6/100 ;			# mol fraction of CH4
N2 = 2.1/100 ;			# mol fraction of N2

# Analysis of entering air
Tf2 = 70. ;			    # Temperature of air -[degree F]
T_air = Tf2 +  460. ;	#Temperature of air-[degree Rankine]
P_air = 29.4 ;			#Pressure of air [in. Hg]
f_N2 = 79./100 ;			# mol fraction of N2
f_O2 =  21./100 ;			# mol fraction of O2

O2r_O2 = O2 * G ;			#  O2 required by O2-[lb mol]
O2r_CO = CO * G/2 ;			# O2 required by CO-[lb mol]
O2r_H2 = H2 * G/2 ;			# O2 required by H2-[lb mol]
O2r_CH4 = G * CH4 * 2 ;			# O2 required by CH4-[lb mol]
O2r_total = O2r_O2 +  O2r_CO +  O2r_H2 +  O2r_CH4 ;			# Total O2 required-[lb mol]
ex_O2 = ex_air * O2r_total ;			# Excess O2-[lb mol]
total_O2 = ex_O2 +  O2r_total ;			# Total amt of O2 in air-[lb mol]
total_N2 = total_O2 * (f_N2/f_O2);			# Total amt of in air-[lb mol]
air = total_O2 +  total_N2 ;			# Total air entering -[lb mol]

# Product analysis
P_CO = ub_CO * CO * G ;			#Unburnt CO in P-[lb mol]
P_N2 = N2 * G +   total_N2 ;			#  N2 in P-[lb mol]
P_CO2 =  (CO2 +  CO +  CH4) * G - 1 * P_CO;			#CO2 in P-[lb mol]
P_H2O = (H2 +  2 * CH4) * G ;			# H2 in P-[lb mol]
P_O2 = (CO2 +  O2 +  0.5 * CO) * G +  total_O2 -P_CO2-0.5 * (P_H2O +  P_CO);			# O2 in P-[lb mol]
P = P_CO +  P_N2 +  P_CO2 +  P_H2O +  P_O2 ;			# Product-[lb mol]
Tf3 =  400  ;			# Temperature of product-[degree F]
T_prod = Tf3 +  460 ;			#Temperature of product-[degree Rankine]
P_prod =  35 ;			# Pressure of product -[in.Hg]
V_gas = (G * m_vol * T_gas * Ps)/(Ts * P_gas);
V_air = (air * m_vol * T_air * Ps)/(Ts * P_air);
V_prod = (P * m_vol * T_prod * Ps)/(Ts * P_prod);
air_ft3 = V_air/V_gas ;			#Air supplied per ft**3 of gas entered-[cubic feet]
P_ft3 =  V_prod/V_gas ;			#Product gas produced per ft**3 of gas entered-[cubic feet]

# Results
print ' Air supplied per ft**3 of gas entered %.2f cubic feet. '%air_ft3
print ' Product gas produced per ft**3 of gas entered %.2f cubic feet.'%P_ft3

 Air supplied per ft**3 of gas entered 3.57 cubic feet.
Product gas produced per ft**3 of gas entered 5.75 cubic feet.


### Example 13.8 Page No. 419¶

In :
# Variables
T1c = 15. ;			    # Temperature of F & P -[degree C]
T1 =  273.  +  T1c ;S	# Temperature of F & P -[K]
P1 =  105. ;			# Pressure of F & P -[kPa]

# Calculations
# F analysis
F_CO2 = 1.2/100 ;			# Volume fraction
F_odr = 98.8/100 ;			# Volume fraction

# P analysis
P_CO2 = 3.4/100 ;			# Volume fraction
P_odr = 96.6/100 ;			# Volume fraction

Tc_CO2 =  7. ;			#Temperature CO2 -[degree C]
T_CO2 =  273. +  Tc_CO2 ;			# Temperature CO2 -[K]
P_CO2 =  131. ;			# Pressure of CO2 -[kPa]
CO2 = 0.0917 ;			# Volume flow rate of CO2-[cubic metre/min]
# Convert given volume flow rate of CO2 at temperature of F & P
nw_CO2 = (CO2 *  T1 *  P_CO2)/(T_CO2 *  P1) ;			# volume flow rate of CO2 at temperature of F & P-[cubic metre]

from numpy import matrix
a = matrix([[F_odr,-P_odr],[1, -1]]);			# Matrix formed by coefficients of unknown
b = matrix([,[-nw_CO2]]) ;			# Matrix formed by constants
a = a.I
x = a*b ;			# matrix of solution, x(1) = F;x(2) = P
F = x ;			#Volume flow rate of entering gas-[cubic metre/min]
P = x ;			#Volume flow rate of product [cubic metre/min]

# Results
print 'Volume flow rate of entering gas is %.2f cubic metre/min'%F

Volume flow rate of entering gas is 5.17 cubic metre/min

In [ ]: