A Generalized Density Dissipation for Weakly-compressible SPH