pyiron / pyiron_atomistics

pyiron_atomistics - an integrated development environment (IDE) for atomistic simulation in computational materials science.
https://pyiron-atomistics.readthedocs.io
BSD 3-Clause "New" or "Revised" License
42 stars 15 forks source link

Inconsistent Free Energy Calculation with D3 Correction in pyiron HDF5 Files #1193

Open yuyuanjingxuan opened 10 months ago

yuyuanjingxuan commented 10 months ago

Summary

The free energy calculated by VASP and stored in a pyiron HDF5 file is not consistent when the D3 (VDW) correction is enabled.

pyiron Version and Platform

Expected Behavior

The job['output/generic/dft/scf_energy_free'] should provide all free energy values, including those that consider the D3 correction when IVDW=11 is added to the INCAR file.

Actual Behavior

The job['output/generic/dft/scf_energy_free'] currently provides the following values:

[ ...,
  -3542.71855343,
  -3542.7185545,
  -3542.71855383
]

However, when searching for all occurrences of "TOTEN" in the OUTCAR file, I found the following values:

... 
free energy    TOTEN  =     -3542.71855450 eV
free energy    TOTEN  =     -3542.71855383 eV
free  energy   TOTEN  =     -3645.65385697 eV

It appears that the last "free energy" value is not included in job['output/generic/dft/scf_energy_free']. This energy corresponds to the calculation with the D3 correction.

Steps to Reproduce

To reproduce the issue, follow these steps:

  1. Set up a VASP calculation with D3 correction by adding IVDW=11 to the INCAR file.
  2. Calculate the free energy using VASP.
  3. Store the results in a pyiron HDF5 file.
  4. Access job['output/generic/dft/scf_energy_free'] to compare the values.

Further Information, Files, and Links

There is an additional space between the last "free energy."

pmrv commented 9 months ago

It seems a similar bug is present in Vasp5.4.4 but has been fixed in Vasp6.

https://www.vasp.at/forum/viewtopic.php?p=21765&hilit=vasprun+energy#p21765

Can you test with vasp6?

yuyuanjingxuan commented 9 months ago

Conducted a test using an H2 molecule in a cubic box with VASP 6.4.0 and set IVDW=11. The obtained results in job['output/generic/dft/scf_energy_free'] are as follows:

[...,
 -6.73179963, 
 -6.73181333, 
 -6.7318166
]

The "free energy" values in the OUTCAR file are:

free energy    TOTEN  =        -6.73181333 eV
free energy    TOTEN  =        -6.73181660 eV                                                                                                       
free  energy   TOTEN  =        -6.73181772 eV

It appears that the last value from the OUTCAR file is not included in the hd5f file of the job.