Abstract A mathematical model for two-dimensional fluid flow under the influence of stream wise transverse magnetic fields in laminar regime is simulated in this study. Heat transfer past a square diamond shaped porous obstacle is also taken into account. The attention is focused to investigate the effects of intensity and direction of magnetic field, Darcy and Reynolds numbers on the mechanism of convective heat transfer and flow structures. The Darcy–Brinkman–Forchheimer model along with the Maxwell equations is used. The nonlinear coupled equations using a finite volume approach (FVA) are solved numerically. The calculations are performed for different governing parameters such as Reynolds number, Nusselt number, Stuart number and Prandtl Number. The physical interpretation of velocity and isothermal contours is assigned through graphs. It is shown that the effects of a transverse magnetic field on flow behavior and heat transfer mechanism are more than that of the stream wise magnetic field. The configuration of streamlines and vorticity contours phenomena are also presented for porous diamond obstacle. Comparison of the numerical solutions with existing literature is also made.