Obtaining the Arrhenius constants

700 views
Skip to first unread message

kurian jv

unread,
Oct 5, 2020, 10:03:06 AM10/5/20
to Cantera Users' Group
Hey everyone

I am very new to Cantera so this question might be very basic:
I am using the python interface for Cantera and I am trying to get the hang of how to access different values in the reaction mechanism file.
For example: In gri 30
#  Reaction 325
reaction( "CH3 + C3H7 <=> 2 C2H5",   [1.92700E+13, -0.32, 0])

I have figured out that we can get the reaction using:
print(data.reaction_equations([324]))

But I cannot figure out how to print out/get the arrhenius parameters in the reaction i.e. [1.92700E+13, -0.32, 0]

Any leads would be very helpful :)

Thank you!


bryan.a....@gmail.com

unread,
Oct 5, 2020, 11:38:52 AM10/5/20
to Cantera Users' Group
I don't know of any dedicated function for that, but couldn't you use ordinary Python text parsing tools to extract the value you want from your line of text?

Chikpezili Ajulu

unread,
Oct 6, 2020, 1:43:58 PM10/6/20
to Cantera Users' Group
Hi Kurian and Bryan,

In order to get the rate constants in cantera you need to specify whether it's the forward or reverse rate constants you want. Looking at the Python documentation here shows the Kinetics class in cantera and one of the attributes is `forward_rate_constants` similarly the reverse rate constant is `reverse_rate_constants`. This can be gotten by using the Cantera.Kinetics class attribute synatx `cantera.Kinetics.reverse_rate_constants` or  `cantera.Kinetics.forward_rate_constants` which gives an Arrhenius version of the rate constants with the A - pre-exponential factor, α - the temperature exponent, Ea - activation energy. The documentation is here https://cantera.org/documentation/docs-2.4/sphinx/html/cython/kinetics.html

Hope this answers your question.

Best regards,

Chikpezili   

Ingmar Schoegl

unread,
Oct 6, 2020, 6:37:40 PM10/6/20
to Cantera Users' Group
Here's some code that gets you to the Arrhenius object that holds all the information for this type of reaction (see https://cantera.org/documentation/docs-2.4/sphinx/html/cython/kinetics.html#id14):

import cantera as ct # tested for 2.5.0b1
gas = ct.Solution('gri30.yaml')
rxn = gas.reaction(1) # pick one reaction
arr = rxn.rate # this holds the Arrhenius object

arr.pre_exponential_factor # A
arr.temperature_exponent #b
arr.activation_energy # E

Hope this helps ...
-ingmar-

kurian jv

unread,
Oct 7, 2020, 4:46:50 AM10/7/20
to Cantera Users' Group
Hey everyone

Thank you for all the comments.
I tested out the solution described by Ingmar and it seem to work for me

Thanks!
Reply all
Reply to author
Forward
0 new messages