Method for batch calculation of free energy of graphene-loaded transition metal atom catalyst
By batch calculating graphene-loaded transition metal atomic catalyst, the convergence module, file extraction module, automatic submission module and data extraction module are used to solve the problem of low efficiency in calculating catalysts in the prior art, and efficient and accurate calculation results are achieved.
Patent Information
- Application Number
- CN202411618662.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-04
AI Technical Summary
The existing methods for calculating the free energy of catalysts have problems such as slow manual preparation of input files, low efficiency in post-submission analysis and calculation tasks, and low accuracy in manual analysis data.
A method for batch calculation of the free energy of graphene-loaded transition metal atom catalyst is proposed. The convergence module is used to perform convergence judgment of structural optimization calculation, and the required input files are obtained and extracted, and the calculation tasks are automatically submitted using the automatic submission module, and the energy value is extracted and processed through the data extraction module to obtain the free energy value.
It improves calculation efficiency, reduces the time and error risk of manual operation, significantly saves time and cost, and realizes batch and efficient calculation of catalyst free energy.
Smart Images

Figure CN119560056A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of catalytic material methods, and in particular to a method for calculating catalyst free energy. Background Art
[0002] With the continuous improvement of computing power, high-throughput computing has become an indispensable means of studying materials. It can quickly calculate a large number of candidate catalytic materials, greatly improving the calculation speed. However, high-throughput computing often requires processing a large number of calculation result files, which need to be manually copied, named, and submitted according to different calculation tasks or analyses. The existing manual operation method is inefficient and prone to errors.
[0003] For example, the invention patent with application number: 202010116568.5 provides a method for scheduling free energy perturbation calculations in a heterogeneous cluster environment, including the following steps: Step A: Through pre-constructed molecular / protein structures and input files, first perform an NPT ensemble dynamics simulation process to obtain the equilibrium structure; Step B: Run a replica exchange dynamics calculation based on the Hamiltonian to obtain enough trajectory data; Step C: parse the trajectory file, and then combine it with various prmtop to generate a new amber calculation input, and calculate the single point energy corresponding to each combined conformation; Step D: Use regular expressions to extract the energy values in the log file, and clean up the intermediate temporary files to complete the calculation process of a single molecule. The method of the invention is flexible in configuration and can process the free energy calculations of multiple molecules at the same time. The user only needs to write a configuration document, generate a runtime script through configuration, and automatically execute it according to the set process. It can also specify certain steps of partial calculations, and the calculation decoupling is good. However, this patent is mainly for molecular dynamics calculations, involving npt ensemble dynamics simulation, Hamiltonian replica exchange dynamics calculation, trajectory file analysis, etc., which are all common processes for molecular dynamics calculations, and the tool Amber mentioned is also a typical molecular dynamics simulation software, which is not suitable for DFT free energy calculations. This application is mainly for DFT calculations based on quantum mechanics calculation software such as VASP, and does not involve dynamic calculation methods such as trajectory data and Hamiltonian replica exchange in molecular dynamics simulations. Summary of the invention
[0004] In view of the technical problems that the existing methods for calculating the free energy of catalysts have slow manual preparation of input files, low efficiency in submitting post-processing analysis and calculation tasks, and low accuracy of manual analysis data, the present invention proposes a method for batch calculation of the free energy of graphene-supported transition metal atom catalysts, which realizes the quantitative submission and post-processing of the solvation and thermodynamic correction of graphene-supported transition metal atom catalysts, improves the calculation efficiency, and greatly saves time costs.
[0005] In order to achieve the above object, the technical solution of the present invention is implemented as follows: a method for batch calculating the free energy of graphene-loaded transition metal atom catalysts, the steps comprising: S1: Use the convergence module to make a convergence judgment on the structural optimization calculation results in the structural optimization folder; S2: Get the INCAR input files corresponding to the solvation and thermodynamic correction calculations; S3: Extract other input files required for solvation and thermodynamic correction calculations from the structure optimization folder using the file extraction module; S4: Place the INCAR input files corresponding to the solvation and thermodynamic correction calculations into each subfolder respectively; S5: Use the automatic submission module to loop through all subfolders in the corresponding directory and submit the input files for the solvation calculation and thermodynamic correction calculation; S6: Use the data extraction module to loop through all subfolders under the corresponding directory to extract the corresponding energy values, and perform data processing to obtain the free energy value.
[0006] The method for judging the convergence of the structural optimization calculation results in the structural optimization folder in step S1 is: The convergence module is equipped with VASP software. Enter the qvasp -e command in the VASP software to judge the convergence of the structure optimization results. If the calculation converges, output YES to proceed to the next step of solvation and thermodynamic correction calculation; otherwise, output NO; if it does not converge, check and modify it before continuing the structure optimization calculation.
[0007] The method for obtaining the INCAR input file corresponding to the solvation and thermodynamic correction calculation described in step S2 is: The implicit solvent model was used to calculate the solvation. In INCAR, NSW = 0 was set to perform single-point energy calculations, and the parameter LSOL = T was added to turn on the solvation calculation to approximately describe the solvation environment. Frequency calculation is performed when calculating thermodynamic correction. When performing frequency calculation, set IBRION=5 in INCAR to enable frequency calculation, so as to obtain vibration mode and frequency, and then obtain the vibration mode of the molecule for correction.
[0008] The file extraction module in step S3 includes Python library functions and methods; The Python library functions include: os.walk(), os.listdir(), os.path.join(), os.path.isdir(), os.path.exists(), os.makedirs(), shutil.copy(), shutil.move(), open(), re.search(), enumerate(), and subprocess.run(); Methods include: str.rstrip(), str.endswith(), file.readlines(), line.split(), file.writelines(), f-string, writer.writerow(), and split().
[0009] It is characterized in that the method of using the file extraction module in step S3 to extract other input files required for solvation and thermodynamic correction calculations from the structure optimization folder is: S31: Use the file extraction module to extract other input files required for solvation calculation from the structure optimization folder; S32: Using the file extraction module, extract other input files required for thermodynamic correction calculation from the structure optimization folder.
[0010] The method for extracting other input files required for solvation calculation from the structure optimization folder in step S31 is: Other input files required for solvation calculations include: POSCAR, POTCAR, KPOINTS, vasp.pbs and WAVECAR, among which the WAVECAR file is only used for solvation calculations; When extracting other input files required for solvation calculation from the structure optimization folder, by defining the parent directory and the target directory, use a for loop and the function (os.listdir(parent_dir)) to list the names of all files and subfolders in the parent directory, where parent_dir is the parameter variable passed to os.listdir(), representing the path of the parent folder; use the function os.path.join() to execute the command (dir_path=os.path.join(parent_dir, dir_name)) to combine the parent directory and subfolder name into a complete path and traverse all subfolders in the parent directory; use the function (os.path.isdir(dir_path)) to check whether the current path is a directory to ensure that only subfolders are processed, where dir_path is a variable name used to represent the directory path; use the function os.path.exists() and the function os.path.join() to execute the command (os.path.exists(os.path.join(dir_path,"CONTCAR"))) to check whether there is a file named CONTCAR in the subfolder. If it exists, proceed to the next step; use the built-in string method (new_dir_name=dir_name.rstrip(' / ') + "_s") to name the new subfolder and add the suffix _s, use the function os.makedirs() to execute the command os.makedirs(new_dir_path) to create a new folder; use the function (shutil.copy()) to copy the CONTCAR file in the subfolder to the new folder and rename it to POSCAR; Use a for loop to check whether there is a POTCAR file, KPOINTS file, vasp.pbs file, or WAVECAR file in the subfolder. If so, copy it to the new directory; use the os.listdir() function to execute the command (os.listdir(parent_dir)) to list all files and folders in the parent directory again, call the method (dir_name.endswith("_s")) to filter out all folders whose names end with "_s", and use the function (shutil.move()) to move these folders from the parent directory to the target directory.
[0011] The method of extracting other input files required for thermodynamic correction calculation from the structure optimization folder in step S32 is: Other input files required for thermodynamic correction calculations include: POSCAR, POTCAR, KPOINTS, and vasp.pbs; When extracting other input files required for thermodynamic correction calculation from the structure optimization folder, first, by defining the parent directory and the target directory, use a for loop and use the function os.listdir() to execute the command (os.listdir(parent_dir)) to list the names of all files and subfolders in the parent directory, and use the function os.path.join() to execute the command (dir_path=os.path.join(parent_dir, dir_name)) to combine the parent directory and subfolder names into a complete path, and traverse all subfolders in the parent directory; use the function os.path.isdir() to execute the command (os.path.isdir(dir_path)) to check whether the current path is a directory to ensure that only subfolders are processed, and use the functions os.path.exists() and os.path.join() to execute the command (os.path.exists(os.path.join(dir_path,"CONTCAR"))) to check whether there is a file named CONTCAR in the subfolder. If it exists, proceed to the next step; use the built-in string method (new_dir_name=dir_name.rstrip(' / ') + "_v") to name the new subfolder and add the suffix _v, where rstrip() is a Python string method used to remove specified characters at the end of a string; execute the command os.makedirs(new_dir_path) through the function os.makedirs() to create a new folder; use the function (shutil.copy()) to copy the CONTCAR file in the subfolder to the new folder and rename it to POSCAR; then the for loop checks whether there is a POTCAR file, KPOINTS file, or vasp.pbs file in the subfolder. If so, copy it to the new directory; use the function os.listdir() to execute the command (os.listdir(parent_dir)) to list all files and folders in the parent directory again, call the method (dir_name.endswith("_v")) to filter out all folders whose names end with "_v", and use the function (shutil.move()) to move these folders from the parent directory to the target directory; Fix some atoms in POSCAR; use the functions os.walk() and os.path.join() to traverse the target directory and find out whether there is a POSCAR file; use the function open() to execute the command open(file_path, 'r'), and use the method file.readlines() to open the POSCAR file in read-only mode, read all the lines in POSCAR, and store each line as a string; call the function (enumerate()) to check whether it contains "Selectivedynamics", if not, insert the "Selective dynamics" line; call the function (re.search()) to delete the lines with all zero coordinates; use the line.split() method to mark all coordinate lines, and the function (enumerate()) to traverse each coordinate line in the list, and add "FFF" to the atoms that need to be fixed, and add "TTT" to the right of other atomic coordinate lines; finally, use the function open() to execute the command (open(file_path, 'w')) to open the POSCAR file in writing mode, modify the corresponding content and save it, so as to fix some atoms in POSCAR and generate the POSCAR file required for thermodynamic correction.
[0012] The method for placing the INCAR input files corresponding to the solvation and thermodynamic correction calculations into each subfolder in step S4 is as follows: Put the INCAR files corresponding to the solvation and thermodynamic correction calculations into the Sol folder and the frequency folder respectively, and copy the INCAR files to each subfolder through a for loop, so as to obtain all the input files required for the solvation and thermodynamic correction calculations; The os.listdir() function is used to execute the command (os.listdir(parent_dir)) to list all files and folders under the parent directory, the os.path.isdir() function is used to execute the command (os.path.isdir(dir_path)) to ensure that the current path is a directory, and the shutil.copy() function is used to execute the command (shutil.copy(source_incar_file, dir_path)) to copy the INCAR file located in the parent directory to the current subfolder, so that the INCAR input files corresponding to the solvation and thermodynamic correction calculations are placed in each subfolder in the Sol folder and the frequency folder.
[0013] The method for submitting the input files for the solvation calculation and the thermodynamic correction calculation in step S5 is: The input files for solvation calculations include INCAR, POTCAR, POSCAR, KPOINTS, vasp.pbas script file, and WAVECAR; the input files for thermodynamic correction calculations include INCAR, POTCAR, POSCAR, KPOINTS, and vasp.pbas script file; The specific method of using the automatic submission module to loop through all subfolders under the corresponding directory is: The input files required for the solvation and thermodynamic correction calculations of the above-mentioned graphene-supported transition metal atom catalysts are uploaded to the corresponding directory of the computing server. The automatic submission module in the server uses a for loop to traverse all subfolders under the directory and check whether there are INCAR, KPOINTS, vasp.pbs, POSCAR, POTCAR and WAVECAR files required for submitting VASP jobs in each subfolder. If so, the input files are submitted.
[0014] The method for obtaining the free energy value in step S6 is: S61: For the solvation calculation, traverse the folder and subfolders, search for OUTCAR and OSZICAR files, check whether the calculation has converged, if the calculation has converged, extract the corresponding solvation energy value E0, and output the solvation energy value E0 of each subfolder to a CSV file for subsequent data sorting; Use the functions os.walk() and os.path.join() to traverse the directory and generate the file path, find the OUTCAR and OSZICAR files, and check whether the calculation has converged; the functions (open()), csv.writer(), and writer.writerow() are used to open the file and write the read solvation energy value E0 and convergence status into the CSV file; The specific method to check whether the calculation has converged is: run the command qvasp -e in vasp. If the output is YES, it has converged; if the output is No, it has not converged. S62: For thermodynamic correction calculation, traverse the folder and subfolders, execute the vaspkit command for each subfolder to extract the thermodynamic correction related value G(T), and output the G(T) value of each subfolder to a CSV file for subsequent data sorting; Use the functions os.listdir(), os.path.join(), os.path.isdir(), os.chdir(), and os.path.exists() to traverse directories and operate file paths; use the function (subprocess.run()) to execute the vaspkit command to obtain the corresponding output value; use the method (split()) to parse the output information of vaspkit_output.txt; use the function (open()) to open the file to read and write the corresponding thermodynamic correction value G(T); S63: Add the energy value E0 obtained by solvation calculation to the thermodynamic correction related value G(T), that is, the free energy G of each graphene-loaded transition metal atom catalyst.
[0015] The beneficial effects of the present invention are as follows: the present invention uses a convergence module to judge the structural optimization calculation, and performs subsequent analysis and processing on the converged catalyst; uses a file extraction module to obtain the input files required for the calculation, which solves the problem of slow speed and low efficiency of manual copying and renaming of input files, and effectively avoids manual repetitive operations; at the same time, uses an automatic submission module to realize automatic submission of calculation tasks, which solves the problems of low efficiency and high time cost of submitting tasks, and quantitatively extracting input files and submitting calculations significantly improves calculation efficiency and greatly saves time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 The figure is a flow chart of the method of the present invention.
[0018] Figure 2 Prepare the input files of each structure in batches for the solvation calculation and thermodynamic correction calculation for the example.
[0019] Figure 3 is the free energy value of the 7 catalysts listed in the examples. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] Example 1 like Figure 1 As shown, a method for batch calculating the free energy of graphene-supported transition metal atom catalysts comprises the following steps: S1: Use the convergence module to make a convergence judgment on the structural optimization calculation results in the structural optimization folder.
[0022] The convergence module is equipped with VASP software. Enter the qvasp -e command in the VASP software to judge the convergence of the structure optimization results. If the calculation converges, output YES to proceed to the next step of solvation and thermodynamic correction calculation; otherwise, output NO; if it does not converge, check and modify it before continuing the structure optimization calculation.
[0023] S2: Get the corresponding INCAR input file for solvation and thermodynamic correction calculations.
[0024] Prepare the corresponding INCAR file according to the calculation requirements of solvation and thermodynamic correction. When calculating solvation, the implicit solvent model is used. This implicit solvent model does not require the addition of explicit solvent molecules, but describes the solvent effect through the Polarizable Continuum Model (PCM) or the generalized Born model. Set NSW=0 in INCAR for single-point energy calculation, and add the parameter LSOL = T to turn on the solvation calculation to approximately describe the solvation environment. When calculating thermodynamic correction, frequency calculation is required to obtain the vibration mode of the molecule for correction. When performing frequency calculation, set IBRION=5 in INCAR to enable frequency calculation to obtain vibration mode and frequency.
[0025] S3: Extract other input files required for solvation and thermodynamic correction calculations from the structure optimization folder using the file extraction module.
[0026] The file extraction module includes multiple Python library functions and methods.
[0027] The Python library functions specifically include: os.walk() function: used to generate file names in a directory tree; os.listdir(): used to list all file and folder names in a specified directory; os.path.join(): used to combine one or more path parts together to generate a complete path; os.path.isdir(): used to determine whether the specified path is a directory; os.path.exists(): used to check whether the specified path exists; os.makedirs(): used to recursively create directories; shutil.copy(): used to copy files to a specified target path; shutil.move(): used to move files or folders to a new target path; open(): used to open a file and return a file object; re.search(): used to search for matching regular expressions in a string; enumerate(): used to get the index and value of elements while traversing a list or other iterable objects; subprocess.run(): used to execute command line commands and get their output, or wait for command execution to complete.
[0028] Methods include: str.rstrip(): used to remove characters from the end of a string; str.endswith(): used to check whether a string ends with a specified suffix; file.readlines(): used to read all lines of a file and return them as a list; line.split(): used to split a string into a list using whitespace characters (or a specified delimiter); file.writelines(): used to write a series of strings to a file, each string as a line of the file; f-string: used to generate a formatted string; csv.writer(): used to create a "writer object"; writer.writerow(): used to write a single line of data to a CSV file; split(): used to split a string into a list according to the specified delimiter.
[0029] The file extraction module can be used to directly extract the KPOINTS, POTCAR, CONTCAR, vasp.pbs script files and WAVECAR files required for solvation calculations; the KPOINTS, POTCAR, CONTCAR, vasp.pbs script files required for thermodynamic correction calculations can be extracted. There is no need to prepare other input files required for solvation and thermodynamic correction by yourself, and batch extraction can be achieved, which greatly improves the calculation speed and accuracy.
[0030] S31: Use the file extraction module to extract other input files required for the solvation calculation from the structure optimization folder.
[0031] Among them, other input files required for solvation calculation include: POSCAR, POTCAR, KPOINTS, vasp.pbs and WAVECAR, among which the WAVECAR file is only used for solvation calculation.
[0032] Specifically, when extracting other input files required for solvation calculation from the structure optimization folder, by defining the parent directory and the target directory, use a for loop and function (os.listdir(parent_dir)) to list the names of all files and subfolders in the parent directory, where parent_dir is the parameter variable passed to os.listdir(), indicating the path of the parent folder. Use the function os.path.join() to execute the command (dir_path=os.path.join(parent_dir,dir_name)) to combine the parent directory and subfolder name into a complete path, and traverse all subfolders in the parent directory; use the function (os.path.isdir(dir_path)) to check whether the current path is a directory to ensure that only subfolders are processed, where dir_path is a variable name used to indicate the directory path. Use the functions os.path.exists() and os.path.join() to execute the command (os.path.exists(os.path.join(dir_path,"CONTCAR")) to check whether there is a file named CONTCAR in the subfolder. If it exists, proceed to the next step; name the new subfolder and add the suffix _s through the built-in string method (new_dir_name=dir_name.rstrip(' / ') + "_s"), and use the function os.makedirs() to execute the command os.makedirs(new_dir_path) to create a new folder; use the function (shutil.copy()) to copy the CONTCAR file in the subfolder to the new folder and rename it POSCAR. Subsequently, a for loop is used to check whether there is a POTCAR file, a KPOINTS file, a vasp.pbs file, or a WAVECAR file in the subfolder. If so, it is copied to the new directory. The os.listdir() function is used to execute the command (os.listdir(parent_dir)) to list all files and folders in the parent directory again, and the method (dir_name.endswith("_s")) is called to filter out all folders whose names end with "_s", and the function (shutil.move()) is used to move these folders from the parent directory to the target directory.
[0033] S32: Using the file extraction module, extract other input files required for thermodynamic correction calculation from the structure optimization folder.
[0034] Among them, other input files required for thermodynamic correction calculation include: POSCAR, POTCAR, KPOINTS and vasp.pbs. Other input files required for thermodynamic correction calculation and other input files required for solvation calculation are located in two separate folders. POSCAR, POTCAR, KPOINTS and vasp.pbs need to be extracted again.
[0035] Specifically, when extracting other input files required for thermodynamic correction calculation from the structure optimization folder, first, by defining the parent directory and the target directory, use a for loop and use the function os.listdir() to execute the command (os.listdir(parent_dir)) to list the names of all files and subfolders in the parent directory, and use the function os.path.join() to execute the command (dir_path=os.path.join(parent_dir, dir_name)) to combine the parent directory and subfolder names into a complete path, and traverse all subfolders in the parent directory; use the function os.path.isdir() to execute the command (os.path.isdir(dir_path)) to check whether the current path is a directory to ensure that only subfolders are processed, and use the functions os.path.exists() and os.path.join() to execute the command (os.path.exists(os.path.join(dir_path,"CONTCAR"))) to check whether there is a file named CONTCAR in the subfolder. If it exists, proceed to the next step; use the built-in string method (new_dir_name=dir_name.rstrip(' / ') + "_v") to name the new subfolder and add the suffix _v, where rstrip() is a Python string method that is used to remove the specified characters at the end of the string. Use the function os.makedirs() to execute the command os.makedirs(new_dir_path) to create a new folder; use the function (shutil.copy()) to copy the CONTCAR file in the subfolder to the new folder and rename it to POSCAR; then the for loop checks whether there is a POTCAR file, KPOINTS file, or vasp.pbs file in the subfolder. If so, copy it to the new directory; use the function os.listdir() to execute the command (os.listdir(parent_dir)) to list all files and folders in the parent directory again, call the method (dir_name.endswith("_v")) to filter out all folders whose names end with "_v", and use the function (shutil.move()) to move these folders from the parent directory to the target directory.
[0036] Different from solvation calculations, thermodynamic correction calculations require fixing some atoms in POSCAR, so an extra fixing step is required. Specifically, the functions (os.walk() and os.path.join()) are used to traverse the target directory and find out whether there is a POSCAR file; the function open() is used to execute the command open(file_path, 'r'), and the method file.readlines() is used to open the POSCAR file in read-only mode, read all the lines in POSCAR, and store each line as a string; the function (enumerate()) is called to check whether it contains "Selective dynamics", and if not, the "Selective dynamics" line is inserted; the function (re.search()) is called to delete the lines with all coordinates of 0; the line.split() method is used to mark all the coordinate lines, and the function (enumerate()) traverses each coordinate line in the list, and adds "FFF" to the atoms that need to be fixed, and adds "TTT" to the right of the coordinate lines of other atoms; finally, the function open() is used to execute the command (open(file_path, 'w')) to open the POSCAR file in writing mode, modify the corresponding content and save it, so as to fix some atoms in POSCAR and generate the POSCAR file required for thermodynamic correction.
[0037] S4: Place the INCAR input files corresponding to the solvation and thermodynamic correction calculations into each subfolder, respectively.
[0038] The specific method to place the INCAR input files corresponding to the solvation and thermodynamic correction calculations into each subfolder is as follows: Put the INCAR files corresponding to the solvation and thermodynamic correction calculations into the Sol folder and the frequency folder respectively. Use the for loop to copy the INCAR files to each subfolder, thereby obtaining all the input files required for the solvation and thermodynamic correction calculations.
[0039] Specifically, the os.listdir() function is used to execute the command (os.listdir(parent_dir)) to list all files and folders under the parent directory, the os.path.isdir() function is used to execute the command (os.path.isdir(dir_path)) to ensure that the current path is a directory, and the shutil.copy() function is used to execute the command (shutil.copy(source_incar_file, dir_path)) to copy the INCAR file located in the parent directory to the current subfolder, so as to place the INCAR input files corresponding to the solvation and thermodynamic correction calculations into each subfolder in the Sol folder and the frequency folder.
[0040] S5: Use the automatic submission module to loop through all subfolders under the corresponding directory and submit the input files for solvation calculation and thermodynamic correction calculation.
[0041] Among them, the input files for solvation calculation include INCAR, POTCAR, POSCAR, KPOINTS, vasp.pbas script file and WAVECAR; the input files for thermodynamic correction calculation include INCAR, POTCAR, POSCAR, KPOINTS and vasp.pbas script file.
[0042] The specific method of using the automatic submission module to loop through all subfolders under the corresponding directory is: The input files required for the solvation and thermodynamic correction calculations of the above-mentioned graphene-supported transition metal atom catalysts are uploaded to the corresponding directory of the computing server. The automatic submission module in the server uses a for loop to traverse all subfolders under the directory and check whether there are input files required to submit the VASP job (INCAR, KPOINTS, vasp.pbs, POSCAR, POTCAR and WAVECAR (only required for solvation calculations)) in each subfolder. If so, the input files are submitted.
[0043] S6: Use the data extraction module to loop through all subfolders under the corresponding directory to extract the corresponding energy values, and perform data processing to obtain the free energy value.
[0044] The specific method of using the data extraction module to loop through all subfolders in the corresponding directory to extract the corresponding energy values and perform corresponding data processing to obtain the free energy value is as follows: S61: For solvation calculations, traverse the folder and subfolders, search for OUTCAR and OSZICAR files, check whether the calculations have converged, and if so, extract the corresponding solvation energy value E0, and output the solvation energy value E0 of each subfolder to a CSV file for subsequent data collation.
[0045] Use functions (os.walk() and os.path.join()) to traverse the directory and generate file paths, find OUTCAR and OSZICAR files, and check whether the calculation has converged; functions (open()), csv.writer(), and writer.writerow() are used to open the file and write the read solvation energy value E0 and convergence status into the CSV file.
[0046] The specific method to check whether the calculation has converged is: run the command qvasp -e in vasp. If it outputs YES, it has converged; if it outputs No, it has not converged.
[0047] S62: For thermodynamic correction calculation, traverse the folder and subfolders, execute the vaspkit command for each subfolder to extract the thermodynamic correction related value G(T), and output the G(T) value of each subfolder to a CSV file for subsequent data sorting.
[0048] Use functions (os.listdir(), os.path.join(), os.path.isdir(), os.chdir(), and os.path.exists()) to traverse directories and operate file paths; use function (subprocess.run()) to execute vaspkit commands to obtain corresponding output values; use method (split()) to parse the output information of vaspkit_output.txt; use function (open()) to open the file to read and write the corresponding thermodynamic correction value G(T).
[0049] S63: Add the energy value E0 obtained by solvation calculation to the thermodynamic correction related value G(T), that is, the free energy G of each graphene-loaded transition metal atom catalyst.
[0050] Example 2 A method for batch calculating the free energy of graphene-loaded transition metal atom catalysts. The following is a detailed description of an embodiment of the method disclosed in the present application for batch calculating the free energy of graphene-loaded transition metal atom catalysts.
[0051] This example takes the batch calculation of the free energy of graphene-supported transition metal atom catalysts as an example. The steps are as follows: For files that use the Vienna Ab-initio Simulation Package (VASP) for structural optimization calculations, convergence judgment is performed using the command qvasp-e. If the output is YES, the next step of solvation and thermodynamic correction calculation is performed.
[0052] Graphene-supported bimetallic atom catalyst Ag-Ag- x N( x =0-6) takes the adsorption of intermediate species OOH* as an example. After the structure optimization converges, subsequent solvation and thermodynamic correction calculations are performed to obtain the corresponding free energy value of the catalyst. First, prepare the INCAR files required for the solvation and thermodynamic correction calculations, and use the file extraction module to extract the POSCAR, POTCAR, KPOINTS, vasp.pbs and WAVECAR files required for the solvation calculation into the solvation calculation folder Sol; use the file extraction module to extract the POSCAR, POTCAR, KPOINTS and vasp.pbs files required for the thermodynamic correction calculation into the thermodynamic correction calculation folder frequency; and place the INCAR files required for the calculation in each subfolder of the solvation and thermodynamic correction calculation, so as to realize the batch preparation of the input files corresponding to each structure, and upload the above-mentioned Sol folder and frequency folder to the server, such as Figure 2 As shown. Then upload the automatic submission module to the same folder on the server and grant executable permissions (chmod+x automatic submission module name) to achieve batch solvation and thermodynamic correction calculation tasks. After the calculation is completed, use the data extraction module to loop through all subfolders under the Sol folder to extract the corresponding energy value E0 and all subfolders under the frequency folder to extract the corresponding thermodynamic correction value G(T). Add the E0 value and G(T) value of each catalyst to get the free energy value G. Figure 3 Graphene-supported bimetallic atom catalyst Ag-Ag- x N( x =0-6) of free energy value.
[0053] The other structures and principles are the same as those in Example 1.
[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for batch calculation of free energy of graphene-supported transition metal atom catalysts, characterized in that the steps include: S1: Use the convergence module to make a convergence judgment on the structural optimization calculation results in the structural optimization folder; S2: Get the INCAR input files corresponding to the solvation and thermodynamic correction calculations; S3: Extract other input files required for solvation and thermodynamic correction calculations from the structure optimization folder using the file extraction module; S4: Place the INCAR input files corresponding to the solvation and thermodynamic correction calculations into each subfolder respectively; S5: Use the automatic submission module to loop through all subfolders in the corresponding directory and submit the input files for the solvation calculation and thermodynamic correction calculation; S6: Use the data extraction module to loop through all subfolders under the corresponding directory to extract the corresponding energy values, and perform data processing to obtain the free energy value.
2. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to claim 1, characterized in that: The method for judging the convergence of the structural optimization calculation results in the structural optimization folder in step S1 is: The convergence module is equipped with VASP software. Enter the qvasp -e command in the VASP software to judge the convergence of the structure optimization results. If the calculation converges, it will output YES to proceed to the next step of solvation and thermodynamic correction calculation; otherwise, it will output NO. If convergence has not occurred, check and modify before continuing with the structural optimization calculation.
3. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to claim 2, characterized in that: The method for obtaining the INCAR input file corresponding to the solvation and thermodynamic correction calculation described in step S2 is: The implicit solvent model was used to calculate the solvation. In INCAR, NSW = 0 was set to perform single-point energy calculations, and the parameter LSOL = T was added to turn on the solvation calculation to approximately describe the solvation environment. Frequency calculation is performed when calculating thermodynamic correction. When performing frequency calculation, set IBRION=5 in INCAR to enable frequency calculation, so as to obtain vibration mode and frequency, and then obtain the vibration mode of the molecule for correction.
4. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to claim 3, characterized in that: The file extraction module in step S3 includes Python library functions and methods; The Python library functions include: os.walk(), os.listdir(), os.path.join(), os.path.isdir(), os.path.exists(), os.makedirs(), shutil.copy(), shutil.move(), open(), re.search(), enumerate(), and subprocess.run(); Methods include: str.rstrip(), str.endswith(), file.readlines(), line.split(), file.writelines(), f-string, writer.writerow(), and split().
5. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to any one of claims 2 to 4, characterized in that: The method of using the file extraction module in step S3 to extract other input files required for solvation and thermodynamic correction calculations from the structure optimization folder is: S31: Use the file extraction module to extract other input files required for solvation calculation from the structure optimization folder; S32: Using the file extraction module, extract other input files required for thermodynamic correction calculation from the structure optimization folder.
6. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to claim 5, characterized in that: The method for extracting other input files required for solvation calculation from the structure optimization folder in step S31 is: Other input files required for solvation calculations include: POSCAR, POTCAR, KPOINTS, vasp.pbs and WAVECAR, among which the WAVECAR file is only used for solvation calculations; When extracting other input files required for solvation calculation from the structure optimization folder, by defining the parent directory and the target directory, use a for loop and the function (os.listdir(parent_dir)) to list the names of all files and subfolders in the parent directory, where parent_dir is the parameter variable passed to os.listdir(), representing the path of the parent folder; use the function os.path.join() to execute the command (dir_path=os.path.join(parent_dir, dir_name)) to combine the parent directory and subfolder name into a complete path and traverse all subfolders in the parent directory; use the function (os.path.isdir(dir_path)) to check whether the current path is a directory to ensure that only subfolders are processed, where dir_path is a variable name used to represent the directory path; use the function os.path.exists() and the function os.path.join() to execute the command (os.path.exists(os.path.join(dir_path,"CONTCAR"))) to check whether there is a file named CONTCAR in the subfolder. If it exists, proceed to the next step; use the built-in string method (new_dir_name=dir_name.rstrip(' / ') + "_s") to name the new subfolder and add the suffix _s, use the function os.makedirs() to execute the command os.makedirs(new_dir_path) to create a new folder; use the function (shutil.copy()) to copy the CONTCAR file in the subfolder to the new folder and rename it to POSCAR; Use a for loop to check whether there is a POTCAR file, KPOINTS file, vasp.pbs file, or WAVECAR file in the subfolder. If so, copy it to the new directory. Use the os.listdir() function to execute the command (os.listdir(parent_dir)) to list all files and folders in the parent directory again. Call the method (dir_name.endswith("_s")) to filter out all folders whose names end with "_s", and use the function (shutil.move()) to move these folders from the parent directory to the target directory.
7. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to claim 6, characterized in that: The method of extracting other input files required for thermodynamic correction calculation from the structure optimization folder in step S32 is: Other input files required for thermodynamic correction calculations include: POSCAR, POTCAR, KPOINTS, and vasp.pbs; When extracting other input files required for thermodynamic correction calculation from the structure optimization folder, first, by defining the parent directory and the target directory, use a for loop and use the function os.listdir() to execute the command (os.listdir(parent_dir)) to list the names of all files and subfolders in the parent directory, and use the function os.path.join() to execute the command (dir_path=os.path.join(parent_dir, dir_name)) to combine the parent directory and subfolder names into a complete path, and traverse all subfolders in the parent directory; use the function os.path.isdir() to execute the command (os.path.isdir(dir_path)) to check whether the current path is a directory to ensure that only subfolders are processed, and use the functions os.path.exists() and os.path.join() to execute the command (os.path.exists(os.path.join(dir_path,"CONTCAR"))) to check whether there is a file named CONTCAR in the subfolder. If it exists, proceed to the next step; use the built-in string method (new_dir_name=dir_name.rstrip(' / ') + "_v") to name the new subfolder and add the suffix _v, where rstrip() is a Python string method used to remove specified characters at the end of a string; execute the command os.makedirs(new_dir_path) through the function os.makedirs() to create a new folder; use the function (shutil.copy()) to copy the CONTCAR file in the subfolder to the new folder and rename it to POSCAR; then the for loop checks whether there is a POTCAR file, KPOINTS file, or vasp.pbs file in the subfolder, and if so, copy it to the new directory; use the function os.listdir() to execute the command (os.listdir(parent_dir)) to list all files and folders in the parent directory again, call the method (dir_name.endswith("_v")) to filter out all folders whose names end with "_v", and use the function (shutil.move()) to move these folders from the parent directory to the target directory; Fix some atoms in POSCAR; use the functions os.walk() and os.path.join() to traverse the target directory and find out whether there is a POSCAR file; use the function open() to execute the command open(file_path, 'r'), and use the method file.readlines() to open the POSCAR file in read-only mode, read all the lines in POSCAR, and store each line as a string; call the function (enumerate()) to check whether it contains "Selectivedynamics", if not, insert the "Selective dynamics" line; call the function (re.search()) to delete the lines with all zero coordinates; use the line.split() method to mark all coordinate lines, and the function (enumerate()) to traverse each coordinate line in the list, and add "FFF" to the atoms that need to be fixed, and add "TTT" to the right of other atomic coordinate lines; finally, use the function open() to execute the command (open(file_path, 'w')) to open the POSCAR file in writing mode, modify the corresponding content and save it, so as to fix some atoms in POSCAR and generate the POSCAR file required for thermodynamic correction.
8. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to claim 7, characterized in that: The method for placing the INCAR input files corresponding to the solvation and thermodynamic correction calculations into each subfolder in step S4 is as follows: Put the INCAR files corresponding to the solvation and thermodynamic correction calculations into the Sol folder and the frequency folder respectively, and copy the INCAR files to each subfolder through a for loop, so as to obtain all the input files required for the solvation and thermodynamic correction calculations; The os.listdir() function is used to execute the command (os.listdir(parent_dir)) to list all files and folders under the parent directory, the os.path.isdir() function is used to execute the command (os.path.isdir(dir_path)) to ensure that the current path is a directory, and the shutil.copy() function is used to execute the command (shutil.copy(source_incar_file, dir_path)) to copy the INCAR file located in the parent directory to the current subfolder, so that the INCAR input files corresponding to the solvation and thermodynamic correction calculations are placed in each subfolder in the Sol folder and the frequency folder.
9. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to claim 8, characterized in that: The method for submitting the input files for the solvation calculation and the thermodynamic correction calculation in step S5 is: The input files for solvation calculations include INCAR, POTCAR, POSCAR, KPOINTS, vasp.pbas script file, and WAVECAR; the input files for thermodynamic correction calculations include INCAR, POTCAR, POSCAR, KPOINTS, and vasp.pbas script file; The specific method of using the automatic submission module to loop through all subfolders under the corresponding directory is: The input files required for the solvation and thermodynamic correction calculations of the above-mentioned graphene-supported transition metal atom catalysts are uploaded to the corresponding directory of the computing server. The automatic submission module in the server uses a for loop to traverse all subfolders under the directory and check whether there are INCAR, KPOINTS, vasp.pbs, POSCAR, POTCAR and WAVECAR files required for submitting VASP jobs in each subfolder. If so, the input files are submitted.
10. The method for batch calculating the free energy of graphene-supported transition metal atom catalysts according to claim 8 or 9, characterized in that: The method for obtaining the free energy value in step S6 is: S61: For the solvation calculation, traverse the folder and subfolders, search for OUTCAR and OSZICAR files, check whether the calculation has converged, if the calculation has converged, extract the corresponding solvation energy value E0, and output the solvation energy value E0 of each subfolder to a CSV file for subsequent data sorting; Use the functions os.walk() and os.path.join() to traverse the directory and generate the file path, find the OUTCAR and OSZICAR files, and check whether the calculation has converged; the functions (open()), csv.writer(), and writer.writerow() are used to open the file and write the read solvation energy value E0 and convergence status into the CSV file; The specific method to check whether the calculation has converged is: run the command qvasp -e in vasp. If the output is YES, it has converged; if the output is No, it has not converged. S62: For thermodynamic correction calculation, traverse the folder and subfolders, execute the vaspkit command for each subfolder to extract the thermodynamic correction related value G(T), and output the G(T) value of each subfolder to a CSV file for subsequent data sorting; Use the functions os.listdir(), os.path.join(), os.path.isdir(), os.chdir(), and os.path.exists() to traverse directories and operate file paths; use the function (subprocess.run()) to execute the vaspkit command to obtain the corresponding output value; use the method (split()) to parse the output information of vaspkit_output.txt; use the function (open()) to open the file to read and write the corresponding thermodynamic correction value G(T); S63: Add the energy value E0 obtained by solvation calculation to the thermodynamic correction related value G(T), that is, the free energy G of each graphene-loaded transition metal atom catalyst.
Citation Information
Patent Citations
Free energy perturbation calculation scheduling method used in heterogeneous cluster environment
CN111341391A