Hello everyone,I am new to Cantera and trying to understand the kinetics codes for my thesis on emissions modeling.
I am attempting to write a code by looking at various online resources to find the top 10 reactions that NOx formation is most sensitive to for hydrogen blend fuels.
Here are the relevant sections of the code. Could you please tell me if I am right or wrong in understanding the sensitivity analysis in Cantera.
r = ct.IdealGasConstPressureReactor(gas)
sim = ct.ReactorNet([r])
no_rxn = gas.n_reactions
for i in range(no_rxn):
r.add_sensitivity_reaction(i)
max_NO = [0]*no_rxn
max_NO_abs = [0]*no_rxn
for time in np.arange(0,tot_time,dt):
sim.advance(time)
for j in range(no_rxn):
s = sim.sensitivity('NO',j) # Gives sensitivity for all reactions (Please let me know if this line is correct)
if np.abs(s) > np.abs(max_NO[j]): # arranging in descending order of sensitivity
max_NO[j] = s
max_NO_abs[j] = abs(s)
Thank you for your help.