Project

Handling Mixtures With Cantera

Object :

Handling Mixtures (O2 + N2 +CH4) in Cantera and calculating the Adiabatic Flame Temperature.

Calculating Mole Fraction:

The General equation CH4 + 2 (O2 + 3.72 N2)=CO2+2H2O+7.52N2

Calculating the mole fraction of O2 and N2, These were we defined O2 = 0.21 and N2 = 0.79 that equal to 1.

Now, A is contain air, which is a Mixture of O2 & N2. A is contain 2 Moles because of it must be greater than the fuel as provided moles.

For mole fraction = (No.Of moles of species / Total no.of species)

O2 mole fraction =`(2/(2+2*3.72))= 0.21`

N2 mole fraction = `((2*3.72)/(2+2(3.72))) = 0.79`

define A Moles = (No.Moles)/(species Mole fraction)

Moles of O2 = `(2/0.21) = 9.52`

Moles of N2 = `(2/0.79) = 9.52`

as above calculated moles of air is both were equal. so we can use either one.

Using Cantera To calculating AFT

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} # Mole fraction in g
A.moles= (2/0.21)  #mole fraction of O = 0.21, Number Moles Of O = 2
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())

\'\'\'
	Mixture of fuel
\'\'\'
M=A+B
M.equilibrate(\'HP\')
print(M.T)

\"\"

1. Use the \"moles\" method/function of the A object and explain how it was calculated.

The first step was calculated Moles of Air. That has been using formula

define A Moles = (No.Moles)/(species Mole fraction)

Moles of O2 = `(2/0.21) = 9.52`

Moles of N2 = `(2/0.79) = 9.52`

Both are getting the same values so we can use anyone.

If the Moles are greater than 2 or less than 2 The final temperature we were getting less than 2000 K Because the equivalent ratio has a rich mixture or lean mixture.

2. Use the method mole_fraction_dict() of the A object and explain the result that you get. Here is how you need to use it. print(A.mass_fraction_dict())

Using mole_fraction_dict() of A which will give a mass fraction of air that contains O2 and N2.

N2=0.76708

O2=.2329

3. What is happening in lines 14 and 15? Make sure you explain what 1546 means? Is that reasonable?

inline number 14 defined Temperature, pressure and mole fraction of CH4.

Inline number 15 defined Number moles.

CH4 1546, Here 1546 is defined as a Mole fraction of CH4.

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

We were getting AFT finally 2224.224 K when we adjust the moles of air, so finally we were put 9.52 that will give High-temperature .its depend on No.of moles were given.

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.