Details of viscosity estimation (gmx energy -vis)

GROMACS version: 2023.2
GROMACS modification: No

Hello everyone,

I have started using gmx energy -vis to estimate shear viscosity (file visco.xvg) from equilibrium MD simulations. The command is very convenient and easy to use, but I would like to know the details of these calculations. For instance, it is not clear to me whether it is using the Green-Kubo relation or the Einstein relation (I assume that the Green-Kubo is used, but it is not stated in the output file). Which stress tensors are taken in to account for the estimation? I would also like more specifics about the estimation of the autocorrelation function and the integration. For instance, is there a time lag considered for the correlation function?

Can I find somewhere this information? Any help you can provide is appreciated. Thank you!

Best regards,
Evangelos (Vangelis)

Yes, documentation is lacking. There are two outputs. visco.xvg is from Green-Kubo and the plots are as a function of integration time over the AC function. evisco output is using the Einstein formula. For the shear viscosity all three off-diagonal terms are used.

Note that both methods require extremely frequent pressure calculation, nstcalcenergy should be at most 5. For Green-Kubo, you need nstenergy=nstcalcenergy. Einstein has the advantage that that is not needed. So I would advise to use Einstein. I just updated the manual for 2024 with this information:
https://manual.gromacs.org/2024-beta/reference-manual/special/viscosity-calculation.html

The Einstein viscosity calculation is much improved the the 2024 version, I would advise to use the 2024 version of gmx energy:
https://manual.gromacs.org/2024-beta/onlinehelp/gmx-energy.html

Thank you so much for all the help!

Best regards,
Vangelis