Dry granular masses impacting on rigid obstacles: numerical analysis and theoretical modelling