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

Resonance structures of adsorbates don't put radicals on the surface. #1828

Closed
wants to merge 5 commits into from

Conversation

rwest
Copy link
Member

@rwest rwest commented Nov 23, 2019

Motivation or Problem

See #1820 for details.

Synopsis:
resonance structure generation was shuffling radicals and double bonds around and ending up with a radical on a surface site X. This adsorbate (with a radical on X) then failed to match anything in the adsorption thermochemistry tree and raised a thermo error.

Description of Changes

The fix proposed in this PR is: if you try to increment the radical (or lone pair) count on a surface site, it has no effect.
This has a consequence that some resonance structures of an adsorbate have unpaired electrons and some don't. In order for such Species to be passed back and forth through multiprocessing, the __init__ method of Species needed modifying to allow different multiplicities when creating a species; this is only permitted for adsorbates.

Testing

A few large models with heterogeneous surface chemistry have been run without any errors.
Modified a unit test as needed. Ran unit tests.

Other

Also includes a couple of small fixes made along the way: one tiny change to make code more readable and fast, and one to improve diagnostic error logging.

@rwest rwest requested a review from mliu49 November 23, 2019 20:22
@codecov
Copy link

codecov bot commented Nov 23, 2019

Codecov Report

Merging #1828 into master will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1828      +/-   ##
==========================================
- Coverage   47.16%   47.12%   -0.05%     
==========================================
  Files          88       88              
  Lines       23189    23189              
  Branches     6033     6033              
==========================================
- Hits        10938    10928      -10     
- Misses      11103    11110       +7     
- Partials     1148     1151       +3     
Impacted Files Coverage Δ
rmgpy/data/thermo.py 61.95% <0.00%> (ø)
rmgpy/molecule/draw.py 51.97% <0.00%> (-1.29%) ⬇️
arkane/kinetics.py 12.24% <0.00%> (ø)
rmgpy/data/kinetics/family.py 49.16% <0.00%> (+0.20%) ⬆️

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 bd01afe...6f9803c. Read the comment docs.

@mliu49
Copy link
Contributor

mliu49 commented Nov 25, 2019

I think the changes themselves look good, and the approach seems to make sense physically. I'm wondering if this has any dangerous consequences.

The first thing that comes to mind is conservation of electrons/multiplicity. If a surface species has one resonance structure with a radical and one without, then you could get what appears to be a radical recombination with a stable species or H abstraction from a radical. I guess it wouldn't matter when simulating though.

Also, would this result in any weird thermo estimates? Since we take the structure with the lowest H298.

@rwest
Copy link
Member Author

rwest commented Jan 5, 2020

Some strange things showing up that I don't understand but are quite possibly related to this.

One problem: radical adsorbates still showing up

HNOX(541)
multiplicity 2
1 O u0 p2 c0 {2,S} {4,S}
2 N u1 p1 c0 {1,S} {3,S}
3 H u0 p0 c0 {2,S}
4 X u0 p0 c0 {1,S}

and a vdW one

H2NOX(542)
multiplicity 2
1 O u0 p2 c0 {2,S} {4,S}
2 N u1 p1 c0 {1,S} {3,S}
3 H u0 p0 c0 {2,S}
4 H u0 p0 c0 {1,S}
5 X u0 p0 c0

and a biradical vdW adsorbed

HNOX(2461)
multiplicity 3
1 O u1 p2 c0 {2,S}
2 N u1 p1 c0 {1,S} {3,S}
3 H u0 p0 c0 {2,S}
4 X u0 p0 c0

Another weird thing:
a multiplicity 2 species with no radicals (causes an InvalidAdjacencyListError when you try to load the dictionary)

NOX(2818)
multiplicity 2
1 O u0 p2 c0 {2,D}
2 N u0 p1 c0 {1,D} {3,S}
3 X u0 p0 c0 {2,S}

that is a duplicate of a species that's already there

NOX(507)
1 O u0 p2 c0 {2,D}
2 N u0 p1 c0 {1,D} {3,S}
3 X u0 p0 c0 {2,S}

These are copied from the chemkin/species_dictionary.txt file.
(For my own reference: HAN/5ef9a10cc030ff846c80619c3b59eb89d7696912 )

@rwest
Copy link
Member Author

rwest commented Mar 2, 2020

Note to self: Gas phase radicals should not adsorb via van-der-Waals.

If you can't find adsorption energy group value,
log the adjacency list of the molecule.
Tiny change. Increases readability and presumably speed.
This may hide bugs, or it may be exactly the right
thing to do. I'm not entirely sure.
But it currently seems like a good idea.

The presumption is:
surface sites of metals should not have unpaired
or pairs of electrons - they just have a big sea
of delocalized electrons at their disposal.

See #1820
…multiplicity.

When a metal surface is involved, your adsorbate may
have different multiplicity in different resonance forms
because you may hybridize a radical onto the metal
where it "disappears". 

It is an attempt to address 
#1820
Trying to forbid them using the forbidden structures doesn't 
seem to be working (a bug in is_subgraph_isomorphic?) but
making the top level node have multiplicity [1,3] excludes
anything with multiplicity 2 and seems to work on a 
generate_reactions level. Probably a better solution anyway, 
as it's inefficient to match the node, apply the recipe, generate
the products, and *then* discard them as forbidden.
@JacksonBurns
Copy link
Contributor

Changing base and attempting to rebase. Would be nice to get these fixes and tests in, if possible.

@JacksonBurns JacksonBurns changed the base branch from master to main May 12, 2023 20:55
@JacksonBurns
Copy link
Contributor

@rwest there is a simple conflict to resolve and then this PR can be evaluated for merging. Please resolve if still worth doing, or close otherwise.

@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 Aug 11, 2023
@github-actions github-actions bot added the abandoned abandoned issue/PR as determined by actions bot label Sep 11, 2023
@github-actions github-actions bot closed this Sep 11, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants