Week 4.1- Handling Mixtures with Cantera
Assignment No.-02
Assignment name-mixing handling with cantera
1.Use mole fraction method of the object A and calculate moles
CH4 + 2(O2+3.76N2) = CO2 +2H2O + 7.52N2
Mole fraction is defined as number of moles of object A by basic chemistry
Mole fraction can be given as
X=n1/(n1+n2)
Where
X= mole fraction of A object
n1=number of moles of species
n2= total number of species in mixture
Moles of air=2/0.21
Moles of air=9.52
2.“mole_fraction_dict ()”, “mass_fraction_dict ()”-
This is used in program for only calculating mole fraction and mass fraction of particular object
When we print this command then we can see mole and mass fraction in console window
Calculation of mole fraction and mass fraction theoretically
We know Mole fraction of air is 0.21
From stoichiometric reaction number of mole of O2 is 2
Mass of O2=32*2=64
Mass of N2=28*7.52=210.56
Total mass equal to =64+210.56=274.56
Mass fraction of O2=64/274.56
Mass fraction O2=0.2331
Mass fraction N2=0.7668 or Mass fraction of N2=210.56/274.56=0.7668
Screenshot of console
Air
1.mole fraction

2.Mass fraction

Mole and mass fraction fuel(CH4)- in fuel CH4 is only species so mass and mole fraction is equal to 1

3.Lines 15 and 16
In the line 15 we assign initial condition of the objective B
The formulate is TPX (Temperate in k, pressure in pa, mole fraction) we can have used dict file for calculating mole fraction and mass fraction. But in our case species is 1 then there is show mass/mole fraction of CH4 is 1
In line 16 we assign number of moles of object
4.RIght value of AFT (adiabatic flame temperature)
It depends on assigning right values of moles of fuel and air which react at constant pressure.
Hence we provide corrected number of moles of each object
Number of moles of air=9.52
Number of moles of fuel=1
Adiabatic temperatures=2224.411 k
Screenshot

5.What is happening in lines 15 and 16? Make sure you explain what 1546 means? Is that reasonable?
This 1546 is number donated mole fraction of object but in our case number of species is 1 so there is no any role and not any sense .and it should note that 0 is not acceptable
Coding approach-
- Enter solution class as ct. Solution
- Assign initial condition of air and methane(fuel)
- Calculate moles of air
- Insert Quantity class- quantity class is used for create various mixtures
- Print the value of mole fraction, mass fraction and adiabatic flame temperature
Cantera code-
"""
mixing handling using cantera
author-siddhesh sakpal
date-03/01/2022
quantity class
"""
"""
n=number of moles
n_air=n_O2+n_N2
x=mole fraction
x_air=n_O2/(n_N2+n_O2)
x_air=n_O2/(n_air)
for stiochiometric combustion of methane
n_O2=2
n_air=2/0.21
n_air=9.52
"""
import cantera as ct
#define initial condition of air
T_air=298.15
P_air=101325
# define intitial condition of fuel
T_fuel=298.15
P_fuel=101325
gas = ct.Solution('gri30.cti')
air = ct.Quantity(gas)
air.TPX=T_air,P_air,{"O2":0.21,"N2":0.79}
air.moles=9.52
fuel=ct.Quantity(gas)
fuel.TPX=T_fuel,P_fuel,{"CH4":1546}
#consider only 1 species
fuel.moles=1
mix= air + fuel
mix.equilibrate('HP','auto')
print ('Mole fraction of individual species in oxidizer(air) is n',air.mole_fraction_dict())
print ('Mass fraction of individual species in oxidizer(air) is n',air.mass_fraction_dict())
print('adibatic_temp =',mix.T)
print(fuel.mass_fraction_dict())
print(fuel.mole_fraction_dict())
conclusion-
- code is run successfully
- adiabatic temperature of this assignment is match to value mention in the assignment question
- mass fraction is obtained through cantera program exactly match with theoretically calculation