Re: Understanding sensitivity analysis in Cantera

147 views
Skip to first unread message
Message has been deleted

Bryan Weber

unread,
Mar 5, 2022, 10:13:02 AM3/5/22
to Cantera Users' Group
Hi,

I think your understanding is correct. If you have a more specific question, please let me know!

Best,
Bryan

On Thursday, February 24, 2022 at 1:56:43 PM UTC-5 twit...@gmail.com wrote:
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.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages