Residual stress magnitudes are a consequence of hardening precipitation that occurs during quenching which allows a greater elastic stress to be supported.
I would like to suggest you article: J.E.Wyatt, J.T.Berry, A.R.Williams, Residual stresses in aluminum castings, Journal of Materials Processing Technology 191 (2007) 170-173.