LAMMPS Atoms lost

Dear LAMMPS-creators,
I am a beginner and using lammps to create agglomerates of milk powder particles. I want the milk powder particles to fall onto the wall by gravity and form agglomerates. But during the run I am warned that the atoms are being lost.
At the bottom of the simulation box I set up the wall and ran the thermodynamic information once per frame. With ovito I observed that the atoms went through the wall and disappeared.
I am constantly trying to modify the code, if you have time, maybe you can give me some valuable advices.
My code is attached below.
Sincerely
Cute

variable        name string pour_into_box                          

atom_style      sphere                                              
units           si                                            

variable        boxx equal 1000e-6                                       
variable        boxy equal 1000e-6
variable        boxz equal 1000e-6

variable        x1 equal 0                                          
variable        x2 equal 1*${boxy}
variable        y1 equal 0                                          
variable        y2 equal 1*${boxy}
variable        z1 equal 0.5*${boxz}                                
variable        z2 equal 1*${boxz}
variable        z3 equal 0.001*${boxz}

variable        rlo equal 14e-6                                      
variable        rhi equal 18e-6
variable        dlo equal 2.0*${rlo}
variable        dhi equal 2.0*${rhi}

variable        dens equal 450                                  

variable        skin equal 10*${rhi}                               

#############
region          boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz}          
create_box      1 boxreg                                            
change_box      all boundary p p f                                  

pair_style      granular                                   
pair_coeff      1 1 jkr 3.57e9 0.8 0.12 0.0574 tangential mindlin NULL 0.7 0.5 rolling sds 500.0 200.0 0.5 twisting marshall
                        


comm_modify     vel yes                                             

region          insreg1 block ${x1} ${x2} ${y1} ${y2} ${z1} ${z2}   
region          wallreg block 0 ${boxx} 0 ${boxy} 0 ${z3}

fix             1 all nve/sphere                                    
fix             grav all gravity 10.0 vector 0 0 -1                 
fix             ins1 all pour 2000 1 54436 region insreg1 diam range ${dlo} ${dhi} dens ${dens} ${dens} 
delete_atoms overlap 0.54e-6  all all

neighbor        ${skin} bin                                         
neigh_modify    delay 0 every 1 check yes

fix              2 all wall/gran/region granular jkr 3.57e9 0.8 0.12 0.0574 tangential mindlin NULL 0.7 0.5 rolling sds 500.0 200.0 0.5 twisting marshall region wallreg

compute  1 all erotate/sphere

thermo_style    custom step atoms ke
thermo_modify   lost warn
thermo          1

timestep        0.0001

dump            1 all custom 1 ${name}.dump id type radius mass x y z

run             5000

MILK

Is there a particular reason you are using fix wall/gran/region and not fix wall/gran?

Dear Akohlmey,

I used both, but they all didnt work.

Sincerely
Cute

You should be using fix wall/gran. If used correctly, it has to stop particles from leaving the box.
But for that to work as expected, you also have to make certain that particles do not accelerate to speeds where they can pass in one timestep through the repulsive part of the wall. Either your wall parameters may need to be adjusted or your timestep reduced or the gravity force.

P.S.: please try to avoid the term “it does not work”. It is an unscientific, imprecise and - in this specific case - inaccurate description. LAMMPS does work and your input does work (in that it does not reject any commands), but it may not give you the expected results.

Dear Akohlmey,

thanks for your reply, i have lerned a lot from it.
Thanks again.

Sincerely,
Cute

Were you able to get your desired outcome? I’m having a similar issue