Viscosity of pure liquid

GROMACS version: 2021
GROMACS modification: Yes/No
Dear all,
I want to calculate the viscosity of a pure liquid, which command exactly does this for me? I used gmx energy and obtained visco.xvg (by flag -vis), is this true?
best,
Ganj

1 Like

Hi Ganj,

Yes! visco.xvg is the estimate of the viscosity obtained by computing Green-Kubo formula.
If you want to get the estimate from Einstein’s formula, supply the flags -evisco and -eviscoi on top of -vis.

Mind that the statistical converge of such formulas is quite bad. I suggest to run several simulations in parallel and average the results over them.

Just for curiosity’s sake: which liquid are you computing the viscosity of?

Michele

Thank you Dear Michele, I’m trying for n-Heptane.
evisco.xvg file containing 5 columns, which one is correct? The fifth column?

Hi,
This is a bit tricky and, frankly, completely undocumented: the first colum is time while the other 4 are estimates of the viscosity up to that time. Gromacs ‘cuts’ the trajectory in 4 chunks and computes the observable (either correlation for GK or integral for Einstein) on each of them. You can average the last 4 columns (for the same time) to get a better estimate.

Michele

1 Like

Dear Michele,
Many thanks, it must be done in all over the simulation time or just at the end of simulation time?
Best,
Ganj

Hi, this is a tricky subject. In essence: on one hand you want to start averaging the results only after the decorrelation time of the shear stresses; on the other hand, the most ‘noisy’ data are at the end, due to statistical diffusion. So, taking all the point is as wrong as taking the last point only imho. You should compute the average in a time window [t_low, t_up]. Maybe this paper may be of some help: https://doi.org/10.1021/acs.jctc.5b00351

1 Like

Dear Michele,
Many thanks.
Best,
Ganj

Dear michele, since evisco file is generated using Einstein formula, then why you said that either correlation for GK or Einstein.

either correlation for GK or integral for Einstein

Even if they are computed in different ways numerically, and one is more advantageous than the other, Green-Kubo and Einstein formulas are mathematically equivalent. In Gromacs <= 2023 gmx energy -vis computed the GK formula, while providing -evisco returned both GK and Einstein. The behaviour has been changed in the latest release, so now you can compute just Einstein (no GK) using -evisco.

OK i got it. thanks a lot