Preliminary treatment of ores or scrap