Update How-to viscosity and put the example together with other viscosity examples.

This commit is contained in:
Zheng Gong 2020-04-30 17:05:01 +02:00
parent 846146c9d4
commit 26321d49c4
6 changed files with 39 additions and 12 deletions

View File

@ -1,10 +1,11 @@
Calculate viscosity
===================
The shear viscosity eta of a fluid can be measured in at least 5 ways
The shear viscosity eta of a fluid can be measured in at least 6 ways
using various options in LAMMPS. See the examples/VISCOSITY directory
for scripts that implement the 5 methods discussed here for a simple
Lennard-Jones fluid model. Also, see the :doc:`Howto kappa <Howto_kappa>` doc page for an analogous discussion for
Lennard-Jones fluid model and 1 method for SPC/E water model.
Also, see the :doc:`Howto kappa <Howto_kappa>` doc page for an analogous discussion for
thermal conductivity.
Eta is a measure of the propensity of a fluid to transmit momentum in
@ -130,9 +131,24 @@ time-integrated momentum fluxes play the role of Cartesian
coordinates, whose mean-square displacement increases linearly
with time at sufficiently long times.
The sixth is periodic perturbation method. It is also a non-equilibrium MD method.
However, instead of measure the momentum flux in response of applied velocity gradient,
it measures the velocity profile in response of applied stress.
A cosine-shaped periodic acceleration is added to the system via the
:doc:`fix accelerate/cos <fix_accelerate_cos>` command,
and the :doc:`compute viscosity/cos<compute_viscosity_cos>` command is used to monitor the
generated velocity profile and remove the velocity bias before thermostating.
.. note::
An article by :ref:`(Hess) <Hess3>` discussed the accuracy and efficiency of these methods.
----------
.. _Daivis-viscosity:
**(Daivis and Todd)** Daivis and Todd, Nonequilibrium Molecular Dynamics (book),
Cambridge University Press, https://doi.org/10.1017/9781139017848, (2017).
.. _Hess3:
**(Hess)** Hess, B. The Journal of Chemical Physics 2002, 116 (1), 209-217.

View File

@ -1,5 +0,0 @@
The input script in in.1000SPCE.lmp gives an example on how to calculate
the shear viscosity of SPCE water with the periodic perturbation method.
For a production run, much longer simulation is required.
Note that the acceleration amplitude of `fix accelerate/cos` should be carefully chosen,
and an extrapolation is generally required to get the viscosity at zero-shear.

View File

@ -1,5 +1,6 @@
This directory has 5 scripts that compute the viscosity (eta) of a
Lennard-Jones fluid using 5 different methods. See the discussion in
This directory has 6 scripts that compute the viscosity (eta) of fluid
using 6 different methods. 5 of them are for a Lennard-Jones fluid
and the last one is for SPC/E water model. See the discussion in
Section 6.21 of the manual for an overview of the methods and pointers
to doc pages for the commands which implement them. Citations for the
various methods can also be found in the manual.
@ -10,7 +11,7 @@ enough to generate good statistics and highly accurate results.
-------------
These are the 5 methods for computing viscosity. The first 3 are
These are the 5 methods for computing viscosity of a LJ fluid. The first 3 are
non-equilibrium methods; the last 2 are equilibrium methods.
in.wall = move a wall to shear the fluid between two walls
@ -89,3 +90,18 @@ heat/flux doc page - the resulting value prints at the end of the run
and is in the log file
eta = 1.07
-------------
in.cos.1000SPCE is an example script of using cosine periodic perturbation method
to calculate the viscosity of SPC/E water model.
The reciprocal of eta is computed within the script, and printed out as v_invVis
in thermo_style command. The result will converge after hundreds of picoseconds.
Then eta is obtained from the reciprocal of time average of v_invVis.
eta = 0.75 mPa*s
Note that the calculated viscosity by this method decreases with increased acceleration.
It is therefore generally necessary to perform calculation at different accelerations
and extrapolate the viscosity to zero shear.

View File

@ -15,7 +15,7 @@ angle_style harmonic
dihedral_style none
improper_style none
read_data data.1000SPCE.lmp
read_data data.cos.1000SPCE
variable T equal 300
variable P equal 1.0
@ -29,7 +29,7 @@ fix com all momentum 100 linear 1 1 1
fix rigid all shake 1e-4 20 0 b 1 a 1
# Viscosity ##################################
variable A equal 0.02e-5 # angstrom/fs^2
variable A equal 0.05e-5 # angstrom/fs^2
fix cos all accelerate/cos ${A}
compute cos all viscosity/cos