Skip to content

Conversation

BonhyeokKoo
Copy link

@BonhyeokKoo BonhyeokKoo commented May 28, 2025

Summary

This PR adds new options to RMG's liquid-phase thermochemistry pipeline, allowing users to enable temperature-dependent solvation correction and choose between LSER- or ML-based methods. Previously, RMG only supported LSER correction and did not support temperature dependence or ML-based corrections.

Motivation or Problem

  • RMG currently applies solvation corrections using the LSER (Linear Solvation Energy Relationship) method. This PR introduces dummy ML functions that act as placeholders for real ML models.
  • In the current RMG, once a solvation correction is calculated at 298K via LSER, it estimates thermodynamic properties at other temperatures using G = H - TS. However, this PR introduces an additional option for a temperature-dependent solvation model based on the work of Chung et al., AlChE Journal, 66(6), 2020.

Description of Changes

Add MLSolvation class to rmgpy/data/solvation.py

  • Structurally similar to the existing MLEstimator class in mlEstimator.py.
  • Configurable via an mlSolvation block in the input file, with parameters:
    T_dep: Boolean to enable temperature-dependent model.
    method: One of SoluteGC, SoluteML, or DirectML – specifying how to compute 298 K solvation properties.
  • The method get_solvation_correction() uses the selected approach to compute solvation corrections at 298K.
  • The method generate_solvation_model() returns either a TDepModel or StaticModel, depending on the T_dep flag.

Modify rmgpy/thermo/thermoengine.py and rmgpy/species.py

  • The submit function now includes a definition of solvationthermo when a system is in the liquid phase.
  • solvationthermo is constructed using generate_solvation_model() under MLSolvation.
  • The relevant helper functions were added to species.py to store and access solvationthermo.

Add solvation correction to rmgpy/reaction.py

  • Previously, solvation corrections were applied by directly modifying the thermodynamic properties of each species within rmgpy/thermo/thermoengine.py. However, this approach posed challenges when integrating temperature-dependent models.
  • We now compute solvation corrections in rmgpy/reaction.py at the point where the dGrxn (Gibbs free energy of reaction) is calculated. A solvation correction therm ddGsolv (solvation free energy of reaction) is computed based on the solvation free energies of reactants and products. These values are from the solvationthermo of each species.

Update in test/rmgpy/data/solvationTest.py

  • Test functions were updated to reflect function name changes and class refactoring.

Skip collision limit violation check in the liquid phase

  • Collision limit checks in rmgpy/rmg/main.py are now skipped for reactions in the liquid phase because the check sweeps temperatures up to 2000K, but temperature-dependent solvation models are only valid below the solvent's critical temperature.

Testing

  • Verified that T_dep=True yields a TDepModel and T_dep=False returns a StaticModel.
  • Confirmed that the method parameter correctly alters the computed solvation correction (SoluteGC, SoluteML, or DirectML). However, both SoluteML and DirectML are currently implemented as dummy methods that return zero correction.

@JacksonBurns
Copy link
Contributor

JacksonBurns commented May 29, 2025

hi @BonhyeokKoo welcome to RMG world! Please tag me in this PR as needed, and as a reviewer when the time comes.

Following up on some offline discussion, the following things need to happen to unblock this PR by adding support for Python 3.11:

@BonhyeokKoo BonhyeokKoo changed the title Add optional ML-based solvation correction pathway Add T-Dependent and ML Options for Solvation Corrections Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants