"RICH MIXTURE Composition Calculations - Unburned Mixture and low Temperature Burned Mixture"

"Reference:  Heywood.  Section 4.2"

"Hydrocarbon fuels -- Start with Data on Fuel"

alpha = 8
beta = 18
M_f = MOLARMASS(C8H18)
y = beta/alpha										"H/C ratio for the fuel"
epsilon = 4/(4+y)

"Fuel air equivalence ratio - also air composition"

phi = 1.2
psi = 3.773

"Fraction of burned gas in the mixture"

x_b = 0.15

"Temperature for burned mixture - 1000 selected to agree with CSU Applet default"

T1 = 1000											"[K]"

"Molar balance equations - per mole of O2"

epsilon*phi = n_CO2b + n_COb

2*(1-epsilon)*phi = n_H2Ob + n_H2b

1 = n_CO2b + 1/2 * n_COb + 1/2 * n_H2Ob

psi = n_N2b

"Additional equation from chemical equilibrium"

K = exp( 2.743 - 1.761e3/T1 - 1.611e6/T1^2 + 0.2803e9/T1^3)

K = (n_H2Ob*n_COb)/(n_H2b*n_CO2b)

"At this point the exhaust gas composition is calculated."

n_b = n_CO2b + n_COb + n_H2Ob + n_H2b + n_N2b

"Molar Ratios - Per Mole Air - Product - Put in to Compare with CSU Applet"

moles_air = 1 + psi
yr_H2 = n_H2b /moles_air
yr_CO = n_COb / moles_air
yr_N2 = n_N2b / moles_air
yr_CO2 = n_CO2b / moles_air
yr_H2O = n_H2Ob/ moles_air

"Mass ratios - Per Kg Air - Product - Put in to Compare with CSU Applet"

mass_air = moles_air * MOLARMASS(Air)
xr_H2 = n_H2b * MOLARMASS(H2) / mass_air
xr_CO = n_COb * MOLARMASS(CO) / mass_air
xr_N2 = n_N2b * MOLARMASS(N2) / mass_air
xr_CO2 = n_CO2b * MOLARMASS(CO2) / mass_air
xr_H2O = n_H2Ob * MOLARMASS(H2O) / mass_air

"This is test code to check vs. the text.  See table 4.3"

{n_bt = (2-epsilon)*phi + psi
c = n_COb
n_CO2t = epsilon*phi-c
n_H2t= 2*(phi-1)-c
n_H2Ot = 2*(1-epsilon*phi)+c}

"The number of moles of mixture is now calculated"

n_fuel = (12*epsilon*phi+2*(1-epsilon)*phi*MOLARMASS(H2))/M_f

{n_fuelt = (4/M_f )*(1+2*epsilon)*phi}					"Another Text Comparison"

n_mix = n_fuel + 1 + psi

"Finally the numberof moles of unburned gas is calculated"

n_u = (1-x_b)*n_mix + x_b*n_b

n_f = (1-x_b)*n_fuel
n_O2 = 1-x_b
n_CO2 =  x_b*n_CO2b
n_CO =    x_b*n_COb
n_H2 =     x_b*n_H2b
n_H2O =  x_b*n_H2Ob
n_N2 = psi

	"More comparison - Table 4.4"

{													
n_f1 = 4*(1-x_b)*(1+2*epsilon)*phi/M_f
c=n_COb
n_O21 = 1-x_b
n_N21= psi
n_CO21 = x_b*(epsilon*phi-c)
n_H2O1 = x_b*(2*(1-epsilon*phi)+c)
n_CO1 = x_b*c
n_H21 = x_b*(2*(phi-1)-c) }

"Molar Fractions"

y_f = n_f /n_u
y_O2 = n_O2 / n_u
y_N2 = n_N2 / n_u
y_CO2 = n_CO2 / n_u
y_CO = n_CO / n_u
y_H2O = n_H2O / n_u
y_H2 = n_H2 / n_u