Handling Mixtures with Cantera
Objective: Determine the adiabatic flame temperature of the stoichiometric combustion of methane at constant pressure by handling mixtures of methane and air as separate quantities of the gas object.
Stoichiometric combustion of methane
`CH_4+2(O_2+3.76N_2)rarrCO_2+2H_2O+7.52N_2`
In this code A is considered as air and B is considered as methane
Python code
`A.TPX=>` For assigning temperature, pressure, and mole fraction of air. Mole fraction is assigned as a dictionary.
Temperature=298.15K
Pressure =1 atm
Mole fraction of O2=0.21
Mole fraction of N2=0.79
For the stoichiometric combustion 1 mole of CH4 needs 2 moles of O2. The number of moles of O2 is assigned using 'moles' in line number 10.
Mole fraction of O2=Number of moles of O2/Total number of moles
So,
The total number of moles= 2/0.21
mass_fraction_dict() & mole_fraction dict() is used for determining mass fraction and mole fraction of a quantity. We can print the value using print(mass_fraction_dict()) as shown in line number 18 & 19.
It gives the result,
In line number 12 mass fraction of quantity B is given as 1546. In the next line number of moles of B is given as 1. Since only one component is present in B. The mole fraction automatically takes the value 1.
We need to assign the number of moles of A mixture to obtain the correct stoichiometric value of 2224K.