Validation of single and two-phase flow MHD code for application to liquid metal batteries