All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
A. In the given code, mole fractions of O2 & N2 are given as 0.21 & 0.79 we know that mole fraction = (number of moles of that species)/ (Total number of moles) from the reaction of methane (CH4) CH4+2O2+2(3.76)N2=CO2+2H2O+2(3.76)N2\">CH4 + 2O2 + 2(3.76) *N2 = CO2 + 2H2O + 2(3.76) *N2CH4 + 2O2 + 2(3.76)…
Arun Gupta
updated on 01 Jul 2019
A. In the given code, mole fractions of O2 & N2 are given as 0.21 & 0.79
we know that mole fraction = (number of moles of that species)/ (Total number of moles)
from the reaction of methane (CH4)
CH4+2O2+2(3.76)N2=CO2+2H2O+2(3.76)N2\">CH4 + 2O2 + 2(3.76) *N2 = CO2 + 2H2O + 2(3.76) *N2CH4 + 2O2 + 2(3.76) *N2 = CO2 + 2H2O + 2(3.76) *N2
let\'s calculate the mole fraction of O2(A gas quantity) as example
O2 mole fraction (for A gas quantity) = (number of moles of O2)/ (Total number of moles)
O2 mole fraction (for A gas quantity) = 2/(2+(2*3.76))
O2 mole fraction (for A gas quantity) = 2/9.52 = 0.21
N2 mole fraction (for A gas quantity) = (2*3.76)/(2+(2*3.76)) = 7.52/9.52 = 0.79
Now, for moles of A = (no. of moles of O2)/ (O2 mole fraction)
Now, for moles of A = (no. of moles of N2)/ (N2 mole fraction).
for moles of A (with O2) = 2/0.21 = 9.52 (Approx.) equation-1
for moles of A (with N2) = (2*3.76)/0.79 = 9.52 (Approx.) equation-2
for calculating moles of A, we can use either equation-1 or equation-2 which is same. So, A.moles = (2/0.21) or (7.52/0.79) which is shown in my code of line 10.
B. By using A.mass_function_dict() we are converting the mole fraction of O2 & N2 into the mass fractions of O2 & N2 and print(A.mass_function_dict()) will print those values as dictionaries.
C. In the code line 15 & 16, the B gas quantity has given values of TPX (Temperature, Pressure & Mole fractions(X) of all species in B. Here, 1546 refers to the number of mole fractions of CH4 & moles of B is already mentioned as one (1).
D. In order to get the Adiabatic Flame Temperature, moles of A should be set. I have already calculated for moles of A in point (2) which is (2/0.21) or ((2*3.76)/0.79) = (7.52/0.79). The results were calculated with constant enthalpy & constant pressure process which is shown above with AFT = 2224.461 (K).
Program
import matplotlib.pyplot as plt
import numpy as np
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*3.76)/0.79
print(A.mass_fraction_dict())
B = ct.Quantity(gas)
B.TPX = 298.15,ct.one_atm,\'CH4:1546\'
B.moles = 1
M = A + B
M.equilibrate(\'HP\')
print(C.T)
Result
{\'N2\': 0.7670829987741036, \'O2\': 0.23291700122589645}
2224.461438930544
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...
Project 1 : Flow over Ahmed Body
Flow over Ahmed's Body The Ahmed body represents a simplified, ground vehicle geometry of a bluff body type. Its shape is simple enough to allow for accurate flow simulation but retains some important practical features relevant to automobile bodies. This model describes how to calculate the turbulent flow field around…
24 Nov 2023 05:24 AM IST
Project 1 : CFD Meshing for Tesla Cyber Truck
Objective : To Identify & clean up all the topological errors in the given Tesla Cyber Truck Car model. To create a surface mesh. To Create a wind tunnel around Tesla Cyber Truck Car. To create a volumetric mesh to perform an external flow CFD analysis simulation. Introduction : ANSA : ANSA is a Computer-aided engineering tool…
09 Sep 2023 11:52 AM IST
Project 1 - Meshing of Floor Panel
AIM:- To mesh the given floor panel for the given quality criterias without any failure in the elements. Project description:- FLOOR PANEL GIVEN:- Procedures for Meshing a 2D component:- i) Importing the CAD model into ANSA:- The cad model is imported into the Ansa software by clicking File ---> New command. ii) Geometry…
04 Mar 2023 05:12 AM IST
Project 1 : CFD Meshing for Tesla Cyber Truck
Objective : To Identify & clean up all the topological errors in the given Tesla Cyber Truck Car model. To create a surface mesh. To Create a wind tunnel around Tesla Cyber Truck Car. To create a volumetric mesh to perform an external flow CFD analysis simulation. Introduction : ANSA : ANSA is…
04 Mar 2023 05:05 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.