ReactionMechanismGenerator / RMG-Py

Python version of the amazing Reaction Mechanism Generator (RMG).
http://reactionmechanismgenerator.github.io/RMG-Py/
Other
376 stars 226 forks source link

Encountered an Error When Using Arkane to Calculate Reaction Rates Based on Gaussian Output Files #2666

Closed OJ-0908 closed 1 month ago

OJ-0908 commented 1 month ago

General area which your question is related to.

Dear RMG Team, cal rate.zip

I am writing to seek your guidance regarding an issue I encountered while attempting to use Arkane to calculate reaction rates. Despite following the standard procedures, I encountered an error during the calculation.I have attached the Gaussian frequency and single point energy calculations for the reactants, products, and transition state. However, I am unable to identify the cause of the error.I would greatly appreciate any assistance or suggestions you can provide to resolve this issue.Thank you very much for your time and support.

Arkane execution initiated at Mon May 27 16:33:52 2024

################################################################
#                                                              #
# Automated Reaction Kinetics and Network Exploration (Arkane) #
#                                                              #
#   Version: 3.2.0                                             #
#   Authors: RMG Developers (rmg_dev@mit.edu)                  #
#   P.I.s:   William H. Green (whgreen@mit.edu)                #
#            Richard H. West (r.west@neu.edu)                  #
#   Website: http://reactionmechanismgenerator.github.io/      #
#                                                              #
################################################################

The current git HEAD for RMG-Py is:
        036ab3f8ca0f94f567b50b0b83110bab0a14a35f
        Wed Aug 16 15:56:48 2023 -0400

The current git HEAD for RMG-database is:
        b7ff16364a07c9a51a34303aa28407a83455a3e4
        Tue Aug 8 09:37:08 2023 -0400

Databases not found. Making databases
Loading frequencies library from halogens_G4.py in /rmg/RMG-database/input/statmech/libraries...
Loading frequencies group database from /rmg/RMG-database/input/statmech/groups...
Loading transport library from OneDMinN2.py in /rmg/RMG-database/input/transport/libraries...
Loading transport library from NIST_Fluorine.py in /rmg/RMG-database/input/transport/libraries...
Loading transport library from PrimaryTransportLibrary.py in /rmg/RMG-database/input/transport/libraries...
Loading transport library from GRI-Mech.py in /rmg/RMG-database/input/transport/libraries...
Loading transport library from NOx2018.py in /rmg/RMG-database/input/transport/libraries...
Loading transport group database from /rmg/RMG-database/input/transport/groups...
Loading species H2NN...
Loading species OH...
Loading species NNH...
Loading species H2O...
Loading transition state TS1...
Loading reaction H2NN + OH <=> NNH + H2O...
Warning: No frequency scaling factor found for LevelOfTheory(method='m062x',basis='6311++g(2df,2p)',software='gaussian'). Assuming a value of unity. This will affect the partition function and all quantities derived from it  (thermo quantities and rate coefficients).

Loading statistical mechanics parameters for TS1...
Traceback (most recent call last):
  File "/rmg/RMG-Py/arkane/encorr/corr.py", line 118, in get_atom_correction
    atom_energies = data.atom_energies[energy_level]
KeyError: LevelOfTheory(method='m062x',basis='6311++g(2df,2p)',software='gaussian')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/rmg/RMG-Py/arkane/encorr/corr.py", line 121, in get_atom_correction
    atom_energies = data.atom_energies[energy_level.simple()]
KeyError: LevelOfTheory(method='m062x',basis='6311++g(2df,2p)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/rmg/RMG-Py/Arkane.py", line 59, in <module>
    arkane.execute()
  File "/rmg/RMG-Py/arkane/main.py", line 215, in execute
    job.execute(output_directory=self.output_directory, plot=self.plot, pdep=is_pdep(self.job_list))
  File "/rmg/RMG-Py/arkane/statmech.py", line 291, in execute
    self.load(pdep, plot)
  File "/rmg/RMG-Py/arkane/statmech.py", line 600, in load
    atoms, self.atomEnergies)
  File "/rmg/RMG-Py/arkane/encorr/corr.py", line 123, in get_atom_correction
    raise AtomEnergyCorrectionError(f'Missing atom energies for {energy_level}')
arkane.exceptions.AtomEnergyCorrectionError: Missing atom energies for LevelOfTheory(method='m062x',basis='6311++g(2df,2p)',software='gaussian')
mjohnson541 commented 1 month ago

In order to compute rate coefficients and thermochemistry at a particular level of theory Arkane usually wants frequency scaling factors (for both) and atom energy corrections and bond additivity corrections for thermochemistry. Strictly however of these it only requires the atom energy corrections, without which most resulting calculations would be useless.

Likely RMG does not have corrections for your level of theory in the RMG-database (although it's worth checking if it has it and the way you specified the theory in the input file is causing RMG to misinterpret the level of theory). If the RMG-database does not have the corrections. You have three primary options: 1) There are IPython notebooks in RMG-database/scripts for automating computation of atom energy corrections (AECs) and bond additivity corrections (BACs). Although, they will require installation of ARC. 2) Find AECs, frequency scaling factors and ideally BACs in literature and add them to RMG-database/input/quantum_corrections 3) Manually run a set of calculations and fit at least AECs to them and then add the result to RMG-database/input/quantum_corrections

JacksonBurns commented 1 month ago

@mjohnson541 thanks for the very thorough set of next steps! I will add that the log has this warning before the errors Warning: No frequency scaling factor found for LevelOfTheory(method='m062x',basis='6311++g(2df,2p)',software='gaussian'). Assuming a value of unity. ...

Should have Arkane still have successfully executed here, assuming some default value for the corrections (however erroneous it may be)?

mjohnson541 commented 1 month ago

So in general for computing properties:

Atom Energy Corrections Frequency scaling factors Bond Additivity Corrections
Thermochemistry Necessary Improves Accuracy Improves Accuracy
Rate Coefficients No Impact Improves Accuracy No Impact

In abstract, the primary function of the atom energy corrections is to take the quantum chemistry energies and reference them to the standard state. So unlike frequency scaling and bond additivity corrections which only refine the numbers to better match experiments the atom energy corrections can be very large. One would be unlikely to get a sane thermochemistry computation without them. See https://doi.org/10.1002/kin.21637.

However, I think if a user were to compute all species of interest at the exact same level of theory the relative thermochemistry for all of those species would be correct without atom energy corrections. So one could imagine allowing a user to deliberately turn off atom energy corrections, but in such a system you could never mix data because the references would be different.

Yeah, in hindsight atom energy "correction" may not have been the best choice of term from the kinetics community.

OJ-0908 commented 1 month ago

@mjohnson541 ,@Jackson Burns, thank you very much for your response. Following mjohnson541's suggestion, we have successfully incorporated the selected Gaussian method's BACs into the program, allowing it to run smoothly and generate reaction rate curves.