Open googhgoo opened 3 years ago
Ah, I see you've already used my solution from #187 for calculating the activation energy using electronic energy and ZPE. Also, see #187 for why we accept T for reaction.get_EoRT_act
.
Our ChemkinReaction
object has a beta
attribute but as you pointed out we never fit it because we always ran isothermal. We'd greatly appreciate if you submit a pull request. That way we could include your fitting function into the official version!
Okay sounds good. Where should I make the "adapter" definition? I was never involved with pmutt, so I'm not sure. Should I make it a definition for the reaction class?
I think a class method similar to the Reaction.from_string
method would maintain consistency. Perhaps adding this to ChemkinReaction
:
class ChemkinReaction:
@classmethod
def from_data(T, k):
# Insert your fitting algorithm here
return cls(A=A, beta=beta, Ea=Ea)
However, that class was specifically written for IO to Chemkin so if you find it too inflexible, you can define your own Reaction child class. If you're still interested, you can submit a pull request to the development branch and we can iterate from there.
Describe the solution you'd like MKM packages such as chemkin and Cantera uses modified Arrhenius equation which looks like:
k = AT^(b)e^(-Ea/RT)
Typically, we run isothermal reactor, so We simply use b = 0, and use A and Ea that would reproduce the transition state theory calculated k at the reactor temperature. This is okay for the isothermal reactor, but for those of who running the nonisothermal reactor needs to nail down the A, b and Ea values well for the correct simulation. It would be nice to have a function from pmutt.reaction.Reaction that fit these values correctly.
Describe alternatives you've considered Currently, I had to write my own function to fit A, b, and Ea. I calculated Ea first by
rxn.get_E_state('transition_state','eV',include_ZPE=True) - rxn.get_E_state('reactants','eV',include_ZPE=True)
Be aware that you should not use get_E_act, here because it actually calculates get_H_act. (It doesn't make sense anyway that get_E_act needs T. Perhaps we need to differentiate it with get_U_act).
After this, I calculate a line of A values:
and I have written least-square fitting function to fit A*T^b:
I hope this is implemented in the future, and also the difference between E and U should be solved.