The magnetohydrodynamic (MHD) flow in a rectangular duct is investigated for the case when the flow is driven by the current produced by electrodes, placed one in each of the walls of the duct where the applied magnetic field is perpendicular, The flow is steady, laminar and the fluid is incompressible, viscous and electrically conducting. A stabilized finite element with the residual-free bubble (RFB) functions is used for solving the governing equations. The finite element method employing the RFB functions is capable of resolving high gradients near the layer regions without refining the mesh. Thus, it is possible to obtain solutions consistent with the physical configuration of the problem even for high values of the Hartmann number. Before employing the bubble functions in the global problem, we have to find them inside each element by means of a local problem. This is achieved by approximating the bubble functions by a nonstandard finite element method based on the local problem. Equivelocity and current lines are drawn to show the well-known behaviours of the MHD flow. Those are the boundary layer formation close to the insulated walls for increasing values of the Hartmann number and the layers emanating from the endpoints of the electrodes. The changes in direction and intensity with respect to the values of wall inductance are also depicted in terms of level curves for both the velocity and the induced magnetic field. (c) 2005 Elsevier B.V. All rights reserved.