Modelling of Spin-Dependent Mechanical Friction at Atomic Level