Skip to content

Commit d676724

Browse files
committed
Fix unit tests for Arkane reading of P and T limits.
Because the T limits were being read incorrectly, a test of the rate coefficient that was supposedly at Tmax (but was in fact at 700K) was failing once the T limit reading was fixed. Also the pressure limit reading test was using .value instead of .value_si so that broke also.
1 parent e279681 commit d676724

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

test/arkane/commonTest.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ def setup_class(cls):
110110
arkane = Arkane()
111111
job_list = arkane.load_input_file(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "arkane", "data", "methoxy.py"))
112112
pdepjob = job_list[-1]
113+
cls.pdepjob = pdepjob
113114
cls.kineticsjob = job_list[0]
114115
pdepjob.active_j_rotor = True
115116
network = pdepjob.network
117+
cls.network = network
116118
cls.Nisom = len(network.isomers)
117119
cls.Nreac = len(network.reactants)
118120
cls.Nprod = len(network.products)
@@ -169,23 +171,25 @@ def test_temperatures_units(self):
169171
"""
170172
assert str(self.TmaxUnits) == "K"
171173

172-
def test_temperatures_value(self):
174+
def test_temperatures_limits(self):
173175
"""
174-
Test the temperature value.
176+
Test the temperature limits.
175177
"""
176-
assert self.TminValue == 450.0
178+
assert self.pdepjob.Tmin.value_si == 450.0
179+
assert self.pdepjob.Tmax.value_si == 1200.0
177180

178181
def test_temperatures_list(self):
179182
"""
180183
Test the temperature list.
181184
"""
182185
assert np.array_equal(self.TlistValue, np.array([450, 500, 678, 700]))
183186

184-
def test_min_pressure_value(self):
187+
def test_pressure_limits(self):
185188
"""
186-
Test the minimum pressure value.
189+
Test the pressure limits.
187190
"""
188-
assert "%0.7f" % self.PminValue == str(0.0101325)
191+
assert self.pdepjob.Pmin.value_si == 1013.25 # Pa
192+
assert self.pdepjob.Pmax.value_si == 101325000.0 # Pa
189193

190194
def test_pressure_count(self):
191195
"""
@@ -234,8 +238,8 @@ def test_calculate_tst_rate_coefficient(self):
234238
"""
235239
Test the calculation of the high-pressure limit rate coef for one of the kinetics jobs at Tmin and Tmax.
236240
"""
237-
assert "%0.7f" % self.kineticsjob.reaction.calculate_tst_rate_coefficient(self.TminValue) == str(46608.5904933)
238-
assert "%0.5f" % self.kineticsjob.reaction.calculate_tst_rate_coefficient(self.Tmaxvalue) == str(498796.64535)
241+
assert "%0.7f" % self.kineticsjob.reaction.calculate_tst_rate_coefficient(450.0) == str(46608.5904933)
242+
assert "%0.5f" % self.kineticsjob.reaction.calculate_tst_rate_coefficient(700.0) == str(498796.64535)
239243

240244
def test_tunneling(self):
241245
"""

0 commit comments

Comments
 (0)