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

Check for adsorbates in resonance structure generation #2717

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bjkreitz
Copy link
Contributor

Motivation or Problem

@kirkbadger18 observed an issue when generating mechanisms with adsorbates that contain N atoms. RMG seems to generate species that have formal charges, although the reaction templates technically don't allow this reaction. This is described in issue #2716. The reason RMG found this issue is because of the resonance structure generation. Currently, there is no check if a species is an adsorbate or a gas-phase species, when applying the resonance algorithm. In this case, it produced a species with charge separation and then produced a whole bunch of weird reactions from that before crashing.

In my opinion, we should not apply the resonance structure generation templates for gas-phase species to adsorbates because we don't really know if they exist (yet). But I'm open to discussion if something thinks that the gas-phase recipes should be applied to adsorbates.

I have another PR open #2511 that adds resonance generation specifically for adsorbates.

Description of Changes

I added a check in resonance.py to only apply the resonance structure generation if a species is an adsorbate.

Testing

I confirmed that the issue is resolved. RMG passes the tests locally and I can also generate mechanisms without any errors.

Reviewer Tips

This should be fairly quick to review. It shouldn't affect the gas-phase chemistry and doesn't have any implications for catalysis mechanisms. It would be great, if someone could test this for a gas-phase reaction mechanism that involves N where resonance is important and confirm that this didn't change anything.
@alongd It would be great if you could take a look at this .

@bjkreitz bjkreitz self-assigned this Sep 23, 2024
@bjkreitz bjkreitz changed the title Check for adsorbates in resonance Check for adsorbates in resonance structure generation Sep 23, 2024
Copy link

Regression Testing Results

WARNING:root:Initial mole fractions do not sum to one; normalizing.
WARNING:root:Initial mole fractions do not sum to one; normalizing.
WARNING:root:Initial mole fractions do not sum to one; normalizing.
⚠️ One or more regression tests failed.
Please download the failed results and run the tests locally or check the log to see why.

Detailed regression test results.

Regression test aromatics:

Reference: Execution time (DD:HH:MM:SS): 00:00:01:06
Current: Execution time (DD:HH:MM:SS): 00:00:01:06
Reference: Memory used: 2770.46 MB
Current: Memory used: 2778.10 MB

aromatics Passed Core Comparison ✅

Original model has 15 species.
Test model has 15 species. ✅
Original model has 11 reactions.
Test model has 11 reactions. ✅

aromatics Failed Edge Comparison ❌

Original model has 106 species.
Test model has 106 species. ✅
Original model has 358 reactions.
Test model has 358 reactions. ✅

Non-identical thermo! ❌
original: C1=CC2C=CC=1C=C2
tested: C1=CC2C=CC=1C=C2

Hf(300K) S(300K) Cp(300K) Cp(400K) Cp(500K) Cp(600K) Cp(800K) Cp(1000K) Cp(1500K)
164.90 80.93 22.21 28.97 35.25 40.69 48.70 53.97 64.36
129.39 79.85 22.98 30.09 36.61 42.21 50.22 55.39 65.95

thermo: Thermo group additivity estimation: group(Cs-(Cds-Cds)(Cds-Cds)(Cds-Cds)H) + group(Cds-Cds(Cds-Cds)(Cds-Cds)) + group(Cds-CdsCsH) + group(Cds-CdsCsH) + group(Cds-Cds(Cds-Cds)H) + group(Cds-Cds(Cds-Cds)H) + group(Cds-CdsCsH) + group(Cdd-CdsCds) + Estimated bicyclic component: polycyclic(s4_6_6_ane) - ring(Cyclohexane) - ring(Cyclohexane) + ring(124cyclohexatriene) + ring(124cyclohexatriene)
thermo: Thermo group additivity estimation: group(Cs-(Cds-Cds)(Cds-Cds)(Cds-Cds)H) + group(Cds-Cds(Cds-Cds)(Cds-Cds)) + group(Cds-CdsCsH) + group(Cds-CdsCsH) + group(Cds-Cds(Cds-Cds)H) + group(Cds-Cds(Cds-Cds)H) + group(Cds-CdsCsH) + group(Cdd-CdsCds) + Estimated bicyclic component: polycyclic(s4_6_6_ane) - ring(Cyclohexane) - ring(Cyclohexane) + ring(124cyclohexatriene) + ring(1,4-Cyclohexadiene)

Non-identical kinetics! ❌
original:
rxn: [c]1ccccc1(3) + C1=CC2C=C[C]1C=C2(49) <=> benzene(1) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation
tested:
rxn: [c]1ccccc1(3) + C1=CC2C=C[C]1C=C2(49) <=> benzene(1) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -3.00 -0.74 0.70 1.71 3.07 3.97 5.33 6.15
k(T): 4.24 4.69 5.05 5.33 5.79 6.14 6.78 7.23

kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(9.943,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 38.5 to 41.6 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(0,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 38.5 to 41.6 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0

Non-identical kinetics! ❌
original:
rxn: [H](4) + C1=CC2C=C[C]1C=C2(49) <=> [H][H](11) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation
tested:
rxn: [H](4) + C1=CC2C=C[C]1C=C2(49) <=> [H][H](11) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -7.44 -4.08 -2.05 -0.69 1.02 2.06 3.46 4.18
k(T): 5.77 5.83 5.88 5.92 5.97 6.02 6.10 6.16

kinetics: Arrhenius(A=(4.06926e+10,'cm^3/(mol*s)'), n=0.47, Ea=(18.137,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O Multiplied by reaction path degeneracy 3.0 Ea raised from 75.2 to 75.9 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(4.06926e+10,'cm^3/(mol*s)'), n=0.47, Ea=(0,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O Multiplied by reaction path degeneracy 3.0""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O
Multiplied by reaction path degeneracy 3.0
Ea raised from 75.2 to 75.9 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O
Multiplied by reaction path degeneracy 3.0

Non-identical kinetics! ❌
original:
rxn: [CH]=C(7) + C1=CC2C=C[C]1C=C2(49) <=> C=C(13) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation
tested:
rxn: [CH]=C(7) + C1=CC2C=C[C]1C=C2(49) <=> C=C(13) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -7.17 -3.66 -1.56 -0.16 1.60 2.65 4.05 4.75
k(T): 4.06 4.76 5.18 5.46 5.81 6.02 6.30 6.44

kinetics: Arrhenius(A=(7.23e+12,'cm^3/(mol*s)'), n=0, Ea=(19.262,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_N-Sp-6R!H-4CHNS Multiplied by reaction path degeneracy 3.0""")
kinetics: Arrhenius(A=(7.23e+12,'cm^3/(mol*s)'), n=0, Ea=(3.841,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_N-Sp-6R!H-4CHNS Multiplied by reaction path degeneracy 3.0""")
Identical kinetics comments:
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_N-Sp-6R!H-4CHNS
Multiplied by reaction path degeneracy 3.0

Non-identical kinetics! ❌
original:
rxn: [CH]1C2=CC=CC12(8) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2CC2=C1(27) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation
tested:
rxn: [CH]1C2=CC=CC12(8) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2CC2=C1(27) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -30.48 -21.35 -15.79 -12.03 -7.23 -4.28 -0.16 2.03
k(T): -4.55 -1.90 -0.23 0.94 2.49 3.50 5.02 5.92

kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(47.659,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 195.4 to 199.4 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(12.063,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 46.8 to 50.5 kJ/mol to match endothermicity of reaction.""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 195.4 to 199.4 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 46.8 to 50.5 kJ/mol to match endothermicity of reaction.

Non-identical kinetics! ❌
original:
rxn: [CH]1C2=CC=CC12(8) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2C=C2C1(29) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation
tested:
rxn: [CH]1C2=CC=CC12(8) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2C=C2C1(29) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -31.23 -21.91 -16.23 -12.40 -7.51 -4.50 -0.31 1.91
k(T): -5.30 -2.46 -0.68 0.57 2.21 3.28 4.87 5.80

kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(48.686,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 202.2 to 203.7 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(13.089,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 53.5 to 54.8 kJ/mol to match endothermicity of reaction.""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 202.2 to 203.7 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 53.5 to 54.8 kJ/mol to match endothermicity of reaction.

Non-identical kinetics! ❌
original:
rxn: [CH]1C2=CC=CC12(8) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2=CC2C1(28) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation
tested:
rxn: [CH]1C2=CC=CC12(8) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2=CC2C1(28) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -27.24 -18.91 -13.84 -10.40 -6.02 -3.30 0.48 2.51
k(T): -1.38 0.48 1.67 2.52 3.68 4.45 5.66 6.39

kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(43.208,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 180.2 to 180.8 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(7.718,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 180.2 to 180.8 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0

Non-identical kinetics! ❌
original:
rxn: [CH]=CC=C(15) + C1=CC2C=C[C]1C=C2(49) <=> C=CC=C(17) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation
tested:
rxn: [CH]=CC=C(15) + C1=CC2C=C[C]1C=C2(49) <=> C=CC=C(17) + C1=CC2C=CC=1C=C2(79) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -11.95 -7.61 -5.01 -3.27 -1.10 0.20 1.93 2.80
k(T): -0.49 0.99 1.87 2.46 3.19 3.64 4.23 4.52

kinetics: Arrhenius(A=(2.529e+11,'cm^3/(mol*s)'), n=0, Ea=(23.821,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-6R!H-R Multiplied by reaction path degeneracy 3.0""")
kinetics: Arrhenius(A=(2.529e+11,'cm^3/(mol*s)'), n=0, Ea=(8.084,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-6R!H-R Multiplied by reaction path degeneracy 3.0""")
Identical kinetics comments:
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-6R!H-R
Multiplied by reaction path degeneracy 3.0

Non-identical kinetics! ❌
original:
rxn: C1=CC2C=C[C]1C=C2(49) + [CH]=Cc1ccccc1(12) <=> C1=CC2C=CC=1C=C2(79) + C=Cc1ccccc1(16) origin: Disproportionation
tested:
rxn: C1=CC2C=C[C]1C=C2(49) + [CH]=Cc1ccccc1(12) <=> C1=CC2C=CC=1C=C2(79) + C=Cc1ccccc1(16) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -12.28 -7.86 -5.21 -3.44 -1.23 0.10 1.87 2.75
k(T): -0.66 0.85 1.76 2.37 3.13 3.58 4.19 4.49

kinetics: Arrhenius(A=(2.529e+11,'cm^3/(mol*s)'), n=0, Ea=(24.273,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-6R!H-R Multiplied by reaction path degeneracy 3.0""")
kinetics: Arrhenius(A=(2.529e+11,'cm^3/(mol*s)'), n=0, Ea=(8.328,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-6R!H-R Multiplied by reaction path degeneracy 3.0""")
Identical kinetics comments:
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-6R!H-R
Multiplied by reaction path degeneracy 3.0

Non-identical kinetics! ❌
original:
rxn: C1=CC2C=C[C]1C=C2(49) + [CH]1C2=CC=CC1C=C2(48) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2C=CC(=C1)C2(69) origin: Disproportionation
tested:
rxn: C1=CC2C=C[C]1C=C2(49) + [CH]1C2=CC=CC1C=C2(48) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2C=CC(=C1)C2(69) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -30.44 -21.32 -15.76 -12.01 -7.22 -4.26 -0.16 2.03
k(T): -4.51 -1.87 -0.20 0.96 2.51 3.52 5.03 5.92

kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(47.606,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 195.1 to 199.2 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(12.01,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 46.5 to 50.2 kJ/mol to match endothermicity of reaction.""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 195.1 to 199.2 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 46.5 to 50.2 kJ/mol to match endothermicity of reaction.

Non-identical kinetics! ❌
original:
rxn: C1=CC2C=C[C]1C=C2(49) + [CH]1C2=CC=CC1C=C2(48) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2C=CC(=C2)C1(70) origin: Disproportionation
tested:
rxn: C1=CC2C=C[C]1C=C2(49) + [CH]1C2=CC=CC1C=C2(48) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2C=CC(=C2)C1(70) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -32.11 -22.57 -16.76 -12.84 -7.84 -4.76 -0.49 1.78
k(T): -6.18 -3.12 -1.20 0.13 1.88 3.01 4.70 5.67

kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(49.895,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 205.2 to 208.8 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(14.299,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 56.6 to 59.8 kJ/mol to match endothermicity of reaction.""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 205.2 to 208.8 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 56.6 to 59.8 kJ/mol to match endothermicity of reaction.

Non-identical kinetics! ❌
original:
rxn: C1=CC2C=C[C]1C=C2(49) + [CH]1C2=CC=CC1C=C2(48) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2=CC(C=C2)C1(71) origin: Disproportionation
tested:
rxn: C1=CC2C=C[C]1C=C2(49) + [CH]1C2=CC=CC1C=C2(48) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2=CC(C=C2)C1(71) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -33.97 -23.97 -17.88 -13.77 -8.54 -5.32 -0.86 1.50
k(T): -8.04 -4.52 -2.32 -0.81 1.18 2.46 4.32 5.39

kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(52.457,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 214.4 to 219.5 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(16.86,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 65.8 to 70.5 kJ/mol to match endothermicity of reaction.""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 214.4 to 219.5 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 65.8 to 70.5 kJ/mol to match endothermicity of reaction.

Non-identical kinetics! ❌
original:
rxn: C1=CC2C=C[C]1C=C2(49) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2C=CC1C=C2(82) origin: Disproportionation
tested:
rxn: C1=CC2C=C[C]1C=C2(49) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2C=CC1C=C2(82) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -30.48 -21.35 -15.79 -12.03 -7.23 -4.28 -0.16 2.03
k(T): -4.55 -1.90 -0.23 0.94 2.49 3.50 5.02 5.92

kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(47.659,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 195.4 to 199.4 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(17.1699,'cm^3/(mol*s)'), n=3.635, Ea=(12.063,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 3.0 Ea raised from 46.8 to 50.5 kJ/mol to match endothermicity of reaction.""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 195.4 to 199.4 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 3.0
Ea raised from 46.8 to 50.5 kJ/mol to match endothermicity of reaction.

Non-identical kinetics! ❌
original:
rxn: C1=CC2C=C[C]1C=C2(49) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2C=CC1=CC2(83) origin: Disproportionation
tested:
rxn: C1=CC2C=C[C]1C=C2(49) + C1=CC2C=C[C]1C=C2(49) <=> C1=CC2C=CC=1C=C2(79) + C1=CC2C=CC1=CC2(83) origin: Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): -19.49 -12.98 -9.00 -6.29 -2.81 -0.64 2.42 4.08
k(T): 3.96 4.60 5.07 5.43 5.98 6.39 7.11 7.60

kinetics: Arrhenius(A=(51.5097,'cm^3/(mol*s)'), n=3.635, Ea=(33.226,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 9.0 Ea raised from 133.4 to 139.0 kJ/mol to match endothermicity of reaction.""")
kinetics: Arrhenius(A=(51.5097,'cm^3/(mol*s)'), n=3.635, Ea=(1.036,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R Multiplied by reaction path degeneracy 9.0""")
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 9.0
Ea raised from 133.4 to 139.0 kJ/mol to match endothermicity of reaction.
kinetics: Estimated from node Root_Ext-1R!H-R_N-4R->O_Sp-5R!H=1R!H_Ext-4CHNS-R_Ext-4CHNS-R
Multiplied by reaction path degeneracy 9.0

Observables Test Case: Aromatics Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

aromatics Passed Observable Testing ✅

Regression test liquid_oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:02:11
Current: Execution time (DD:HH:MM:SS): 00:00:02:12
Reference: Memory used: 2906.45 MB
Current: Memory used: 2887.75 MB

liquid_oxidation Passed Core Comparison ✅

Original model has 37 species.
Test model has 37 species. ✅
Original model has 215 reactions.
Test model has 215 reactions. ✅

liquid_oxidation Failed Edge Comparison ❌

Original model has 202 species.
Test model has 202 species. ✅
Original model has 1610 reactions.
Test model has 1610 reactions. ✅

Non-identical kinetics! ❌
original:
rxn: CCCCCO[O](104) + CC(CC(C)OO)O[O](103) <=> oxygen(1) + CCCCC[O](128) + CC([O])CC(C)OO(127) origin: Peroxyl_Disproportionation
tested:
rxn: CCCCCO[O](104) + CC(CC(C)OO)O[O](103) <=> oxygen(1) + CCCCC[O](127) + CC([O])CC(C)OO(129) origin: Peroxyl_Disproportionation

k(1bar) 300K 400K 500K 600K 800K 1000K 1500K 2000K
k(T): 3.52 4.27 4.71 5.01 5.39 5.61 5.91 6.06
k(T): 7.79 7.46 7.21 7.00 6.67 6.41 5.94 5.60

kinetics: Arrhenius(A=(3.2e+12,'cm^3/(mol*s)'), n=0, Ea=(4.096,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-5R-R_7R!H->C_N-7C-inRing_Ext-5R-R""")
kinetics: Arrhenius(A=(3.18266e+20,'cm^3/(mol*s)'), n=-2.694, Ea=(0.053,'kcal/mol'), T0=(1,'K'), comment="""Estimated from node Root_Ext-5R-R_7R!H->C_N-7C-inRing Ea raised from 0.0 to 0.2 kJ/mol to match endothermicity of reaction.""")
kinetics: Estimated from node Root_Ext-5R-R_7R!H->C_N-7C-inRing_Ext-5R-R
kinetics: Estimated from node Root_Ext-5R-R_7R!H->C_N-7C-inRing
Ea raised from 0.0 to 0.2 kJ/mol to match endothermicity of reaction.

Observables Test Case: liquid_oxidation Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

liquid_oxidation Passed Observable Testing ✅

Regression test nitrogen:

Reference: Execution time (DD:HH:MM:SS): 00:00:01:27
Current: Execution time (DD:HH:MM:SS): 00:00:01:24
Reference: Memory used: 2896.75 MB
Current: Memory used: 2892.94 MB

nitrogen Passed Core Comparison ✅

Original model has 41 species.
Test model has 41 species. ✅
Original model has 360 reactions.
Test model has 360 reactions. ✅

nitrogen Passed Edge Comparison ✅

Original model has 133 species.
Test model has 133 species. ✅
Original model has 983 reactions.
Test model has 983 reactions. ✅

Observables Test Case: NC Comparison

✅ All Observables varied by less than 0.200 on average between old model and new model in all conditions!

nitrogen Passed Observable Testing ✅

Regression test oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:02:24
Current: Execution time (DD:HH:MM:SS): 00:00:02:24
Reference: Memory used: 2763.77 MB
Current: Memory used: 2752.16 MB

oxidation Passed Core Comparison ✅

Original model has 59 species.
Test model has 59 species. ✅
Original model has 694 reactions.
Test model has 694 reactions. ✅

oxidation Passed Edge Comparison ✅

Original model has 230 species.
Test model has 230 species. ✅
Original model has 1526 reactions.
Test model has 1526 reactions. ✅

Observables Test Case: Oxidation Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

oxidation Passed Observable Testing ✅

Regression test sulfur:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:55
Current: Execution time (DD:HH:MM:SS): 00:00:00:54
Reference: Memory used: 2875.60 MB
Current: Memory used: 2859.59 MB

sulfur Passed Core Comparison ✅

Original model has 27 species.
Test model has 27 species. ✅
Original model has 74 reactions.
Test model has 74 reactions. ✅

sulfur Failed Edge Comparison ❌

Original model has 89 species.
Test model has 89 species. ✅
Original model has 227 reactions.
Test model has 227 reactions. ✅
The original model has 1 reactions that the tested model does not have. ❌
rxn: O(4) + SO2(15) (+N2) <=> SO3(16) (+N2) origin: primarySulfurLibrary
The tested model has 1 reactions that the original model does not have. ❌
rxn: O(4) + SO2(15) (+N2) <=> SO3(16) (+N2) origin: primarySulfurLibrary

Observables Test Case: SO2 Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

sulfur Passed Observable Testing ✅

Regression test superminimal:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:36
Current: Execution time (DD:HH:MM:SS): 00:00:00:35
Reference: Memory used: 2979.68 MB
Current: Memory used: 2966.29 MB

superminimal Passed Core Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 21 reactions.
Test model has 21 reactions. ✅

superminimal Passed Edge Comparison ✅

Original model has 18 species.
Test model has 18 species. ✅
Original model has 28 reactions.
Test model has 28 reactions. ✅

Regression test RMS_constantVIdealGasReactor_superminimal:

Reference: Execution time (DD:HH:MM:SS): 00:00:02:26
Current: Execution time (DD:HH:MM:SS): 00:00:02:23
Reference: Memory used: 3443.02 MB
Current: Memory used: 3419.01 MB

RMS_constantVIdealGasReactor_superminimal Passed Core Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 19 reactions.
Test model has 19 reactions. ✅

RMS_constantVIdealGasReactor_superminimal Passed Edge Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 19 reactions.
Test model has 19 reactions. ✅

Observables Test Case: RMS_constantVIdealGasReactor_superminimal Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_constantVIdealGasReactor_superminimal Passed Observable Testing ✅

Regression test RMS_CSTR_liquid_oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:06:02
Current: Execution time (DD:HH:MM:SS): 00:00:05:56
Reference: Memory used: 3367.51 MB
Current: Memory used: 3364.84 MB

RMS_CSTR_liquid_oxidation Failed Core Comparison ❌

Original model has 37 species.
Test model has 37 species. ✅
Original model has 232 reactions.
Test model has 233 reactions. ❌
The tested model has 1 reactions that the original model does not have. ❌
rxn: CCO[O](35) <=> [OH](22) + CC=O(61) origin: intra_H_migration

RMS_CSTR_liquid_oxidation Failed Edge Comparison ❌

Original model has 206 species.
Test model has 206 species. ✅
Original model has 1508 reactions.
Test model has 1508 reactions. ✅
The original model has 2 reactions that the tested model does not have. ❌
rxn: CCCO[O](36) <=> [OH](22) + CCC=O(50) origin: intra_H_migration
rxn: CCO[O](35) <=> C[CH]OO(63) origin: intra_H_migration
The tested model has 2 reactions that the original model does not have. ❌
rxn: CCO[O](35) <=> [OH](22) + CC=O(61) origin: intra_H_migration
rxn: CCCO[O](34) <=> CC[CH]OO(45) origin: intra_H_migration

Observables Test Case: RMS_CSTR_liquid_oxidation Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_CSTR_liquid_oxidation Passed Observable Testing ✅

Regression test fragment:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:41
Current: Execution time (DD:HH:MM:SS): 00:00:00:41
Reference: Memory used: 2692.40 MB
Current: Memory used: 2683.85 MB

fragment Passed Core Comparison ✅

Original model has 10 species.
Test model has 10 species. ✅
Original model has 2 reactions.
Test model has 2 reactions. ✅

fragment Passed Edge Comparison ✅

Original model has 33 species.
Test model has 33 species. ✅
Original model has 47 reactions.
Test model has 47 reactions. ✅

Observables Test Case: fragment Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

fragment Passed Observable Testing ✅

Regression test RMS_constantVIdealGasReactor_fragment:

Reference: Execution time (DD:HH:MM:SS): 00:00:03:08
Current: Execution time (DD:HH:MM:SS): 00:00:03:04
Reference: Memory used: 3572.13 MB
Current: Memory used: 3594.63 MB

RMS_constantVIdealGasReactor_fragment Passed Core Comparison ✅

Original model has 10 species.
Test model has 10 species. ✅
Original model has 2 reactions.
Test model has 2 reactions. ✅

RMS_constantVIdealGasReactor_fragment Passed Edge Comparison ✅

Original model has 27 species.
Test model has 27 species. ✅
Original model has 24 reactions.
Test model has 24 reactions. ✅

Observables Test Case: RMS_constantVIdealGasReactor_fragment Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_constantVIdealGasReactor_fragment Passed Observable Testing ✅

Regression test minimal_surface:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:45
Current: Execution time (DD:HH:MM:SS): 00:00:00:44
Reference: Memory used: 2867.97 MB
Current: Memory used: 2864.59 MB

minimal_surface Passed Core Comparison ✅

Original model has 11 species.
Test model has 11 species. ✅
Original model has 3 reactions.
Test model has 3 reactions. ✅

minimal_surface Passed Edge Comparison ✅

Original model has 38 species.
Test model has 38 species. ✅
Original model has 38 reactions.
Test model has 38 reactions. ✅

Observables Test Case: minimal_surface Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

minimal_surface Passed Observable Testing ✅

beep boop this comment was written by a bot 🤖

Copy link

@kirkbadger18 kirkbadger18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fix the issue #2716. I reran the input file I posted there:
input.zip

On the main branch I saw species such as these show up:
image
image
image
image

When running with these changes I do not see these species show up anymore.

@rwest
Copy link
Member

rwest commented Sep 24, 2024

Is this preferable to what Matt noted in #2716 (comment) ? namely that

Surface_Monodentate_to_Bidentate template allows the participating atoms to have any charge, which makes this a reaction. If you require the participating atoms to be uncharged in the template the charge separated resonance structure will not react with that template.

Or indeed should we do both?

@bjkreitz
Copy link
Contributor Author

Matts's solution wouldn't prevent RMG from finding the charged species in the first place, but only that it reacts further. I think that we want both solutions. This PR addresses the general problem of why it found the charged species. RMG uses the resonance templates that were designed for gas-phase species and applies them to adsorbates. With our current understanding of nitrogen chemistry, I don't think that we should apply the gas-phase resonance templates, as this creates a whole range of problems we need to fix. It also saves computational time (not sure how much) by preventing the unintended execution of the resonance generation code for adsorbates.

@kirkbadger18
Copy link

I am creating a set of reaction recipes for the nitrogen chemistry project that handle charge separation. They either create charge separation or remove it where necessary. An example would be *NO2 dissociation to *N and *NO. My thought is that we should keep the charge separation to be limited to being across just one bond and not on opposite sides of an adsorbate. For systems where it is expected that no charge separated species are created, Matts solution works just fine, but there are issues when using my new recipes with resonance. Turning off resonance seems to fix these issues.

I think in some cases we may want charge for the surface families to be "cx" like in the case of the association reaction:
*NO2 + *C --> *CNO2

If we set charge to 0 for the R group in the surface dissociation reaction family, this reaction would not be found. I would bet in many cases the recipes would just not work for charged R groups because the recipes do not specify the movement of lone pairs, so in many cases setting the charge to 0 would be redundant, but in some cases we may want to have charge be "cx"

@mjohnson541
Copy link
Contributor

I might be misunderstanding the broader issue, but I don't think the issues discussed here don't exist in gas phase theoretically. I think these were solved in gas phase by modifying existing templates, adding ORs, and creating new families. Which would probably be more ideal.

It should also be possible to tweak the reasonance functions to make them not applicable to certain structures involving surface sites as needed. Although, I don't think that is as trivial as modifying the families. Far away and resonance-wise isolated from the site I think we would expect adsorbates to have the same resonance behavior as gas-phase species so it seems like ignoring them rather than tweaking them might not be ideal.

@bjkreitz
Copy link
Contributor Author

This pull request adjusts the resonance code so that it is not applied to surface species, and it is actually rather trivial. Certainly, this is much easier than modifying all the families. I don't see the point in generating all possible resonance structures for adsorbates that contain charge separation based on the gas-phase template if we don't apply the reaction templates to convert them.

We should also modify the reaction templates so as not to do anything unintended for charged species. However, fixing the resonance code already takes a huge step towards preventing unintended species with charge separation.

I also agree that the resonance behavior for large adsorbates is probably similar to that of gas-phase species. However, there is currently no proof that this is actually the case. We can use RMG reliably only for small adsorbates at the moment (around 3 heavy atoms). For these structures, I don't think that the resonance behavior is similar to that of gas-phase species, and I would prevent it. We might have to revisit this idea when we develop mechanisms for very large N-containing molecules, though.
Also, suppose the part of the molecule that exhibits resonance is far away from the surface. In that case, it does not participate in any reactions because bond breaking is typically limited to atoms close to the surface. Therefore, I think that adjusting the resonance code, as suggested in this PR, does not have any negative impacts on the catalysis projects.

@mjohnson541
Copy link
Contributor

I don't have a grasp of the exact issues you're running into so really all I'm trying to say is that this looks a lot like splitting a system/ or turning off a system we're going to eventually want to merge back together/turn on. Historically, we do this all the time because sometimes adding a new feature/system is too much work to integrate all at once. However, we almost consistently end up paying for it after people have left and/or have less incentives to do the work. Sometimes we look back and it was unavoidable, other times we feel differently.

If you've determined this is the most sensible way to get adsorbate resonance working this is fine with me, but I would be surprised if we don't eventually want to merge the resonance systems together, but how far away we are from that I don't know.

@alongd
Copy link
Member

alongd commented Sep 27, 2024

Could you please explain the original issue in #2716?
If the adsorbed reactant has a valid resonance structure with a double bond between C and N (and formal charge separation), then why does it violate the reaction template?

@@ -130,6 +130,7 @@ def analyze_molecule(mol, save_order=False):
'is_aryl_radical': False,
'hasNitrogenVal5': False,
'hasLonePairs': False,
'is_adsorbate':mol.contains_surface_site(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: please add a space after :

@kirkbadger18
Copy link

kirkbadger18 commented Oct 1, 2024

I am trying to generate a set of reaction families to handle reactions where charge separation is created or removed. For the Reaction:

image

I made a generic template to handle this:

image

With the Recipe:

recipe(actions=[
['BREAK_BOND', '*1', 1, '*2'],
['FORM_BOND', '*2', 1, '*4'],
['CHANGE_BOND', '*2', 1, '*4'],
['LOSE_PAIR','*2','1'],
['GAIN_PAIR', '*1', '1'],
])

And the top level node:

entry(
index = 1,
label = "Combined",
group =
"""
1 *1 N u0 p0 cx {2,S} {3,[S,D]} {4,[S,D]}
2 *2 R!H u0 px cx {1,S}
3 *3 Xo u0 p0 c0 {1,[S,D]}
4 R!H u0 px c0 {1,[S,D]}
""",
kinetics = None,
)

entry(
index = 2,
label="VacantSite",
group =
"""
1 *4 Xv u0 p0 c0
""",
kinetics = None,
)

But now RMG will find a species like:

image

Then apply resonance to get:

image

It will then say that this structure fits the description of my family, try to apply the recipe, and then get an error because my recipe only works currently when the charge separation is on adjacent atoms.

I have tried setting the charge in my template to c+1 and c-1 instead of cx respectively, but then the recipe is only found in the forward direction.

@alongd
Copy link
Member

alongd commented Oct 5, 2024

HI, sorry for being slow on this:
If the top level node only permits charge sep. on adjacent atoms, how come RMG applied the recipe to the structure in your last image? Maybe the issue we need to solve is wrong identification by RMG rather than forbidding resonance pathways?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creation of surface species with charge separation more than one atom apart.
5 participants