[lammps-users] Rigid molecules in confinement

Hi Axel,
          I have conducted simulations on both cases with the langevin on all atoms in the system, and only on those which
are moving (rigid dumbbells). The results are for MSD are very similar (6% difference). The thermostat does perform slightly
better with the langevin applied to the only the moving molecules T* = 1.7 instead of T* = 2.0. I don’t understand why the

there is no "slightly better" here. it looks like you are doing
something that is inconsistent. the most common problem i encountered
in cases using rigid molecules, is that the number of degrees of freedom
was not properly accounted for. i would suggest to carefully check your
input against the documentation and make sure that what you are looking
at is actually what you expect to see. as it so happens, if you do not
account for the missing degree of freedom through the rigid bond between
the two particles when computing the temperature but with a properly
working thermostat, you would get 5/6 = 0.83333 with a target of 2.0
that would be 1.66666 ~= 1.7. hmmm...

diffusivity in confinement is very high (11.25 vs 0.4567). In the m.d code I have written the Nose-Hoover thermostat is only
applied to the moving dumbbell molecules. Thanks

how do you compute MSD? i didn't see a fix msd in your input?
if you use and external code, are you certain, that code handles
the pbc wrapping correctly?


Axel's comments about Temp of rigid bodies are correct - you
need to make sure the degrees-of-freedom are counted
correctly. LAMMPS explains how it does this and you can
modify it if needed via the compute_modify command.

Re: MSD of rigid bodies. This comment on the fix msd doc
page is relevant:

IMPORTANT NOTE: If an atom is part of a rigid body (see the "fix
rigid"_fix_rigid.html command), it's periodic image flags are altered,
and the computed MSD will not reflect its true displacement. See the
"fix rigid"_fix_rigid.html command for details. Thus, to compute the
MSD of rigid bodies as they cross periodic boundaries, you will need
to post-process a "dump file"_dump.html containing coordinates of the
atoms in the bodies.


Hello all,
         With some insight from Steve regarding the langevin
thermostat I was able to simulate rigid molecules in bulk and
obtain acceptable MSD values. I am currently trying to simulate rigid
dumbbell molecules in confinement. With 2 fcc wall
structures, containing atoms with a fixed positions in the z axis.
The atoms that consist of the wall have a zero velocity
and a set force of zero. In this case the thermostat reduces the
temperature to approx T* = 1.3 instead of T* = 2. Also I
would like to point out the MSD values calculated from lammps are very
large in comparison to the m.d code. Any insight in
working with confinement and would be of tremendous values. Sincerely

# 3d confinement simulation

units lj
atom_style molecular
dimension 3d
boundary p p f

read_data data.ljconfine

mass 1 1.0
mass 2 1.0
mass 3 1.0

pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0
pair_coeff 1 2 1.0 1.0
pair_coeff 1 3 1.0 1.0
pair_coeff 2 2 1.0 1.0
pair_coeff 2 3 1.0 1.0
pair_coeff 3 3 0.0 0.0

group wallupper type 3
group dumbbell molecule <> 1 200

neighbor 0.3 bin
neigh_modify delay 0 every 1

fix 1 wallupper setforce 0.0 0.0 0.0
fix 2 dumbbell rigid molecule
fix 3 all langevin 2.0 2.0 500.0 48279

dump 1 dumbbell xyz 100 dump.xyz

thermo 100

run 60000
run_style verlet
timestep 0.005