Creation of atoms in lammps

I am new to LAMMPS to get insight in to things I started with the examples but facing the following basic problem in understanding the examples (flow)

  1. How it is calculating the number of atoms (examples-flow -in.flow.poiss) . I calculated as Number den=no./vol therefore 0.7*(20*10)=140. and then multiplied by 3. from the create box command then it gives no. of atoms 420. but it doesn’t work for others example.

  2. How it is assigning 60 no. of atoms to lower and upper region.(please check in the output file) .

I gone through documentation but doesn’t got clear idea. Please help me in clearing the doubt.
input file
dimension 2
boundary p s p
atom_style atomic
neighbor 0.3 bin

  1. neigh_modify delay 5

    create geometry

    lattice hex 0.7
    region box block 0 20 0 10 -0.25 0.25
    create_box 3 box
    create_atoms 1 box

    mass 1 1.0
    mass 2 1.0
    mass 3 1.0

    LJ potentials

    pair_style lj/cut 1.12246
    pair_coeff * * 1.0 1.0 1.12246

    define groups

    region 1 block INF INF INF 1.25 INF INF
    group lower region 1
    region 2 block INF INF 8.75 INF INF INF
    group upper region 2
    group boundary union lower upper
    group flow subtract all boundary

    set group lower type 2
    set group upper type 3
    OUTPUT FILE
    dimension 2
    boundary p s p
    atom_style atomic
    neighbor 0.3 bin
    neigh_modify delay 5

create geometry

lattice hex 0.7
Lattice spacing in x,y,z = 1.28436 2.22457 1.28436
region box block 0 20 0 10 -0.25 0.25
create_box 3 box
Created orthogonal box = (0 0 -0.321089) to (25.6871 22.2457 0.321089)
1 by 1 by 1 processor grid
create_atoms 1 box
Created 420 atoms
mass 1 1.0
mass 2 1.0
mass 3 1.0

LJ potentials

pair_style lj/cut 1.12246
pair_coeff * * 1.0 1.0 1.12246

define groups

region 1 block INF INF INF 1.25 INF INF
group lower region 1
60 atoms in group lower
region 2 block INF INF 8.75 INF INF INF
group upper region 2
60 atoms in group upper
group boundary union lower upper
120 atoms in group boundary
group flow subtract all boundary
300 atoms in group flow
set group lower type 2
60 settings made for type
set group upper type 3
60 settings made for type

I suggest you visualize the system and see where the
atoms are. Create_atoms uses the lattice and tiles a region
of space (e.g. the simlution box). However many atoms fit
inside it is the count. When you define a group, the number
of atoms in the group is the count, e.g. inside a geometric
region.

Steve