Skip to content

Commit 81dd414

Browse files
committed
Check whether to compute thermo before appending species to self.qm
to avoid computing thermo for species that participate in a reaction and must be sent to ARC, but they are well known from libraries, e.g., OH
1 parent ac0935f commit 81dd414

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

t3/main.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def execute(self):
321321
self.run_arc(arc_kwargs=self.qm)
322322
self.process_arc_run()
323323
if not additional_calcs_required and self.iteration >= len(self.rmg['model']['core_tolerance']):
324-
# T3 iterated through all of the user requested tolerances, and there are no more calculations required
324+
# T3 iterated through all the user requested tolerances, and there are no more calculations required
325325
break
326326

327327
if self.check_overtime():
@@ -1231,6 +1231,7 @@ def load_species_and_reactions_from_chemkin_file(self) -> Tuple[List[Species], L
12311231
def add_species(self,
12321232
species: Species,
12331233
reasons: Union[List[str], str],
1234+
compute_thermo: bool = True,
12341235
) -> Optional[int]:
12351236
"""
12361237
Add a species to self.species and to self.qm['species'].
@@ -1239,6 +1240,7 @@ def add_species(self,
12391240
Args:
12401241
species (Species): The species to consider.
12411242
reasons (Union[List[str], str]): Reasons for calculating this species.
1243+
compute_thermo (bool, optional): Whether to compute thermo for this species (default: ``True``).
12421244
12431245
Returns:
12441246
Optional[int]: The T3 species index (the respective self.species key) if the species was just added,
@@ -1256,6 +1258,7 @@ def add_species(self,
12561258
'reasons': reasons,
12571259
'converged': None,
12581260
'iteration': self.iteration,
1261+
'compute_thermo': compute_thermo,
12591262
}
12601263

12611264
# Check whether T3 has xyz information for this species, if so process it.
@@ -1274,7 +1277,7 @@ def add_species(self,
12741277
xyzs.append(xyz_dict)
12751278
if len(xyzs):
12761279
if self.qm['adapter'] == 'ARC':
1277-
# Make qm_species and ARCSpecies instance to consider the xyz information
1280+
# Make qm_species an ARCSpecies instance to consider the xyz information
12781281
qm_species = ARCSpecies(label=qm_species.label,
12791282
rmg_species=qm_species,
12801283
xyz=xyzs,
@@ -1283,6 +1286,17 @@ def add_species(self,
12831286
else:
12841287
raise NotImplementedError(f"Passing XYZ information to {self.qm['adapter']} "
12851288
f"is not yet implemented.")
1289+
if not self.species_requires_refinement(qm_species):
1290+
if isinstance(qm_species, ARCSpecies):
1291+
qm_species.compute_thermo = False
1292+
qm_species.include_in_thermo_lib = False
1293+
else:
1294+
qm_species = ARCSpecies(label=qm_species.label,
1295+
rmg_species=qm_species,
1296+
xyz=None,
1297+
compute_thermo=False,
1298+
include_in_thermo_lib=False,
1299+
)
12861300
self.qm['species'].append(qm_species)
12871301
return key
12881302

0 commit comments

Comments
 (0)