# Shear Viscosity

GROMACS version: 5.1.2
GROMACS modification: Yes/No

Hi everyone,
Is there any best tutorial to calculate shear viscosity of carbohydrate in water? I already obtained diffusion coefficient of carbohydrate in water. Do the files obtained during msd run work for calculating viscosity? I will be much thankful if any one could help me to know the steps to be followed to calculate shear viscosity.

Hello!

Viscosity calculation can be done using several methods, although their accuracy and sometimes results may vary. A few equilibrium and non-equilibrium methods are described and compared in (among many others) Hess (2002), and Bordat & Müller-Plathe (2002).

The former paper describes a few methods which are available in the Gromacs tools. See this chapter in the manual for more information.

As an aside, unless you are required to use Gromacs 5.1.2 specifically, I would suggest upgrading to the newest release (2020.3). The 5-series is five years old at this point, and many improvements have since been made to both speed and usability.

Regards,
Petter

Dear pjohansson,
Thank you very much for your help. I red two papers that you suggested. However, I’m facing problems to create .mdp files for the run to find viscosity. Secondly, could you help me to know the the exact procedures to follow (I mean the steps to be followed)?

The steps and .mdp options involved depend on which method you want to measure the viscosity through. As I mentioned, this chapter in the manual has more information on how to use two of the methods that Gromacs supports. The first method uses `gmx energy -vis` along with a (very long) NPT ensemble simulation. The `-vis` flag makes `gmx-energy` output `evisco.xvg` and `eviscoi.xvg` which is the Einstein relation shear viscosity and its integral, respectively (of course you can calculate these by yourself using the relation and the pressure tensor components). Note that both files contains its component along all directions and then the average of them all. The second method uses the `cos-acceleration` MDP option. Typically, you want to simulate in double precision.

Im using periodic perturbation method to calculate the viscosity for carbohydrate in water. Here i have attached the .mdp file that i constructed. Please kindly suggest whether this mdp file parameters are sufficient or not .

;PREPROCESSING PARAMETERS
define=DPOSRES

;RUN CONTROL
integrator=md
tinit=0
dt=0.001
nsteps=1200000

;BOND CONSTRAINTS
constraints=none
constraints_algorithm=lincs
lincs_order=4

;OUTPUT CONTROL
nstxout=1000
nstvout=1000
nstfout=0
nstlog=1000
nstenergy=1000

;NEIGHBOR LIST
ns_type=grid
nstlist=5
rlist=0.9
pbc=xyz
periodic_molecules=no

;ELECTROSTATICS
coulombtype=PME
rcoulomb=0.9
optimize_fft=yes
vdwtype=cut-off
rvdw=0.9
DispCorr=EnerPres

;TEMPERATURE COUPLING
Tcoupl=berendsen
tc-grps=system
tau_t=0.1
ref_t=300

;PRESSURE COUPLING
Pcoupl=no
Pcoupltype=isotropic
tau_p=1.0
compressibility=4.5e-5
ref_p=1.0

;VELOCITY GENERATION
gen_vel=no
gen_temp=300
gen_seed=173529

;NON-EQUILIBRIUM MD
cos-acceleration=0.025
acc-grps=SYSTEM