Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surface auto tree gen support with metal attrs #2187

Closed
wants to merge 36 commits into from
Closed

Conversation

davidfarinajr
Copy link
Contributor

Motivation or Problem

Adding auto tree gen support for Surface families and improving kinetics estimates based on metal attrs.

Description of Changes

  • modified get_bde method to get energies for metal bonds (X-A) using atomic binding energies from MetalDB
  • modified ArrheniusBM methods to work for surface reactions and created SurfaceArrheniusBM class as subclass of ArrheniusBM
  • added metal attrs to reaction class
  • modified tree descend algorithms to include metal attrs
  • revised tree gen methods to work for surface families
  • created a split_template family method to break up merged template (created by autogen trees) into difference reactant templates
  • added facet to rmg input file, and metal attrs to Kinetics Database that are used when descending kinetics trees to match training reactions or nodes in surface kinetics trees
  • added notebook to estimate A factors for surface reactions

Testing

autogenerated surface families trees here ReactionMechanismGenerator/RMG-database#499 and built CPOX models with different metals and facets for which the appropriate nodes and training reactions are selected based on metal attrs

@lgtm-com
Copy link

lgtm-com bot commented Jul 26, 2021

This pull request introduces 4 alerts when merging d96097f into 6932bc8 - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Unused local variable
  • 1 for Variable defined multiple times

@codecov
Copy link

codecov bot commented Jul 26, 2021

Codecov Report

Merging #2187 (47c4e0b) into main (47c4e0b) will not change coverage.
The diff coverage is n/a.

❗ Current head 47c4e0b differs from pull request most recent head 5ed781e. Consider uploading reports for the commit 5ed781e to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2187   +/-   ##
=======================================
  Coverage   47.21%   47.21%           
=======================================
  Files         104      104           
  Lines       27706    27706           
  Branches     7133     7133           
=======================================
  Hits        13082    13082           
  Misses      13217    13217           
  Partials     1407     1407           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47c4e0b...5ed781e. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Jul 26, 2021

This pull request introduces 4 alerts when merging 4ce2516 into 6932bc8 - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Unused local variable
  • 1 for Variable defined multiple times

@mazeau
Copy link
Contributor

mazeau commented Sep 25, 2021

more as a note to myself, but after the rebase, this passes all py tests locally

@mazeau
Copy link
Contributor

mazeau commented Sep 25, 2021

probably doesn't matter too much here, but I get errors with the py tests on discovery

======================================================================
ERROR: Test that generate_thermo_data() works correctly on gaussian PM3.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussianTest.py", line 78, in test_generate_thermo_data
    self.qmmol1.generate_thermo_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 363, in generate_thermo_data
    self.qm_data = self.generate_qm_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 265, in generate_qm_data
    success = self.run()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 100, in run
    return self.verify_output_file()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 170, in verify_output_file
    qm_data = self.parse()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 340, in parse
    qm_data = parse_cclib_data(cclib_data, radical_number + 1)  # Should `radical_number+1` be `self.molecule.multiplicity` in the next line of code? It's the electronic ground state degeneracy.
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/qmdata.py", line 101, in parse_cclib_data
    rotational_constants = (cclib_data.rotcons[-1], 'cm^-1')
IndexError: list index out of range

======================================================================
ERROR: Test that generate_thermo_data() can load thermo from the previous gaussian PM3 run.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussianTest.py", line 94, in test_load_thermo_data
    self.qmmol1.generate_thermo_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 363, in generate_thermo_data
    self.qm_data = self.generate_qm_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 254, in generate_qm_data
    if self.verify_output_file():
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 170, in verify_output_file
    qm_data = self.parse()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 340, in parse
    qm_data = parse_cclib_data(cclib_data, radical_number + 1)  # Should `radical_number+1` be `self.molecule.multiplicity` in the next line of code? It's the electronic ground state degeneracy.
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/qmdata.py", line 101, in parse_cclib_data
    rotational_constants = (cclib_data.rotcons[-1], 'cm^-1')
IndexError: list index out of range

======================================================================
ERROR: Test that generate_thermo_data() works correctly for gaussian PM6.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussianTest.py", line 136, in test_generate_thermo_data
    self.qmmol1.generate_thermo_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 363, in generate_thermo_data
    self.qm_data = self.generate_qm_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 265, in generate_qm_data
    success = self.run()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 100, in run
    return self.verify_output_file()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 170, in verify_output_file
    qm_data = self.parse()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 340, in parse
    qm_data = parse_cclib_data(cclib_data, radical_number + 1)  # Should `radical_number+1` be `self.molecule.multiplicity` in the next line of code? It's the electronic ground state degeneracy.
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/qmdata.py", line 101, in parse_cclib_data
    rotational_constants = (cclib_data.rotcons[-1], 'cm^-1')
IndexError: list index out of range

======================================================================
ERROR: Test that generate_thermo_data() can load thermo from the previous gaussian PM6 run.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussianTest.py", line 153, in test_load_thermo_data
    self.qmmol1.generate_thermo_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 363, in generate_thermo_data
    self.qm_data = self.generate_qm_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 254, in generate_qm_data
    if self.verify_output_file():
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 170, in verify_output_file
    qm_data = self.parse()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 340, in parse
    qm_data = parse_cclib_data(cclib_data, radical_number + 1)  # Should `radical_number+1` be `self.molecule.multiplicity` in the next line of code? It's the electronic ground state degeneracy.
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/qmdata.py", line 101, in parse_cclib_data
    rotational_constants = (cclib_data.rotcons[-1], 'cm^-1')
IndexError: list index out of range

======================================================================
ERROR: Test that Gaussian get_thermo_data() works correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/mainTest.py", line 276, in test_get_thermo_data_gaussian
    thermo1 = self.gauss1.get_thermo_data(mol)
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/main.py", line 224, in get_thermo_data
    thermo0 = qm_molecule_calculator.generate_thermo_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 363, in generate_thermo_data
    self.qm_data = self.generate_qm_data()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 265, in generate_qm_data
    success = self.run()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 100, in run
    return self.verify_output_file()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/gaussian.py", line 170, in verify_output_file
    qm_data = self.parse()
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 340, in parse
    qm_data = parse_cclib_data(cclib_data, radical_number + 1)  # Should `radical_number+1` be `self.molecule.multiplicity` in the next line of code? It's the electronic ground state degeneracy.
  File "/home/mazeau.e/Code/RMG-Py/rmgpy/qm/qmdata.py", line 101, in parse_cclib_data
    rotational_constants = (cclib_data.rotcons[-1], 'cm^-1')
IndexError: list index out of range

@davidfarinajr davidfarinajr changed the base branch from master to main October 1, 2021 17:34
- make deepcopies of adsorbates since thermo is different on different metals
- assign metal/facet/site to reverse entries
- stick entry index on reaction index (helpful for debugging)
metal attrs are loaded from input and set as attrs on kinetics database.  They are taken from kinetics database and set on reactions generated with the kineticsDB
if we fail to split the node any furthur or all the reactions are the same, make child facet nodes
this fixed a bug where surface group parent specified rings, but children did not
Metal attrs are loaded and saved to entries.  They are loaded as Database attr, but not saved.  This commit saves DB metal attrs
…b test

The surface thermo groups should no longer have metal attrs since the adsorption groups are used for any type of metal/facet and this can mess with descending the trees if the thermo group entry has a metal, and the structure does not.  Instead, the metal and facet are saved as thermo group database attrs
@lgtm-com
Copy link

lgtm-com bot commented Oct 1, 2021

This pull request introduces 4 alerts when merging 5ed781e into 47c4e0b - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Unused local variable
  • 1 for Variable defined multiple times

@github-actions
Copy link

This pull request is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant pull request, otherwise it will automatically be closed in 30 days.

@github-actions github-actions bot added the stale stale issue/PR as determined by actions bot label Jun 21, 2023
@github-actions github-actions bot added the abandoned abandoned issue/PR as determined by actions bot label Jul 22, 2023
@github-actions github-actions bot closed this Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned abandoned issue/PR as determined by actions bot stale stale issue/PR as determined by actions bot Status: WIP This is currently work-in-progress Topic: Catalysis Topic: Kinetics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants