Bug in vdwforcefield.F
Posted: Wed Sep 08, 2010 12:13 pm
Hi,
I believe that there is a bug in the code to add the Grimme correction for van der Waals interactions in the file vdwforcefield.F, VASP version 5.2.2.
The bug is related to the way in which the vdW interaction over periodically repeated unit cells is performed. In the original source code the interaction between an atom and the periodic repeat of itself is counted twice, once in the forward direction and once in the backward direction. This introduces a double counting error.
The error can most easily be seen by running two test jobs of a 1D chain of atoms, say Ne atoms, one with the smallest unit cell, and one with a supercell of twice the length. The vdW correction in the second should be twice as large, but because of the double counting error is not. For example, for a chain of Ne atoms separated by 3 Angstroms I get the following for the vdW correction to the energy:
Single cell: -0.01347
Double cell: -0.01369
Whereas they should be:
Single Cell: -0.00673
Double Cell: -0.01347
The bug only affects the energy and not the forces, since interactions between periodic repeats of a given atom sum to give zero force anyway.
I have a corrected version of the source file vdwforcefield.F which fixes the bug which I am happy to provide or upload if people would like it, and which I have sent to the people in Vienna.
Thanks
Matthew Dyer
University of Liverpool
Input files for test:
INCAR:
SYSTEM = Ne atoms
!Electronic settings
VOSKOWN = 1
ALGO = Fast
ISMEAR = 0
SIGMA = 0.01
EDIFF = 1.E-8
!Moving atoms
IBRION = -1
NSW = 0
!vdW Grimme corrections
VDW_RADIUS = 50.
Single POSCAR:
Ne
1.
6.0 0. 0.
0. 15. 0.
0. 0. 15.
2
Direct
0.25 0.3 0.4
0.75 0.3 0.4
Double POSCAR:
Ne
1.
3.0 0. 0.
0. 15. 0.
0. 0. 15.
1
Direct
0.75 0.3 0.4
Standard PAW_PBE Ne POTCAR file and calculation at the gamma point
I believe that there is a bug in the code to add the Grimme correction for van der Waals interactions in the file vdwforcefield.F, VASP version 5.2.2.
The bug is related to the way in which the vdW interaction over periodically repeated unit cells is performed. In the original source code the interaction between an atom and the periodic repeat of itself is counted twice, once in the forward direction and once in the backward direction. This introduces a double counting error.
The error can most easily be seen by running two test jobs of a 1D chain of atoms, say Ne atoms, one with the smallest unit cell, and one with a supercell of twice the length. The vdW correction in the second should be twice as large, but because of the double counting error is not. For example, for a chain of Ne atoms separated by 3 Angstroms I get the following for the vdW correction to the energy:
Single cell: -0.01347
Double cell: -0.01369
Whereas they should be:
Single Cell: -0.00673
Double Cell: -0.01347
The bug only affects the energy and not the forces, since interactions between periodic repeats of a given atom sum to give zero force anyway.
I have a corrected version of the source file vdwforcefield.F which fixes the bug which I am happy to provide or upload if people would like it, and which I have sent to the people in Vienna.
Thanks
Matthew Dyer
University of Liverpool
Input files for test:
INCAR:
SYSTEM = Ne atoms
!Electronic settings
VOSKOWN = 1
ALGO = Fast
ISMEAR = 0
SIGMA = 0.01
EDIFF = 1.E-8
!Moving atoms
IBRION = -1
NSW = 0
!vdW Grimme corrections
VDW_RADIUS = 50.
Single POSCAR:
Ne
1.
6.0 0. 0.
0. 15. 0.
0. 0. 15.
2
Direct
0.25 0.3 0.4
0.75 0.3 0.4
Double POSCAR:
Ne
1.
3.0 0. 0.
0. 15. 0.
0. 0. 15.
1
Direct
0.75 0.3 0.4
Standard PAW_PBE Ne POTCAR file and calculation at the gamma point