Skip to content

Commit

Permalink
[ck2cti] Don't include reactions with explicit reverse rate equal to …
Browse files Browse the repository at this point in the history
…zero
  • Loading branch information
bryanwweber authored and speth committed Nov 25, 2016
1 parent 6b32c73 commit a9814a1
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions interfaces/cython/cantera/ck2cti.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,23 +1347,26 @@ def parseExpression(expression, dest):
elif 'rev' in line.lower():
reaction.reversible = False

# Create a reaction proceeding in the opposite direction
revReaction = Reaction(reactants=reaction.products,
products=reaction.reactants,
thirdBody=reaction.thirdBody,
reversible=False)
tokens = tokens[1].split()
revReaction.kinetics = Arrhenius(
A=(float(tokens[0].strip()), klow_units),
b=float(tokens[1].strip()),
Ea=(float(tokens[2].strip()), energy_units),
T0=(1,"K"),
parser=self
)
if thirdBody:
revReaction.kinetics = ThirdBody(
arrheniusHigh=revReaction.kinetics,
parser=self)
# If the A factor in the rev line is zero, don't create the reverse reaction
if float(tokens[0].strip()) != 0.0:
# Create a reaction proceeding in the opposite direction
revReaction = Reaction(reactants=reaction.products,
products=reaction.reactants,
thirdBody=reaction.thirdBody,
reversible=False)

revReaction.kinetics = Arrhenius(
A=(float(tokens[0].strip()), klow_units),
b=float(tokens[1].strip()),
Ea=(float(tokens[2].strip()), energy_units),
T0=(1,"K"),
parser=self
)
if thirdBody:
revReaction.kinetics = ThirdBody(
arrheniusHigh=revReaction.kinetics,
parser=self)

elif 'ford' in line.lower():
tokens = tokens[1].split()
Expand Down

0 comments on commit a9814a1

Please sign in to comment.