Question about the fix setforce command

Hello,

I man using the lammps comb potential to simulate a hydrocarbon on Cu111 surface

Here is my input file , in which I define a group named bottomCu which is 3 layers of Cu in my slab
I want to fix their positions, so I use the fix setforce command as in the input file as below:
But the trajectory show that, atoms in the bottomCu group are not fixed at all.

In order to check whether my input file has some errors, I use a EAM potential instead of this COMB potential
the result shows that the fix setforce works!

So what happens? I am confused
Thank you for any suggestions !

units metal
atom_style charge
dimension 3
boundary p p p

read_data input.lmp

mass 1 65.39
mass 2 1.00
mass 3 12.00
group bottomCu id 1:48

pair_style comb3 polar_off
pair_coeff * * ffield.comb3 Cu H C

neighbor 2.0 bin
neigh_modify every 10 delay 0 check no

dump 1 all custom 20 dump.lammpstrj id type q x y z vx vy vz element
dump_modify 1 element Cu H C

fix 1 bottomCu setforce 0.0 0.0 0.0
fix 2 all nvt temp 400.0 400.0 0.2
fix 3 all qeq/comb 10 1e-3

timestep 0.00020

thermo_style custom step temp pe
thermo 10
run 30000

Hello,

I man using the lammps comb potential to simulate a hydrocarbon on Cu111
surface

Here is my input file , in which I define a group named bottomCu which
is 3 layers of Cu in my slab
I want to fix their positions, so I use the fix setforce command as in
the input file as below:
But the trajectory show that, atoms in the bottomCu group are not fixed
at all.

In order to check whether my input file has some errors, I use a EAM
potential instead of this COMB potential
the result shows that the fix setforce works!

So what happens? I am confused

​you only provide one input, so it is difficult to say where the
significant differences are, but you have to keep in mind that fix setforce
by itself is not sufficient to immobilize atoms, you also have to set their
velocities to zero.

axel.​

Axel :

Thank you for your reply:

My input file for eam test looks like (below), In the EAM test system, I remove the hydrocarbon on the surface:

AND If I want to set the temperature to zero at the same time with set force to zero, which temperature control method is the best?
IF I set this command in my simulation
fix 5 bottomCu langevin 0.0 0.0 0.5? bottomCu group (I want to immobilize atoms in this group):
How could I insure the velocities of these atoms are set to zero every timestep( If I set the damp of the langevin too small ,some error may happen in my experience)

Another related question:
How to remove the degree of the freedom if I fix 48 atoms in my simulation when I calculate the temperature of the system?
use a compute_modify or define a new compute?

thank you !

units metal
atom_style atomic

dimension 3
boundary p p p

read_data input.lmp

mass 1 65.39

group bottomCu id 1:48

pair_style eam/alloy
pair_coeff * * Cu.eam Cu

neighbor 2.0 bin
neigh_modify every 10 delay 0 check no

dump 1 all custom 20 dump.lammpstrj id type x y z
dump_modify 1 element Cu

fix 1 bottomCu setforce 0.0 0.0 0.0
fix 2 all nvt temp 400.0 400.0 0.2

timestep 0.00020

thermo_style custom step temp pe
thermo 10

run 30000000

Axel :

Thank you for your reply:
My input file for eam test looks like (below), In the EAM test system, I
remove the hydrocarbon on the surface:

AND If I want to set the temperature to zero at the same time with set
force to zero, which temperature control method is the best?

​you'd use the velocity command.​

​in general there are two options to immobilize atoms:
1) ​initialize velocities to zero at the beginning and then set the forces
to zero during the run.
2) only time integrate the mobile atoms.

this is a very frequently asked question, please search the mailing list
archives for more details and explanations and study the documentation and
tutorials more carefully.

IF I set this command in my simulation
*fix 5 bottomCu langevin 0.0 0.0 0.5? * * bottomCu group (I want
to **im*mobilize atoms in this group):
How could I insure the velocities of these atoms are set to zero every
timestep( If I set the damp of the langevin too small ,some error may
happen in my experience)

​this is not how it is done.​

Another related question:
How to remove the degree of the freedom if I fix 48 atoms in my
simulation when I calculate the temperature of the system?

use a compute_modify or define a new compute?

​define a new compute​