ck2cti error : Unable to parse transport data: not enough parameters

516 views
Skip to first unread message

Fanne

unread,
Oct 28, 2014, 6:29:18 AM10/28/14
to canter...@googlegroups.com
Hi all !


So, I recently switched to the v 2.1 and I am trying to familiarize with its novelties.

I just wanted to check with you something about the new ck2cti program : I tried to compare the old and new version of the ck2cti (by 'old', I mean version 1.8 of Cantera ) on the mechanism of Wang and Frenklach that can be found here : http://ignis.usc.edu/Mechanisms/PAH/pah.html . The thing is that when I change absolutely nothing and try to get a .cti with the command : 

ck2cti -i mech.inp -t therm.dat -tr tran.dat -d

so, with the old cantera, I get no errors and a perfectly viable .cti ... On the other hand, the (I have to say, less easy to write) new command with the new cantera : 

ck2cti --input=mech.inp --thermo=therm.dat --transport=tran.dat

will produce this :

INFO:root:Skipping unexpected species "C(S)" while reading thermodynamics entry.
INFO:root:Skipping unexpected species "n-C4H7" while reading thermodynamics entry.
INFO:root:Skipping unexpected species "c-C6H3" while reading thermodynamics entry.
INFO:root:Skipping unexpected species "A1C2HC2H2" while reading thermodynamics entry.
INFO:root:Skipping unexpected species "A2HR5" while reading thermodynamics entry.
INFO:root:Skipping unexpected species "A2R5" while reading thermodynamics entry.
INFO:root:Skipping unexpected species "A4H" while reading thermodynamics entry.
Traceback (most recent call last):
  File "/usr/local/cantera211/bin/ck2cti", line 5, in <module>
    ck2cti.main(sys.argv[1:])
  File "/usr/local/cantera211/lib64/python2.7/site-packages/cantera/ck2cti.py", line 1882, in main
    outName, permissive=permissive)
  File "/usr/local/cantera211/lib64/python2.7/site-packages/cantera/ck2cti.py", line 1817, in convertMech
    self.parseTransportData(lines)
  File "/usr/local/cantera211/lib64/python2.7/site-packages/cantera/ck2cti.py", line 1686, in parseTransportData
    raise InputParseError('Unable to parse transport data: not enough parameters')
cantera.ck2cti.InputParseError: Unable to parse transport data: not enough parameters

As I more or less understood that the problem came from the tran.dat file, I removed all end of file comments, and it seemed to have worked. However, I don't understand : 
Why, as there still are comments and \n on the middle of the transport file ?
And what happened to the log file, doesn't it exist anymore ?

I know I could probably found answers looking at the.py file but if someone has a good grasp on this, it could save me time :)

Thanks a lot anyway !
Anne

Ray Speth

unread,
Oct 28, 2014, 11:25:59 AM10/28/14
to canter...@googlegroups.com
Anne,

The old version of ck2cti generated incorrect CTI files when given these input files, as discussed in this recent thread. The fact that more recent more recent versions of ck2cti raise exceptions when parsing these mechanisms from USC should be regarded as an improvement.

I can't really guess at why ck2cti does or doesn't parse an input file that you have modified without actually seeing the input file in question. If you would like to attach it to this thread, I can try to explain what's happening.

The log file was removed because it was effectively redundant with the resulting CTI file. Improving the error messages provided by ck2cti has been an ongoing effort. The current development version will print the line number where parsing fails in the case of not finding the correct number of transport parameters.

Finally, if you don't like typing the full option names, you can type just enough of each option's name to specify it uniquely, e.g.

ck2cti --in=mech.inp --th=therm.dat --tr=tran.dat

Regards,
Ray

Fanne

unread,
Oct 28, 2014, 12:09:05 PM10/28/14
to canter...@googlegroups.com
Hi Ray


Thanks for the response and the options shortening possibilities... very useful for us lazy ones !

I join the altered transport file (tran_alt.txt), along with the other chemkin unaltered input file. But basically it is as I just said : I simply removed the last 10 lines or so, when compared to the one found on the website of Dr Wang. If the parser had problems with spaces and non chemistry related sentences, why is it OK with this version, as line 77 still contains one ?

I was not aware of the fact that the old ck2cti had problems... So you are saying that the .cti generated from those files with the old ck2cti would give unreliable results ? It did not seem to be the case, however ... I am confused.


Thank you for your help !
Anne
tran.txt
therm.txt
mech.txt
tran_alt.txt

Ray Speth

unread,
Oct 28, 2014, 1:07:18 PM10/28/14
to canter...@googlegroups.com
Anne,

The logic of the transport parser is as follows:

- Read a line
- Does the line contain at least 7 space-separated tokens? 
  - If not, raise an exception.
- Is the first token the name of a species in the mechanism?
  - If it is, parse the line to determine the coefficients

For the line: "The Lennard-Jones parameters of polycyclic aromatic hydrocarbons were estimated", what happens is that it passes the first check, but "The" is not a species, so the line is simply ignored, since it doesn't matter whether or not it contains valid transport coefficients. On the other hand, the line "  1-15: Species name" doesn't contain enough parameters to be a valid transport entry, and fails the first check.

And yes, I am saying that the old version of ck2cti would generate CTI files that would lead incorrect transport property calculations (and flame speeds) for some input files, specifically the ones containing the coefficients for Hai Wang's modified transport formulation that is included in some of the mechanisms distributed on that USC site, but not this specific mechanism. The thread I linked to covers some of the problems that occur. The current development version of Cantera has some additional checks on the transport coefficients to detect this problem, specifically looking for 'geometry' flags that are incompatible with the number of atoms in each molecule.

Regards,
Ray

Fanne

unread,
Oct 28, 2014, 1:26:07 PM10/28/14
to canter...@googlegroups.com
Ok thank you for these explanations, it is much clearer.

But to go further, then, would it be possible to use one of those mechanisms with the modified transport formulation in Cantera ? I am not working with them at the moment so there is no need to be specific, but just to keep that in a corner of my mind :) .
I checked the thread you provided but I could not answer this question... But maybe I read it wrong.


Thanks again
Anne

Ray Speth

unread,
Oct 28, 2014, 2:03:40 PM10/28/14
to canter...@googlegroups.com
Anne,

That modified transport formulation is not implemented in Cantera. I believe that the mechanisms which use this formulation also provide coefficients for the standard parameterization, so they can still be used in Cantera (or unmodified versions of Chemkin) once that extra data has been removed.

Regards,
Ray

Fanne

unread,
Oct 30, 2014, 10:50:14 AM10/30/14
to canter...@googlegroups.com
Ok thanks a lot for those insights, it was very helpful !

Anne
Reply all
Reply to author
Forward
0 new messages