Challenge

Week 4.1- Handling Mixtures with Cantera

Questions

1. Use the "moles" method/function of the A object and explain how it was calculated. You need to use this after line number 9.

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())

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

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. Hint: The change needs to be done in line number 10. You have to compute the right number of moles of A.

--> The value of number of moles of A mixture can be determined by the following stoichiometric chemical reaction. We can also use the formula for the mole fraction of a species(O2 or N2).

Moles Fraction of O2 = No. of moles of O2/Total moles of Mixture A

=> Total moles of Mixture A = No. of moles of O2/Moles Fraction of O2 = 2/0.21 = 9.52.

--> 1546 does not mean anything as we are using only one species and moles of B mixture are fixed as 1.

import math
import numpy as ny
import matplotlib as plt
import cantera as ct 

gas = ct.Solution('gri30.cti')

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

B=ct.Quantity(gas)
B.TPX = 298.15,ct.one_atm,{'CH4':1}
B.moles = 1

# The following step is used to apply correct molar balance
M=A+B
M.equilibrate('HP')
print(M.T)

--> The above pic gives us the values of mass fraction, mole fraction and Adiabatic flame temperature respectively.

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.