All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
INTRODUCTION: Flame speed is the measured rate of expansion of a flame front in a combustion reaction. While the auto-ignition temperature and ignition delay (0-D analysis) can indicate when the reaction will take place, the flame speed (1-D analysis) is an indicator of how the flame propagates. The flame occupies a small…
Shrey Shah
updated on 29 Apr 2020
INTRODUCTION:
Flame speed is the measured rate of expansion of a flame front in a combustion reaction. While the auto-ignition temperature and ignition delay (0-D analysis) can indicate when the reaction will take place, the flame speed (1-D analysis) is an indicator of how the flame propagates. The flame occupies a small portion of the combustible mixture at any one time and it is propagating towards the unburnt gases. The flame speed is a measure of the rate at which the unburnt mixture is entering the flame.
1. What type of analysis is this, steady-state or transient?
In reality, the problem is of a transient nature, since the flame is propagating through the domain and changes its position with time. However, it can be converted to a steady-state problem by considering the problem in the reference frame of the propagating flame. In this reference frame, the flame can be considered as stationary, while the unburnt mixture moves into the flame and the burnt gases move away from the flame. Sometimes, the solution may not converge in a steady-state. In such cases, Cantera will automatically switch to the transient approach temporarily for the first few steps and revert to the steady-state approach when a guess value is good enough for steady-state convergence.
2. Why do we need a separate file to simulate the hydrogen mechanism?
The hydrogen mechanism can also be simulated using the GRI 3.0 mechanism. However, the GRI 3.0 mechanism has been optimized for the combustion of hydrocarbons. Hence, a separate file which includes the optimized hydrogen mechanism is used to obtain more accurate results.
IMPLEMENTATION IN PYTHON USING CANTERA MODULE:
The project involves analyzing the flame speed of methane and hydrogen mechanisms. The flame speed can be affected by various parameters such as:
The above list may not be exhaustive but includes the parameters which can have a major impact on the simulation. For this project, we consider an equivalence ratio of 0.9 (lean mixture). Hence the species_dict, which includes the mole fractions of the species in the mixture, is modified accordingly.
Methane: 0.9CH4+2(O2+3.76N2)→0.9CO2+1.8H2O+7.52N2+0.2O2
Hydrogen: 1.8H2+O2+3.76N2→1.8H2O+3.76N2+0.1O2
The initial temperature and pressure are set to 300 K and 1 atm respectively. A Solution object "gas" is created using the above initial conditions. A FreeFlame object is created with a domain length of 0.03 m from the gas object. The Cantera solver obtains a solution for a coarse grid using the Newton-Raphson method. The solution is then monitored for gradients and curvature and subsequent grid refinement is done at points of interest. The solving and refinement continues till a converged solution satisfying the refinement criteria is obtained. The Python code and results for both the methane and hydrogen mechanisms are shown below:
Methane mechanism (gri30.xml)
import cantera as ct
import numpy as np
import matplotlib.pyplot as plt
gas = ct.Solution('gri30.xml', 'gri30_mix')
T0 = 300.0
P0 = ct.one_atm
species_dict = {'CH4':0.9, 'O2':2, 'N2':7.52}
gas.TPX = T0, P0, species_dict
f = ct.FreeFlame(gas, width=0.03)
f.set_refine_criteria(ratio=3, slope=0.07, curve=0.14)
f.solve(loglevel=1, refine_grid=True, auto=False)
print('==============================================================================')
print('==============================================================================')
print('Mixture-averaged flamespeed = %.6f m/s\n' % (f.u[0]))
x = f.grid
T = f.T
v = f.u
conc_CO2 = f.concentrations[gas.species_index('CO2'),:]
X_CO2 = f.X[gas.species_index('CO2'),:]
fig1, ax1 = plt.subplots()
plt.subplot(2,1,1)
plt.plot(x, T, linewidth=2)
plt.grid('both',linestyle='--',linewidth=1)
plt.ylabel('Temperature [K]', fontweight='bold', fontsize=12)
frame1 = plt.gca()
frame1.axes.xaxis.set_ticklabels([])
plt.title('Temperature and Velocity along the Length of the Domain',fontweight='bold')
plt.subplot(2,1,2)
plt.plot(x, v, linewidth=2)
plt.grid('both',linestyle='--',linewidth=1)
plt.xlabel('Distance along the grid [m]', fontweight='bold', fontsize=12)
plt.ylabel('Velocity [m/s]', fontweight='bold', fontsize=12)
plt.tight_layout()
fig2, ax2 = plt.subplots()
plt.subplot(2,1,1)
plt.plot(x, conc_CO2, linewidth=2)
plt.grid('both',linestyle='--',linewidth=1)
plt.ylabel('Concentration [kmol/m$^3$]', fontweight='bold', fontsize=9)
frame1 = plt.gca()
frame1.axes.xaxis.set_ticklabels([])
plt.title('CO2 variation along the Length of the Domain',fontweight='bold')
plt.subplot(2,1,2)
plt.plot(x, X_CO2, linewidth=2)
plt.grid('both',linestyle='--',linewidth=1)
plt.xlabel('Distance along the grid [m]', fontweight='bold', fontsize=12)
plt.ylabel('Mole Fraction', fontweight='bold', fontsize=10)
plt.tight_layout()
plt.show()
Hydrogen Mechanism (H2_mech.cti):
import cantera as ct
import numpy as np
import matplotlib.pyplot as plt
gas = ct.Solution('H2_mech.cti')
T0 = 300.0
P0 = ct.one_atm
species_dict = {'H2':1.8, 'O2':1, 'N2':3.76}
gas.TPX = T0, P0, species_dict
f = ct.FreeFlame(gas, width=0.03)
f.set_refine_criteria(ratio=3, slope=0.07, curve=0.14)
f.solve(loglevel=1, refine_grid=True, auto=False)
print('==============================================================================')
print('==============================================================================')
print('Mixture-averaged flamespeed = %.6f m/s\n' % (f.u[0]))
x = f.grid
T = f.T
v = f.u
conc_CO2 = f.concentrations[gas.species_index('CO2'),:]
X_CO2 = f.X[gas.species_index('CO2'),:]
fig1, ax1 = plt.subplots()
plt.subplot(2,1,1)
plt.plot(x, T, linewidth=2)
plt.grid('both',linestyle='--',linewidth=1)
plt.ylabel('Temperature [K]', fontweight='bold', fontsize=12)
frame1 = plt.gca()
frame1.axes.xaxis.set_ticklabels([])
plt.title('Temperature and Velocity along the Length of the Domain',fontweight='bold')
plt.subplot(2,1,2)
plt.plot(x, v, linewidth=2)
plt.grid('both',linestyle='--',linewidth=1)
plt.xlabel('Distance along the grid [m]', fontweight='bold', fontsize=12)
plt.ylabel('Velocity [m/s]', fontweight='bold', fontsize=12)
plt.tight_layout()
fig2, ax2 = plt.subplots()
plt.subplot(2,1,1)
plt.plot(x, conc_CO2, linewidth=2)
plt.grid('both',linestyle='--',linewidth=1)
plt.ylabel('Concentration [kmol/m$^3$]', fontweight='bold', fontsize=9)
frame1 = plt.gca()
frame1.axes.xaxis.set_ticklabels([])
plt.title('CO2 variation along the Length of the Domain',fontweight='bold')
plt.subplot(2,1,2)
plt.plot(x, X_CO2, linewidth=2)
plt.grid('both',linestyle='--',linewidth=1)
plt.xlabel('Distance along the grid [m]', fontweight='bold', fontsize=12)
plt.ylabel('Mole Fraction', fontweight='bold', fontsize=10)
plt.tight_layout()
plt.show()
3. What do you infer from the graphs? What would you state the flame speed as?
The graphs denote the variation of variables (temperature and velocity) along the length of the domain of 0.03 m. The starting point of the graph (x=0) indicates the flame (since we are solving the equations based on the flame's reference frame). We can see that the unburnt gases enter the flame at the initial temperature of 300 K. As they move into the flame, the combustion reaction occurs which increases the temperature, and hence we can see the sudden peak in the temperature and velocity. Because of the reference frame, the flame speed is the velocity at the starting point, which can be accessed as f.u[0]. The following table compares the flame speed and the highest temperature of both the mechanisms:
Mechanism–––––––––––––1-D Flame Speed [m/s]–––––––––––––––––––––––––Max. Temperature [K]–––––––––––––––––––––––––Methane0.3398362137.8Hydrogen2.1385522280.97
After subsequent refinements to the grid, the methane combustion is solved using 155 grid points and the hydrogen combustion is solved using 122 grid points. We also plot the concentration and mole fraction of CO2 from the solution. The CO2 concentration for the methane mechanism shows that as the reaction progresses, more CO2 is generated, whereas, for the hydrogen mechanism, no CO2 is generated. This can also be seen from the reactions where there is no CO2 on the products side of the hydrogen combustion reaction.
From the flame speed for the methane and hydrogen mechanisms, we can also conclude that the hydrogen combustion occurs more aggressively than the methane combustion.
4. Does the width parameter have an effect on the solution?
The width parameter does not have a huge effect on the solution as long as the domain is big enough for Cantera to perform the time-integration. If the domain is too small, the solution will not be able to converge. The larger the domain, the more accurate the solution, but it will also take more computational resources to provide the solution.
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...
1-D flame speed analysis for methane and hydrogen combustion mechanisms using Python and Cantera
INTRODUCTION: Flame speed is the measured rate of expansion of a flame front in a combustion reaction. While the auto-ignition temperature and ignition delay (0-D analysis) can indicate when the reaction will take place, the flame speed (1-D analysis) is an indicator of how the flame propagates. The flame occupies a small…
29 Apr 2020 08:01 PM IST
Simulating a 2-D flow in a rectangular channel for different mesh sizes using CONVERGE CFD
INTRODUCTION: In this project, we will be simulating a 2-D flow through a rectangular channel. The size of the mesh will be varied (from coarse - fine - very fine) to compare the results. The setup is done using CONVERGE Studio and the results are post-processed in Paraview. The geometry is a simple box (channel) with…
29 Apr 2020 08:01 PM IST
Full scale simulation of port fuel injected engine (SI8-PFI) starting from geometry cleanup to setting up different physical phenomena using CONVERGE CFD
SURFACE PREPARATION: CONVERGE CFD utilizes geometry provided in the ".stl" format, which contains a triangulated surfaces that make up the body. The geometry of the PFI engine is provided with certain geometrical errors. Some of the errors are and the methodology to correct them are listed below: 1. Intersections This…
29 Apr 2020 08:01 PM IST
Calculating auto-ignition time for methane combustion under various initial condition using Python and Cantera
INTRODUCTION: Auto-ignition occurs when a mixture of gases or vapors ignites spontaneously in absence of any external ignition source such as a flame or a spark. The temperature at which auto-ignition occurs is called the auto-ignition temperature. It is the lowest temperature in a system where the rate of heat evolved…
29 Apr 2020 08:01 PM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.