Fixed handling of reaction delimiters
This commit is contained in:
parent
c80113d767
commit
cee19f67a6
1 changed files with 11 additions and 4 deletions
|
|
@ -979,11 +979,18 @@ def readKineticsEntry(entry, speciesDict, energyUnits, moleculeUnits):
|
|||
thirdBody = False
|
||||
|
||||
# Split the reaction equation into reactants and products
|
||||
reversible = True
|
||||
reactants, products = reaction.split('=')
|
||||
if '=>' in reaction:
|
||||
products = products[1:]
|
||||
if '<=>' in reaction:
|
||||
reversible = True
|
||||
reactants, products = reaction.split('<=>')
|
||||
elif '=>' in reaction:
|
||||
reversible = False
|
||||
reactants, products = reaction.split('=>')
|
||||
elif '=' in reaction:
|
||||
reversible = True
|
||||
reactants, products = reaction.split('=')
|
||||
else:
|
||||
raise ChemkinError("Failed to find reactant/product delimiter in reaction string.")
|
||||
|
||||
if '(+M)' in reactants: reactants = reactants.replace('(+M)','')
|
||||
if '(+m)' in reactants: reactants = reactants.replace('(+m)','')
|
||||
if '(+M)' in products: products = products.replace('(+M)','')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue