[lammps-users] Atoms fly off when using fix setforce 0.0 0.0 0.0

Dear lammps users

When I was using fix setforce 0.0 0.0 0.0 command to fix a layer of atoms, I found that the rest atoms (outside this fix) flying off during simulation. When I cancelled this fix everything worked well. Would you like to help me to see what's wrong with my input script?

log log.lammps
units metal
boundary p p p
atom_style atomic
lattice fcc 3.615
region box block 0 4 0 4 0 4
create_box 1 box
create_atoms 1 box

pair_style eam
pair_coeff * * Cu_u3.eam

mass 1 63.55

region frozen block 0 4 0 4 0 1
region mobile block 0 4 0 4 1 4

group frozen1 region frozen
group mobile region mobile

neighbor 0.3 bin
neigh_modify delay 10

velocity all create 400.0 49001 rot yes mom yes dist gaussian
thermo 100

fix 1 all nve
fix 2 mobile temp/rescale 10 400.0 400.0 0.05 1.0
fix 3 frozen1 setforce 0 0 0

minimize 1.0e-4 1.0e-6 1000 10000
run 1000

Thanks!

The frozen atoms have non-zero initial velocity. Try:

velocity frozen create 400.0 49001 rot yes mom yes dist gaussian

You could also make the same change for fix nve, although that should have no effect.

Aidan

I believe Aidan meant to write “velocity mobile create”, not “velocity frozen create”. . . .

–AEI

Hi Aidan

Thank you very much for your reply. I tried to modify the velocity create to velocity mobile create but there was no effect. The system seems to blow up except of the frozen region. Please see the output:

units metal
boundary p p p
atom_style atomic
lattice fcc 3.615
Lattice spacing in x,y,z = 3.615 3.615 3.615
region box block 0 4 0 4 0 4
create_box 1 box
Created orthogonal box = (0 0 0) to (14.46 14.46 14.46)
1 by 1 by 1 processor grid
create_atoms 1 box
Created 256 atoms

pair_style eam
pair_coeff * * Cu_u3.eam

mass 1 63.55

region frozen block 0 4 0 4 0 1
region mobile block 0 4 0 4 1 4

group frozen1 region frozen
96 atoms in group frozen1
group mobile region mobile
192 atoms in group mobile

neighbor 0.3 bin
neigh_modify delay 10

velocity mobile create 400.0 49001 rot yes mom yes dist gaussian
thermo 100

fix 1 all nve
fix 2 frozen1 setforce 0 0 0
fix 3 mobile temp/rescale 10 400.0 400.0 0.05 1.0

minimize 1.0e-4 1.0e-6 1000 10000
Memory usage per processor = 2.54288 Mbytes
Step Temp E_pair E_mol TotEng Press
0 299.60784 -906.24 0 -896.36453 3488.7412
1 299.60784 -906.24 0 -896.36453 3488.7412
Loop time of 0.00117517 on 1 procs for 1 steps with 256 atoms

Minimization stats:
Stopping criterion = energy tolerance
Energy initial, next-to-last, final =
-906.240000584 -906.240000584 -906.240000584
Force two-norm initial, final = 6.62397e-14 6.06828e-13
Force max component initial, final = 5.97786e-15 4.71897e-14
Final line search alpha, max atom move = 1 4.71897e-14

Iterations, force evaluations = 1 1

Pair time () = 0.00111175 (94.6034) Neigh time () = 0 (0)
Comm time () = 2.02656e-05 (1.72449) Outpt time () = 0 (0)
Other time (%) = 4.31538e-05 (3.67214)

Nlocal: 256 ave 256 max 256 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 843 ave 843 max 843 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 6912 ave 6912 max 6912 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 6912
Ave neighs/atom = 27
Neighbor list builds = 0
Dangerous builds = 0
run 1000
Memory usage per processor = 1.85623 Mbytes
Step Temp E_pair E_mol TotEng Press
1 299.60784 -906.24 0 -896.36453 3488.7412
100 299.60784 -855.56509 0 -845.68962 68572.828

200 299.60784 -788.29152 0 -778.41605 135879.8
300 299.60784 -578.3219 0 -568.44642 106885.25
400 299.60784 4.6392436 0 14.514719 146385.19
500 299.60784 444.71386 0 454.58934 428109.6
600 299.60784 490.20208 0 500.07756 510423.23
700 299.60784 332.00369 0 341.87917 403428.04
800 299.60784 178.90839 0 188.78386 293247.34
900 299.60784 76.671344 0 86.546819 207713.66
1000 299.60784 21.062491 0 30.937966 137204.27
1001 300.07599 20.899712 0 30.790617 136646.89
Loop time of 0.579276 on 1 procs for 1000 steps with 256 atoms

Pair time () = 0.515226 (88.9431) Neigh time () = 0.0377429 (6.51552)
Comm time () = 0.0136955 (2.36424) Outpt time () = 0.000613928 (0.105982)
Other time (%) = 0.0119979 (2.0712)

Nlocal: 256 ave 256 max 256 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 978 ave 978 max 978 min
Histogram: 1 0 0 0 0 0 0 0 0 0

There is probably some thing else going on. Once possibility is that the atoms are assigned to groups differently than you had hoped. Relying on floating point coordinates to do discrete assignments is always a little risky. What happens to atoms at z = 1? There may be other problems with your script too. The best thing is to look closely at x,v,F for all the atoms at timestep 0 and timestep 1. Remember, LAMMPS does not do what you want, it does what you tell it to do.

Aidan