The manual has the following note for fix langevin
:
This accumulated energy does NOT include kinetic energy removed by the zero flag. LAMMPS will print a warning when both options are active.
However, if I issue the command:
fix 1 all langevin 300. 300. $(100*dt) 185497 angmom 1.0 zero yes tally yes
No warning is issued. Has the option zero yes
changed to conserve the kinetic energy?
Here is a minimal script to play with the fix.
test_langevin.in
# GayBerne ellipsoids in LJ background fluid
units lj
atom_style ellipsoid
dimension 2
lattice sq 0.01
region box block 0 20 0 20 -0.5 0.5
create_box 1 box
create_atoms 1 box
set type 1 mass 1.0
set type 1 shape 3 2 1
set group all quat/random 18238
compute rot all temp/asphere
velocity all create 2.4 87287 loop geom
pair_style gayberne 1.0 3.0 1.0 4.0
pair_coeff 1 1 1.5 3.0 0.4 0.8 1 0.4 0.8 1 2.5
neighbor 0.8 bin
thermo_style custom step c_rot epair etotal press vol
thermo 100
compute 0 all property/atom quatw quati quatj quatk shapex shapey shapez
dump 1 all custom 100 test_langevin.dump id type x y z c_0[*]
dump_modify 1 colname c_0[1] quatw colname c_0[2] quati colname c_0[3] quatj colname c_0[4] quatk &
colname c_0[5] shapex colname c_0[6] shapey colname c_0[7] shapez
timestep 0.001
fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 &
mtk no pchain 0 tchain 1
fix 2 all enforce2d
# equilibrate to shrink box around dilute system
run 2000
# Check the option
unfix 1
fix 1 all nve/asphere
fix 3 all langevin 2.0 2.0 0.1 185497 angmom 1.0 zero yes tally yes
run 20000