Models, algorithms and validation for opensource DEM and CFD-DEM