Application of Thermodynamic Models for Better Understanding and Optimizing the Hall–Heroult Process