Heat transfer and microstructure during the early stages of metal solidification