Arman,
Not sure that this is a fix wall/gran issue, more likely an issue with the overall dynamics.
First, by placing granular particles randomly, then increasing their diameters, you introduce potentially large overlaps in the initial state, leading to very large forces, leading to large velocities of particles that then shoot through the walls. Consider an alternate pre-processing step to place particles in a non-overlapping initial configuration, or using minimization or fix nve/limit to remove the initial overlaps. Another good option specifically for this is fix pour.
Second, when you scale everything by a constant factor, you may also need to adjust the timestep. For pair gran/hooke, the time step scales like sqrt(mass/stiffness), and when you multiply your radii by {factor}, you’re changing mass by {factor}^3. So the timestep likely needs to be adjusted. For more complex contact models like the one you’re using, there’s some literature on how to choose the timestep, but it’s likely something you’ll have to explore empirically, since it also depends on your dynamics.
Third, be aware that with your choice of units, and the way you’re creating atoms, you get some very strange masses. You probably want to also set densities (after you set the diameters, so that LAMMPS can update the masses appropriately):
set type * density 1000 #since you’re using ‘units si’
Otherwise, LAMMPS will set diameters to 1 when you create the particles, then set masses accordingly based on an assumed density of 1, regardless of units. These masses won’t change when you then change the diameters via the ‘set’ command, unless you also subsequently change the density.
Let me know if you still have problems after you fix these issues.
Best,
Dan