Viscosity calculation#
The shear viscosity is a property of liquids that can be determined easily by experiment. It is useful for parameterizing a force field because it is a kinetic property, while most other properties which are used for parameterization are thermodynamic. The viscosity is also an important property, since it influences the rates of conformational changes of molecules solvated in the liquid.
The viscosity can be calculated from an equilibrium simulation using an Einstein relation:
This can be done with gmx energy. This method converges
rather slowly 149, and usually hundreds of nanoseconds
are needed for an accurate determination of the viscosity. The
result is very dependent on the treatment of the electrostatics. Using a
(short) cut-off results in large noise on the off-diagonal pressure
elements, which can increase the calculated viscosity by an order of
magnitude. It is most convenient to use the Einstein relation.
Because gmx mdrun stores averages of quantities computed every
nstcalcenergy
steps, the Einstein relation can use these averages
and thus writing to energy file (nstenergy
) can be done infrequently.
This avoids the overhead of very large energy files that are needed
with the autocorrelation function approach.
GROMACS also has two non-equilibrium methods for determining the viscosity. The recommended method is to apply a shear to the system, see the next section. The viscosity can the be measured as the stress of the corresponding off-diagonal element of the pressure tensor divided by the shear rate. This is a straightforward procedure. The only disadvantage is that one needs to balance the cost of long simulatiosn at low shear rate due to low signal to noise ratio to the risk of shear thinning appearing at higher shear rates. Running at multiple shear rates might be necessary to ensure that one is in the linear regime.
The second non-equilibrium method is called “cosine acceleration”. This makes use of the fact that energy, which is fed into system by external forces, is dissipated through viscous friction. The generated heat is removed by coupling to a heat bath. For a Newtonian liquid adding a small force will result in a velocity gradient according to the following equation:
Here we have applied an acceleration
where
The viscosity can be calculated from
In the simulation
The generated velocity profile is not coupled to the heat bath.
Moreover, the velocity profile is excluded from the kinetic energy. One
would like
For a simulation with:
The heat generated by the viscous friction is removed by coupling to a heat bath. Because this coupling is not instantaneous the real temperature of the liquid will be slightly lower than the observed temperature. Berendsen derived this temperature shift 31, which can be written in terms of the shear rate as:
where
Note that the system has to build up the velocity profile when starting from an equilibrium state. This build-up time is of the order of the correlation time of the liquid.
Two quantities are written to the energy file, along with their averages
and fluctuations: