Creating symmetric atoms in regions for a couette flow problem

I am using the following code to create atoms for the top, bottom wall and also the fluid in the channel. The creation and spacing (along y) is symmetric for case when density of wall and fluid are same. But, when I change to a different density the symmetry is lost. I would be appreciate if someone could suggest the best approach in Lammps to create atoms that are symmetric both in quantity and in spacing(especially between wall and fluid). And is there a general way to approach this problem for cases with varying density or do we have to fine tune it for each case individually.

Thank you.


region fluid block 0 11.95 1.5 26.07 0.0 7.22 units box
region btm_wall block 0 11.95 0 1.5 0.0 7.22 units box
region top_wall block 0 11.95 26.07 28.0 0.0 7.22 units box
region simulation_box union 3 btm_wall fluid top_wall units box

create_box 3 simulation_box

lattice fcc 0.81 orient x 1 1 -2 orient y 1 1 1 orient z 1 -1 0
create_atoms 1 region fluid units box
lattice fcc 3.24 orient x -1 1 0 orient y 1 1 1 orient z 1 1 -2
create_atoms 2 region btm_wall units box
lattice fcc 3.24 orient x -1 1 0 orient y 1 1 1 orient z 1 1 -2
create_atoms 3 region top_wall units box

mass 1 1.0
mass 2 1.0
mass 3 1.0

If you are using create_atoms with a region, you will get ill-defined
behavior for coordinates exactly on the region boundary (due
to round-off). This will be especially true if the region boundary
coincides with the periodic box boundary. So if that's what
you want to do, you typically need to tweak the region size to
get exactly what you want. If you use create_atoms with the
whole box, then LAMMPS takes care of the periodic boundaries
and does the right thing.


In my case the walls have have a different 'scale' value for the 'lattice' as compared to the fluid region.
So, I am not sure how to use 'create_atoms' along with 'box' to create these two separate regions, hence opted for 'region' command.

Also I was able to tweak the the region size to fix the periodicity along the x & z(periodic boundaries).
The problem I was facing was along the y direction(not periodic). I was finding it difficult to maintain an equal gap between the top_wall-fluid & btm_wall-flui regions.

Appreciate your constant support.


As you indicate you can re-use the lattice and create_atoms command
as many times as you like to create different sets of atoms. It is
then up to you to position them precisely where you want them, and
to insure proper positions at or near boundaries (periodic or otherwise).
Note that you can define any region with either box or lattice units,
which is independent of how create_atoms uses the lattice definition.
If you confuse the two, your region geometry will be messed up.