Challenge

Week 4 - Handling Mixtures with Cantera

Aim:To perform mixture calculations.

Process:

We will consider simple equation of fuel reacting with air producing water and carbon dioxide

CH4 + 2(O2+3.76N2) = H2O+2CO2+7.52N2

To calculate mole fraction we have formula:

X(o2) = n(O2) / n(total)

where,

n(total) = n(O2)+n(N2)

n(total) = 2+7.52

n(total) = 9.52

X(O2) = 2/9.52 = 0.21

X(N2) = 7.52/9.52 = 0.79

X = mole fraction symbol

Mass fraction calculation:

Y(O2) = (n*Mw) O2/(n*Mw)total

Mw(O2) = 32

Mw(N2) = 28

Y(O2) = (2*32)/(2*32 + 7.52*28)

Y(O2) =0.233

Y(N2) = 1 - 0.233 = 0.766

Y = mass fraction of species

Python code to calculate the mole fraction/mass fraction and adiabatic flame temperature:

import cantera as ct 
#defining a instance
gas = ct.Solution('gri30.cti')

#Air
A  = ct.Quantity(gas)
A.TPX = 298.15,101325,{'O2':0.21 , 'N2':0.79}
print(A.mass_fraction_dict())
print(A.mole_fraction_dict())
A.moles = 9.52

#Fuel
B = ct.Quantity(gas)
B.TPX = 298.15,101325,'CH4:1546'
B.moles = 1

M=A+B
M.equilibrate('HP')
#adiabatic flame temperature
print(M.T)

When we print mass_fraction_dict() we get a mass fraction of species same in case of mole_fraction_dict()

1)What is happenging in lines 15 and 16? Make sure you explain what 1546 means? Is that reasonable?

-> In line 15 we are defining standard temperature and pressure with fuel species a the number we use in front of CH4 is independent, we can use any random number rather then 0.

2)What changes do you need to put in place to get the right value of AFT in line 22?.

-> To get write answer for adiabatic flame temperature we should add no of moles of air present.

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.