This tutorial will guide you through the process of running a geometry optimization calculation for a Mg-MOF-74 structure using VASP software. VASP v6.4.3 is pre-installed on CCR and the folder is located in /projects/academic/kaihangs/share/software/vasp
including the licensed pseudo potential files. Let’s get started!
Geometry optimization is a computational method used to find the most energetically stable configuration of atoms in a molecular or crystalline system. Here's a brief overview:
In this tutorial, we are going to relax the Mg-MOF-74 structure from the QMOF database. The initial structure will go through a full geometry optimization (i.e., relaxing positions, cell shape, and cell volume) using VASP, with structures relaxed until the interionic forces were less than 0.01 eV/Å. The calculation will be performed using the rev-vdw-DF2 functionals. Plane-wave basis set with energy cutoff of 520 eV will be used.
First copy the example files to your own CCR folder. For example, under your CCR project space, e.g., /projects/academic/kaihangs/kaihangs
, create a test folder and copy the files:
# create a folder with name "vasp_test" if you haven't done so
# this folder should exist if you have done the single-point DFT tutorial
mkdir vasp_test
cd vasp_test
cp -r /projects/academic/kaihangs/share/software/vasp/example/Geometry_optimization .
cd Geometry_optimization
Inside the folder, there are:
INCAR
(input parameters for the geometry optimization run)POSCAR
(initial structure of Mg-MOF-74)KPOINTS
(k-points used in the calculation)run_vasp.job
(slurm job script file)vdw_kernel.bindat
(proprietary pre-calculated vdw kernels)You can visualize the initial structure, i.e., POSCAR
file, using OVITO software by simply dragging the file into the OVITO window:
We are still missing POTCAR
file which is the pseudopotentials for the atoms. This file is proprietary. We have purchased the license, and you can create this file by concatenating pseudopotential files for each involving elements. For instance, in the header of the POSCAR
file, it says Mg H C O
, so we need to add ALL pseudopotential files to POTCAR
file match the exact same sequence as Mg H C O
. All pseudopotential files are available in /projects/academic/kaihangs/share/software/vasp
. In this case, we will use PBE functionals.
cd /projects/academic/kaihangs/share/software/vasp/potpaw_PBE.64/
cat Mg/POTCAR H/POTCAR C/POTCAR O/POTCAR > your_project_space/Geometry_optimization/POTCAR
The above command will create a POTCAR
file in your folder with the exact same sequence as Mg H C O
. Feel free to double-check POTCAR
file to ensure all pseudopotential information is included. When you publish your paper with VASP simulation input files, you can ONLY publish INCAR
, POSCAR
and KPOINTS
files. Both vdw_kernel
and POTCAR
files are proprietary.
With all files ready, you can go back to the Geometry_optimization
folder in your project space and submit the VASP job through
sbatch run_vasp.job
You can check the job status:
squeue -M all -u **your_CCR_username**
<aside>
⚠️ To cancel your job before it finishes, use command scancel -M all <jobid>
This is because Slurm commands default to the UB-HPC cluster. You have to specify the faculty cluster (use either the -M faculty
or --clusters=faculty
option) or all clusters (use -M all
). Source: CCR website.
</aside>
The geometry optimization calculation will take a while to finish. Once it finishes, all output data will be in OUTCAR
file. Scrolling down to the end of the OUTCAR
file, you will find the zero-temperature energy of the final geometry optimized Mg-MOF-74 system:
FREE ENERGIE OF THE ION-ELECTRON SYSTEM (eV)
---------------------------------------------------
free energy TOTEN = -336.21814048 eV
energy without entropy= -336.21814048 energy(sigma->0) = -336.21814048
d Force = 0.6838110E-04[ 0.484E-04, 0.883E-04] d Energy = 0.6543235E-04 0.295E-05
d Force = 0.5098288E+00[ 0.510E+00, 0.510E+00] d Ewald =-0.1399724E+01 0.191E+01
--------------------------------------------------------------------------------------------------------
POTLOK: cpu time 2.1574: real time 2.1601
From the output, the final system energy at zero temperature is -336.21814 eV
. You can also go to the beginning of the OUTCAR
file and check the initial energy of the system at Iteration 1:
--------------------------------------- Iteration 1( 1) ---------------------------------------
vdW kernel read from vdw_kernel.bindat
0.0000 0.2424 0.5071 0.7962 1.1119 1.4567 1.8333 2.2446 2.6937 3.1842
3.7199 4.3049 4.9438 5.6415 6.4036 7.2358 8.1446 9.1372 10.2212 11.4050
12.6979 14.1099 15.6519 17.3360 19.1751 21.1837 23.3773 25.7729 28.3892 31.2465
34.3669 37.7748 41.4965 45.5611 50.0000
POTLOK: cpu time 2.1984: real time 2.2153
SETDIJ: cpu time 0.1162: real time 0.1211
EDDAV: cpu time 4.0777: real time 4.1624
DOS: cpu time 0.0010: real time 0.0036
--------------------------------------------
LOOP: cpu time 6.3933: real time 6.5025
eigenvalue-minimisations : 2336
total energy-change (2. order) : 0.2023911E+04 (-0.9524293E+04)
number of electron 222.0000000 magnetization
augmentation part 222.0000000 magnetization
Free energy of the ion-electron system (eV)
---------------------------------------------------
alpha Z PSCENC = 173.86057146
Ewald energy TEWEN = 9938.12650556
-Hartree energ DENC = -19685.84033356
-exchange EXHF = 0.00000000
-V(xc)+E(xc) XCENC = 534.93731830
PAW double counting = 9263.23378033 -8981.80695101
entropy T*S EENTRO = -0.01264636
eigenvalues EBANDS = -800.59211885
atomic energy EATOM = 11582.00494921
Solvation Ediel_sol = 0.00000000
---------------------------------------------------
free energy TOTEN = 2023.91107506 eV
energy without entropy = 2023.92372143 energy(sigma->0) = 2023.91739825
--------------------------------------------------------------------------------------------------------
The energy of the initial structure is very high at 2023.911 eV
and the geometry optimization calculation brings the structure to its optimized state with optimized system energy at -336.21814 eV
.
In addition to the energy, you can also compare the geometry of the initial structure (in POSCAR
) and the optimized structure (in CONTCAR
). For the initial structure, the unit cell size matrix is (at the beginning of the POSCAR
file):
6.8893573999999997 0.0000000000000000 0.0000000000000000
-2.2971884941708183 15.0573150058231722 0.0000000000000000
-2.2981913480608416 -7.5300531800166368 13.0399668583215096
While for the optimized structure, we can see the slight change of the cell size to its energetically optimized state (at the beginning of the CONTCAR
file):
6.8740188159629696 0.0002019915767303 0.0006839505157405
-2.2916329674452682 15.0410255444379555 -0.0001477640595996
-2.2920017645951369 -7.5219386555107013 13.0251531111067784
The change of cell size is small after optimization that’s because the initial structure was taken from the QMOF database where all MOF structures were already pre-equilibrated using PBE functionals.
Congratulations and that’s the end of the tutorial! 👏🏼