def test_species_atomic_nasa_polynomial(self): """ Test loading a atom with NASA polynomials """ label0 = "H(1)" kwargs = { "structure": SMILES('[H]'), "thermo": NASA(polynomials=[ NASAPolynomial(coeffs=[2.5, 0, 0, 0, 0, 25473.7, -0.446683], Tmin=(200, 'K'), Tmax=(1000, 'K')), NASAPolynomial(coeffs=[2.5, 0, 0, 0, 0, 25473.7, -0.446683], Tmin=(1000, 'K'), Tmax=(6000, 'K')) ], Tmin=(200, 'K'), Tmax=(6000, 'K'), comment="""Thermo library: FFCM1(-)"""), "energyTransferModel": SingleExponentialDown(alpha0=(3.5886, 'kJ/mol'), T0=(300, 'K'), n=0.85) } spc0 = species(label0, **kwargs) self.assertEqual(spc0.label, label0) self.assertEqual(spc0.smiles, '[H]') self.assertTrue(spc0.has_statmech()) self.assertEqual(spc0.thermo, kwargs['thermo'])
def test_species_polyatomic_nasa_polynomial(self): """ Test loading a species with NASA polynomials """ label0 = "benzyl" kwargs = { "structure": SMILES('[c]1ccccc1'), "thermo": NASA(polynomials=[ NASAPolynomial(coeffs=[ 2.78632, 0.00784632, 7.97887e-05, -1.11617e-07, 4.39429e-11, 39695, 11.5114 ], Tmin=(100, 'K'), Tmax=(943.73, 'K')), NASAPolynomial(coeffs=[ 13.2455, 0.0115667, -2.49996e-06, 4.66496e-10, -4.12376e-14, 35581.1, -49.6793 ], Tmin=(943.73, 'K'), Tmax=(5000, 'K')) ], Tmin=(100, 'K'), Tmax=(5000, 'K'), comment="""Thermo library: Fulvene_H + radical(CbJ)"""), "energyTransferModel": SingleExponentialDown(alpha0=(3.5886, 'kJ/mol'), T0=(300, 'K'), n=0.85) } spc0 = species(label0, **kwargs) self.assertEqual(spc0.label, label0) self.assertTrue(spc0.has_statmech()) self.assertEqual(spc0.thermo, kwargs['thermo'])
def test_species(self): """ Test loading a species from input file-like kew word arguments """ label0 = 'CH2O' kwargs = { 'E0': (28.69, 'kcal/mol'), 'structure': SMILES('C=O'), 'collisionModel': TransportData(sigma=(3.69e-10, 'm'), epsilon=(4.0, 'kJ/mol')), 'energyTransferModel': SingleExponentialDown(alpha0=(0.956, 'kJ/mol'), T0=(300, 'K'), n=0.95), 'spinMultiplicity': 1, 'opticalIsomers': 1, 'modes': [ HarmonicOscillator( frequencies=([1180, 1261, 1529, 1764, 2931, 2999], 'cm^-1')), NonlinearRotor(rotationalConstant=([ 1.15498821005263, 1.3156969584727, 9.45570474524524 ], "cm^-1"), symmetry=2, quantum=False), IdealGasTranslation(mass=(30.0106, "g/mol")), ] } spc0 = species(label0, **kwargs) self.assertEqual(spc0.label, 'CH2O') self.assertEqual(spc0.smiles, 'C=O') self.assertAlmostEqual(spc0.conformer.E0.value_si, 120038.96) self.assertEqual(spc0.conformer.spin_multiplicity, 1) self.assertEqual(spc0.conformer.optical_isomers, 1) self.assertEqual(len(spc0.conformer.modes), 3) self.assertIsInstance(spc0.transport_data, TransportData) self.assertIsInstance(spc0.energy_transfer_model, SingleExponentialDown)
def test_reaction(self): """ Test loading a reaction from input file-like kew word arguments """ species(label='methoxy', structure=SMILES('C[O]'), E0=(9.44, 'kcal/mol'), modes=[ HarmonicOscillator(frequencies=( [758, 960, 1106, 1393, 1403, 1518, 2940, 3019, 3065], 'cm^-1')), NonlinearRotor(rotationalConstant=([0.916, 0.921, 5.251], "cm^-1"), symmetry=3, quantum=False), IdealGasTranslation(mass=(31.01843, "g/mol")) ], spinMultiplicity=2, opticalIsomers=1, molecularWeight=(31.01843, 'amu'), collisionModel=TransportData(sigma=(3.69e-10, 'm'), epsilon=(4.0, 'kJ/mol')), energyTransferModel=SingleExponentialDown(alpha0=(0.956, 'kJ/mol'), T0=(300, 'K'), n=0.95)) species(label='formaldehyde', E0=(28.69, 'kcal/mol'), molecularWeight=(30.0106, "g/mol"), collisionModel=TransportData(sigma=(3.69e-10, 'm'), epsilon=(4.0, 'kJ/mol')), energyTransferModel=SingleExponentialDown(alpha0=(0.956, 'kJ/mol'), T0=(300, 'K'), n=0.95), spinMultiplicity=1, opticalIsomers=1, modes=[ HarmonicOscillator( frequencies=([1180, 1261, 1529, 1764, 2931, 2999], 'cm^-1')), NonlinearRotor(rotationalConstant=([ 1.15498821005263, 1.3156969584727, 9.45570474524524 ], "cm^-1"), symmetry=2, quantum=False), IdealGasTranslation(mass=(30.0106, "g/mol")) ]) species(label='H', E0=(0.000, 'kcal/mol'), molecularWeight=(1.00783, "g/mol"), collisionModel=TransportData(sigma=(3.69e-10, 'm'), epsilon=(4.0, 'kJ/mol')), energyTransferModel=SingleExponentialDown(alpha0=(0.956, 'kJ/mol'), T0=(300, 'K'), n=0.95), modes=[IdealGasTranslation(mass=(1.00783, "g/mol"))], spinMultiplicity=2, opticalIsomers=1) transitionState( label='TS3', E0=(34.1, 'kcal/mol'), spinMultiplicity=2, opticalIsomers=1, frequency=(-967, 'cm^-1'), modes=[ HarmonicOscillator(frequencies=( [466, 581, 1169, 1242, 1499, 1659, 2933, 3000], 'cm^-1')), NonlinearRotor(rotationalConstant=([0.970, 1.029, 3.717], "cm^-1"), symmetry=1, quantum=False), IdealGasTranslation(mass=(31.01843, "g/mol")) ]) reactants = ['formaldehyde', 'H'] products = ['methoxy'] tunneling = 'Eckart' rxn = reaction('CH2O+H=Methoxy', reactants, products, 'TS3', tunneling=tunneling) self.assertEqual(rxn.label, 'CH2O+H=Methoxy') self.assertEqual(len(rxn.reactants), 2) self.assertEqual(len(rxn.products), 1) self.assertAlmostEqual(rxn.reactants[0].conformer.E0.value_si, 0) self.assertAlmostEqual(rxn.reactants[1].conformer.E0.value_si, 120038.96) self.assertAlmostEqual(rxn.products[0].conformer.E0.value_si, 39496.96) self.assertAlmostEqual(rxn.transition_state.conformer.E0.value_si, 142674.4) self.assertAlmostEqual(rxn.transition_state.frequency.value_si, -967.0) self.assertIsInstance(rxn.transition_state.tunneling, Eckart)