Skip to content

Commit

Permalink
Add tests to load species from NASA polynomials
Browse files Browse the repository at this point in the history
This commit adds two test methods to load species from nasa
polynomials, ensuring the proper attributes are saved.
  • Loading branch information
goldmanm committed Jun 17, 2019
1 parent b910c51 commit ae69477
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions arkane/inputTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
from rmgpy.statmech.rotation import NonlinearRotor
from rmgpy.kinetics.tunneling import Eckart
from rmgpy.exceptions import InputError
from rmgpy.thermo.nasa import NASAPolynomial, NASA
from rmgpy.molecule import Molecule

from arkane.input import species, transitionState, reaction, SMILES, loadInputFile, process_model_chemistry

Expand Down Expand Up @@ -81,6 +83,37 @@ def test_species(self):
self.assertIsInstance(spc0.transportData, TransportData)
self.assertIsInstance(spc0.energyTransferModel, SingleExponentialDown)

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.hasStatMech())
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.hasStatMech())
self.assertEqual(spc0.thermo, kwargs['thermo'])

def test_transitionState(self):
"""
Test loading a transition state from input file-like kew word arguments
Expand Down

0 comments on commit ae69477

Please sign in to comment.