This repository contains Python code to calculate shear viscosity from components of stress tensor using Green Kubo relation from LAMMPS simulations. It contains the following files:
-
input.dat - stress tensor data obtained from LAMMPS. Please run your LAMMPS simulations with the following commands:
variable pxy equal pxy variable pxz equal pxz variable pyz equal pyz variable pxx equal pxx variable pyy equal pyy variable pzz equal pzz fix printp all ave/time 2 1 2 v_pxy v_pxz v_pyz v_pxx v_pyy v_pzz file stress.txt mode scalar -
output.out - sample output file containing autocorrelation and viscosity data generated by the code.
-
viscousity.ipynb - Python code to calculate shear viscosity from Green Kubo relation as:
$\eta=\frac{1}{Vk_{B}T}\int_{0}^{\infty} \langle X_{ACF} \rangle dt$ , where$X_{ACF}(t)=\frac{1}{5}\sum_{i}\langle P_{i}(t)P_{i}(0) \rangle$ , where$P_{i}$ 's are the five independent components of traceless stress tensor -$P_{xy}$ ,$P_{yz}$ ,$P_{zx}$ ,$P_{xx}-P_{yy}/2$ ,$P_{yy}-P_{zz}/2$