Skip to content

Commit 4d8275e

Browse files
committed
Change the way cyclic and polycyclic corrections are handled AND don't include gauche correcitons.
Use overall ring correction instead of most destabilizing one for enthalpy. (We were using cyclopentane corrections for cyclopentene.) Now it is corrected. Don't include gauche corrections if the molecule is cyclic. (Still need to include them for parts of the molecule that aren't in the rings.. but we'll figure that out later.
1 parent 82e60c6 commit 4d8275e

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

rmgpy/data/thermo.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ def estimateThermoViaGroupAdditivity(self, molecule):
878878
return self.estimateRadicalThermoViaHBI(molecule, self.estimateThermoViaGroupAdditivity )
879879

880880
else: # non-radical species
881+
cyclic = molecule.isCyclic()
881882
# Generate estimate of thermodynamics
882883
for atom in molecule.atoms:
883884
# Iterate over heavy (non-hydrogen) atoms
@@ -891,9 +892,10 @@ def estimateThermoViaGroupAdditivity(self, molecule):
891892
logging.error(molecule.toAdjacencyList())
892893
raise
893894
# Correct for gauche and 1,5- interactions
894-
try:
895-
self.__addGroupThermoData(thermoData, self.groups['gauche'], molecule, {'*':atom})
896-
except KeyError: pass
895+
if not cyclic:
896+
try:
897+
self.__addGroupThermoData(thermoData, self.groups['gauche'], molecule, {'*':atom})
898+
except KeyError: pass
897899
try:
898900
self.__addGroupThermoData(thermoData, self.groups['int15'], molecule, {'*':atom})
899901
except KeyError: pass
@@ -904,7 +906,7 @@ def estimateThermoViaGroupAdditivity(self, molecule):
904906
# Do ring corrections separately because we only want to match
905907
# each ring one time
906908

907-
if molecule.isCyclic():
909+
if cyclic:
908910
if molecule.getAllPolycyclicVertices():
909911
# If the molecule has fused ring atoms, this implies that we are dealing
910912
# with a polycyclic ring system, for which separate ring strain corrections may not
@@ -923,21 +925,14 @@ def estimateThermoViaGroupAdditivity(self, molecule):
923925
for ring in rings:
924926
# Make a temporary structure containing only the atoms in the ring
925927
# NB. if any of the ring corrections depend on ligands not in the ring, they will not be found!
926-
ringCorrection = None
927-
for atom in ring:
928+
try:
929+
self.__addGroupThermoData(thermoData, self.groups['ring'], molecule, {})
930+
except KeyError:
931+
logging.error("Couldn't find in ring database:")
932+
logging.error(ring)
933+
logging.error(ring.toAdjacencyList())
934+
raise
928935

929-
try:
930-
correction = self.__addGroupThermoData(None, self.groups['ring'], molecule, {'*':atom})
931-
except KeyError:
932-
logging.error("Couldn't find in ring database:")
933-
logging.error(ring)
934-
logging.error(ring.toAdjacencyList())
935-
raise
936-
937-
if ringCorrection is None or ringCorrection.H298.value_si < correction.H298.value_si:
938-
ringCorrection = correction
939-
940-
self.__addThermoData(thermoData, ringCorrection)
941936

942937
# Correct entropy for symmetry number
943938
molecule.calculateSymmetryNumber()

0 commit comments

Comments
 (0)