[lammps-users] Coulomb friction on individual atom

Dear Users,

I need to apply classic Coulomb dry friction conditions on a group of atoms. As the simplest example consider 3 particles along x axis connected by 2 springs (bond_style harmonic). The left one is fixed by setforce 0, The right one is moved by move linear. the middle one is going to stand dry friction so that it rests until the total acting force on it reaches Fsc (maximum static friction), and afterward a constant kinetic friction Fdy is applied against its motion. Here is my input:

dimension 3
units metal
boundary p p p
atom_style molecular

read_data data.txt #as follows:
{3 atoms
2 bonds
1 atom types
1 bond types
-5 100 xlo xhi
-5 5 ylo yhi
-5 5 zlo zhi

Masses

1 1

Atoms

1 1 1 0 0 0
2 1 1 1 0 0
3 1 1 2 0 0

Bonds

1 1 1 2
2 1 2 3} # end of data file

group left id 1
group midd id 2
group right id 3
bond_style harmonic/shift/cut
bond_coeff 1 5 1 10
velocity all create 0 4928459 mom yes rot yes dist uniform
timestep 0.001
thermo 100

variable Fsc equal 0.003
variable Fdy equal 0.002

#fix 1 all nve
fix 1 all nvt temp 0.01 0.01 0.001
fix 2 left setforce 0 0 0
fix 3 right move linear 0.1 0 0 units box
dump 1 all custom 1 dump.xyz id x fx

label loop
variable a loop 50000
variable FX2 equal abs(fx[2])
if “v_FX2 < 0.003” then “fix 4 midd setforce 0 NULL NULL” else “unfix 4” “fix 4 midd addforce -0.002 0 0”
run 1 pre no post no
next a
unfix 4
jump SELF loop

I expected when the spring (bond) 2 is stretched enough, the force fx[2] be bigger than Fsc and it starts to move but it doesn’t. Wrongly, with this code fx[2] always sets to 0. To overcome, I tried another way: define a friction force, FR, which is opposite of fx in static mode and equals to kinetic friction after sliding with this code:

label loop
variable a loop 10000
variable FX equal fx[2]
variable FXA equal abs(FX)
if “v_FXA < 0.003” then “variable FR equal -v_FX” else “variable FR equal -0.002”
fix 4 midd addforce v_FR 0 0
run 1 pre no post no
next a
unfix 4
jump SELF loop

but it doesn’t work either.

Thank you, Kamal

there are multiple problems here:
a) your understanding of the “if” keyword and how LAMMPS processes input is incorrect
b) your model is not representing what you are describing
c) your input has multiple formal issues

first, the approach of using a loop and defining/removing/updating fixes is flawed. it looks as if you are communicating with a human and not a computer program.
so if you want an equal style variable to provide a different result depending on a given condition, you have to put the condition inside the formula. So if you want to add two different force values to be added to a particle you can have an expressions like this:

variable Fadd equal (condition1)*value1+(!condition1)*value2

the condition operation will evaluate to either 1.0 (if true) or 0.0 (if false) and thus the value of Fadd will be either value1 or value2 depending on whether the condition is true of false.

second, you must not use time integration on an atom multiple times (LAMMPS should have printed a warning about this, and you must not ignore warnings unless you know for certain that you may ignore them in your specific case) and there is no point in applying a thermostat for a system like yours. instead, your atom 1 is immobile and thus would need no time integration at all, atom 3 is moved by fix move, which is a time integration, so only atom 2 needs to be handled with a regular time integration, i.e. fix nve.

because of the harmonic springs with equal force constants between your atoms, atom 2 will be in the middle of atoms 1 and 3.
since these are point particles with no other interactions defined, there are no other forces at work, i.e. nothing equivalent to friction or similar. you would have to add this.

so how large would that “friction force” have to be to model the situation that you are describing? for as long as the particle is supposed to remain in place, the force would have to be equivalent (but in opposite direction) to the force trying to pull it away, but when it “breaks loose”, that force becomes smaller and a term that would scale with the velocity (sliding friction), right?

in the end, this all comes down to applying basic classical mechanics, but keeping in mind that there are only the interactions present that you put there and that those can be quite different from manipulating macroscopic objects.

axel.