|
43 | 43 | from rmgpy.transport import TransportData |
44 | 44 | from rmgpy.kinetics import ( |
45 | 45 | Arrhenius, |
| 46 | + Lindemann, |
46 | 47 | PDepArrhenius, |
47 | 48 | Troe, |
48 | 49 | ThirdBody, |
@@ -164,6 +165,13 @@ def test_reaction_to_dicts_arrhenius_equation_and_rate(self): |
164 | 165 | assert np.isclose(d["rate-constant"]["b"], 0.5) |
165 | 166 | assert np.isclose(d["rate-constant"]["Ea"], 10e6) # 10 kJ/mol → 1e7 J/kmol |
166 | 167 |
|
| 168 | + def test_reaction_to_dicts_negative_a_arrhenius(self): |
| 169 | + """Negative Arrhenius A factors are marked for Cantera.""" |
| 170 | + kin = Arrhenius(A=(-1e13, "s^-1"), n=0.5, Ea=(10, "kJ/mol"), T0=(1, "K")) |
| 171 | + rxn = Reaction(reactants=[self.h2], products=[self.h, self.h], kinetics=kin) |
| 172 | + entries = reaction_to_dicts(rxn, self.all_gas) |
| 173 | + assert entries[0]["negative-A"] is True |
| 174 | + |
167 | 175 | def test_reaction_to_dicts_thirdbody(self): |
168 | 176 | """ThirdBody: type is three-body, equation uses M, efficiencies map present.""" |
169 | 177 | kin = ThirdBody( |
@@ -234,6 +242,24 @@ def test_reaction_to_dicts_troe(self): |
234 | 242 | assert "efficiencies" in d |
235 | 243 | assert np.isclose(d["efficiencies"]["Ar(3)"], 2.0) |
236 | 244 |
|
| 245 | + def test_reaction_to_dicts_negative_a_falloff(self): |
| 246 | + """Falloff rates with negative high- and low-pressure A factors are marked for Cantera.""" |
| 247 | + kin = Lindemann( |
| 248 | + arrheniusHigh=Arrhenius( |
| 249 | + A=(-1e14, "s^-1"), n=0, Ea=(10, "kJ/mol"), T0=(1, "K") |
| 250 | + ), |
| 251 | + arrheniusLow=Arrhenius( |
| 252 | + A=(-1e20, "cm^3/(mol*s)"), n=0, Ea=(10, "kJ/mol"), T0=(1, "K") |
| 253 | + ), |
| 254 | + efficiencies={self.ar.molecule[0]: 2.0}, |
| 255 | + ) |
| 256 | + rxn = Reaction(reactants=[self.h], products=[self.h], kinetics=kin) |
| 257 | + entries = reaction_to_dicts(rxn, self.all_gas) |
| 258 | + d = entries[0] |
| 259 | + assert d["negative-A"] is True |
| 260 | + assert d["low-P-rate-constant"]["A"] < 0 |
| 261 | + assert np.isclose(d["efficiencies"]["Ar(3)"], 2.0) |
| 262 | + |
237 | 263 | # ------------------------------------------------------------------ |
238 | 264 | # reaction_to_dicts — surface kinetics |
239 | 265 | # ------------------------------------------------------------------ |
@@ -271,6 +297,19 @@ def test_reaction_to_dicts_sticking_coefficient(self): |
271 | 297 | assert np.isclose(d["sticking-coefficient"]["A"], 0.1) |
272 | 298 | assert np.isclose(d["sticking-coefficient"]["Ea"], 0.0) |
273 | 299 |
|
| 300 | + def test_reaction_to_dicts_negative_a_sticking_coefficient(self): |
| 301 | + """Negative sticking-coefficient A factors are marked for Cantera.""" |
| 302 | + kin = StickingCoefficient( |
| 303 | + A=(-0.1, ""), n=0, Ea=(0, "kJ/mol"), T0=(1, "K") |
| 304 | + ) |
| 305 | + rxn = Reaction( |
| 306 | + reactants=[self.h2, self.x, self.x], |
| 307 | + products=[self.hx, self.hx], |
| 308 | + kinetics=kin, |
| 309 | + ) |
| 310 | + entries = reaction_to_dicts(rxn, self.all_surface) |
| 311 | + assert entries[0]["negative-A"] is True |
| 312 | + |
274 | 313 | def test_reaction_to_dicts_coverage_dependence(self): |
275 | 314 | """Coverage-dependent kinetics: coverage-dependencies block present with correct units. |
276 | 315 |
|
|
0 commit comments