You can change the mass in the particle field, that is correct. However, that mass is most likely only used to solve the velocity verlet algorithm in your setup. So in that context the density changes, yes. But it doesn’t affect the external acceleration caused by gravity. In the DKT2D example, this acceleration is quantified by the variable
accExt, as you can see, the particle density affects it. If you want to change it, you would have to update it with the new particle density.