Skip to content

Commit dac8885

Browse files
committed
Merge branch 'pr/287' to get Enoch's CanTherm fixes, examples, and tests.
This closes #287. 1) It now alerts the user if they are not using the lowest energy conformer (based on the hindered rotor scans). 2) There is an example for methoxy decomposition. 3) There are some unit tests.
2 parents 78b9536 + 2faa586 commit dac8885

8 files changed

Lines changed: 711 additions & 3 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
to run, execute 'run-cantherm'
2+
(if not executable and if you are using linux, use the command: chmod +x run-cantherm)
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
2+
title = 'methoxy decomposition to H + CH2O'
3+
4+
description = \
5+
"""
6+
This example illustrates how to manually set up a CanTherm input file for a small P-dep reaction system [using only the
7+
RRHO assumption, and without tunneling, although this can be easily implemented]. Such a calculation is desireable if the user
8+
wishes to supply experimentally determined freqeuncies, for example. Althgou some coommented notes below may be useful,
9+
see http://greengroup.github.io/RMG-Py/users/cantherm/index.html for more documented information about CanTherm and
10+
creating input files. (information pertaining this file is adopted by Dames and Golden, 2013, JPCA 117 (33) 7686-96.)
11+
"""
12+
transitionState(
13+
label = 'TS3',
14+
E0 = (34.1,'kcal/mol'), # this INCLUDES the ZPE. Note that other energy units are also possible (e.g., kJ/mol)
15+
spinMultiplicity = 2,
16+
opticalIsomers = 1,
17+
frequency = (-967,'cm^-1'),
18+
modes = [ # these modes are used to compute the partition functions
19+
HarmonicOscillator(frequencies=([466,581,1169,1242,1499,1659,2933,3000],'cm^-1')),
20+
NonlinearRotor(rotationalConstant=([0.970, 1.029, 3.717],"cm^-1"),symmetry=1, quantum=False),
21+
IdealGasTranslation(mass=(31.01843,"g/mol")) #this must be included for every species/ts
22+
],
23+
24+
)
25+
26+
transitionState(
27+
label = 'TS2',
28+
E0 = (38.9,'kcal/mol'),
29+
spinMultiplicity = 2,
30+
opticalIsomers = 1,
31+
frequency = (-1934,'cm^-1'),
32+
modes = [
33+
HarmonicOscillator(frequencies=([792, 987 ,1136, 1142, 1482 ,2441 ,3096, 3183],'cm^-1')),
34+
NonlinearRotor(rotationalConstant=([0.928,0.962,5.807],"cm^-1"),symmetry=1, quantum=False),
35+
IdealGasTranslation(mass=(31.01843,"g/mol"))
36+
],
37+
38+
)
39+
transitionState(
40+
label = 'TS1',
41+
E0 = (39.95,'kcal/mol'),
42+
spinMultiplicity = 2,
43+
opticalIsomers = 1,
44+
frequency = (-1756,'cm^-1'),
45+
modes = [
46+
HarmonicOscillator(frequencies=([186 ,626 ,1068, 1234, 1474, 1617, 2994 ,3087],'cm^-1')),
47+
NonlinearRotor(rotationalConstant=([0.966,0.986,5.253],"cm^-1"),symmetry=1, quantum=False),
48+
IdealGasTranslation(mass=(31.01843,"g/mol"))
49+
],
50+
51+
)
52+
53+
species(
54+
label = 'methoxy',
55+
structure = SMILES('C[O]'),
56+
E0 = (9.44,'kcal/mol'),
57+
modes = [
58+
HarmonicOscillator(frequencies=([758,960,1106 ,1393,1403,1518,2940,3019,3065],'cm^-1')),
59+
NonlinearRotor(rotationalConstant=([0.916, 0.921, 5.251],"cm^-1"),symmetry=3, quantum=False),
60+
IdealGasTranslation(mass=(31.01843,"g/mol")),
61+
],
62+
spinMultiplicity = 3.88, # 3+exp(-89/T)
63+
opticalIsomers = 1,
64+
molecularWeight = (31.01843,'amu'),
65+
collisionModel = TransportData(sigma=(3.69e-10,'m'), epsilon=(4.0,'kJ/mol')),
66+
energyTransferModel = SingleExponentialDown(alpha0=(0.956,'kJ/mol'), T0=(300,'K'), n=0.95),
67+
)
68+
69+
70+
species(
71+
label = 'CH2O',
72+
E0 = (28.69,'kcal/mol'),
73+
molecularWeight = (30.0106,"g/mol"),
74+
collisionModel = TransportData(sigma=(3.69e-10,'m'), epsilon=(4.0,'kJ/mol')),
75+
energyTransferModel = SingleExponentialDown(alpha0=(0.956,'kJ/mol'), T0=(300,'K'), n=0.95),
76+
spinMultiplicity = 1,
77+
opticalIsomers = 1,
78+
modes = [
79+
HarmonicOscillator(frequencies=([1180,1261,1529,1764,2931,2999],'cm^-1')),
80+
NonlinearRotor(rotationalConstant=([1.15498821005263, 1.3156969584727, 9.45570474524524],"cm^-1"),symmetry=2, quantum=False),
81+
IdealGasTranslation(mass=(30.0106,"g/mol")),
82+
],
83+
)
84+
85+
species(
86+
label = 'H',
87+
E0 = (0.000,'kcal/mol'),
88+
molecularWeight = (1.00783,"g/mol"),
89+
collisionModel = TransportData(sigma=(3.69e-10,'m'), epsilon=(4.0,'kJ/mol')),
90+
energyTransferModel = SingleExponentialDown(alpha0=(0.956,'kJ/mol'), T0=(300,'K'), n=0.95),
91+
modes = [
92+
IdealGasTranslation(mass=(1.00783,"g/mol")),
93+
],
94+
spinMultiplicity = 2,
95+
opticalIsomers = 1,
96+
97+
)
98+
99+
species(
100+
label = 'CH2Ob', #this is a special system with two chemically equivalent product channels. Thus, different labels are used.
101+
E0 = (28.69,'kcal/mol'),
102+
molecularWeight = (30.0106,"g/mol"),
103+
collisionModel = TransportData(sigma=(3.69e-10,'m'), epsilon=(4.0,'kJ/mol')),
104+
energyTransferModel = SingleExponentialDown(alpha0=(0.956,'kJ/mol'), T0=(300,'K'), n=0.95),
105+
spinMultiplicity = 1,
106+
opticalIsomers = 1,
107+
modes = [
108+
HarmonicOscillator(frequencies=([1180,1261,1529,1764,2931,2999],'cm^-1')),
109+
NonlinearRotor(rotationalConstant=([1.15498821005263, 1.3156969584727, 9.45570474524524],"cm^-1"),symmetry=2, quantum=False),
110+
IdealGasTranslation(mass=(30.0106,"g/mol")),
111+
],
112+
)
113+
114+
species(
115+
label = 'Hb',
116+
E0 = (0.0001,'kcal/mol'),
117+
molecularWeight = (1.00783,"g/mol"),
118+
collisionModel = TransportData(sigma=(3.69e-10,'m'), epsilon=(4.0,'kJ/mol')),
119+
energyTransferModel = SingleExponentialDown(alpha0=(0.956,'kJ/mol'), T0=(300,'K'), n=0.95),
120+
modes = [
121+
IdealGasTranslation(mass=(1.00783,"g/mol")),
122+
],
123+
spinMultiplicity = 2,
124+
opticalIsomers = 1,
125+
126+
)
127+
species(
128+
label = 'CH2OH',
129+
E0 = (0.00,'kcal/mol'),
130+
molecularWeight = (31.01843,"g/mol"),
131+
modes = [
132+
HarmonicOscillator(frequencies=([418,595, 1055, 1198, 1368, 1488, 3138, 3279, 3840],'cm^-1')),
133+
# below is an example of how to include hindered rotors
134+
#HinderedRotor(inertia=(5.75522e-47,'kg*m^2'), symmetry=1, barrier=(22427.8,'J/mol'), semiclassical=False),
135+
NonlinearRotor(rotationalConstant=([0.868,0.993,6.419],"cm^-1"),symmetry=1, quantum=False),
136+
IdealGasTranslation(mass=(31.01843,"g/mol")),
137+
],
138+
spinMultiplicity = 2,
139+
opticalIsomers = 2,
140+
collisionModel = TransportData(sigma=(3.69e-10,'m'), epsilon=(4.0,'kJ/mol')),
141+
energyTransferModel = SingleExponentialDown(alpha0=(0.956,'kJ/mol'), T0=(300,'K'), n=0.95),
142+
)
143+
144+
species(
145+
label = 'He',
146+
# freqScaleFactor = 1, # TypeError: species() got an unexpected keyword argument 'freqScaleFactor'.
147+
structure = SMILES('[He]'),
148+
molecularWeight = (4.003,'amu'),
149+
collisionModel = TransportData(sigma=(2.55e-10,'m'), epsilon=(0.0831,'kJ/mol')),
150+
energyTransferModel = SingleExponentialDown(alpha0=(0.956,'kJ/mol'), T0=(300,'K'), n=0.95),
151+
)
152+
153+
reaction(
154+
label = 'CH2O+H=Methoxy',
155+
# label = 'Methoxy = CH2O+H',
156+
reactants = ['CH2O','H'],
157+
products = ['methoxy'],
158+
# reactants = ['methoxy'],
159+
# products = ['CH2O', 'H'],
160+
transitionState = 'TS3',
161+
#tunneling='Eckart',
162+
)
163+
164+
reaction(
165+
# label = 'CH2Ob+Hb=CH2OH',
166+
label = 'CH2OH = CH2Ob+Hb',
167+
# products = ['CH2OH'],
168+
reactants = ['CH2OH'],
169+
# reactants = ['CH2Ob','Hb'],
170+
products = ['CH2Ob', 'Hb'],
171+
transitionState = 'TS1',
172+
#tunneling='Eckart',
173+
)
174+
175+
reaction(
176+
label = 'CH2OH = Methoxy',
177+
# reactants = ['methoxy'],
178+
# products = ['CH2OH'],
179+
# label = 'Methoxy = CH2OH',
180+
products = ['methoxy'],
181+
reactants = ['CH2OH'],
182+
transitionState = 'TS2',
183+
#tunneling='Eckart',
184+
)
185+
186+
kinetics('CH2O+H=Methoxy')
187+
#kinetics('Methoxy = CH2O+H' )
188+
#kinetics('Methoxy = CH2OH' )
189+
kinetics('CH2OH = Methoxy')
190+
kinetics('CH2OH = CH2Ob+Hb' )
191+
#kinetics('CH2Ob+Hb=CH2OH')
192+
network(
193+
label = 'methoxy',
194+
isomers = [
195+
'methoxy',
196+
'CH2OH',
197+
],
198+
199+
reactants = [
200+
('CH2O','H'),
201+
# ('CH2Ob','Hb'),
202+
],
203+
204+
bathGas = {
205+
'He': 1,
206+
},
207+
)
208+
209+
pressureDependence(
210+
label = 'methoxy',
211+
Tmin = (450,'K'), Tmax = (1200,'K'), Tcount = 4,
212+
Tlist = ([450,500,678,700],'K'),
213+
Pmin = (0.01,'atm'), Pmax = (1000,'atm'), Pcount = 7,
214+
Plist = ([0.01,0.1,1,3,10,100,1000],'atm'),
215+
maximumGrainSize = (0.5,'kcal/mol'),
216+
minimumGrainCount = 500,
217+
method = 'modified strong collision',
218+
#Other methods include: 'reservoir state', 'chemically-significant eigenvalues',
219+
interpolationModel = ('pdeparrhenius'),
220+
activeKRotor = True,
221+
# activeJRotor = False, #causes cantherm to crash
222+
rmgmode = False,
223+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
python ../../../../cantherm.py input.py

rmgpy/cantherm/common.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
################################################################################
5+
#
6+
# RMG - Reaction Mechanism Generator
7+
#
8+
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
9+
# RMG Team (rmg_dev@mit.edu)
10+
#
11+
# Permission is hereby granted, free of charge, to any person obtaining a
12+
# copy of this software and associated documentation files (the "Software"),
13+
# to deal in the Software without restriction, including without limitation
14+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
15+
# and/or sell copies of the Software, and to permit persons to whom the
16+
# Software is furnished to do so, subject to the following conditions:
17+
#
18+
# The above copyright notice and this permission notice shall be included in
19+
# all copies or substantial portions of the Software.
20+
#
21+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27+
# DEALINGS IN THE SOFTWARE.
28+
#
29+
################################################################################
30+
31+
import numpy
32+
import os.path
33+
import logging
34+
import rmgpy.constants as constants
35+
################################################################################
36+
37+
def checkConformerEnergy(Vlist,path):
38+
"""
39+
Check to see that the starting energy of the species in the potential energy scan calculation
40+
is not 0.5 kcal/mol (or more) higher than any other energies in the scan. If so, print and
41+
log a warning message.
42+
"""
43+
Vlist = numpy.array(Vlist, numpy.float64)
44+
Vdiff = (Vlist[0] - numpy.min(Vlist))*constants.E_h*constants.Na/1000
45+
if Vdiff >= 2: #we choose 2 kJ/mol to be the critical energy
46+
logging.warning('the species corresponding to ' + str(os.path.basename(path)) + ' is different in energy from the lowest energy conformer by ' + "%0.2f" % Vdiff + ' kJ/mol. This can cause significant errors in your computed rate constants. ')
47+
48+

0 commit comments

Comments
 (0)