LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] region move with periodic boundary conditions

# [lammps-users] region move with periodic boundary conditions

 From: Francesco Benfenati Date: Tue, 24 Oct 2017 13:32:01 +0200

Hi,

I'm studying a flow inside a nanotube, with periodic boundary conditions: the fluid particles exit from one end of the nanotube and enter from the other.
There are two fluids moving side by side, and I'd like to know the temperatures and pressures for each fluid away from the interface and from the walls. So, I created moving regions centered around the center of mass of each fluid.

The problem is that, while the center of mass is computed with unwrapped coordinates, the region command uses "wrapped" coordinates, so after a while the moving region moves outside of the simulation box and then it doesn't contain any atom.

Is there a way to make the moving region reenter the simulation box, with periodic boundary conditions? The only workaround I could think of is to define multiple moving regions separated by the box length, so that when one is exiting another one is entering.

Here is the code I'm using:

compute           wcom water com
compute           hcom hept com
variable             dz_w equal c_wcom[3]-150
variable             dz_h equal c_hcom[3]-150

region               waterregion cylinder z 0 0 22 130 170 units box move NULL NULL v_dz_w
region               heptregion1 cylinder z 0 0 22 0 20 units box move NULL NULL v_dz_h
region               heptregion2 cylinder z 0 0 22 281 301 units box move NULL NULL v_dz_h
region               heptregion union 2 heptregion1 heptregion2
group                waterbulk dynamic water region waterregion every 1
group                heptbulk dynamic hept region heptregion every 1

compute            twater waterbulk temp/com
compute            pperatomwater waterbulk stress/atom twater

compute            thept heptbulk temp/com
compute            pperatomhept heptbulk stress/atom thept