Residual stress modeling in machining processes