[lammps-users] behavior of wall/gran wiggle

Dear all,

I just would like to discuss the behavior of the wiggle option of wall/gran
fix, which is different from what I would expect when reading the
documentation (I'm using lammps-18Mar10):

"The arguments to the wiggle keyword specify a dimension for the motion (...).
Note that if the dimension is in the plane of the wall, this is effectively a
shearing motion."

So I tried the following set of fixes to simulate a 3D container shaken

fix wz all wall/gran 2.0e5 NULL 50.0 NULL 0.5 0 zplane 0.0 500.0 wiggle z 1.0 3.0
fix wx all wall/gran 2.0e5 NULL 50.0 NULL 0.5 0 xplane 0.0 10.0 wiggle z 1.0 3.0
fix wy all wall/gran 2.0e5 NULL 50.0 NULL 0.5 0 yplane 0.0 10.0 wiggle z 1.0 3.0

But when I vizualized the resulting dump file (with a large number of grains
so that I clearly could see the walls' position), it appeared that the xplane
walls' position was oscillating in the x direction (and ditto for the yplane),
while I was expecting their position to remain constant with only a sinusoidal
velocity in the z direction ("shearing motion").

But then it seems to me that this behavior can be expected from the code:

in fix_wall_gran.cpp:
258: wlo = lo + amplitude - amplitude*cos(arg);
259: whi = hi + amplitude - amplitude*cos(arg);

288: if (wallstyle == XPLANE) {
289: del1 = x[i][0] - wlo;
290: del2 = whi - x[i][0];

The position is oscillating in the XPLANE direction, regardless of the wiggle
direction ('axis' variable). I would have expected the position to change only
if the wiggle direction was the same as the wall direction.

So I was wondering if this was a choice you had made, if I did'nt get
something, or if there was a mistake? If this is a choice, I can modify the
code on my own for it to do what I was thinking, but could you maybe modify
the documentation to precise this point?

Thank you,
Best regards,


This was a bug. The tangential velocity was set correctly for this
case, but it shouldn't have been also resetting the wall position.
I posted a patch.