Analysis of solidification in sand and permanent mold castings and shrinkage prediction