Effect of velocity command and fix nvt command on each other

Dear Lammps users,

I am confused that the velocity command and fix nvt command affect each other.
The simplified input file is

units lj
fix 1 all nvt temp 0.02 0.02 0.5
velocity group-1 set 0.1 0 0
velocity group-2 set -0.1 0 0.

In this file, atmos in group-1 and group-2 will collide.
And, I consider that the impact velocity is 0.1+0.1=0.2 in this calculation.
However using this file, the velocity of group-1 is 0.16 0 0, and that of group-2 is -0.16 0 0, so that the impact velocity becomes 0.32.

I check some archives, and I found that the damping of thermostat affects the velocity of the groups.
But there is no explanation that the initial velocity varies.
Also, the velocity varies, getting bigger and smaller.
My question is “Is there any relation between fix command and velocity command?”, also “How do they affect each other?”.
Or, is my question fundamentally wrong?

Best regards,

I think so.

First: Velocity != Temperature
Second: the velocity command applies input by default in multiples of the lattice spacing in that direction (units lattice) and those can be different from the actual units (units box) unless you have a default lattice setting.

Dear Mr Akohlmey,

Thank you for your answer.
I didn’t know that velocity is multiples of lattice.

In my input file, the lattice is set to 1.091.
So, the initial velocity of group is inconsistent even if the lattice parameter is included.

And, I have a question.
In LAMMPS, is there any possibility that the atoms are affected by surrounding?
I think that there is no surrounding, but there is a possibility that the pressur e of surrounding can affect atoms.

Best regards,

Atoms are affected by anything that they are interacting with.

For anything more specific, you have to produce a complete input deck and relevant parts of the output so that one can see “everything” you are doing. Discussing this in general terms is rarely productive because there are so many different settings and LAMMPS commands that can have an impact.

Dear Mr. Akohlmey,

This is my entire input file.
Using this file, the velocity is not one that I estimate.
If you have some comments, could you tell me?

Best regards,

atom_style atomic
variable latparam equal 1.09 # set lattice

region dere sphere -35 0 0 8.37 # group-1
region mili sphere 35 0 0 8.37 # group-2
region imas block -80 80 -40 40 -40 40 # simulation box
create_box 1 imas

lattice fcc ${latparam} orient x 1 0 0 orient y 0 1 0 orient z 0 0 1

create_atoms 1 region dere
create_atoms 1 region mili

region 1 sphere -35 0 0 10
region 2 sphere 35 0 0 10
group left region 1
group right region 2

mass * 1.0

pair_style lj/cut 5.0
pair_coeff * * 1 1

compute peratom all pe/atom

######### EQULIBRATION ########
reset_timestep 0
timestep 0.01

thermo 200
thermo_style custom step lx ly lz press pxx pyy pzz pe temp

fix 1 all nvt temp 0.1 0.1 1.0 # equilibration
dump 1 all atom 200 dump.equi

run 1000

unfix 1
undump 1
######### COLLISION #############

reset_timestep 0
timestep 0.01

fix 1 all nvt temp 0.2 0.2 0.5 # surrounding ?

velocity left set 0.1 0 0 # give velocity to group-1
velocity right set -0.1 0 0 # give velocity to group-2

dump 1 all custom 200 dump.*.collision id x y z vx fx fy fz

run 10000

a few comments:

  • since you didn’t specify units, you’ll be using reduced units (“units lj”) and you should note that a few commands have different defaults and the lattice parameter a different meaning
  • if you want to not have your velocities be dependent on the lattice spacing you can just add “units box”
  • while it makes (some) sense to use fix nvt during equilibration, there is no physical meaning to using a thermostat for your collision experiment. those two groups of atoms are not coupling with anything external, which is what a thermostat will mimic. you should use “fix nve”
  • after thermalizing and equilibrating your two groups you don’t want to overwrite the velocities (why equilibrate them otherwise) but you want to add the collision velocities. please see the manual for details

Dear Mr. Akohlmey

Thank you for your comments!!

I forget writing “units lj” in my previous reply.
My simulation is under lj units.
After I add “units box”, I can give the correct velocity.

Also, I change fix command, “fix nvt” → “fix nve”.
And, the simulation works correctly.

Think you!!