Week 4.1- Handling Mixtures with Cantera
Aim :
In this assignment we are going to work on the recuperator mechanism ,to find the mixture calculation of the air and fuel and the chemical reaction and to print the adiabatic flame temperature.
Case 1:
We have to find the mole fraction analytically of the air mixture.
Since we are dealing with stoichiometric combustion,the combustion is complete .
`CH_4 +2(O_2 + 3.76N_2) -> CO_2 +2H_2O + 7.52N_2O`
At STP the oxidizer contains 21% `O_2` and 79% `N_2`.This has to be provided as input for the TPX method.
mole fraction of O2 in air => `XO_2=((nO_2)/(nair))
we need to moles of O2 complete combustion of Ch4
so nO2 = 2 ,xO2 =0.21
so substituting in mole fraction equation we get nair =9.52
Case 2: We need to find the mass fraction of the species analytically.
Moles Mass Mass fraction
O2 0.21*9.52 =2 2*32=64 64/(64+210.56) = 0.2331
N2 0.79*9.52=7.52 7.52*28=210.56 210.56/(64+210.56)= 0.7668
We get same result in cantera by using the mass_fraction_dict() function

Case 3:
In line 15 and 16 we are providing the initial temperature and pressure value for for the fuel (B)
We did not use dict() function because CH4 is the only species present.
And the number 1546 is just an arbitary number as there is one species by default one mole of CH4 is taken.
In line 16 we assign the number of moles for B.
Case 4:
To get the correct AFT of the combustion we have to provide the correct number of moles of air and fuel.
The AFT is 2224.411K
The code:
import cantera as ct
gas = ct.Solution('gri30.cti')
A = ct.Quantity(gas)
A.TPX = 298.15,ct.one_atm,{'O2':0.21,'N2':0.79}
#as we have calculated analytically the moles of air
A.moles = 9.52
B = ct.Quantity(gas)
B.TPX = 298.15,ct.one_atm,'CH4:1546' # 1546 is an arbitary .Since one species is present, default one mole of CH4 is taken
B.moles = 1
M=A+B
print('Mole fraction of individual species air is n',A.mole_fraction_dict())
print('Mass fraction of individual species air is n',A.mass_fraction_dict())
M.equilibrate('HP','auto')
print ('Adiabatic temperature for constant pressure combination = ',M.T)
Result:
