A simulation of the quenching process for predicting temperature, microstructure and residual stresses