Challenge

Week 4 - Handling Mixtures with Cantera

Ans1)

The mole function is the part of quality class of cantera, We insert the number of moles of the species as input to the class object after balancing the reaction in stochiometric form, to calculate the AFT value. In this case , reaction is combustion of methane in air with molar concentration of O2:21% and N2:79% .

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

Thus, Total number of moles of Air = 2+ 2*3.76= 9.52 Moles

Total number of moles of Methane = 1 Mole

Therefore, A.moles = 9.52 and B.moles = 1

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

B = ct.Quantity(gas)

B.TPX = 298.15, ct.one_atm, {'CH4':1564}

B.moles = 1

Mixture = Air + Fuel

Mixture.equilibrate('HP', 'auto')

print ('The AFT is ' + str(round (Mixture.T,4)) + 'K')

print (M.mass_fraction_dict())

print (M.mole_fraction_dict())

Ans.2)

Hence , Mass fraction are calculated using the code . Calculation for mass fraction are as follows:

Mass Fraction of species =Molesspecies*(MWspecies/MWmixture)

Mass Fraction of oxygen =Molesoxygen*(MWoxygen/MWmixture)

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

= 0.233

Mass Fraction of Nitrogen =Molesnitrogen*(MWnitrogen/MWmixture)

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

= 0.767

Mass fraction calculated using formula are approximately equal to the mass fraction calculated using cantera. Mass_fraction_dict() command calculated values after inserting the correct molar concentration values.

Ans.3)

Lines 15,16 denote the methane species as an object B and molar concentration of the species. Number 1564 has no significance as we insert normalized molar concentration in the TPX function and that value do-not exceed 1.0. Thus, we have modified that to 1 in our code.

Ans.4)

We need to change the molar concentration of A as 9.52 in line 22 , resulting in AFT = 2224K

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.