Contradiction between PPPM and Wall/piston

Dear LAMMPS Users,

For Kspace_style, we always use Ewald or PPPM, which all require PBCs in all directions, unless we use a slab option. However, The slab keyword allows an Ewald or PPPM solver to be used for a systems that are periodic in x,y but non-periodic in z - a boundary setting of “boundary p p f”.

For fix Wall/piston, the face that has the wall/piston must be boundary type ‘s’ (shrink-wrapped).

It’s clear that we can not use Ewald/PPPM to compute long-range Coulombic interactions when we use wall/piston. What a big contradiction it is!

Is there anyone who also encounter the problem? From my understanding, the only way to solve this problem is to use MSM as the solver to computer coulombic force. I wonder whether there are another alternatives to use fix wall/piston and Ewald/PPPM meanwhile? Because the accuracy of MSM is worse than Ewald/PPPM.

Any help would be highly appreciated.

Thanks

Timmy

Dear LAMMPS Users,

For Kspace_style, we always use Ewald or PPPM, which all require PBCs in all directions, unless we use a slab option. However, The slab keyword allows an Ewald or PPPM solver to be used for a systems that are periodic in x,y but non-periodic in z - a boundary setting of "boundary p p f".

For fix Wall/piston, the face that has the wall/piston must be boundary type ‘s’ (shrink-wrapped).

It’s clear that we can not use Ewald/PPPM to compute long-range Coulombic interactions when we use wall/piston. What a big contradiction it is!

this is not a "contradiction", but a "conflict" that is based on the
way how, both, the kspace slab option and fix wall/piston are
implemented.
the slab option requires (and transparently implements), that there is
2x the amount of vacuum between slabs, than the slab is thick. this is
required for the inter-slab poisson solver to be sufficiently accurate
to correct for the otherwise fully periodic calculation. this is
achieved through internally scaling the volume in z-direction, and
thus requires the use of a fixed boundary. with "s" it would
immediately collapse back into a volume that is unusable. thus fix
wall/piston is not compatible with this feature.

Is there anyone who also encounter the problem? From my understanding, the only way to solve this problem is to use MSM as the solver to computer coulombic force. I wonder whether there are another alternatives to use fix wall/piston and Ewald/PPPM meanwhile? Because the accuracy of MSM is worse than Ewald/PPPM.

an alternative would be to modify the fix wall/piston implementation
to identify the boundaries of the system differently and be no longer
dependent on "s" boundaries. no idea how much effort that would be,
though.

axel

Dear Prof. Axel,

Thanks very much to your fast reply.

It’s indeed a conflict instead of a contradiction.

Maybe I can try to replace “fix wall/piston” by “fix wall/reflect”, which can be used under “p p f”. It seems that “fix wall/reflect” has a same function of “wall/piston”, which can also flip the velocity of those molecules that try to move thru the wall.

Thanks again for your suggestion.

Best

Timmy

Dear Prof. Axel,

Thanks very much to your fast reply.

It’s indeed a conflict instead of a contradiction.

Maybe I can try to replace “fix wall/piston” by “fix wall/reflect”, which can be used under “p p f”. It seems that “fix wall/reflect” has a same function of “wall/piston”, which can also flip the velocity of those molecules that try to move thru the wall.

nope, that cannot work either. as already alluded to, the slab option
modifies cell parameters, so that the box is expanded to 3x the volume
and boundaries are internally treated as periodic (again), since the
underlying kspace solvers *must* run in all 3 directions with a
periodic boundary. that would place the reflecting wall into a "no-go
zone", where the calculation of the slab correction will become
inaccurate, if particles move there.

if it is the velocity inversion, you are after, then you should
consider fix oneway (and best test it with a regular size periodic box
using a potential not requiring long-range electrostatics). if you can
make it work to give equivalent results to fix wall/piston in that
case, there is a good chance, it will also work with long-range
coulomb.

another option to consider could be the new scafacos kspace style,
which offers additional long-range solvers, and perhaps one of them is
applicable with sufficient accuracy for your needs.

axel.