modeling electrochemistry in metallurgical processes