diff --git a/rmgpy/data/kinetics/familyTest.py b/rmgpy/data/kinetics/familyTest.py index abf087c1847..75c4e73a15a 100644 --- a/rmgpy/data/kinetics/familyTest.py +++ b/rmgpy/data/kinetics/familyTest.py @@ -68,7 +68,8 @@ def setUpClass(cls): 'Intra_R_Add_Exo_scission', 'intra_substitutionS_isomerization', 'R_Addition_COm', - 'R_Recombination' + 'R_Recombination', + 'Surface_Adsorption_vdW', ], ) cls.family = cls.database.families['intra_H_migration'] @@ -623,6 +624,51 @@ def test_r_addition_com(self): self.assertEqual(len(products), 1) self.assertTrue(expected_products[0].is_isomorphic(products[0])) + def test_surface_adsorption_vdw(self): + """ + Test that the Surface_Adsorption_vdW family doesn't adsorb radicals + """ + family = self.database.families['Surface_Adsorption_vdW'] + + # Test it with Oj as the *1 atom + reactants = [Molecule().from_adjacency_list(""" +multiplicity 2 +1 *1 O u1 p2 c0 {2,S} +2 H u0 p0 c0 {1,S} +"""), + Molecule().from_adjacency_list(""" +1 *2 X u0 p0 c0 +""")] + products = family.apply_recipe(reactants) + #self.assertTrue(family.is_molecule_forbidden(products[0]), "Radical product should be forbidden") + t1 = family.is_molecule_forbidden(products[0]) # Should be True (but currently broken) + + # Now test it the other way around + reactants = [Molecule().from_adjacency_list(""" +multiplicity 2 +1 O u1 p2 c0 {2,S} +2 *1 H u0 p0 c0 {1,S} +"""), + Molecule().from_adjacency_list(""" +1 *2 X u0 p0 c0 +""")] + products = family.apply_recipe(reactants) + #self.assertTrue(family.is_molecule_forbidden(products[0]), "Radical product should be forbidden") + t2 = family.is_molecule_forbidden(products[0]) # Should be True (but currently broken) + + # Now test it with no labeling + reactants = [Molecule().from_adjacency_list(""" +multiplicity 2 +1 O u1 p2 c0 {2,S} +2 H u0 p0 c0 {1,S} +"""), + Molecule().from_adjacency_list(""" +1 X u0 p0 c0 +""")] + reactions = family.generate_reactions(reactants) + self.assertEqual(len(reactions), 0, "Should have made 0 reactions.") + + def test_save_family(self): """ diff --git a/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/groups.py b/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/groups.py new file mode 100644 index 00000000000..e7661b10a61 --- /dev/null +++ b/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/groups.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# encoding: utf-8 + +name = "Surface_Adsorption_vdW/groups" +shortDesc = u"" +longDesc = u""" +Physisorption of a gas-phase species onto the surface. + + *1 *1 + ----> : +~*2~ ~*2~~ + +The rate, which should be in mol/m2/s, +will be given by k * (mol/m2) * (mol/m3) +so k should be in (m3/mol/s). We will use sticking coefficients. +""" + +template(reactants=["Adsorbate", "VacantSite"], products=["Adsorbed"], ownReverse=False) + +reverse = "Surface_Desorption_vdW" + +reactantNum=2 +productNum=1 + +recipe(actions=[ + ['FORM_BOND', '*1', 0, '*2'] +]) + +entry( + index = 1, + label = "Adsorbate", + group = +""" +multiplicity [1,3] +1 *1 R u0 px c0 +""", + kinetics = None, +) + +entry( + index = 2, + label="VacantSite", + group = +""" +1 *2 Xv u0 p0 c0 +""", + kinetics = None, +) + + + +tree( +""" +L1: Adsorbate + +L1: VacantSite +""" +) + +forbidden( + label = "radical1", + group = +""" +1 R u[1,2,3] +""", + shortDesc = u"""Radicals not allowed""", + longDesc = +u""" +""", +) + + +forbidden( + label = "charge1", + group = +""" +1 R ux c+1 +""", + shortDesc = u"""Charges not allowed""", + longDesc = +u""" +""", +) + +forbidden( + label = "charge2", + group = +""" +1 R ux c-1 +""", + shortDesc = u"""Charges not allowed""", + longDesc = +u""" +""", +) diff --git a/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/rules.py b/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/rules.py new file mode 100644 index 00000000000..178324e2c82 --- /dev/null +++ b/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/rules.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# encoding: utf-8 + +name = "Surface_Adsorption_vdW/rules" +shortDesc = u"" +longDesc = u""" +Surface adsorption of a closed-shell gas-phase species forming a van der Waals bond to the surface site +""" +entry( + index = 1, + label = "Adsorbate;VacantSite", + kinetics = StickingCoefficientBEP( + A = 0.1, + n = 0, + alpha = 0, + E0 = (0, 'kcal/mol'), + Tmin = (200, 'K'), + Tmax = (3000, 'K'), + ), + rank = 0, + shortDesc = u"""Default""", + longDesc = u"""Made up""" +) + + + diff --git a/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/training/dictionary.txt b/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/training/dictionary.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/training/reactions.py b/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/training/reactions.py new file mode 100644 index 00000000000..9ba6e6e84d0 --- /dev/null +++ b/rmgpy/test_data/testing_database/kinetics/families/Surface_Adsorption_vdW/training/reactions.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# encoding: utf-8 + +name = "Surface_Adsorption_vdW/training" +shortDesc = u"Reaction kinetics used to generate rate rules" +longDesc = u""" +Put kinetic parameters for specific reactions in this file to use as a +training set for generating rate rules to populate this kinetics family. +"""