DEM simulation of cake formation in sedimentation and filtration