Skip to content

Commit 8852ecf

Browse files
committed
[Solvation] Added logging info when reading solvation inputs
1 parent 41f65ba commit 8852ecf

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

rmgpy/rmg/input.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,19 @@ def solvation(solvent, solventData=None, excludedSpecies=None, excludedLibraries
11871187
rmg.solvation_excluded_species = excludedSpecies if excludedSpecies is not None else []
11881188
rmg.solvation_excluded_libraries = excludedLibraries if excludedLibraries is not None else []
11891189

1190+
# Log species and libraries excluded from solvation corrections
1191+
if rmg.solvation_excluded_species:
1192+
logging.info(
1193+
f"Solvation corrections will be skipped for the following species: "
1194+
f"{', '.join(rmg.solvation_excluded_species)}"
1195+
)
1196+
if rmg.solvation_excluded_libraries:
1197+
logging.info(
1198+
f"Solvation corrections will be skipped for species from the following thermo libraries: "
1199+
f"{', '.join(rmg.solvation_excluded_libraries)}"
1200+
)
1201+
1202+
11901203
def model(toleranceMoveToCore=None, toleranceRadMoveToCore=np.inf,
11911204
toleranceMoveEdgeReactionToCore=np.inf, toleranceKeepInEdge=0.0,
11921205
toleranceInterruptSimulation=1.0,
@@ -1769,7 +1782,16 @@ def save_input_file(path, rmg):
17691782
f.write(')\n\n')
17701783

17711784
if rmg.solvent:
1772-
f.write("solvation(\n solvent = '{0!s}'\n)\n\n".format(rmg.solvent))
1785+
f.write("solvation(\n")
1786+
f.write(" solvent = '{0!s}',\n".format(rmg.solvent))
1787+
1788+
if rmg.solvation_excluded_species:
1789+
f.write(" excludedSpecies = {0},\n".format(repr(rmg.solvation_excluded_species)))
1790+
1791+
if rmg.solvation_excluded_libraries:
1792+
f.write(" excludedLibraries = {0},\n".format(repr(rmg.solvation_excluded_libraries)))
1793+
1794+
f.write(")\n\n")
17731795

17741796
# Simulator tolerances
17751797
f.write('simulator(\n')

rmgpy/rmg/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ def __init__(self, core=None, edge=None, surface=None):
237237
self.new_surface_spcs_loss = set()
238238
self.new_surface_rxns_loss = set()
239239
self.solvent_name = ""
240+
self.solvation_excluded_species = []
241+
self.solvation_excluded_libraries = []
240242
self.surface_site_density = None
241243
self.unrealgroups = [
242244
Group().from_adjacency_list(
@@ -557,7 +559,7 @@ def make_new_reaction(self, forward, check_existing=True, generate_thermo=True,
557559
elif isinstance(forward, LibraryReaction) and forward.is_surface_reaction():
558560
# do fix the library reaction barrier if this is scaled from another metal
559561
if any(['Binding energy corrected by LSR' in x.thermo.comment for x in forward.reactants + forward.products]):
560-
forward.fix_barrier_height(solvent=self.solvent_name)
562+
forward.fix_barrier_height(solvent=self.solvent_name)
561563
elif forward.kinetics.solute:
562564
forward.apply_solvent_correction(solvent=self.solvent_name)
563565
if self.pressure_dependence and forward.is_unimolecular():
@@ -1601,7 +1603,7 @@ def add_seed_mechanism_to_core(self, seed_mechanism, react=False, requires_rms=F
16011603
self.new_reaction_list = []
16021604
self.new_species_list = []
16031605
edge_species_to_move = []
1604-
1606+
16051607
num_old_core_species = len(self.core.species)
16061608
num_old_core_reactions = len(self.core.reactions)
16071609

0 commit comments

Comments
 (0)