This paper presents the effect of a magnetic field on the ferrofluid flow pattern, heat transfer and entropy generation in a curved pipe. A non-uniform magnetic field is applied to ferrofluid (water + 2% vol. Fe 3 O 4 nanoparticles) flow and under the constant heat flux boundary condition. Governing equations are solved by the finite volume method and based on the SIMPLE algorithm. The major objective of this work is to illustrate the effects of circumferential angle (0 • ≤ ≤ 180 •) and strengths of a magnetic field 0 ≤ Mn ≤ 3 × 10 6 on the hydro-thermal behavior and entropy production rate. It is found that circumferential angle of the magnetic source plays an important role in hydro-thermal performance of a curved pipe. At low magnetic numbers, the optimal circumferential location of the magnetic source is opt = 180 • which leads to the maximum heat transfer enhancement and hydro-thermal performance and the minimal entropy generation rate. For high magnetic numbers, the optimal operating condition occurs at = 0 • and = 60 • depending on the magnetic number. Second law analysis reveals that the major source of entropy generation comes from heat transfer irreversibility which reduces significantly by applying a magnetic field. In the range of studied parameters, the maximum heat transfer enhancement is about 29% which occurs at = 0 • and Mn = 3 × 10 6. Keywords Curved pipe • Entropy generation • Ferrofluid • Heat transfer enhancement • Magnetic field List of symbols C Specific heat at constant pressure (Jkg −1 K −1) d p Particle diameter (m) Ec Eckert number (−) H Magnetic field intensity (Am −1) I Electric current (A) K Thermal conductivity (Wm −1 K −1) k B Boltzmann constant (1.380648 × 10 −23 J K −1) Ms Saturation magnetization (Am −1) Mn Magnetic number (−) m p Magnetic moment of nanoparticles (Am 2) Nu Nusselt number(−) P Pressure (Pa) Pr Prandtl number (−) q′′ Heat flux (Wm −2) q* Non-dimensional heat flux (−) r Radial coordinate (m) R c Radius of curvature (m) Re Reynolds number (−) S f Volumetric entropy generation rate due to friction (Wm −3 K −1) S gen Total volumetric entropy generation rate (Wm −3 K −1) S T Volumetric entropy generation rate due to heat transfer (Wm −3 K −1) T Temperature (K) u, v, w Velocity components (ms −1) x, y, z Cartesian coordinates (m) Greek symbols α Particle volume fraction (−) μ Dynamic viscosity (Pa s −1) μ B Bohr magneton (9.274 × 10 −24 Am 2) μ o Vacuum permeability (Tm A −1) ξ Langevin parameter (−) ρ Density (kg m −3) ϕ v Viscous dissipation function (s −1