Thermal Model of the Casting Process of Functionally Graded Composites