wall boundary condition in dpd

Hi Dear lammps-users,

There is no documented prohibition against using wall/reflect and one of the DPD pair styles. There is this warning for rigid fix styles:

“A reflecting wall should not be used with rigid bodies such as those defined by a “fix rigid” command. This is because the wall/reflect displaces atoms directly rather than exerts a force on them. For rigid bodies, use a soft wall instead, such as fix wall/lj93. LAMMPS will flag the use of a rigid fix with fix wall/reflect with a warning, but will not generate an error.”

So, your choices are:

  1. Replace wall/reflect with fix wall/region with a cylindrical region.

  2. Explore exactly what you mean by “does not work”

  3. I suspect you mean that wall/reflect only handles planar walls. Back in the olden days, when LAMMPS was still FORTRAN, I put in a cylindrical reflective wall and wrote a paper on it:

A. P. Thompson, “Non-equilibrium Molecular Dynamics Simulation of Electroosmotic Flow in a Charged Nanopore,” J. Chem. Phys., 119, 7503 (2003).

Here is the FORTRAN code:

do i = 1,nlocal

rcyl = sqrt(rcsq)

vdotr = v(2,i)*x(2,i)+v(3,i)*x(3,i)

vsq = v(2,i)**2+v(3,i)**2

tc = (-vdotr+sqrt(vdotr**2+vsq*(rcsq-rsq)))/vsq

rcy = x(2,i)+tc*v(2,i)

rcz = x(3,i)+tc*v(3,i)

vdotrc = v(2,i)*rcy+v(3,i)*rcz

fac = 2*vdotrc/rcsq

x(2,i) = x(2,i)+tcfacrcy

x(3,i) = x(3,i)+tcfacrcz

v(2,i) = v(2,i)-fac*rcy

v(3,i) = v(3,i)-fac*rcz

Based on this, you could add your particular boundary condition to void FixWallReflect::post_integrate() in fix_wall_reflect.cpp.