slepicka-craig / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

TCHEB/PCHEB case dependency #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Download new isopentanol mechanism from 
(http://www.sciencedirect.com/science/article/pii/S0010218013002472)
2.  Fix obvious errors e.g. 4.8791+04, remove hv reactions (I've attached files 
with these steps performed)
3.  Run ck2cti --input=mmc2.txt --thermo=mmc3.txt

What is the expected output? What do you see instead?
Problem occurs during parsing of '! h-catalyzed keto-enol isomerization include 
rmg rates for low p flame simulations' reaction (Cheb. reaction)'

The problem occurs because 'cheb' is search for in line.lower() [1228]
however, only the keywords 'TCHEB' and 'PCHEB' are valid for the temperature 
and pressure lines

Error:
__main__.InputParseError: Missing TCHEB line for reaction ic5h9oh1-1 + h (+ M) 
<=> ic4h9cho + h (+ M)

This should probably be consistent with the 'cheb' search
A possible fix:

tchebMatch = re.compile("([tT][cC][hH][eE][bB])")
pchebMatch = re.compile("([pP][cC][hH][eE][bB])")
if re.search(tchebMatch, line):
     tchebStr = re.search(tchebMatch, line).groups()[0]
     index = tokens.index(tchebStr )
     tokens2 = tokens[index+1].split()
     chebyshev.Tmin = float(tokens2[0].strip())
     chebyshev.Tmax = float(tokens2[1].strip())
if re.search(pchebMatch , line):
     pchebStr = re.search(pchebMatch, line).groups()[0]
     index = tokens.index(pchebStr )
     tokens2 = tokens[index+1].split()
     chebyshev.Pmin = (float(tokens2[0].strip()), 'atm')
     chebyshev.Pmax = (float(tokens2[1].strip()), 'atm')
if re.search(tchebMatch, line) or re.search(pchebMatch, line):
     pass

What version of the product are you using? On what operating system?
Windows 7 x64, but should be product independent.  Using an older build based 
off r2683, but I checked on the main branch 
(http://code.google.com/p/cantera/source/browse/cantera/trunk/interfaces/python/
ck2cti.py?r=2585) and problem still persists.

Original issue reported on code.google.com by argh...@gmail.com on 8 Apr 2014 at 5:02

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2878.

Original comment by yarmond on 8 Apr 2014 at 7:39

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2924.

Original comment by yarmond on 29 Apr 2014 at 7:02