Project

Handling Mixture Using Cantera

1. Use the \"mole\" method of the object A and calculate moles:-

Consider a stoichiometric reaction of Methane and air,

`CH_4 + 2(O_2 + 3.76N_2) rightarrow CO_2 + 2H_2O + 7.52N_2`

Mole fraction can be given as,

`A_(speices) = frac{n_1}{n_1 + n_2}`

where `A_(speieces) rightarrow` mole fraction of A object

`n_1 rightarrow` Number of moles of species

`n_2 rightarrow` Total Number of species in mixture

For Oxygen,

`A_(O_2) = frac{2}{2+3.76*2} = 0.21`

For Nitrogen,

`A_(N_2) = frac{2*3.76}{2*3.76 + 2} = 0.789991 approx 0.79`

By summation of the both the value we get 1. (0.21 + 0.79)

To Calculate Mole:-

Moles = Number of Moles / Moles fraction of Speices

Moles of `O_2` = `frac{2}{0.21}`=9.52

Moles of `N_2 = frac{2*3.76}{0.79} = 9.52`

2. Use the method mole_fraction_dict() of the A object and explain the result:-

Code:-

\"\"\"
Sample code to vary the temperature of air and oxidizer individually
\"\"\"

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}
A.moles=2/0.21
print(A.mass_fraction_dict())

B=ct.Quantity(gas)
B.TPX=298.15,ct.one_atm,\'CH4:1546\'
B.moles=1
print(B.mass_fraction_dict())


# The Following step is used to apply the right molar balance
M=A+B
M.equilibrate(\'HP\',\'auto\')
print(M.T)

\"\"

From the above result we can say that,

Mass Fraction for Nitrogen = 0.767

Mass Fraction for Oxygen = 0.232

Mass Fraction for Methane = 1

3. What is happening in lines 15 & 16 ? Explain what is 1546 means?

  • TPX command is used which means to Get the Temperature [K], Pressure [Pa] and Mole Fraction.
  • The Number 1546 represent the number of moles of the object that in this case is Methane.
  • The value can have any value rather than zero.
  • For this case we have taken one mole in the object.

4. What changes do need to put in place to get right value of AFT in line 22?

  • In this equilibrate command is used for Mixture Object.
  • By using \'HP\' which consider the constant enthalpy and Pressure
  • As we have used auto as solver which means that it first used to solve by using element potential method and in case it failed then Gibbs solver is used.
  • By using the above tool, we get the Adiabatic Flame Temperature around 2224.224 K which is approx closed to 2224 K
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.