ICME-QM

From EVOCD
Jump to: navigation, search

< Homework 1

Contents

License

By using the codes provided here you accept the the Mississippi State University's license agreement. Please read the agreement carefully before usage.

Overview

To computationally investigate the stable crystal structure for aluminum, it is necessary to investigate how energy of a aluminum in a particular crystal structure changes with respect to volume. It is interesting to compare the energy vs. volume curves (E-V curves) for a number of different structures. The objectives of the exercise are as follows.

  • Main objective is to plot E-V curves for aluminum in bcc, fcc, hcp and diamond structures using Density Functional Theory (DFT) calculations. VASP software package will be used to do DFT calculations.
  • Investigate how changing the XC-functional, k-point grid, smearing technique, energy cutoff changes the results.

Each group plot E-V curves using one of the XC-functionals (LDA, GGA-PW91 and GGA-PBEsol) of the respective crystal structure. To fit curves the Evfit code is used.

Input Decks

To run a DFT calculation in VASP four input files are required.

  • POSCAR - contains position information of crystal structure.
  • INCAR - contains input parameters for VASP.
  • KPOINTS - specifies how the k-space is sampled.
  • POTCAR - contains the psedopotential for the specific element and specifies the XC-functional.

All these files are text files and should be prepared in a LINUX environment.

POSCAR

To plot E-V curve positions of the atoms at different volumes of the crystal structure are needed. The following shell scripts will generate POSCAR files at different volumes and run DFT calculations at each volume. They will also collect information such as energy and volume from the output files OUTCAR and OSZICAR. Finally they will fit the E-V curve to Murnaghan's equation of state and find out the equilibrium volume/lattice constant, energy and bulk modulus.

What the runscripts do:

  • Constructs POSCAR files in a range of lattice parameters. You can change this range and the intervals by changing the following line in the script.
     for a in `seq -w 3.5 0.1 4.5` 
    The initial value is 3.5, final value is 4.5 and the interval is 0.1
  • Executes VASP
  • Extracts energy, volume and cpu time for calculations
  • Prepares data files to plot E-V curves.
  • Fits the E-V data to Murnaghan's equation of state and extracts equilibrium volume/lattice parameter, bulk modulus and equilibrium energy to a SUMMARY file.

Instructions to run the runscripts:

  1. Copy the script to a directory of your choice and do
     chmod u+x <name of script>  
  2. Copy INCAR, KPOINTS, and POTCAR files in to the same directory.
  3. Modify the script with the no. of processors and the path of the VASP executable.
  4. Run the script. To submit to Raptor, copy the text below into your directory with the appropriate changes in the <...> areas. Also, the pbs script below calls 1 node for the calculations. This may be increased, however, care should be taken to ensure that increasing the number of processors doesn't negatively affect computational time
    #PBS -N <name of output files>
    #PBS -l nodes=1:ppn=4 
    #PBS -l walltime=48:00:00
    #PBS -q q64p48h@raptor
    #PBS -mea
    #PBS -r n
    #PBS -V
    cd $PBS_O_WORKDIR
    ./<name of script>
    To then submit to Raptor, type
    qsub <name of pbs script that you just saved>
  5. Graph EvsV file using xmgrace to plot the curve.
  6. If you do not get a minimum (parabolic curve) modify the range of the lattice parameter in the script

FCC runscript

#!/bin/sh

rm EvsA EvsV evfit.4 grace SUMMARY

totT=0

for a in `seq -w 3.5 0.1 4.5`   # range of lattice parameter
do
echo "a= $a" 

cat >POSCAR <<!
Al FCC
1.0
$a  0.00  0.00                  # 
0.00   $a 0.00
0.00   0.00  $a
4
Direct
0.00000000 0.00000000 0.0000000
0.50000000 0.00000000 0.5000000
0.50000000 0.50000000 0.0000000
0.00000000 0.50000000 0.5000000
!

mpirun -np <no. of processors> <path of VASP executable>

V=`grep volume/ion OUTCAR|awk '{print $5}'`
E=`tail -n1 OSZICAR | awk '{ print $5/4}'`
T=`grep 'CPU time' OUTCAR |awk '{print $6}'`
totT=`echo $totT $T|awk '{print $1+$2}'`
echo $a $T >> TvsA
echo $a $E >> EvsA
echo $V $E >> EvsV
./cleanvaspfiles

done

cat <<! | evfit
FCC
4
EvsA
evfit.4
!

Emin=`grep Emin evfit.4|awk '{print $2}'`
A0=`grep A0 evfit.4|awk '{print $2}'`
K0=`grep A0 evfit.4|awk '{print $4}'`

tail +5 evfit.4|awk '{print $1,"\t", $2,"\t", $3}' > grace

echo "Data for Al in FCC" >> SUMMARY
echo "=================================================" >> SUMMARY
echo "Equilibrium Energy per Atom    = $Emin">>SUMMARY
echo "Equilibrium lattice constant   = $A0">>SUMMARY
echo "Bulk Modulus                   = $K0">>SUMMARY
echo "Total CPU time (sec)           = $totT">>SUMMARY

BCC runscript

#!/bin/sh

rm EvsA EvsV evfit.4 grace SUMMARY

totT=0

for a in `seq -w 3.5 0.1 4.5`
do
echo "a= $a"

cat >POSCAR <<!
Al BCC
1.0
$a  0.00  0.00
0.00   $a 0.00
0.00   0.00  $a
2
Direct
0.35 0.35 0.35
0.85 0.85 0.85
!

mpirun -np <no. of processors> <path of VASP executable>

V=`grep volume/ion OUTCAR|awk '{print $5}'`
E=`tail -n1 OSZICAR | awk '{ print $5/2}'`
T=`grep 'CPU time' OUTCAR |awk '{print $6}'`
totT=`echo $totT $T|awk '{print $1+$2}'`
echo $a $T >> TvsA
echo $a $E >> EvsA
echo $V $E >> EvsV

./cleanvaspfiles

done

cat <<! | evfit
BCC
4
EvsA
evfit.4
!

Emin=`grep Emin evfit.4|awk '{print $2}'`
A0=`grep A0 evfit.4|awk '{print $2}'`
K0=`grep A0 evfit.4|awk '{print $4}'`

tail +5 evfit.4|awk '{print $1,"\t", $2,"\t", $3}' > grace

echo "Data for Al in BCC" >> SUMMARY
echo "=================================================" >> SUMMARY
echo "Equilibrium Energy per Atom    = $Emin">>SUMMARY
echo "Equilibrium lattice constant   = $A0">>SUMMARY
echo "Bulk Modulus                   = $K0">>SUMMARY
echo "Total CPU time (sec)           = $totT">>SUMMARY

HCP runscript

#!/bin/sh

totT=0

rm EvsA EvsV evfit.in evfit.4 grace SUMMARY

for a in `seq -w 3.5 0.1 4.5`
do
echo "a= $a"

b=`echo $a|awk '{print $1*3**.5}'`
c=`echo $a|awk '{print $1*1.633}'`

cat >POSCAR <<!
Al HCP
1.0
$a  0.00  0.00
0.00   $b 0.00
0.00   0.00  $c
4
Direct
0.25  0.333  0.25
0.75  0.833  0.25
0.25  0.00   0.75
0.75  0.50   0.75
!

mpirun -np <no. of processors> <path of VASP executable>

V=`grep volume/ion OUTCAR|awk '{print $5}'`
E=`tail -n1 OSZICAR | awk '{ print $5/4}'`
T=`grep 'CPU time' OUTCAR |awk '{print $6}'`
totT=`echo $totT $T|awk '{print $1+$2}'`
echo $a $T >> TvsA
V_3=`echo $V|awk '{print $1**(1./3.)}'`

echo $a $E >> EvsA
echo $V $E >> EvsV
echo $V_3 $E >> evfit.in

./cleanvaspfiles

done

cat <<! | evfit
GEN
1
4
evfit.in
evfit.4
!

Emin=`grep Emin evfit.4|awk '{print $2}'`
A0=`grep A0 evfit.4|awk '{print $2}'`
K0=`grep A0 evfit.4|awk '{print $4}'`

V0=`echo $A0|awk '{print $1**3}'`

tail +5 evfit.4|awk '{print $1,"\t", $2,"\t", $3}' > grace

echo "Data for Al in HCP" >> SUMMARY
echo "=================================================" >> SUMMARY
echo "Equilibrium Energy per Atom    = $Emin">>SUMMARY
echo "Equilibrium Volume             = $V0">>SUMMARY
echo "Bulk Modulus                   = $K0">>SUMMARY
echo "Total CPU time (sec)           = $totT">>SUMMARY

Diamond runscript

#!/bin/sh

totT=0

rm EvsA EvsV evfit.4 grace SUMMARY

for a in `seq -w 3 0.25 6`
do
echo "a= $a"

cat >POSCAR <<!
Al Diamond
1.0
$a  0.00  0.00
0.00   $a 0.00
0.00   0.00  $a
8
Direct
0.10  0.10  0.10
0.60  0.60  0.10
0.60  0.10  0.60
0.10  0.60  0.60
0.35  0.35  0.35
0.85  0.85  0.35
0.85  0.35  0.85
0.35  0.85  0.85
!

mpirun -np <no. of processors> <path of VASP executable>

V=`grep volume/ion OUTCAR|awk '{print $5}'`
E=`tail -n1 OSZICAR | awk '{ print $5/8}'`
totT=`echo $totT $T|awk '{print $1+$2}'`
V_3=`echo $V|awk '{print $1**(1./3.)}'`

echo $a $E >> EvsA
echo $V $E >> EvsV
echo $V_3 $E >> evfit.in

./cleanvaspfiles

done

cat <<! | evfit
GEN
1
4
evfit.in
evfit.4
!

Emin=`grep Emin evfit.4|awk '{print $2}'`
A0=`grep A0 evfit.4|awk '{print $2}'`
K0=`grep A0 evfit.4|awk '{print $4}'`

V0=`echo $A0|awk '{print $1**3}'`

tail +5 evfit.4|awk '{print $1,"\t", $2,"\t", $3}' > grace

echo "Data for Al in Diamond" >> SUMMARY
echo "=================================================" >> SUMMARY
echo "Equilibrium Energy per Atom    = $Emin">>SUMMARY
echo "Equilibrium Volume             = $V0">>SUMMARY
echo "Equilibrium Lattice constant   = $A0">>SUMMARY
echo "Bulk Modulus                   = $K0">>SUMMARY
echo "Total CPU time (sec)           = $totT">>SUMMARY

INCAR


ISMEAR = -5     #Smearing technique - Tetrahedron method
ENCUT = 360     #Energy cutoff
EDIFF = 1e-6    #Global break condition for the electronic SC-loop

KPOINTS


Automatic mesh
0              ! number of k-points = 0 ->automatic generation scheme 
Monkhorst-Pack ! Use Monkhorst-Pack scheme
4  4  4        ! subdivisions N_1, N_2 and N_3 along reciprocal lattice vectors
0. 0. 0.       ! optional shift of the mesh 

POTCAR

The pseudopotential file will be provided by the instructor.

Variation of parameters in DFT calculations

The second objective requires to investigate the change in results due to parameters of the DFT calculation. The following variations are to be considered.

  • Investigate the change of energy and plot E-V curves when k-point grid is increased. This is also called a k-point convergence test. Note the total time taken by the calculations. From this calculation choose the best k-point grid. Use the following script to change k-point grid
#!/bin/sh
for a in `seq 3 1 25`
do

cat >KPOINTS<< !
Automatic mesh
0
Monkhorst-pack
$a $a $a
0 0 0
!

./<name of run script>

echo $a x $a x $a >> kpt_summary
cat SUMMARY >> kpt_summary

t=`grep time SUMMARY|awk '{print $6}'`
echo $a $t >> cpu_time

done
    • Using the chosen k-point grid use different smearing techniques and plot E-V curves.
    • Vary the energy cut-off (ENCUT) and plot E-V curves
    • Vary the global break condition for the electronic SC-loop (EDIFF) and plot E-V curves
Personal tools
Namespaces

Variants
Actions
home
Materials
Material Models
Design
Resources
Projects
Education
Toolbox