[ck2cti] Don't include reactions with explicit reverse rate equal to zero

This commit is contained in:
Bryan W. Weber 2016-11-23 12:31:22 -05:00 committed by Ray Speth
parent 6b32c73eee
commit a9814a1216

View file

@ -1347,23 +1347,26 @@ class Parser(object):
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()