The effect of lateral walls on fluid flow and heat transfer is investigated when a fluid passes a magnetic obstacle. The blockage ratio β that represents the ratio between the width of external magnet M y and the spanwise width L y is employed to depict the effect. The finite volume method (FVM) based on the PISO algorithm is applied for the blockage ratios of 0.2, 0.3, and 0.4. The results show that the value of Strouhal number St increases as the blockage ratio β increases, and for small β , the variation of St is very small when the interaction parameter and Reynolds number are increasing. Moreover, the cross-stream mixing induced by the magnetic obstacle can enhance the wall-heat transfer and the maximum value of the overall heat transfer increment is about 50.5%.