Skip to content

Commit 55dd066

Browse files
authored
Merge pull request #2788 to add detailed comments to thermo estimates
When debugging weird thermo, it's helpful to know how things were estimated. Linear Scaling Relations (LSRs) for moving from one catalyst to another, and solvation corrections, can both change thermo. The comments now tell you how much it changed by.
2 parents 28c096d + 2d78555 commit 55dd066

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

rmgpy/data/thermo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,15 +1538,16 @@ def correct_binding_energy(self, thermo, species, metal_to_scale_from=None, meta
15381538

15391539
# now edit the adsorptionThermo using LSR
15401540
comments = []
1541-
for element,bond in normalized_bonds.items():
1541+
change_in_binding_energy = 0
1542+
for element, bond in normalized_bonds.items():
15421543
if bond:
15431544
try:
1544-
change_in_binding_energy = delta_atomic_adsorption_energy[element].value_si * bond
1545+
change_in_binding_energy += delta_atomic_adsorption_energy[element].value_si * bond
15451546
except KeyError:
15461547
continue
1547-
thermo.H298.value_si += change_in_binding_energy
15481548
comments.append(f'{bond:.2f}{element}')
1549-
thermo.comment += " Binding energy corrected by LSR ({}) from {}".format('+'.join(comments), metal_to_scale_from)
1549+
thermo.H298.value_si += change_in_binding_energy
1550+
thermo.comment += f" Binding energy corrected by LSR ({'+'.join(comments)}) from {metal_to_scale_from} (H={change_in_binding_energy/1e3:+.0f}kJ/mol)"
15501551
return thermo
15511552

15521553
def get_thermo_data_for_surface_species(self, species):

rmgpy/thermo/thermoengine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def process_thermo_data(spc, thermo0, thermo_class=NASA, solvent_name=''):
7070
# correction is added to the entropy and enthalpy
7171
wilhoit.S0.value_si = (wilhoit.S0.value_si + solvation_correction.entropy)
7272
wilhoit.H0.value_si = (wilhoit.H0.value_si + solvation_correction.enthalpy)
73-
wilhoit.comment += ' + Solvation correction with {} as solvent and solute estimated using {}'.format(solvent_name, solute_data.comment)
73+
wilhoit.comment += f' + Solvation correction (H={solvation_correction.enthalpy/1e3:+.0f}kJ/mol;S={solvation_correction.entropy:+.0f}J/mol/K) with {solvent_name} as solvent and solute estimated using {solute_data.comment}'
7474

7575
# Compute E0 by extrapolation to 0 K
7676
if spc.conformer is None:

0 commit comments

Comments
 (0)