Skip to content

Commit

Permalink
collider is never None - must change test (See ext)
Browse files Browse the repository at this point in the history
passing an empty dict for third_body results in the attribute being None, but we need it to just be an unpopulated ThirdBody to indicate that the Reaction is a third body reaction
  • Loading branch information
JacksonBurns authored Jan 27, 2025
1 parent 33bd6f2 commit 426c55e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rmgpy/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ def to_cantera(self, species_list=None, use_chemkin_identifier=False):

elif isinstance(self.kinetics, ThirdBody):
# Cantera 3 doesn't have a ThirdBody class, only third body attribute in the normal class
if ct_collider is not None:
if ct_collider:
ct_reaction = ct.Reaction(reactants=ct_reactants, products=ct_products, third_body=ct_collider, rate=ct.ArrheniusRate())
else: # provide the default collider (if we don't have one) to establish this as a ThirdBody reaction
ct_reaction = ct.Reaction(reactants=ct_reactants, products=ct_products, third_body=ct.ThirdBody(), rate=ct.ArrheniusRate())

elif isinstance(self.kinetics, Troe):
if ct_collider is not None:
if ct_collider:
ct_reaction = ct.Reaction(
reactants=ct_reactants,
products=ct_products,
Expand All @@ -369,7 +369,7 @@ def to_cantera(self, species_list=None, use_chemkin_identifier=False):
)

elif isinstance(self.kinetics, Lindemann):
if ct_collider is not None:
if ct_collider:
ct_reaction = ct.Reaction(
reactants=ct_reactants,
products=ct_products,
Expand Down

0 comments on commit 426c55e

Please sign in to comment.