Challenge

Week 4.1- Handling Mixtures with Cantera

AIM: To determing the Adiabtaic Flame Temperature for the combustion of Methane and air at the Stiochiometric conditions and at constant pressure by handling mixtures of methane and air as two seperate quantities using the Quantity Class in the Cantera

The Stiochiometric equation for Methane:

1. Use the "moles" method/function, calculate the number of moles of the object A and explain how it is calculated analytically. You need to use this after line number 9 by using the predefined function ‘A.moles’

Gas is a object or instant of Class we have created in this study for solving the combustion problems, ct is cantera and Class is Solution for this case.

In A.TPX => A: refers to air

T and P refers to the Temperature and Pressure of the air at initial conditions

X = number of moles of the air

print command is used to tell the cantera to execute the code and print the values of Mole and mass fraction values, Mole_fraction_dict is a file with mole fraction and also same for mass_fraction_dict file these files are used and then print the values for Air and Fuel.

Moles of the air in the stiochiometric mixture = 2/2+3.76*2 = 0.21 that is mean 1 mole of air contains 0.21 moles of Oxygen.

Mass of one mole of diatomic oxygen O2 = 32gm

Mass of one mole of diatomic nitrogen N2 = 28gm

Mass of air can be defined as the = 0.21*32 + 0.79*28 = 28.84gm

Mass fraction of Oxygen = 0.21*32/28.84 = 0.23

Mass fraction of nitrogen = 0.79*28/28.84 = 0.77

Python program for calculation of Mole and Mass fraction of Air:-

"""
Handling mixtures with cantera
"""
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 = 9.52
print('Mole Fraction of air = ',A.mole_fraction_dict())
print('Mass fraction of air = ',A.mass_fraction_dict())

B = ct.Quantity(gas)
B.TPX = 298.15,ct.one_atm,{'CH4':1546}
B.moles = 1
print('Mole fraction of fuel= ',B.mass_fraction_dict())

M = A+B
A.constant = 'HP'
B.constant = 'HP'
M.equilibrate('HP')
print('AFT= ',M.T)

Output:

2. Use the method mass_fraction_dict() of the A object and explain it analytically.

for mass fraction: No of moles X no. of moles of the compound with molecular weight.

Number of moles of o2 = 2*32 = 64gm

Number of moles of N2 = 7.52*28 = 210.56gm

Mole-fraction of o2 = 64/64+210.56 = 0.23

Mole-fraction of N2 = 210.56/64+210.56 = 0.77

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

We have used fuel for combustion CH4 (methane) with temperature, pressure and mole fraction values, and number of moles we are defined to avoid the pre-defined the value of the software.

We are defining Ch4 value as 1546 has no effect as it gives the value of mole-fraction as 1.

4. What changes do you need to put in place to get the right value of AFT in line 22?. The right answer is 2224K.

we are using equilibrate function method for the M object and it is holding property 'HP' means constant Enthalpy and constant Pressure. If we add the Solver 'auto' mans automatic it takes the Efficient solver for solving the reaction and gives us correct Adiabatic flame temperature Value.

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.