Minimization and recycling of waste coming out from a magnesium foundry