Skip to content

Commit 3696f49

Browse files
committed
FalloffReaction merged with Reaction
1 parent d151c7b commit 3696f49

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

rmgpy/reaction.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,29 +354,29 @@ def to_cantera(self, species_list=None, use_chemkin_identifier=False):
354354

355355
elif isinstance(self.kinetics, Troe):
356356
if ct_collider is not None:
357-
ct_reaction = ct.FalloffReaction(
357+
ct_reaction = ct.Reaction(
358358
reactants=ct_reactants,
359359
products=ct_products,
360360
tbody=ct_collider,
361361
rate=ct.TroeRate()
362362
)
363363
else:
364-
ct_reaction = ct.FalloffReaction(
364+
ct_reaction = ct.Reaction(
365365
reactants=ct_reactants,
366366
products=ct_products,
367367
rate=ct.TroeRate()
368368
)
369369

370370
elif isinstance(self.kinetics, Lindemann):
371371
if ct_collider is not None:
372-
ct_reaction = ct.FalloffReaction(
372+
ct_reaction = ct.Reaction(
373373
reactants=ct_reactants,
374374
products=ct_products,
375375
tbody=ct_collider,
376376
rate=ct.LindemannRate()
377377
)
378378
else:
379-
ct_reaction = ct.FalloffReaction(
379+
ct_reaction = ct.Reaction(
380380
reactants=ct_reactants,
381381
products=ct_products,
382382
rate=ct.LindemannRate()

rmgpy/tools/canteramodel.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -840,21 +840,20 @@ def check_equivalent_falloff(fall1, fall2):
840840
for j in range(ct_rxn1.rate.data.shape[1]):
841841
assert check_nearly_equal(ct_rxn1.rate.data[i, j], ct_rxn2.rate.data[i, j], dE), \
842842
"Similar Chebyshev coefficients"
843+
else:
844+
assert ct_rxn1.default_efficiency == ct_rxn2.default_efficiency, "Same default efficiency"
845+
assert ct_rxn1.efficiencies == ct_rxn2.efficiencies, "Same efficiencies"
846+
if ct_rxn1.falloff or ct_rxn2.falloff:
847+
check_equivalent_falloff(ct_rxn1.falloff, ct_rxn2.falloff)
848+
if ct_rxn1.high_rate or ct_rxn2.high_rate:
849+
check_equivalent_arrhenius(ct_rxn1.high_rate, ct_rxn2.high_rate)
850+
if ct_rxn1.low_rate or ct_rxn2.low_rate:
851+
check_equivalent_arrhenius(ct_rxn1.low_rate, ct_rxn2.low_rate)
843852

844853
elif isinstance(ct_rxn1, ct.ThreeBodyReaction):
845854
assert ct_rxn1.default_efficiency == ct_rxn2.default_efficiency, "Same default efficiency"
846855
assert ct_rxn1.efficiencies == ct_rxn2.efficiencies, "Same efficiencies"
847856

848-
elif isinstance(ct_rxn1, ct.FalloffReaction):
849-
assert ct_rxn1.default_efficiency == ct_rxn2.default_efficiency, "Same default efficiency"
850-
assert ct_rxn1.efficiencies == ct_rxn2.efficiencies, "Same efficiencies"
851-
if ct_rxn1.falloff or ct_rxn2.falloff:
852-
check_equivalent_falloff(ct_rxn1.falloff, ct_rxn2.falloff)
853-
if ct_rxn1.high_rate or ct_rxn2.high_rate:
854-
check_equivalent_arrhenius(ct_rxn1.high_rate, ct_rxn2.high_rate)
855-
if ct_rxn1.low_rate or ct_rxn2.low_rate:
856-
check_equivalent_arrhenius(ct_rxn1.low_rate, ct_rxn2.low_rate)
857-
858857
except Exception as e:
859858
print("Cantera reaction {0} failed equivalency check on: {1}".format(ct_rxn1, e))
860859
return False

0 commit comments

Comments
 (0)