Professional Documents
Culture Documents
Theory -->
# Simulation Parameters
P=ct.one_atm
Tin = 300.0
reactants = {'CH4':0.45, 'O2':1.0, 'N2':3.76}
reactants1 = {'H2':1.8, 'O2':1, 'N2':3.76}
width = 0.03
gas =ct.Solution('gri30.xml','gri30_mix')
gas1 = ct.Solution('H2_mech.cti')
gas.TPX = Tin, P, reactants
gas1.TPX = Tin, P, reactants1
# Flame Object
f = ct.FreeFlame(gas,width=width)
g = ct.FreeFlame(gas1,width=width)
# Solve
f.solve(loglevel=1, refine_grid=True, auto=False)
g.solve(loglevel=1, refine_grid=True, auto=False)
#help(f.solve)
# Ploting the results
plt.figure(1)
plt.subplot(2,1,1)
plt.title('CH4 [methane-air] combustion using GRI 3.0
Mechanism',fontsize=12,fontweight='bold')
plt.grid('on')
plt.xlabel('Grid')
plt.ylabel('Temperature in k',fontsize=12,fontweight='bold')
plt.plot(f.grid,f.T,color='k',linewidth=2)
plt.subplot(2,1,2)
plt.xlabel('Grid')
plt.ylabel('Velocity in m/s',fontsize=12,fontweight='bold')
plt.plot(f.grid,f.velocity,color='r',linewidth=2)
plt.grid('on')
plt.figure(2)
plt.subplot(2,1,1)
plt.title('H2 [Hydrogen-air] combustion using H2_mech.cti
Mechanism',fontsize=12,fontweight='bold')
plt.plot(g.grid,g.T,color='k',linewidth=2)
plt.grid('on')
plt.xlabel('Grid')
plt.ylabel('Temperature in k',fontsize=12,fontweight='bold')
plt.subplot(2,1,2)
plt.plot(g.grid,g.velocity,color='r',linewidth=2)
plt.xlabel('Grid')
plt.ylabel('Velocity in m/s',fontsize=12,fontweight='bold')
plt.grid('on')
plt.figure(3)
plt.title('Variation of CO2 mole fraction in CH4-Air flame')
plt.plot(f.grid,f.X[gas.species_index('CO2')],linewidth=2,color='g'
)
plt.legend(['Methane[CH4-Air]'])
plt.xlabel('Grid Length',fontsize=12,fontweight='bold')
plt.ylabel('Concentration of CO2',fontsize=12,fontweight='bold')
plt.grid('on')
plt.figure(4)
plt.title('Variation of CO2 mole fraction in H2-Air flame')
plt.plot(g.grid,g.X[gas1.species_index('CO2')],linewidth=2,color='r
')
plt.legend(['Hydrogen[H2-Air]'])
plt.xlabel('Grid Length',fontsize=12,fontweight='bold')
plt.ylabel('Concentration of CO2',fontsize=12,fontweight='bold')
plt.grid('on')
plt.show()
Results:--
From the above graphs, we can infer that the flame front exists between
0.010-0.011. Unburnt reactants move from left to right and as they pass
through the flame front they are converted into products. It can also be seen
that H2 flame speed is higher than CH4 flame speed as H2 is more diffusive
gas than CH4. In the H2 flame, we are not using GRI 3.0 mechanism because
the mechanism has 325 chemical reactions and 53 species instead, we use
H2_mech.cti mechanism which has 268 reactions and 57 species and it is also
optimised for Hydrogen Oxidation. It gives faster and accurate results
compared to GRI 3.0 mechanism.
The following plot is based on the GRI 3.0 Mechanism.
# Simulation Parameters
P=ct.one_atm
Tin = 300.0
# Flame Object
g1 = ct.FreeFlame(gas1,width=width)
g2 = ct.FreeFlame(gas2,width=width)
# Solve
g1.solve(loglevel=1, refine_grid=True, auto=False)
g2.solve(loglevel=1, refine_grid=True, auto=False)
#help(f.solve)
# Ploting the results
plt.figure(1)
plt.subplot(2,1,1)
plt.title('GRI 3.0 Mechanism VS H2_mech.cti Mechanism [Hydrogen-Air
Flame]',fontsize=12,fontweight='bold')
plt.plot(g1.grid,g1.T,color='r',linewidth=2)
plt.plot(g2.grid,g2.T,color='k',linewidth=2)
plt.legend(['GRI 3.0 Mechanism','H2_mech.cti Mechanism'])
plt.grid('on')
plt.xlabel('Grid Length')
plt.ylabel('Temperature in k',fontsize=12,fontweight='bold')
plt.subplot(2,1,2)
plt.plot(g1.grid,g1.velocity,color='r',linewidth=2)
plt.plot(g2.grid,g2.velocity,color='k',linewidth=2)
plt.legend(['GRI 3.0 Mechanism','H2_mech.cti Mechanism'])
plt.xlabel('Grid')
plt.ylabel('Velocity in m/s',fontsize=12,fontweight='bold')
plt.grid('on')
plt.figure(2)
plt.title('Hydrogen-Air H2
Combustion',fontsize=12,fontweight='bold')
plt.plot(g1.grid,g1.X[gas1.species_index('CO2')],linewidth=1.5)
plt.plot(g2.grid,g2.X[gas2.species_index('CO2')],linewidth=1.5)
plt.legend(['GRI 3.0 Mechanism','H2_mech.cti Mechanism'])
plt.xlabel('Grid Length',fontsize=12,fontweight='bold')
plt.ylabel('Concentration of CO2 variation along grid
length',fontsize=13,fontweight='bold')
plt.grid('on')
plt.show()
Results: --
--> The above plot compares GRI 3.0 mechanism with H2_mech.cti
Mechanism, we can see that velocity is slightly higher for the H2 mechanism
and the H2 mechanism gives a more accurate CO2 concentration (negative)
as we know that CO2 will not be formed in H2-Air combustion.
'''
The code shows the effect of width parameter on the solution of 1D
flame speed analysis. Result for Variation
in width is captured for both Methane-Air (GRI 3.0 Mechanism) and
Hydrogen-Air (H2 Mechanism) Combustion.
'''
import cantera as ct
import numpy as np
import matplotlib.pyplot as plt
def CH4_GRI30(width):
# Simulation Parameters
P=ct.one_atm
Tin = 300.0
reactants = {'CH4':0.45, 'O2':1.0, 'N2':3.76}
gas =ct.Solution('gri30.xml','gri30_mix')
gas.TPX = Tin, P, reactants
# Flame Object
f = ct.FreeFlame(gas,width=width)
f.set_refine_criteria(ratio=3, slope=0.07, curve=0.14)
f.solve(loglevel=1, refine_grid=True, auto=False)
return f, gas
def H2_MECH(width):
# Simulation Parameters
P=ct.one_atm
Tin = 300.0
reactants = {'H2':1.8, 'O2':1, 'N2':3.76}
gas =ct.Solution('H2_mech.cti')
gas.TPX = Tin, P, reactants
# Flame Object
g = ct.FreeFlame(gas,width=width)
g.set_refine_criteria(ratio=3, slope=0.07, curve=0.14)
g.solve(loglevel=1, refine_grid=True, auto=False)
return g, gas
plt.figure(2)
plt.subplot(2,1,1)
plt.title('H2 [Hydrogen-air] combustion using H2_mech.cti
Mechanism',fontsize=12,fontweight='bold')
plt.grid('on')
plt.xlabel('Grid',fontsize=12,fontweight='bold')
plt.ylabel('Temperature in k',fontsize=12,fontweight='bold')
plt.plot(f4.grid,f4.T,linewidth=2)
plt.plot(f5.grid,f5.T,linewidth=2)
plt.plot(f6.grid,f6.T,linewidth=2)
plt.legend(['Width = 0.6','Width = 0.12','Width = 0.18'])
plt.subplot(2,1,2)
plt.xlabel('Grid',fontsize=12,fontweight='bold')
plt.ylabel('Velocity in m/s',fontsize=12,fontweight='bold')
plt.grid('on')
plt.plot(f4.grid,f4.velocity,linewidth=2)
plt.plot(f5.grid,f5.velocity,linewidth=2)
plt.plot(f6.grid,f6.velocity,linewidth=2)
plt.legend(['Width = 0.6','Width = 0.12','Width = 0.18'])
plt.show()
Results: --
--> Width represents the length of the domain in 1D space. The above plots
show that width does not affect the profile curves only the flame position
changes with the width. Width must also be physically relevant for the
problem. We cannot use very small or large width as it will affect the physics of
the problem.