Closed kahilah closed 7 years ago
Hmm, I'm wary of diving into the "trying to fix badly formatted Chemkin files" game, since there are simply so many of them (and the Cantera converter does a much better job than we would).
@kyleniemeyer I think the best solution here would be to issue a warning for any species name that starts with whitespace?
I think a simple fix would be to just strip leading & trailing whitespace from the lines before processing—actually I'm surprised we don't do this already...
This should be a "simple" fix, let me take a look.
OK, so we do already strip leading & trailing whitespace, but right after the block of code where keywords are parsed.
I'm going to move that to happen immediately prior to parsing keywords, and that should fix the issue.
Hi @kahilah, could you try with the newest version now? Either download the source, or install v1.0.5b0 via pip or conda.
Hi,
Tested and works!
Cheers
Minor issue regarding the mechanism file reader: If there is a white space in front of "END"-marker of the "SPECIES" block in the chemkin mechanism file, pyjac reads END as a specie and prints out an error: "Error: missing thermo data for END"
Removing the white space removes the problem.
Not a pyjac bug as such but worth to consider adding a check for specie name not being "END".
As an example, consider the following mechanism (SK54.inp) from http://www.sciencedirect.com/science/article/pii/S001623611631184X
in more particular:
http://www.sciencedirect.com/science/MiamiMultiMediaURL/1-s2.0-S001623611631184X/1-s2.0-S001623611631184X-mmc1.zip/271496/html/S001623611631184X/623c3347955e91002d0a4fd53a1570fd/mmc1.zip
Best regards,
-Heikki