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

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

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

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

Hi

What is the recommended simulation time for calculating viscosity using both methods? Is 10 nanoseconds appropriate? Do both methods require the same amount of time?

Hi,

In my experience, the Einstein method is superior memory- and time-wise.

The amount of time needed for convergence and/or the amount of replicates depend on the liquid.

For water (e.g. SPC/E), which has a rather quick velocity autocorrelation relaxation time, 10 ns may be enough, but not with only one replicate. To get a reasonable number ofr water I had to run roughly 10 replicates (or equivalently, run for 100 ns). For other, possibly more viscous liquids, 10 ns is not enough. For example, with pure glycerol I had to wait 10 ns just to get to the linear regime where Einstein formula can be applied. So in that case I had to simulate for > 100 ns and > 10 replicates to get a reasonable value.

In conducting a simulation of one of the water models, I noticed clear differences in the results between the two methods. Is this logical? I used 10 nanoseconds to gather data for both methods, with 10 attempts per method, each attempt lasting 1 nanosecond, and then took the average.

في الاثنين، ٨ يوليو ٢٠٢٤, ٦:١١ ص khadeja khadeja <khadejajust@gmail.com> كتب:

Hello,

I have a question regarding the viscosity results measured using the Einstein method. Could you explain what each column represents in this data?

title “Shear viscosity using Einstein relation”

@ xaxis label “Time (ps)”

@ yaxis label “(kg m\S-1\N s\S-1\N)”

@TYPE xy

0.001 0 0 0 0

0.003 3.65051e-07 3.64278e-07 3.68455e-07 3.65928e-07

0.005 1.08577e-06 1.08345e-06 1.09604e-06 1.08842e-06

0.007 1.77993e-06 1.77606e-06 1.79725e-06 1.78441e-06

…

…

Why does it go up to 250 ps considering that the total time is 1 ns?

The columns are resp. time, the 3 components of the Eintein intergral (3 off-diagonal components of the stress tensor) and their average.

If I am not mistaken, Gromacs already perform an average in time over 4 blocks, which is why you get numbers until 1000/4=250 ps.

Thank you very much. Have you previously used both the Green-Kubo and Einstein methods to calculate water viscosity?

Yes, but I settled with Eintein because of memory issues. Since GK computes viscosity from autocorrelation functions via FFT, it requires very frequent output (even one every step). With Einstein, you still need to compute energies every step (`nstcalcenergy`

), but it can be written every 10/100 steps (`nstenergy`

) as the integral is computed internally.

When calculating viscosity using both methods, how did you analyze the data (from GROMACS) to determine the final viscosity value?

I averaged the attempts and then took the average again. However, I noticed that some attempts were highly fluctuating. In such cases, should I exclude these attempts?

I observed a discrepancy in viscosity values when using the two methods at certain temperatures. Is there an explanation for this?

في الأربعاء، 10 يوليو 2024 في 9:48 ص تمت كتابة ما يلي بواسطة MichelePellegrino via GROMACS forums <notifications@bioexcel1.discoursemail.com>:

في الأربعاء، 10 يوليو 2024 في 1:12 م تمت كتابة ما يلي بواسطة khadeja khadeja <khadejajust@gmail.com>:

The observable is highly diffusive, i.e. fluctuations are bound to occur and they will get stronger as time progresses. This is why one should look at averages over multiple time blocks/replicates.

GK and E seem pretty consistent to me, how does the averaged viscosity compare? What ‘t*’ refers to?