Lees and Edwards suggested a method to combine laminary flow with periodic
boundaries in the direction:
Figure 8.2:
Lees-Edwards boundary conditions. The coordinate origin is in the center
of
the middle cell. Upper and lower replicas are counter-moving at constant
speeds
.
Here are in language-independent form, the appropriate code parts for PBC
and NIC:
// Periodic boundary conditions:
// round(float) is the integer next to float
// L is the cell side length; note that x,y,z vary between -L/2 and L/2
// t is the elapsed time
// gamma is the shear rate
cz=round(z/L)
cx=x-cz*gamma*L*t
x=cx-round(x/L)*L
y=y-round(y/L)*L
z=z-cz*L
.....