Numerical simulation of friction in metal forming using a halfspace model