@@ -2724,7 +2724,8 @@ def extract_source_from_comments(self, species):
27242724
27252725 source = {'Library': String_Name_of_Library_Used,
27262726 'QM': String_of_Method_Used,
2727- 'GAV': Dictionary_of_Groups_Used
2727+ 'GAV': Dictionary_of_Groups_Used,
2728+ 'ADS': Dictionary_of_Adsorption_Group_Used,
27282729 }
27292730
27302731 The Dictionary_of_Groups_Used looks like
@@ -2743,9 +2744,42 @@ def extract_source_from_comments(self, species):
27432744 # Store the level of the calculation, which is the 2nd token in the comments
27442745 source ['QM' ] = tokens [1 ]
27452746
2747+ elif comment .startswith ('Gas phase thermo' ):
2748+ # Handle adsorption correction thermo data of the following format:
2749+ # Library example
2750+ # Gas phase thermo for C(T) from Thermo library: primaryThermoLibrary.
2751+ # Adsorption correction: + Thermo group additivity estimation: adsorptionPt111(Cq*)
2752+
2753+ # GAV example
2754+ # Gas phase thermo for [CH]CC from Thermo group additivity estimation: group(Cs-CsCsHH) + group(Cs-CsHHH) + group(Cs-CsHHH) + radical(CCJ2_triplet).
2755+ # Adsorption correction: + Thermo group additivity estimation: adsorptionPt111(C=*RCR3)"
2756+
2757+ comment = comment .replace (r'\n' , ' ' )
2758+ comment = comment .replace ('\n ' , ' ' )
2759+ assert 'Adsorption correction:' in comment , f'adsorption correction in unrecognized format { comment } '
2760+
2761+ # Handle the gas-phase portion first
2762+ gas_comment = comment .split ('Adsorption correction: + ' )[0 ].strip ()
2763+ gas_comment = gas_comment .replace ('.' , '' , - 1 ) # delete the . at the end if it exists
2764+ gas_comment = gas_comment [gas_comment .find ('from ' , len ('Gas phase thermo for ' )) + len ('from ' ):]
2765+ dummy_gas_phase_species = Species ()
2766+ dummy_gas_phase_species .thermo = NASA ()
2767+ dummy_gas_phase_species .thermo .comment = gas_comment
2768+ source = self .extract_source_from_comments (dummy_gas_phase_species )
2769+
2770+ # This is an adsorption correction
2771+ # comment is split into two parts: the gas phase, and the surface adsorption corection
2772+ ads_correction_comment = comment .split ('Adsorption correction: +' )[- 1 ].strip ()
2773+ dummy_adsorption_correction_species = Species ()
2774+ dummy_adsorption_correction_species .thermo = NASA ()
2775+ dummy_adsorption_correction_species .thermo .comment = ads_correction_comment
2776+ source ['ADS' ] = self .extract_source_from_comments (dummy_adsorption_correction_species )['GAV' ]
2777+
2778+ return source
2779+
27462780 # Check for group additivity contributions to the thermo in this species
27472781
2748- # The contribution of the groups can be either additive or substracting
2782+ # The contribution of the groups can be either additive or subtracting
27492783 # after changes to the polycyclic algorithm
27502784
27512785 comment = comment .replace (' + ' , ' +' )
0 commit comments