All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Objective : To work with the Quantity class of Cantera to create various mixtures and to explain how the mixture calculations are performed. 1. Use the "moles" method/function of the A object and explain how it was calculated. Solution is a class and quantity is also a class which adds extra function to the solution.…
Deepesh Shetty
updated on 13 Aug 2021
Objective : To work with the Quantity class of Cantera to create various mixtures and to explain how the mixture calculations are performed.
1. Use the "moles" method/function of the A object and explain how it was calculated.
Solution is a class and quantity is also a class which adds extra function to the solution.
The stoichiometric reaction of methane and air is given by :
For balanced stoichiometric reaction,
Number of moles of CH4 = 1
Number of moles of O2 = 2
Number of moles of N2 = 7.52
Mole fraction of O2 in air = (Number of moles of O2/ (Number of moles of O2 + Number of moles of N2)) = (2/(2+7.52)) = 0.21
Mole fraction of N2 in air = (Number of moles of N2/ (Number of moles of O2 + Number of moles of N2)) = (7.52/(2+7.52)) = 0.79
2. Use the method mole_fraction_dict() of the A object and explain the result.
Print(A.mass_fraction_dict()) is used calculate and display the mass fraction of the species as shown below
Mole fraction of O2 = 0.21
Mole fraction of N2 = 0.79
Molecular weight of O2 = 32
Molecular weight of N2 = 28
Mass fraction of O2 = (0.21*32/(0.21*32 + 0.79*28)) = 0.233
Mass fraction of N2 = (0.79*28/(0.21*32 + 0.79*28)) = 0.767
3. What is happening in lines 15 and 16? Make sure to explain what 1546 means? Is that reasonable?
TPX command is used to get temperature, pressure and mole fraction.
The number 1546 represents the number of moles of CH4.
Since CH4 is the only species in variable B, the mole fraction will always be 1 irrespective of the number of moles of CH4.
Hence, there can be any number of moles of CH4 other than zero.
4. What changes do need to be put in place to get the right value of AFT in line 22?
Mole fraction of O2 = 0.21
Mole fraction of N2 = 0.79
To calculate mole
Moles of (O2+N2) = 2/0.21 = 9.52
Moles of (O2+N2) = 7.52/0.79 = 9.52
We know that 1 mole of CH4 is present. Species A is composed of O2 and N2. From the balanced stoichiometric reaction, we need to give 9.52 moles for species A (O2+N2) in order to get the correct value of AFT.
Program
"""
Sample code to vary the temperature of air and oxidizer individually
"""
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 = 2/0.21
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())
# The following step is used to apply the right molar balance
M = A + B
M.equilibrate('HP')
print(M.T)
Output
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 4.2 - Combustion Efficiency Calculation after Preheating
Objective: A furnace is used to burn Methane and Air Mixture. A recuperator is connected to this furnace to recover some energy. What is the effect of preheating on the adiabatic flame temperature by changing pre-heating from 298 to 600K. Does preheating help with fuel saving? How does combustion efficiency go up…
23 Aug 2021 07:38 PM IST
Week 5.1 - Compact Notation Derivation for a simple Mechanism
Objective : To derive the reaction rate of ODEs & production rate of each species for the given simple reaction mechanism Reaction Mechanism : CO+ O2 ⇌ CO2 + O O + H2O ⇌ OH + OH CO + OH ⇌ CO2 + H H + O2 ⇌ OH + O For determining the rate of reaction , we need to compute forward and backward…
18 Aug 2021 08:54 PM IST
Week 6 - Multivariate Newton Rhapson Solver
Objectve : To solve the given coupled non linear system of equations using mulltivariate newton raphson method. Theory The given set of differential equations are as follows: The above differential equations using backward differencing scheme can be written as: Writing the above equations in the form of root finding problem…
18 Aug 2021 07:25 PM IST
Week 4.1- Handling Mixtures with Cantera
Objective : To work with the Quantity class of Cantera to create various mixtures and to explain how the mixture calculations are performed. 1. Use the "moles" method/function of the A object and explain how it was calculated. Solution is a class and quantity is also a class which adds extra function to the solution.…
13 Aug 2021 08:01 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.