HANDLING MIXTURES BY USING QUANTITY CLASS IN CANTERA
Aim :
To use Quantity class in Cantera to perform methane- air combustion
Theory :
Balanced stoichiometric combustion equation of Methane :

Air contains 21% of oxygen and 79% of N2 on volume basis
Mole fraction of O2 = 0.21
Mole fraction of N2 = 0.79
0.21 moles of O2 ----> 0.79moles of N2
1 mole of O2 --------> 0.79/0.21 moles of N2
1 mole of O2 --------> 3.76 moles of N2
air contains 4.76 moles of O2 and N2
Total moles of air = 2*4.76 = 9.52
Stoichiometric air contains 0.21% of O2 and 0.79% of N2
Fuel-Air Ratio (FAR): The fuel-air ratio, f, is given by

where mf and ma are the respective masses of the fuel and the air. For a stoichiometric mixture

where Mf and Mair (~28.84 kg/kmol) are the average masses per mole of fuel and air,
respectively. The range of f is bounded by zero and 1. Most hydrocarbon fuels have a stoichiometric fuel-air ratio, fs, in the range of 0.05–0.07.
Equivalence Ratio: Normalizing the actual fuel-air ratio by the stoichiometric fuelair ratio gives the equivalence ratio, f.

The subscript s indicates a value at the stoichiometric condition. Φ <1 is a lean mixture, Φ= 1 is a stoichiometric mixture, and Φ >1 is a rich mixture. Similar to f, the range of Φ is bounded by zero and infinite corresponding to the limits of pure air and fuel respectively. Note that equivalence ratio is a normalized quantity that provides the information regarding the content of the combustion mixture.
Code :
import cantera as ct
gas = ct.Solution('gri30.cti')
phi=1 # Equivalance ratio
# Creating a seperate gas instance called A which is air
A=ct.Quantity(gas)
A.TPX=298.15,ct.one_atm,{'O2':0.21,'N2':0.79}
A.moles=9.52/phi
print(A.mass_fraction_dict())
#Creating a seperate gas instance called B which is fuel Methane
B=ct.Quantity(gas)
B.TPX=298.15,ct.one_atm,{'CH4':1564}
B.moles=1
print(B.mole_fraction_dict())
print(B.mass_fraction_dict())
# Creating the Mixture M
M=A + B
M.equilibrate('hp','auto')
print('Adiabatic flame temperature for Methane-air mixture at stp is ' + str(M.T) + ' K')
print(M.mass_fraction_dict())
Code Explanation :
- The Quantity class is made from solution class So a gas instance is made from solution class
- The air is defined using A and Temperature, pressure and mole fraction is passed by the command A.TPX
- Similarly fuel is defined using B and Temperature, pressure and mole fraction is passed by the command B.TPX
- These 2 gases are mixed together to form a new mixture M
- The combustion is carried out using equilibrate method assuming it to be happening at constant pressure and the solver is kept auto i.e it uses either element potential method or Equilibrium constant method
- The adiabatic flame temperature and mass fraction of species before and after combustion are displaced
- The code is to be repeated for different Equivalent ratios and AFT and mass fractions are to be evaluated.
Outputs :
| Eqivalance Ratio (Φ) | AFT | Mass fraction of O2 after combustion | Mass fraction of N2 after combustion | Mass fraction of CH4 after combustion | Mass fraction of H2O | Mass fraction of CO2 |
| 1 (Stoichio) | 2224.411 | 0.00531 | 0.7237 | 1.78e -17 | 0.1205 | 0.1369 |
| 1.3 (Rich) | 2055.179 | 3.9857e-06 | 0.71292 | 6.253e-13 | 0.12749 | 0.08994 |
| 0.7 (Lean) | 1837.303 | 0.06554 | 0.73575 | 4.744e-24 | 0.0879 | 0.10762 |
Apart from these products so many other species of products are also formed
For phi = 1 :

Conclusions :
- Here air and fuel are taken at same temperature i.e at STP but the main advantage of Quantify class is that air and fuel can be taken at different temperatures
- AFT for stoichiometric mixture is more than lean and rich mixture
- mole fraction of CH4 can be given any number because it contains only 1 species so the mole fraction and mass fraction will automatically equal to 1 (here 1564 is choosen randomly)