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

Undeterminable Kinetics Error of Surface_Abstraction_vdW family #2122

Closed
Tingchenlee opened this issue May 7, 2021 · 9 comments
Closed

Undeterminable Kinetics Error of Surface_Abstraction_vdW family #2122

Tingchenlee opened this issue May 7, 2021 · 9 comments
Labels
abandoned abandoned issue/PR as determined by actions bot stale stale issue/PR as determined by actions bot Topic: Catalysis

Comments

@Tingchenlee
Copy link
Contributor

Tingchenlee commented May 7, 2021

Bug Description

The reactions crashed when the bidentate species tried to match the reverse template of Surface_Abstraction_vdW family. There were three problem reactions so far:
image

How To Reproduce

Maybe an easier way to reproduce these is using the kinetic search of the RMG website, here are the error messages

  • Reaction 1.
rmgpy.exceptions.UndeterminableKineticsError: 
(TemplateReaction(reactants=[Molecule(smiles="NO[O].[Pt]"), Molecule(smiles="[N-]([NH+]=[Pt])[Pt]")], 
products=[Molecule(smiles="[N-]([NH+](O[O])[Pt])[Pt]"), Molecule(smiles="N[Pt]")], 
pairs=[], family='Surface_Abstraction_vdW'), 'Kinetics could not be determined. 
Unable to find matching template for reaction 
<Molecule "NO[O].[Pt]"> + <Molecule "[N-]([NH+]=[Pt])[Pt]"> <=> <Molecule "[N-]([NH+](O[O])[Pt])[Pt]"> + <Molecule "N[Pt]"> 
in reaction family <KineticsGroups "Surface_Abstraction_vdW/groups">.
Trying to match [<Entry index=1 label="AdsorbateVdW">, <Entry index=2 label="Adsorbate1">] but matched [<Entry index=9 label="*N">]')
  • Reaction 2.
rmgpy.exceptions.UndeterminableKineticsError: 
(TemplateReaction(reactants=[Molecule(smiles="NN([Pt])[O].[Pt]"),
Molecule(smiles="O=[Pt]")], products=[Molecule(smiles="[Pt]ON([Pt])[O]"), Molecule(smiles="N[Pt]")], 
pairs=[], family='Surface_Abstraction_vdW'), 'Kinetics could not be determined.
Unable to find matching template for reaction
<Molecule "NN([Pt])[O].[Pt]"> + <Molecule "O=[Pt]"> <=> <Molecule "[Pt]ON([Pt])[O]"> + <Molecule "N[Pt]"> 
in reaction family <KineticsGroups "Surface_Abstraction_vdW/groups">.
Trying to match [<Entry index=1 label="AdsorbateVdW">, <Entry index=2 label="Adsorbate1">] but matched [<Entry index=5 label="*=O">]')
  • Reaction 3.
rmgpy.exceptions.UndeterminableKineticsError: 
(TemplateReaction(reactants=[Molecule(smiles="[Pt]ON(N([Pt])[O])[O].[Pt]"), Molecule(smiles="O=[Pt]")], 
products=[Molecule(smiles="[Pt]ON([Pt])[O]"), Molecule(smiles="[Pt]ON([Pt])[O]")], 
pairs=[], family='Surface_Abstraction_vdW'), 'Kinetics could not be determined. 
Unable to find matching template for reaction 
<Molecule "[Pt]ON(N([Pt])[O])[O].[Pt]"> + <Molecule "O=[Pt]"> <=> <Molecule "[Pt]ON([Pt])[O]"> + <Molecule "[Pt]ON([Pt])[O]"> 
in reaction family <KineticsGroups "Surface_Abstraction_vdW/groups">.
Trying to match [<Entry index=1 label="AdsorbateVdW">, <Entry index=2 label="Adsorbate1">] but matched [<Entry index=5 label="*=O">]') 

Expected Behavior

  • Maybe we should forbid the radical and charged species here? (For reaction 1.)
  • Maybe we don't want to have bidentate species react with this family? (For reactions 2. and 3.)
  • Better ways to prevent the crash?
@Tingchenlee
Copy link
Contributor Author

Previous discussion in RMG-website issue ReactionMechanismGenerator/RMG-website#219

@ChrisBNEU
Copy link
Contributor

more generally I think it is also related to #2106.

@davidfarinajr
Copy link
Contributor

I think PR #2131 should fix this

@davidfarinajr
Copy link
Contributor

I think that PR should fix the UndeterminableKineticsError, but it will not fix the multi-dentate issue where multi-dentate things react with reaction families designed for mono-dentate adsorbates.

@Tingchenlee
Copy link
Contributor Author

Similar error in Surface_Abstraction_Single_vdW family


Error: There is likely a bug in the RMG-database kinetics reaction family involving a missing group, missing atomlabels, forbidden groups, etc.
Reactant
[Pt]ON([Pt])[O]
multiplicity 2
1 O u0 p2 c0 {3,S} {5,S}
2 O u1 p2 c0 {3,S}
3 N u0 p1 c0 {1,S} {2,S} {4,S}
4 X u0 p0 c0 {3,S}
5 X u0 p0 c0 {1,S}

Reactant
[Pt].N
1 N u0 p1 c0 {2,S} {3,S} {4,S}
2 H u0 p0 c0 {1,S}
3 H u0 p0 c0 {1,S}
4 H u0 p0 c0 {1,S}
5 X u0 p0 c0

Product
N[Pt]
1 N u0 p1 c0 {2,S} {3,S} {4,S}
2 H u0 p0 c0 {1,S}
3 H u0 p0 c0 {1,S}
4 X u0 p0 c0 {1,S}

Product
[O]NO[Pt].[Pt]
multiplicity 2
1 O u0 p2 c0 {3,S} {5,S}
2 O u1 p2 c0 {3,S}
3 N u0 p1 c0 {1,S} {2,S} {4,S}
4 H u0 p0 c0 {3,S}
5 X u0 p0 c0 {1,S}
6 X u0 p0 c0


[O]NO[Pt].[Pt]
multiplicity 2
1 O u0 p2 c0 {3,S} {5,S}
2 O u0 p3 c-1 {3,S}
3 N u1 p0 c+1 {1,S} {2,S} {4,S}
4 H u0 p0 c0 {3,S}
5 X u0 p0 c0 {1,S}
6 X u0 p0 c0

Error: Debugging why no reaction was found...
Error: Checking whether the family's forbidden species have affected reaction generation...
Error: Still experiencing error: Expecting one matching reverse reaction, not 0 in reaction family Surface_Abstraction_Single_vdW for forward reaction [Pt]ON([Pt])[O] + [Pt].N <=> N[Pt] + [O]NO[Pt].[Pt].

rmgpy.exceptions.KineticsError: Did not find reverse reaction in reaction family Surface_Abstraction_Single_vdW for reaction [Pt]ON([Pt])[O] + [Pt].N <=> N[Pt] + [O]NO[Pt].[Pt].

A quick solution is applying forbbiden block to avoid bidentates

1 *5 X   u0 p0 c0 {2,S}
2 *4 R!H ux px cx {1,S} {3,[S,D]} 
3    R   ux px cx {2,[S,D]} {4,S}
4    X   u0 p0 c0 {3,S}

Another error in Surface_Dual_Adsorption_vdW family

Error: Problem family: Surface_Dual_Adsorption_vdW
Error: Problem reactants: (Molecule(smiles="[Pt]ON([Pt])O"), Molecule(smiles="[Pt]ON([Pt])[O]"))
Error: <Molecule "[Pt]ON([Pt])O">
1 *6 O u0 p2 c0 {3,S} {6,S}
2    O u0 p2 c0 {3,S} {4,S}
3    N u0 p1 c0 {1,S} {2,S} {5,S}
4    H u0 p0 c0 {2,S}
5    X u0 p0 c0 {3,S}
6 *5 X u0 p0 c0 {1,S}

Error: <Molecule "[Pt]ON([Pt])[O]">
multiplicity 2
1 *2 O u0 p2 c0 {3,S} {5,S}
2 *4 O u1 p2 c0 {3,S}
3 *3 N u0 p1 c0 {1,S} {2,S} {4,S}
4    X u0 p0 c0 {3,S}
5 *1 X u0 p0 c0 {1,S}

rmgpy.exceptions.UndeterminableKineticsError: (TemplateReaction(reactants=[Molecule(smiles="[Pt]ON=O.[Pt]"), Molecule(smiles="[O]NO[Pt].[Pt]")], products=[Molecule(smiles="[Pt]ON([Pt])[O]"), Molecule(smiles="[Pt]ON([Pt])O")], pairs=[], family='Surface_Dual_Adsorption_vdW'), 'Kinetics could not be determined. Unable to find matching template for reaction <Molecule "[Pt]ON=O.[Pt]"> + <Molecule "[O]NO[Pt].[Pt]"> <=> <Molecule "[Pt]ON([Pt])[O]"> + <Molecule "[Pt]ON([Pt])O"> in reaction family <KineticsGroups "Surface_Dual_Adsorption_vdW/groups">.Trying to match [<Entry index=1 label="Adsorbate1">, <Entry index=2 label="Adsorbate2">] but matched [<Entry index=48 label="ONR">]')

A quick solution is applying forbbiden block to avoid bidentates

1 *5 X   u0 p0 c0 {2,S}
2 *6 R!H ux px cx {1,S} {3,[S,D]} 
3    R   ux px cx {2,[S,D]} {4,S}
4    X   u0 p0 c0 {3,S}

and

1 *5 X   u0 p0 c0 {2,S}
2 *6 R!H ux px cx {1,S} {3,[S,D]} 
3    R   ux px cx {2,[S,D]} {4,S}
4    X   u0 p0 c0 {3,S}

@davidfarinajr
Copy link
Contributor

So I think what is actually causing the UndeterminableKineticsError is that the vdw molecules have radicals, and not that they are bidentate. We recently merged a PR (#2131), that I think should fix this problem and prevent the families from generating reactions with vdW rads. Have you tried building a model since that PR was merged? If so, are these errors still occurring? The vdw bidentate problem could also be causing problems and is an issue we still need to address.

This open PR also globally forbids vdW rads
ReactionMechanismGenerator/RMG-database#481

@Tingchenlee
Copy link
Contributor Author

Tingchenlee commented May 20, 2021

The errors can be reproduced by running the following input file on the vdw_radical branch(RMG-database) and master(RMG-Py):

database(
    thermoLibraries=['surfaceThermoPt111', 'surfaceThermoNi111', 'primaryThermoLibrary', 'thermo_DFT_CCSDTF12_BAC','DFT_QCI_thermo', 'GRI-Mech3.0-N', 'NitrogenCurran', 'primaryNS', 'CHON'],
    reactionLibraries = ['Surface/CPOX_Pt/Deutschmann2006'], 
    seedMechanisms = [],
    kineticsDepositories = ['training'],
    kineticsFamilies = ['surface','default'],
    kineticsEstimator = 'rate rules',
)

catalystProperties(
    metal = 'Pt111'
)

generatedSpeciesConstraints(
    allowed=['input species','seed mechanisms','reaction libraries'],
    maximumNitrogenAtoms=2,
    maximumOxygenAtoms=3,
)

# List of species
species(
    label='X',
    reactive=True,
    structure=adjacencyList("1 X u0"),
)

species(
    label='O2',
    reactive=True,
    structure=adjacencyList(
"""
multiplicity 3
1 O u1 p2 c0 {2,S}
2 O u1 p2 c0 {1,S}
"""),
)

species(
    label='NH3',
    reactive=True,
    structure=adjacencyList(
"""
1 N u0 p1 c0 {2,S} {3,S} {4,S}
2 H u0 p0 c0 {1,S}
3 H u0 p0 c0 {1,S}
4 H u0 p0 c0 {1,S}
"""),
)

species(
    label='He',
    reactive=False,
    structure=adjacencyList(
"""
1 He u0 p1 c0
"""),
)

surfaceReactor(  
    temperature=(1000,'K'),
    initialPressure=(1.0, 'bar'),
    nSims=12,
    initialGasMoleFractions={
        "NH3": 0.12,
        "O2": 0.88,
        "He": 0.38,
    },
    initialSurfaceCoverages={
        "X": 1.0,
    },
    surfaceVolumeRatio=(2.8571428e3, 'm^-1'), 
    terminationConversion = {"NH3":0.99,},
    #terminationTime=(10, 's'),
)

simulator( 
    atol=1e-18, 
    rtol=1e-12, 
)

model( 
    toleranceKeepInEdge=0.001, 
    toleranceMoveToCore=0.01, 
    toleranceInterruptSimulation=1e8, 
    maximumEdgeSpecies=50000, 
    minCoreSizeForPrune=50, 
    #toleranceThermoKeepSpeciesInEdge=0.5, 
    minSpeciesExistIterationsForPrune=2, 
)

options(
    units='si',
    saveRestartPeriod=None,
    generateOutputHTML=False,
    generatePlots=False, 
    saveEdgeSpecies=False,
    saveSimulationProfiles=False,
)

@davidfarinajr
Copy link
Contributor

Thanks @Tingchenlee ! I was able to reproduce that error with that input file and those branches.
We have a lot going on here 🤦 . There are 3 main issues:

  1. vdw radicals - this is actually causing RMG to crash with kinetics error. We implemented a multiplicity check to catch this for products in the reverse direction. However, we are getting vdw products in the forward direction here, so we also need to check this direction as well. We added vdw_radical forbidden struct, but we need to add this to each vdw family because I don't think the global forbidden structs are checked until after reaction is generated (and we need to check before because it crashes)
  2. radicals on X - when we fix vdw radical problem, the job continues on and crashes when resonance generates a species with radicals on X. This commit fixes that ddb1766
  3. bidentate vdw - the first 2 issues cause RMG to crash, not sure if this does but it is an issue we still need to solve

I can open a PR, hopefully tomorrow, to fix 1 and 2 and perhaps 3 but I think more discussion is needed for 3.

rwest added a commit that referenced this issue Jun 5, 2021
Catalysis fixes - vdw radicals, bidentates, resonance

vdw radicals - We previously implemented a multiplicity check to ensure products in the reverse direction match the multiplicity of the template reactants . However, we are getting vdw products that do not obey multiplicity restriction in the forward direction (#2122) , so we also need to check this direction as well.

radicals on X - if resonance generation puts radicals/lone pairs/or a formal charge on X, RMG crashes. I added a commit on this PR to filter out these structures

bidentate vdw - We were getting bidentate vdw structures. This PR makes them forbidden for surface families
@github-actions
Copy link

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.

@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 23, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 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 Topic: Catalysis
Projects
None yet
Development

No branches or pull requests

3 participants