Stress per atom due to wall

Dear LAMMPS users

I am using LAMMPS version 22 Aug, 2018. I am simulating a 3D system with the periodic boundary conditions in x and y directions but there are two soft walls (WCA potential) in z-direction at the two ends of box. The stress per atom can be calculated due to pairwise interaction. But how can I calculate the stress per atom due to a wall?

there are no details about how you set up your walls so it is not possible to give any detailed information,
but i don’t see how stress contributions from walls are different from other stress contributions. if programmed correctly, anything that adds a force to atoms can tally its stress contribution.


I am simulating a box containing the ellipsoidal particles(1:1:3) confined by two walls at its two ends in z-direction. Thus there are two forces on the particles. One is due to the Gay-Berne intermolecular potential and other is due to the presence of two soft walls which are WCA potentials.

The Gay-Berne potential is implemented by using this command:
pair_style gayberne/gpu 1.0 1.0 2.0 4.0
pair_coeff * * 1.0 1.0 1.0 1.0 0.2 0 0 0

After simulating the system using NPT ensemble, NVT ensemble is used using:
fix 1 all nvt/asphere temp {T} {T} {Tdamp} mtk yes tchain 10** **compute_modify 1_temp extra/dof {dof}

Then two walls are implemented by:
fix lw all wall/lj126 zlo EDGE 1.0 1.0 ${rljmin} units box pbc no
fix_modify lw energy yes virial yes

fix rw all wall/lj126 zhi EDGE 1.0 1.0 ${rljmin} units box pbc no
fix_modify rw energy yes virial yes
Here rljmin=2^(1/6)

The stress per atom is calculated by using:
compute s all stress/atom 1_temp pair
Here 1_temp is ID of fix nvt/asphere.

I have calculated the stress per atom by using the 'pair’ option. Does this command calculate the stress per atom due to all forces acting on the particles (i.e. Gay-Berne & WCA)? If this only calculates the stress per atom only due to Gay-Berne interaction then how can I get the stress per atom due to the contribution of two walls?

your questions are answered in the compute stress/atom documentation in the manual.

fix id wall/options

use … fix_modify fix_id virial yes.

It will make lammps to count virial due to wall too.
And then compute your stress/atom

I think this will work.

Thanks and regards.

1 Like