4848import numpy as np
4949import psutil
5050import yaml
51- from cantera import ck2cti
51+ from cantera import ck2yaml
5252from scipy .optimize import brute
5353
5454import rmgpy .util as util
@@ -1088,14 +1088,14 @@ def execute(self, initialize=True, **kwargs):
10881088
10891089 self .run_model_analysis ()
10901090
1091- # generate Cantera files chem.cti & chem_annotated.cti in a designated `cantera` output folder
1091+ # generate Cantera files chem.yaml & chem_annotated.yaml in a designated `cantera` output folder
10921092 try :
10931093 if any ([s .contains_surface_site () for s in self .reaction_model .core .species ]):
10941094 self .generate_cantera_files (os .path .join (self .output_directory , 'chemkin' , 'chem-gas.inp' ),
1095- surfaceFile = (
1095+ surface_file = (
10961096 os .path .join (self .output_directory , 'chemkin' , 'chem-surface.inp' )))
10971097 self .generate_cantera_files (os .path .join (self .output_directory , 'chemkin' , 'chem_annotated-gas.inp' ),
1098- surfaceFile = (os .path .join (self .output_directory , 'chemkin' ,
1098+ surface_file = (os .path .join (self .output_directory , 'chemkin' ,
10991099 'chem_annotated-surface.inp' )))
11001100 else : # gas phase only
11011101 self .generate_cantera_files (os .path .join (self .output_directory , 'chemkin' , 'chem.inp' ))
@@ -1660,13 +1660,13 @@ def process_reactions_to_species(self, obj):
16601660
16611661 def generate_cantera_files (self , chemkin_file , ** kwargs ):
16621662 """
1663- Convert a chemkin mechanism chem.inp file to a cantera mechanism file chem.cti
1663+ Convert a chemkin mechanism chem.inp file to a cantera mechanism file chem.yaml
16641664 and save it in the cantera directory
16651665 """
16661666 transport_file = os .path .join (os .path .dirname (chemkin_file ), 'tran.dat' )
1667- file_name = os .path .splitext (os .path .basename (chemkin_file ))[0 ] + '.cti '
1667+ file_name = os .path .splitext (os .path .basename (chemkin_file ))[0 ] + '.yaml '
16681668 out_name = os .path .join (self .output_directory , 'cantera' , file_name )
1669- if 'surfaceFile ' in kwargs :
1669+ if 'surface_file ' in kwargs :
16701670 out_name = out_name .replace ('-gas.' , '.' )
16711671 cantera_dir = os .path .dirname (out_name )
16721672 try :
@@ -1676,14 +1676,14 @@ def generate_cantera_files(self, chemkin_file, **kwargs):
16761676 raise
16771677 if os .path .exists (out_name ):
16781678 os .remove (out_name )
1679- parser = ck2cti .Parser ()
1679+ parser = ck2yaml .Parser ()
16801680 try :
1681- parser .convertMech (chemkin_file , transportFile = transport_file , outName = out_name , quiet = True , permissive = True ,
1681+ parser .convert_mech (chemkin_file , transport_file = transport_file , out_name = out_name , quiet = True , permissive = True ,
16821682 ** kwargs )
1683- except ck2cti . InputParseError :
1683+ except ck2yaml . InputError :
16841684 logging .exception ("Error converting to Cantera format." )
16851685 logging .info ("Trying again without transport data file." )
1686- parser .convertMech (chemkin_file , outName = out_name , quiet = True , permissive = True , ** kwargs )
1686+ parser .convert_mech (chemkin_file , out_name = out_name , quiet = True , permissive = True , ** kwargs )
16871687
16881688 def initialize_reaction_threshold_and_react_flags (self ):
16891689 num_core_species = len (self .reaction_model .core .species )
0 commit comments