Particles in the 2d simulation of a granular system can not be seen

Hello everyone!
I’m trying to simulate the motion of particles in a granular system. First I define the “dimension” to be 2, I make a box whose length in Z direction is much shorter than in X and Y direction. Then I used the “fix pour” command to pour particles in. The code can run but I cannot see any particle in OVITO. I check the dump file, and find that coordinate of all particles are nan. I don’t know why.

However, I change the dimension to 3 and it works, but I doubt if it is the real 2d simulation.

This is my code. I can’t upload file because I’m a new user. Sorry for that.

units lj
atom_style sphere
boundary p p p
dimension 2
comm_modify vel yes

region box block -200 200 -200 200 -0.75 0.75 units box
create_box 2 box

pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1

pair_coeff * * gran/hooke

region container block -180 180 -180 180 -0.75 0.75 units box
fix container all wall/gran/region hooke/history &
4000.0 NULL 100.0 NULL 0.5 1 region container

neighbor 0.3 bin
neigh_modify delay 0 every 1 check yes

fix 1 all nve/sphere
fix 2 all gravity 1.0 vector 0 0 -1
fix 3 all pour 500 1 123456 region container ignore vol 0.86 10 diam poly 2 1.0 0.5 1.4 0.5

timestep 0.05

compute 1 all temp
compute_modify 1 dynamic/dof yes

compute 2 all temp/sphere
compute_modify 2 dynamic/dof yes

thermo 100
thermo_style custom step atoms temp c_1 c_2 press

thermo_modify lost ignore
compute_modify thermo_temp dynamic/dof yes

dump 1 all atom 50 dump1.example

run 500

I see several issues with your code, but the most egregious is the use of fix gravity in the z direction in a 2D simulation. Please read the documentation for running 2D simulations
https://docs.lammps.org/Howto_2d.html
as well as the fix pour documentation in how it pertains to 2D simulations.

Additionally, your timestep is massive, it should be an order of magnitude smaller to start with. However, that is a moot point because you don’t apply a velocity to your particles in insertion (see the vel keyword for fix pour). Although, it seems you want fix gravity to move your particles. So you won’t need to set a velocity, but your timestep is still too high.

Finally, you use thermo_modify lost ignore, suppressing the symptoms likely caused by all of the above.

1 Like

Many thanks for your reply!
Actually I want to simulate the system to be sheared, the code above is a portion of all.I will check my code again and modify it to see what happens. Thank you again!