In this paper, the fully developed flow of an electrically non-conducting, viscous, incompressible, magnetizable fluid is investigated in rectangular pipes with square or rectangular cross-sections under the effect of spatially varying magnetic field. Magnetic field is generated by multiple wires carrying electric current that pass below and above along the pipe. Thus, the problem is reduced to the 2D flow of a magnetizable fluid in the cross-section of the pipe (cavity). Governing equations are solved in terms of the velocity and the pressure of the fluid. Stream function and axial velocity profiles are also presented. The dual reciprocity boundary element method (DRBEM) is applied iteratively in obtaining numerical results. The flow behavior is approximated with a small computational expense due to the boundary only nature of DRBEM. The numerical results reveal that multiple point magnetic sources significantly influence and control the flow in cavities. (C) 2017 Elsevier Ltd. All rights reserved.