A combined method for simulating MHD convection in square cavities through localized heating by method of line and penalty-artificial compressibility