I have a working SPH simulation in 2D. When the particles are in motion everything works fine. But once the simulation comes to a rest particles at the bottom begin to oscillate violently and eventually penetrate the boundary particles. I have tried dampening the simulation with two types of viscosity, XSPH and Artificial viscosity. They only helped slightly. Smaller time steps don't help either. Obviously pressures are building at the bottom. Is there another way to do fix this apart from viscosity and smaller timesteps?
Firstly, XSPH does not behave as viscosity, it simply calculates the positions based on averaged velocity considering the close vicinity of a particle. But it is important, that the velocity itself is not affected, but only used to update positions:
Secondly, it might be counter intuitive, but errors in SPH (at least in fluid simulations) are larger when the fluid motion is slow. That is why it is more efficient in the simulation of dam breaks and other problems where inertial forces are dominant. The results are relevant only as long as the system is under a heavily transient motion.
However, the problem you experienced is still not acceptable and probably depends on the pressure evaluation scheme (equation of state) and the time step size. Check the sound speed $c$ and the smoothing distance $h$ and estimate the order of the required time step size by