Experiments are performed with Fe3O4/water nanofluid through metal foam tube. The best location of electromagnets is determined numerically. Effects of concentration, Reynolds number and magnetic field intensity are examined. The effect of magnetic field is more noticeable near the entrance of tube. New correlation for prediction of the Nusselt number is proposed.