Cantera Open-Source

1D Flame Speed Analysis using Cantera Open-Source

Objective-Write a code to perform a 1D Flame Speed Analysis for Methane and Hydrogen using a separate Hydrogen mechanism to perform Flame Speed Analysis for Hydrogen.

Coding Approach:

1. A instance gas object is created by passing the the ‘gri30.xml’ mechnism file and ‘gri30_mix’ transport properties file.For dealing with hydrogen combustion a separate hydrogen mechanism file is used named H2_mech.cti.

2. The initial temperature,pressure,moles is set using gas.TPX.

3. A flame object is created by passing gas object and width parameter using FreeFlame.Width is the length of domain.

4. Mesh refinement criteria is set using, set_refine_criteria(ratio=3,slope=0.07,curve=0.14) and flame speed is solved.

Code for flame speed for Methane:

import cantera as ct
import numpy as np
import matplotlib.pyplot as plt

P=ct.one_atm
Tin=300
reactants='CH4:0.45,O2:1,N2:3.76'
width=0.03

gas =ct.Solution('gri30.xml','gri30_mix')
gas.TPX= Tin, P, reactants

f=ct.FreeFlame(gas,width=width)
f.set_refine_criteria(ratio=3,slope=0.07,curve=0.14)

f.solve(loglevel=1,auto=True)
plt.figure(1)
plt.subplot(2,1,1)
plt.plot(f.grid,f.T)
plt.ylabel('Temperature(K)')
plt.title('Temperature profile')
plt.grid()
plt.subplot(2,1,2)
plt.plot(f.grid,f.u)
plt.xlabel('Width(m)')
plt.ylabel('Velocity(m/s)')
plt.title('Velocity profile')
plt.grid()
plt.figure(2)
plt.plot(f.grid,f.X[gas.species_index('CO2')])
plt.xlabel('Width(m)')
plt.ylabel('CO2 Concentration')
plt.title('CO2 Concentration variation')
plt.grid()
plt.show()

Results:

Temperature Variation along the domain:

The above graph shows the variation of temperaure and velocity along the length of the domain.At the beginning the temperature is 300 K, but when ignition takes place there is a sudden jump in temperature and velocity.

The flame speed in case of methane combustion is around 2.5 m/s for the given initial conditions.

Code for flame speed for Hydrogen:

import cantera as ct
import numpy as np
import matplotlib.pyplot as plt

P=ct.one_atm
Tin=300
reactants='H2:2,O2:0.5'
width=0.03

gas =ct.Solution('H2_mech.cti')
gas.TPX= Tin, P, reactants

f=ct.FreeFlame(gas,width=width)
f.set_refine_criteria(ratio=3,slope=0.07,curve=0.14)

f.solve(loglevel=1,auto=True)

plt.figure(1)
plt.subplot(2,1,1)
plt.plot(f.grid,f.T)
plt.ylabel('Temperature(K)')
plt.title('Temperature profile')
plt.grid()
plt.subplot(2,1,2)
plt.plot(f.grid,f.u)
plt.xlabel('Width(m)')
plt.ylabel('Velocity(m/s)')
plt.title('Velocity profile')
plt.grid()
plt.figure(2)
plt.plot(f.grid,f.X[gas.species_index('CO2')])
plt.xlabel('Width(m)')
plt.ylabel('CO2 Concentration')
plt.title('CO2 Concentration variation')
plt.grid()
plt.show()

Velocity variation along the domain:

The above graph shows the variation of temperaure and velocity along the length of the domain.At the beginning the temperature is 300 K, but when ignition takes place there is a sudden jump in temperature and velocity.

The flame speed in case of methane combustion is around 72 m/s for the given initial conditions. Hydrogen shows a very higher flame speed in comparision to methane

 What type of analysis is this, steady-state or transient?

The nature of flame propagation is transient in nature as the flame changes with respect to time.But Cantera solve the problem using a steady state approach by using a reference frame.

In some cases if the solution doesnt converge than cantera switches to tansient analysis for certain time steps and again runs in steady state.

Why do we need a separate file to simulate Hydrogen Mechanism can’t it be done using GRI3.0?

GRI3.0 is basically designed for combustion of hydrocarbons. So for hydrogen a separate file is used through which we can obtain more accurate results and save computational time.

CO2 concentration:

There is a increase in CO2 concentration for methane burning indicating the formation of CO2.But in case of hydrogen combustion there is negligible CO2 formation which is obvious due no presence of carbon.This can be seen from the below graphs.

CO2 concentration for Methane combustion:

 CO2 concentration for Hydrogen combustion:

Does the “width” parameter have an effect on the solution, If so or not so, please explain why?

Width parameter has no effect on solution but if we increase the width it will have more computational time.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *