hkmoffat / cantera

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

Ck2cti bugs #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am having some bugs converting files in chemkin to cti's by using this 
version of ck2cti:

$ which ck2cti /usr/local/bin/ck2cti

$ ck2cti -?

ck2cti: convert a CK-format reaction mechanism file to Cantera input format.

D. G. Goodwin, Caltech Version 1.0, August 2003.

options: -i -t -tr -id -d print debugging output

-v  validate the input file 

The results are written to the standard output.

Cantera doesn't understand 'plog' and 'Chebyshev' from chemkin file :

Pressure-dependent "PLOG" form:

SPC(63)=CH2CHO(55)+OH(26) 2.200e+17 -0.42 44.62 PLOG / 1.0 2.00e+35 -6.7 47.45 / PLOG / 10.0 1.10e+28 -4.15 46.19 / PLOG / 50.0 2.80e+26 -3.5 46.34 /

Pressure-dependent Chebyshev form:

O(25)+CH3Oj(16)(+m)=CH3OO(35)(+m) 1.0E0 0.0 0.0
TCHEB / 300.0 3000.0 / PCHEB / 0.009869232667160128 98.69232667160128 / CHEB / 4 4 / CHEB / 9.9454000e+00 1.9824000e+00 -1.2138000e-02 -6.6165000e-03 / CHEB / -1.4728000e-01 -1.5385000e-03 -1.0221000e-03 -5.2309000e-04 / CHEB / -3.9440000e-01 1.0193000e-02 6.9851000e-03 3.7782000e-03 / CHEB / -1.3597000e-01 2.9251000e-03 1.9940000e-03 1.0688000e-03 /


Also,  reaction number in cantera is plus one, for example in this cantera 
error it means reaction 406 not 405!

8 from Cantera import * 9 ---> 10 gas1 = importPhase('chem.cti') 11 print gas1

  /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cantera/importFromFile.pyc in importPhase(file, name, loglevel, debug)
     16     to log files about the details of the object constructed.
     17     """
  ---> 18     return importPhases(file, [name], loglevel, debug)[0]
     19 
     20 def importPhases(file, names = [], loglevel = 0, debug = 0):

  /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cantera/importFromFile.pyc in importPhases(file, names, loglevel, debug)
     23     s = []
     24     for nm in names:
  ---> 25         s.append(solution.Solution(src=file,id=nm,loglevel=loglevel,debug=debug))
     26     return s
     27 

  /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cantera/solution.pyc in __init__(self, src, id, loglevel, debug)
     52         # initialize the kinetics model

     53         ph = [self]
  ---> 54         Kinetics.__init__(self, xml_phase=s, phases=ph)
     55 
     56         # initialize the transport model

  /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cantera/Kinetics.pyc in __init__(self, kintype, thrm, xml_phase, id, phases)
     52 
     53         self.ckin = _cantera.KineticsFromXML(xml_phase,
  ---> 54                                                  p0, p1, p2, p3, p4)
     55 
     56         self._np = self.nPhases()

  error: 

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

  Procedure: getRateCoefficient
  Error:   negative or zero A coefficient for reaction 405

Original issue reported on code.google.com by faribas...@gmail.com on 10 Jul 2012 at 7:27

GoogleCodeExporter commented 9 years ago
Support for converting Chemkin-format mechanisms with plog and Chebyshev 
reaction types is provided in the new 'ck2cti.py' script. The older ck2cti 
executable does not support these reaction types, and will be removed in a 
future version of Cantera.

As for the reaction number, Cantera is written in C++, which starts counting at 
0...

Original comment by yarmond on 11 Jul 2012 at 3:18

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 12 Jul 2012 at 6:49