Modeling of the thermal history of the sand casting process