Problem in Setting the Velocity of a Group of Atoms

Hi everyone,

I met a problem in simulating the movement of a group of atoms in LAMMPS.

As is shown in the input script “in.velocity” as attached, I created a bilayer plane of Au atoms and used the “velocity” command to set all the atoms a constant velocity in the z direction. However, the average velocities of these atoms in the z direction at different times were outputed in “velocity.txt” as attached and they are not constant at all. It seems that the “velocity” command is not valid in my simulation.

Does anyone know how to solve this problem?

Thank you in advance,


in.velocity (1002 Bytes)

velocity.txt (3.62 KB)

Setforce should be the last fix you apply to ensure that forces imposed by any other fix are removed. From the manual:

“Set each component of force on each atom in the group to the specified values fx,fy,fz. This erases all previously computed forces on the atom, though additional fixes could add new forces.”

The velocity command sets the initial velocity
of the atoms you specify. They can change during
a run, depending on the forces on the atoms

and whether you time integrate them. If you

want their v to never change, then use fix setforce

to set the force on those atoms to zero and integrate
them with fix nve.