jcaiuwyo / cantera

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

Cantera ck2cti error: cantera.ck2cti.InputParseError: Unexpected species #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

I am trying to convert a CHEMKIN file to a Cantera .cti file. I am using MATLAB 
to call the function as follow:

f = ck2cti('chem.inp','therm.dat')

But then I get the following error:

??? Error using ==> ctmethods

************************************************
                Cantera Error!
************************************************

Procedure: ck2cti
Error:   Error converting input file "chem.inp" to CTI.
Python command was: 'C:\Python33\python.exe'
The exit code was: 7
-------------- start of converter log --------------
Error reading reaction entry starting on line 27:

ERROR: Unable to parse 'chem.inp' near line 756:

Traceback (most recent call last):
  File "<stdin>", line 8, in <module>
  File "C:\Python33\lib\site-packages\cantera\ck2cti.py", line 1766, in convertMech
    self.loadChemkinFile(inputFile)
  File "C:\Python33\lib\site-packages\cantera\ck2cti.py", line 1561, in loadChemkinFile
    reaction,revReaction = self.readKineticsEntry(kinetics)
  File "C:\Python33\lib\site-packages\cantera\ck2cti.py", line 1096, in readKineticsEntry
    falloff_3b_r, thirdBody = parseExpression(reactants, reaction.reactants)
  File "C:\Python33\lib\site-packages\cantera\ck2cti.py", line 1090, in parseExpression
    raise InputParseError('Unexpected species "{0}" in reaction expression "{1}".'.format(species, expression))
cantera.ck2cti.InputParseError: Unexpected species "H2" in reaction expression 
"H2+M".
--------------- end of converter log ---------------

Error in ==> ck2cti at 35
iok = ctmethods(0,1, infile, thermo, transport, idtag, 0, 0);

Could someone perhaps tell me what could be causing this error? I know the file 
content and structure are correct.

Thank you

Original issue reported on code.google.com by EonRet...@gmail.com on 25 Oct 2013 at 4:02

GoogleCodeExporter commented 9 years ago
Can you attach the input files that are you are using?

Original comment by yarmond on 25 Oct 2013 at 7:11

GoogleCodeExporter commented 9 years ago
Hi

Unfortunately I cannot upload the data since it is confidential. However, I 
have since been able to get it to work. For some reason Cantera don't recognize 
the keyword "SPECIE" as the start of the definitions for the species list. When 
I changed this to "SPECIES" it worked perfectly.

Original comment by EonRet...@gmail.com on 25 Oct 2013 at 9:07

GoogleCodeExporter commented 9 years ago
According to the Chemkin manual, either 'SPECIES' or 'SPEC' is an acceptable 
way to start the species section, and in practice the Chemkin interpreter seems 
to accept any string that is the first four-or-more letters of 'species', 
either capital or lower case.

The same applies to the other section headers as well ('REACTIONS', 'THERMO', 
etc.), and it's not unreasonable for Cantera's interpreter to accept these 
variations.

Original comment by yarmond on 28 Oct 2013 at 6:30

GoogleCodeExporter commented 9 years ago
Fixed in r2584.

Original comment by yarmond on 6 Dec 2013 at 11:20

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 6 Dec 2013 at 11:21