ReactionMechanismGenerator / RMG-Py

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

All resonance structures necessary to forbid group in reaction family #795

Closed nyee closed 1 year ago

nyee commented 7 years ago

In order to forbid a group in reaction families, you have to forbid all resonance structures. Test case we used to discover was for c1cc(C)ccc1[O] <=> c1cc[CH2]ccc1O in intra-H-migration family. I've added more inputs at bottom of post for testing.

This issue makes it very inconvenient to ban certain reactions. On the flip side, there may be a situation where only one resonance structure appears to be something we would want to forbid, but another may look more reasonable. I don't know what the correct solution is, but we should probably address this somehow...

generateReactions input:

database(
    thermoLibraries = ['KlippensteinH2O2','primaryThermoLibrary','DFT_QCI_thermo','CBS_QB3_1dHR'],
    reactionLibraries = [],  
    seedMechanisms = [],
    kineticsDepositories = 'default', 
    #this section lists possible reaction families to find reactioons with
    kineticsFamilies = ['intra_H_migration'],
    kineticsEstimator = 'rate rules',
)

# List all species you want reactions between
species(
    label='paracresol1',
    reactive=True,
    structure=SMILES("c1cc(C)ccc1[O]"),
)

# you must list reactor conditions (though this may not effect the output)
simpleReactor(
    temperature=(650,'K'),
    pressure=(10.0,'bar'),
    initialMoleFractions={
        "paracresol1": 1,
    },
    terminationConversion={
        'paracresol1': .99,
    },
    terminationTime=(40,'s'),
)

Necessary forbidden groups:

forbidden(
    label = "benzene_para_1",
    group = 
"""
1     C u0 {2,D} {7,S}
2     C u0 {1,D} {3,S} 
3  *5 C u0 {2,S} {4,S} {5,D}
4  *2 C u0 {3,S} {9,S}
5  *7 C u0 {3,D} {6,S} 
6  *6 C u0 {5,S} {7,D}
7  *4 C u0 {1,S} {6,D} {8,S}
8  *1 R!H u1 {7,S}
9  *3 H u0  {4,S}
""",
    shortDesc = u"""""",
    longDesc = 
u"""
Should not occur because TS would be too strained
""",
)

forbidden(
    label = "benzene_para_2",
    group = 
"""
1     C u0 {2,S} {7,D}
2     C u0 {1,S} {3,D} 
3  *5 C u0 {2,D} {4,S} {5,S}
4  *2 C u0 {3,S} {9,S}
5  *7 C u0 {3,S} {6,D} 
6  *6 C u0 {5,D} {7,S}
7  *4 C u0 {1,D} {6,S} {8,S}
8  *1 R!H u1 {7,S}
9  *3 H u0  {4,S}
""",
    shortDesc = u"""""",
    longDesc = 
u"""
Should not occur because TS would be too strained
""",
)

forbidden(
    label = "benzene_para_aromaticc",
    group = 
"""
1     C u0 {2,B} {7,B}
2     C u0 {1,B} {3,B} 
3  *5 C u0 {2,B} {4,S} {5,B}
4  *2 C u0 {3,S} {9,S}
5  *7 C u0 {3,B} {6,B} 
6  *6 C u0 {5,B} {7,B}
7  *4 C u0 {1,B} {6,B} {8,S}
8  *1 R!H u1 {7,S}
9  *3 H u0  {4,S}
""",
    shortDesc = u"""""",
    longDesc = 
u"""
Should not occur because TS would be too strained
""",
)
nyee commented 7 years ago

Suggested solution from RMG Group meeting: Repeat (or move?) forbidden structure check after we collapse reactions into species.

rwest commented 7 years ago

I haven't thought through all the details and I may be wrong, but I feel that inside a family it's better to forbid molecules (as currently) than species. If needed, add both resonance structures to the forbidden structures. This is because what we're trying to restrict is the template being applied to widely, rather than forbidding a species which shouldn't ever exist (which appears in the generic forbidden structures, not the family-specific one)

nyee commented 7 years ago

@rwest A forbidden structure in a family will not widely ban a species because you add atom labels (1, 2) to the structure. It should only ban reactions that match both the species and the reacting sites. Not 100% sure it works this way, but I think that is the intention.

In terms of solution, I know @mliu49 is making changes to how resonance structures work with matching templates, so it is probably worth waiting to see what the final result of that will be.

alongd commented 6 years ago

I think we should address this issue now, especially with the new resonance structures underway. @mliu49 ,would you agree with the historic suggestion (above) that Repeat (or move?) forbidden structure check after we collapse reactions into species?

mliu49 commented 6 years ago

I'm sad that something from a year and a half ago is now historic...

Anyway, I agree that we should address this issue. Here are some initial considerations:

alongd commented 6 years ago

Noted. If I understand correctly, this shouldn't require resonance re-generation, just checking all molecules of all species for each new reaction created (or entering the core?).

alongd commented 6 years ago

Now that we're forbidding species in forbiddenStructures.py, we no longer need to manually give all resonance structures to forbid a species. I think the original issue is solved. @mliu49, would you agree?

github-actions[bot] commented 1 year ago

This issue 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 issue, otherwise it will automatically be closed in 30 days.