Skip to content

Commit

Permalink
Write the thermo coverage dependent data to yaml files in right format
Browse files Browse the repository at this point in the history
  • Loading branch information
12Chao committed Apr 1, 2024
1 parent e9e2703 commit 8d7756a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rmgpy/rmg/main.py
Expand Up @@ -1197,11 +1197,13 @@ def execute(self, initialize=True, **kwargs):
mol = Molecule().from_adjacency_list(dep_sp)
for sp in self.reaction_model.core.species:
if sp.is_isomorphic(mol, strict=False):
parameters['units'] = {'energy':'J', 'quantity':'mol'}
parameters['enthalpy-coefficients'] = [float(value) for value in parameters['enthalpy-coefficients']]
parameters['entropy-coefficients'] = [float(value) for value in parameters['entropy-coefficients']]
try:
parameters['units'] = {'energy':'J', 'quantity':'mol'}
content["species"][surf.species_index(sp.to_chemkin())]['coverage-dependencies'][sp.to_chemkin()] = parameters
content["species"][gas.n_species+surf.species_index(sp.to_chemkin())]['coverage-dependencies'][sp.to_chemkin()] = parameters
except KeyError:
content["species"][surf.species_index(sp.to_chemkin())]['coverage-dependencies'] = {sp.to_chemkin(): parameters}
content["species"][gas.n_species+surf.species_index(sp.to_chemkin())]['coverage-dependencies'] = {sp.to_chemkin(): parameters}

annotated_yaml_path = os.path.join(self.output_directory, "cantera", "chem_annotated.yaml")
with open(annotated_yaml_path, 'r') as f:
Expand Down

0 comments on commit 8d7756a

Please sign in to comment.