All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To write a code to import all the reactions from GRI mechanism and to calculate 10 most sensitive reactions with respect to temperature parameter Theoritical Background: Sensitivity Analysis It is the process to get relationship between the parameters and the output of the model. Sensitivity analysis investigates…
Sachin B N
updated on 22 Jul 2021
AIM: To write a code to import all the reactions from GRI mechanism and to calculate 10 most sensitive reactions with respect to temperature parameter
Theoritical Background:
Sensitivity Analysis
It is the process to get relationship between the parameters and the output of the model. Sensitivity analysis investigates the effect of parameter change on the solution of mathematical models. In chemical kinetics, models are usually based on differential equations and the results are concentration-time curves, reaction rates, and various kinetic features of the reaction
"""
Program to perform sensitivity analysis on Methane combustion
"""
import numpy as np
import cantera as ct
import matplotlib.pyplot as plt
gas = ct.Solution("gri30.xml")
Temp = 1500
Pressure = ct.one_atm
gas.TPX = Temp,Pressure,{'CH4':1,'O2':2,'N2':7.52}
r=ct.IdealGasConstPressureReactor(gas, name='R1')
sim=ct.ReactorNet([r])
n = gas.n_reactions
for i in range(n):
r.add_sensitivity_reaction(i)
# Set relative and absolute tolerances for solution and sensitivity analysis
sim.rtol = 1e-06
sim.atol = 1e-15
sim.rtol_sensitivity = 1e-06
sim.atol_sensitivity = 1e-06
states = ct.SolutionArray(gas, extra =['t'])
s_max = [0]*n
for t in np.arange(0,2e-3,5e-6):
sim.advance(t)
for i in range(n):
s = sim.sensitivity('temperature',i)
if(abs(s)>abs(s_max[i])):
s_max[i] = s
states.append(r.thermo.state, t = 1000*t)
# sorting top 10 reactions
N = 10
sen = [0]*n
sen_order = [0]*N
react_number = [0]*N
for i in range(N):
for j in range(n):
if(abs(np.min(s_max))>np.max(s_max)):
sen_order[i] = np.min(s_max)
else:
sen_order[i] = np.max(s_max)
react_number[i] = s_max.index(sen_order[i])
s_max.remove(sen_order[i])
sens_react = [0]*N
print('Sensitivity index for the 10 most sensitive reactions')
for i in range(N):
sens_react[i] = sim.sensitivity_parameter_name(react_number[i])
print('s=',sen_order[i],'for reaction',sens_react[i])
plt.figure(1)
plt.barh(sens_react,sen_order)
plt.xlabel('Sensitivity')
plt.figure(2)
plt.subplot(2,2,1)
plt.plot(states.t,states.T)
plt.xlabel('Time(in ms)')
plt.ylabel('Temperature(in K)')
plt.subplot(2,2,2)
plt.plot(states.t,states('CH4').X)
plt.xlabel('Time(in ms)')
plt.ylabel('Mole fraction of CH4')
plt.subplot(2,2,3)
plt.plot(states.t,states('H').X)
plt.xlabel('Time(in ms)')
plt.ylabel('Mole fraction of H')
plt.subplot(2,2,4)
plt.plot(states.t,states('OH').X)
plt.xlabel('Time(in ms)')
plt.ylabel('Mole fraction of OH')
plt.show()
Results:
Plots
Variation of Temperature with respect to Molar Concentration for species like CH4, OH, H are observed in the above plots
The most sensitive reaction from the above plot was found to be CH3 +O2 <=> CH3O + O. This reaction has a sensitivity coefficient of 16.83. The reaction occurs very faster and has shorter ignition period. If the sensitivity coefficient is Positive, which means reactions are becoming faster , that having a shorter ignition period. If the sensitivity coefficient is Negative means reaction is inhibiting the ignition delay.
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-6 : Turbocharger Modelling
AIM: To List down different TC and locate examples from GT Power To Explore tutorial number 6 and 7 To Plot operating points on compressor and turbine maps To find the application in which Variable Geometry Turbine is beneficial? To Explore example- Diesel VGT EGR and understand the modeling part Solution: Turbocharger:…
28 Jul 2024 11:58 AM IST
Week 9 - Senstivity Analysis Assignment
AIM: To write a code to import all the reactions from GRI mechanism and to calculate 10 most sensitive reactions with respect to temperature parameter Theoritical Background: Sensitivity Analysis It is the process to get relationship between the parameters and the output of the model. Sensitivity analysis investigates…
22 Jul 2021 10:03 AM IST
Week 7 - Auto ignition using Cantera
AIM: To simulate the case of autoignition of methane fuel for finding the ignition delay and to study the effect of temperature and pressure on ignition delay. Theoritical Background: Ignition dealy Ignition delay (ID) is defined as the time period between the start of fuel injection to the start of combustion…
21 Jul 2021 02:37 PM IST
Week 6 - Multivariate Newton Rhapson Solver
AIM: To solve the give set of Ordinary differential equations using Multivariate Newton-Raphson Method Theoritical Background: Newton-Raphson Iteration Let f(x) be a well-behaved function, and let r be a root of the equation f(x) = 0. Of the many iterative root-finding procedures, the Newton-Raphson method, with…
20 Jul 2021 12:54 PM 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.