[ck2cti] Add support for surface coverage dependencies
This commit is contained in:
parent
db90a7c0a1
commit
de9bb5b1c9
2 changed files with 27 additions and 1 deletions
|
|
@ -463,6 +463,22 @@ class SurfaceArrhenius(Arrhenius):
|
|||
"""
|
||||
An Arrhenius-like reaction occurring on a surface
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
Arrhenius.__init__(self, *args, **kwargs)
|
||||
self.coverages = []
|
||||
|
||||
def rateStr(self):
|
||||
s = Arrhenius.rateStr(self)
|
||||
|
||||
if self.coverages:
|
||||
if len(self.coverages) == 1:
|
||||
covs = self.coverages[0]
|
||||
else:
|
||||
covs = self.coverages
|
||||
s = '\n{0}Arrhenius({1},\n{2}coverage={3})'.format(
|
||||
' '*17, s[1:-1], ' '*27, list(covs))
|
||||
return s
|
||||
|
||||
|
||||
def to_cti(self, reactantstr, arrow, productstr, indent=0):
|
||||
rxnstring = reactantstr + arrow + productstr
|
||||
|
|
@ -1374,6 +1390,10 @@ class Parser(object):
|
|||
falloff = Sri(A=A, B=B, C=C)
|
||||
else:
|
||||
falloff = Sri(A=A, B=B, C=C, D=D, E=E)
|
||||
elif 'cov' in line.lower():
|
||||
C = tokens[1].split()
|
||||
arrhenius.coverages.append(
|
||||
(C[0], fortFloat(C[1]), fortFloat(C[2]), fortFloat(C[3])))
|
||||
|
||||
elif 'cheb' in line.lower():
|
||||
# Chebyshev parameters
|
||||
|
|
|
|||
|
|
@ -20,6 +20,12 @@ from __future__ import print_function
|
|||
|
||||
import sys
|
||||
|
||||
# Python 2/3 compatibility
|
||||
try:
|
||||
basestring
|
||||
except NameError:
|
||||
basestring = str
|
||||
|
||||
def _printerr(*args):
|
||||
# All debug and error output should go to stderr
|
||||
print(*args, file=sys.stderr)
|
||||
|
|
@ -1015,7 +1021,7 @@ class Arrhenius(rate_expression):
|
|||
self._c = [A, b, E]
|
||||
|
||||
if coverage:
|
||||
if isinstance(coverage[0], str):
|
||||
if isinstance(coverage[0], basestring):
|
||||
self._cov = [coverage]
|
||||
else:
|
||||
self._cov = coverage
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue