I am trying to calculate the viscosity of an ionic liquid using the Green-Kubo relation. I am following the example “8.3.6. Calculate viscosity” on LAMMPS documentation. But I still don’t understand the correlation time for viscosity calculation. If I run a simulation for 1 ns, how can I calculate the viscosity at 200, 400, 600, 800, 1000 ps?
variable p equal 50000 # correlation length
variable s equal 20 # sample interval
variable d equal $p*$s # dump interval
variable pxy equal pxy
variable pxz equal pxz
variable pyz equal pyz
fix SS all ave/correlate $s $p $d v_pxy v_pxz v_pyz type auto file S0St.dat ave running
variable scale equal ${convert}/(${kB}*$T)*$V*$s*${dt}
variable v11 equal trap(f_SS[3])*${scale}
variable v22 equal trap(f_SS[4])*${scale}
variable v33 equal trap(f_SS[5])*${scale}
run 1000000 # 1ns
That is controlled by a) the Nrepeat, Nevery, Noutput settings of fix ave correlate and b) how and when you output the variables v11, v22, v33 (e.g. via fix print at the desired interval).