The improvement of heat transfer inside the solar heat exchangers is important for the development of solar energy in an urban area. In this study, the usage of a non-uniform magnetic field on the thermal efficiency of the nanofluid (Fe3O4) streaming inside the U-turn pipe of solar heat exchangers is examined. Computational fluid dynamic is applied to visualize the nanofluid flow inside the solar heat exchanger. The role of magnetic intensity and Reynolds number on thermal efficiency are fully investigated. The effect of single and triple sources of the magnetic field is also studied in our research. Obtained results indicate that the usage of the magnetic field results in the production of vortex in the base fluid and heat transfer improves inside the domain. Our finding indicates that the usage of the magnetic field with Mn = 25 K would improve the average heat transfer by about 21% along the U-turn pipe of solar heat exchangers.