Introduction

One of the most important problems in the twenty-first century and following centuries is energy savings. So, many researchers have made important studies on this topic. Improving the useful life of equipment and saving the energy can be achieved by increasing heating (or cooling) in thermal devices. So far, many methods have been proposed by various researchers to save energy.

Due to the remarkable properties of nanofluids, especially their extreme thermal conductivity, many research studies have been carried out in the nanofluids field [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]. Recently, nanofluids have been widely used in the petrochemical industry, nanomedicine and consumer products. One of the many considerations is the use of nanofluids to increase convection heat transfer. Therefore, the process of cooling and heating in the equipment is carried out more quickly.

One of the most modern collections of nanofluids is magnetic nanofluids. This type of nanofluids, in addition to having good thermal transfer properties, can response and react to the magnetic field. Nowadays, these branches of the nanofluids have been widely used in medicine and the industry. In recent years, a number of researchers have used ferrofluids to examine heat transfer [18,19,20,21,22,23]. Esmaeili et al. [24] examined heat transfer in a magnetic nanofluid within copper pipe with a length of 1.2 m and an internal diameter of 6.8 mm. The effect of the magnetic field has been studied in their work. It has been shown that by varying the frequency of the magnetic field from 50 Hz to 1 MHz, the heat transfer of water-based nanofluid increased by 48%. While using ethylene glycol as a base fluid in the same conditions, the amount of heat transfer increased by 15%. Bahiraei and Hangi [25] simulated the flow behavior of magnetic nanofluid in a heat exchanger. In their work, the effect of volume fraction, nanoparticle size and magnetic field on nanofluid flow and heat transfer properties has been considered. They showed that the larger diameter of the nanoparticles leads to enhance the heat transfer. It should also be noted that they showed that the pressure drop also increased with increasing diameter of the nanoparticles. By increasing the nanoparticles’ volume fraction, the hot fluid temperature will decrease over the heat exchanger. Also, with increasing magnetic field, the overall heat transfer coefficient increases. Sheikhnejad et al. [26] studied the flow of ferrofluid under a magnetic field effect as a way to increase heat transfer inside a pipe. The constant heat flux was applied as a thermal boundary condition for the test section. The use of magnetic field and nanoparticles results in a higher Darcy friction coefficient. Yarahmadi et al. [27] examined forced convection through a magnetic nanofluid at constant and oscillating magnetic fields. Their experimental work has been conducted in a pipe with boundary conditions of constant heat flux and a laminar flow regime. In their work, the effects of Reynolds number, volume fraction, intensity and arrangement of magnetic field on the heat transfer have been studied.

To simulate the nanofluids flow, single-phase and two-phase methods can be used [28,29,30,31]. Since several factors such as Brownian force, thermophoretic force, friction between base fluid and nanoparticles, gravity and dispersion may occur in nanofluids, some researchers have tried to achieve more realistic results using two-phase methods for nanofluids. So far, two-phase models have been proposed including the Euler–Euler model and the Euler–Lagrange model.

The irreversible factors can be minimized by applying the second law of thermodynamics. Therefore, in the study of nanofluids flow, in addition to the first law of thermodynamics, it is necessary to consider the second law of thermodynamics, which can be a criterion for the operation of engineering devices. In recent years, some researchers have exerted entropy generation to investigate the behavior of fluids [32,33,34,35,36,37,38]. Mahmud and Fraser [39] analytically investigated entropy generation in a non-Newtonian fluid flow. They reported that with the increase of the power law index, the entropy generation rate would increase. Bahiraei et al. [40] studied the behavior of nanofluid flow containing graphene nanoparticles by considering entropy generation and exergy destruction. Their studied geometry was a micro-heat exchanger. In their simulation, the viscous dissipation was considered. They showed that the addition of nanoparticles leads to increased frictional and thermal exergy destruction. Shahsavar et al. [41] calculated the entropy generation in a magnetic nanofluid flow within a micro-channel. Their geometry was under magnetic field. In their work, it has been shown that the frictional entropy generation rate increases with increasing magnetic field intensity, while thermal entropy generation rate decreases. Rezaei Gorjaei et al. [42] investigated entropy generation and heat transfer in water–Al2O3 nanofluid. Two-phase mixture method was used to simulate nanofluid. In their work, the Bejan number, the frictional and thermal entropy generation rates were calculated. Simulation results show that entropy generation and heat transfer increase with increasing nanofluid concentration. It is also shown that Bejan number is close to 1.

The present simulation considers the second law of thermodynamics (thermal and frictional entropy generation rate) in the water–Fe3O4 nanofluid. Moreover, in the current simulation, the effects of Reynolds number, concentration and magnetic field strength are evaluated on the convective heat transfer coefficient, pressure drop and nanoparticles distribution. The non-uniform magnetic field is employed to a part of the tube. The magnetic field strength is linear, and it has a negative gradient. To simulate the nanofluid, the Euler–Lagrange method is applied. However, in most of the previous studies, single-phase and Euler–Euler methods have been used to study nanofluid behavior.

Geometry and magnetic field

The studied heat exchanger is a tube, which is simulated in two-dimensional mode. The fluid used inside the tube is water–Fe3O4 nanofluid. The length of the tube is 130 times the radius of the tube (L = 130 r). Figure 1 shows schematic of the geometry. The non-uniform magnetic field is applied on a part of tube (from X = x/L = 0.3 to X = 0.61), and the constant heat flux is applied on the tube wall. The magnetic field has a negative gradient, and the magnetic field strength (H) decreases linearly. That is, at the point X = 0.3, it has the maximum value, and at X = 0.61 it reaches its lowest value. At the tube outlet, a zero relative pressure is applied. At the tube inlet, uniform temperature and velocity are applied for continuous phase and nanoparticles.

Fig. 1
figure 1

Schematic of studied geometry

Euler–Lagrange method

The evaluation of the characteristics of the nanofluid flow (water–Fe3O4) that flows inside the tube is carried out using the Euler–Lagrange method. In this method, only the properties of the water and nanoparticles are needed and do not depend on effective models for calculating thermophysical properties. Also, the fluid is applied as a continuous phase with the nanoparticles dispersed inside it. Therefore, the governing equations are as follows:

Continuity equation

$$\nabla \cdot (\rho_{\text{f}} V_{\text{f}} ) = 0$$
(1)

Momentum equation

$$\nabla \cdot (\rho_{\text{f}} V_{\text{f}} V_{\text{f}} ) = - \nabla P + \nabla \cdot (\mu_{\text{f}} \nabla V_{\text{f}} ) + S_{\text{p,m}}$$
(2)

Energy equation

$$\nabla .(\rho_{\text{f}} C_{\text{p,f}} V_{\text{f}} T_{\text{f}} ) = \nabla \cdot (k_{\text{f}} \nabla T_{\text{f}} ) + S_{\text{p,e}}$$
(3)

where P and T indicate pressure and temperature, respectively. Also, k, ρ, μ and Cp are thermal conductivity, density, dynamic viscosity and the specific heat. The subscript f refers to the continuous phase. The source terms of Sp,m and Sp,e are defined as below [43]:

$$S_{\text{p,m}} = \sum {n_{\text{p}} \frac{{m_{\text{p}} }}{\delta \forall }F}$$
(4)
$$S_{\text{p,e}} = \sum n_{\text{p}} \frac{{m_{\text{p}} }}{\delta \forall }C_{\text{p}} \frac{{{\text{d}}T_{\text{p}} }}{{{\text{d}}t}}$$
(5)

where F and mp, respectively, represent total force per unit mass of the particle acting on it and particle mass, np is the number of solid particles within a cell volume, and δ represents the cell volume. Also, subscript p refers to nanoparticle.

In Eq. (4), the parameter F is comprised of different forces including magnetic force, Brownian force, Saffman lift force, drag force and thermophoretic force.

$$F = F_{\text{D}} + F_{\text{L}} + F_{\text{T}} + F_{\text{B}} + F_{\text{M}} .$$
(6)

Gravity is neglected, because it is not significant compared with other forces [44].

The drag force (FD) is obtained by various formulas. A form of Stokes’ drag law is employed for submicron particles [45].

$$F_{\text{D}} = \frac{{18\mu_{f} }}{{d_{\text{p}}^{2} \rho_{\text{p}} C_{\text{c}} }}(V_{\text{f}} - V_{\text{p}} )$$
(7)

where Cc is Cunningham correction factor.

$$C_{\text{c}} = 1 + \frac{2\lambda }{{d_{\text{p}} }}(1.257 + 0.4e^{{ - (1.1d_{p} /2\lambda )}} )$$
(8)

where dp and λ represent the particle diameter and the molecular mean free path, respectively.

The Saffman lift force (FL) [46]:

$$F_{\text{L}} = \frac{{2 \times K_{\text{s}} \times v^{0.5} \rho_{\text{f}} d_{\text{ij}} }}{{\rho_{\text{p}} d_{\text{p}} \left( {d_{\text{ij}} d_{\text{ij}} } \right)^{0.25} }}\left( {V_{\text{f}} - V_{\text{p}} } \right)$$
(9)

where Ks = 2.594 and dij is the deformation tensor.

The thermophoretic force (FT) [47]:

$$F_{\text{T}} = \frac{{ - 6\pi \mu_{\text{f}}^{2} d_{\text{p}} C_{\text{s}} }}{{\rho_{\text{f}} (1 + 3C_{\text{m}} Kn)}}\frac{{k_{\text{f}} /k_{\text{p}} + C_{\text{t}} Kn}}{{1 + 2\left( {k_{\text{f}} /k_{\text{p}} } \right) + 2C_{\text{t}} Kn}}\frac{\nabla T}{{m_{\text{p}} T}}$$
(10)

where Cm= 1.14, Ct= 2.18 and Cs = 1.17.

The Brownian force (FB,i):

$$F_{\text{Bi}} = \xi_{\text{i}} (\frac{{\pi S_{0} }}{\Delta t})^{0.5}$$
(11)

where \(\xi_{{\rm i}}\) denotes the unit-variance-independent Gaussian random number with zero mean. Different components of the Brownian force (FB) are modeled as a Gaussian white noise process, while the spectral intensity of Sn,ij is given by Li and Ahmadi [48]:

$$S_{\text{n,ij}} = S_{0} \delta_{\text{ij}}$$
(12)

where δij is the Kronecker delta function, and:

$$S_{0} = \frac{{216vk_{\text{B}} T}}{{\pi^{2} \rho_{\text{f}} d_{\text{p}}^{5} (\frac{{\rho_{\text{p}} }}{{\rho_{\text{f}} }})^{2} C_{\text{c}} }}$$
(13)

where kB represents Boltzmann constant and ν is the kinematic viscosity.

The magnetic force applied on the magnetic nanofluid is calculated by [49]:

$$F_{\text{M,tot}} = \, \mu_{0} (M \cdot \nabla )H$$
(14)

where H denotes the magnetic field strength, M is magnetization, and μ0 represents the magnetic permeability [50]:

$$M = N \, m \, L(\xi ) = Nm\left( {\coth \xi - \frac{1}{\xi }} \right)$$
(15)

where \(\xi\). is the Langevin function argument (L), N denotes the nanoparticles number in unit volume, and m represents the magnetic moment.

$$\xi = \frac{{\mu_{0} mH}}{{k_{\rm B} T}}$$
(16)

The force applied on a single magnetic particle in unit mass is calculated by:

$$F_{\text{M}} = \frac{{\mu_{0} mL\left( \xi \right)\nabla H}}{{m_{\text{p}} }}$$
(17)

The magnetic moment of a nanoparticle is obtained by:

$$m = \frac{{8 \times 4\mu_{\rm B} \forall_{\rm p} }}{{7.3 \times 10^{ - 28} }}$$
(18)

where μB is Bohr magneton, and p is volume.

Energy equation for nanoparticles is calculated by:

$$m_{\text{p}} C_{\text{p,p}} \frac{{{\text{d}}T_{\text{p}} }}{{{\text{d}}t}} = Nu_{\text{p}} \pi d_{\text{p}} k_{\text{f}} (T_{\text{f}} - T_{\text{p}} )$$
(19)

where Nup number is calculated by Eq. (20) (Ranz and Marshall [51]).

$$Nu_{\text{p}} = 2 + 0.6Re_{\text{p}}^{0.5} Pr^{0.3}$$
(20)

where Pr is the Prandtl number, and Rep represents the particle Reynolds number.

Data reduction

The total entropy generation rate is calculated by:

$$\dot{S}^{\prime\prime\prime}_{\text{g,t}} = \dot{S}^{\prime\prime\prime}_{\text{g,h}} + \dot{S}^{\prime\prime\prime}_{\text{g,f}}$$
(21)

where \(\dot{S}^{\prime\prime\prime}_{\text{g,h}}\) and \(\dot{S}^{\prime\prime\prime}_{\text{g,f}}\) are thermal and frictional entropy generation rates, respectively.

$$\dot{S}^{\prime\prime\prime}_{\text{g,h}} = \frac{k}{{T^{2} }}\left[ {\left( {\frac{\partial T}{\partial x}} \right)^{2} + \left( {\frac{\partial T}{\partial y}} \right)^{2} } \right]$$
(22)
$$\dot{S}^{\prime\prime\prime}_{\text{g,f}} = \frac{\mu }{T}\left\{ {2\left[ {\left( {\frac{\partial u}{\partial x}} \right)^{2} + \left( {\frac{\partial v}{\partial y}} \right)^{2} } \right] + \left( {\frac{\partial u}{\partial y} + \frac{\partial v}{\partial x}} \right)^{2} } \right\}$$
(23)

With integration of local entropy generation rate, global entropy generation rate is obtained.

$$\dot{S}_{{\rm g,h}} = \int {\dot{S}^{\prime\prime\prime}_{{\rm g,h}} } {\text{d}}\forall \;{\text{and}}\;\dot{S}_{{\rm g,f}} = \int {\dot{S}^{\prime\prime\prime}_{g,f} } {\text{d}}\forall$$
(24)
$$\dot{S}_{{\rm g,t}} = \int {\dot{S}^{\prime\prime\prime}_{{\rm g,t}} d\forall } = \int {\dot{S}^{\prime\prime\prime}_{{\rm g,f}} } d\forall + \int {\dot{S}^{\prime\prime\prime}_{{\rm g,h}} } d\forall$$
(25)

The Bejan number is the ratio of thermal entropy generation rate to total entropy generation rate and is calculated by:

$$Be = \frac{{\dot{S}_{\text{g,h}} }}{{\dot{S}_{\text{g,t}} }}$$
(26)

The convective heat transfer coefficient is obtained by:

$$h = \frac{{q^{\prime\prime}}}{{T_{\text{w}} - T_{\text{b}} }}$$
(27)

Numerical method

The simulation of the magnetic nanofluid flow in the tube is performed only on one side of the tube. Therefore, the governing equations are solved two-dimensionally. The finite volume procedure is used for solving the governing equations. The meshes are selected very finer near the tube wall, because the temperature and velocity gradients are severe near the tube wall. In fact, a non-uniform network is considered. For investigation of the mesh independence, a number of different meshes are analyzed, and finally, the 400*30 mesh are selected in the longitudinal and radial directions of geometry, respectively (Re = 500, \(\phi\) = 0.03, dp= 50 nm and \(\frac{{{\text{d}}H}}{{{\text{d}}x}} = 0\)). The mesh used in the present simulation is shown in Fig. 2. The errors presented for the average convective heat transfer coefficient are obtained with respect to the best grid results (see Table 1)

Fig. 2
figure 2

Mesh configurations for the current simulation

Table 1 Checking the independence of the mesh

The accuracy of the simulation results of the Euler–Lagrange approach is compared with the data obtained from the experimental work of Kim et al. [52]. In their work, the nanofluid was carried out inside a tube at ϕ = 0.03 and Re = 1460. Figure 3 shows the acceptable results for the current paper. The comparison parameter between the two studies is convective heat transfer coefficient. It is found that the maximum error is 5%; therefore, the present results are correct.

Fig. 3
figure 3

Comparison between this paper with Kim et al. [52]

Results and discussion

The simulation of water–Fe3O4 nanofluid flow in this paper is carried out using the Euler–Lagrange method. The tube is investigated under a non-uniform magnetic field with different negative gradients. Also, different Reynolds numbers and three concentrations (ϕ) at dp = 50 nm (diameter of nanoparticles) are considered to evaluate the performance of the tube. In this research, the entropy generation (locally and globally), convective heat transfer coefficient, pressure drop, and distribution of nanoparticles concentration are studied.

In Fig. 4, the distribution of concentration of Fe3O4 nanoparticles at ϕ = 0.03 and Re = 500 with and without magnetic field is shown in a cross section of the tube. As can be seen from this figure, there is a non-uniform distribution in the tube cross section for nanoparticles, and the concentration of nanoparticles in the tube center is higher than the wall adjacency, which is generally attributed to the migration of Fe3O4 nanoparticles due to reasons like shear rate. In some papers, similar results have been reported for the non-uniform distribution of nanoparticles [53, 54]. However, most studies on nanofluid have used a single-phase method to simulate nanofluid, which, in their articles, it is assumed that the distribution of concentration is uniform [55, 56]. Moreover, this figure shows that in the presence of magnetic field, the distribution of concentration becomes more uniform. This is because the force of magnetic attracts the Fe3O4 nanoparticles toward the tube wall, and therefore, the nanoparticles concentration is enhanced near the wall.

Fig. 4
figure 4

Distribution of nanoparticles concentration at a cross section

If the magnetic field is applied, the velocity profile may change due to the distribution of nanoparticles non-uniform. In other words, because of the higher number of particles in the tube center (due to more concentration), the force in these regions becomes more important. For a cross section of tube at ϕ = 0.03 and Re = 500, the velocity profile for different magnetic fields with negative gradients is shown in Fig. 5 (where subscript s refers to a magnetic field strength at ϕ = 0.03 and Re = 500). In this figure, it can be seen that the velocity of the nanofluid in the central part of the tube decreases with the application of the magnetic field and the increase in its gradient. However, the nanofluid velocity near the wall increases with increasing magnetic field gradient. Because the gradient of the magnetic field is negative, the force exerted on the Fe3O4 nanoparticles is in the opposite direction of the nanofluid; due to the non-uniform concentration distribution in the cross section of the tube, the velocity increases near the tube wall and reduces in the central regions.

Fig. 5
figure 5

Velocity profile at a cross section for different magnetic fields

Figure 6 demonstrates the non-dimensional nanofluid velocity profile at a cross section for the concentration of 0.01, 0.03 and 0.05 (dH/dx = 0 and Re = 500). By approaching the tube central part, the velocity gradient decreases. It is found that the nanofluid flow at ϕ = 0.03 and 0.05 possesses a flatter velocity profile in comparison with ϕ = 0.01.

Fig. 6
figure 6

Velocity profile at a cross section for ϕ = 0.01, 0.03 and 0.05

As shown in Fig. 7, the frictional entropy generation rate near the wall of the tube is highest, and in the central part, frictional entropy generation rates are very low (ϕ = 0.03 and Re = 500). The changes obtained for the frictional entropy generation rate are due to the velocity gradient at the cross section of the tube. (As the tube wall is narrowed, the velocity profile changes slowly.) It can be seen from Fig. 7 that the frictional entropy generation rate changes with the application of the magnetic field and with the increase in its gradient. With increasing magnetic field strength, the frictional entropy generated rate in the vicinity of the walls increases, and in the central part of the tube, less quantities are generated for entropy. The reason for these changes is due to the velocity changes described in Fig. 5. Figure 8 shows the contour of the frictional entropy generation rate near the inlet of the tube. It is found that more quantities are generated for frictional entropy in the vicinity of the wall in comparison with the other regions.

Fig. 7
figure 7

Frictional entropy generation rate at a cross section for different magnetic fields

Fig. 8
figure 8

Frictional entropy generation rate distribution near the inlet

The dimensionless temperature (Tw/Tin) and local convective heat transfer coefficient on the tube wall for various gradients of the magnetic field are shown in Fig. 9 (ϕ = 0.03, Re = 500). Figure 9a shows that with the application of the magnetic field, the convective heat transfer coefficient increases. The increase in convective heat transfer coefficient is due to the fact that the use of the magnetic field leads to an increase in speed near the wall of the tube (see Fig. 5). Also, it is found that the increase in magnetic field strength can also lead to an increase in the convective heat transfer coefficient (see Fig. 9a). Applying a magnetic field with a gradient of (dH/dx)/(dH/dx)s = 2 can increase the local convective heat transfer coefficient up to 48 percent at X = 0.3. Moreover, it is clear that in the longitudinal direction of the tube, as the amount of magnetic field decreases, the convective heat transfer coefficient decreases, and then after X = 0.61, convective heat transfer coefficient values are equal to all the gradients. (After leaving the nanofluid flow from the magnetic field, its behavior resembles a state in which the magnetic field is not applied.) Moreover, in Fig. 9b it is clearly shown that the wall temperature of the tube decreases in part where the magnetic field is employed, and the more the magnetic field is increased, the better the tube surface cooling is done.

Fig. 9
figure 9

a Local convective heat transfer coefficient and b non-dimensional temperature on the tube wall

The local convective heat transfer coefficient in a non-magnetized state for different concentrations is presented in Fig. 10 (Re = 500). It is clear from the figure that the use of nanoparticles and the addition of nanoparticles concentration lead to an increase in the convective heat transfer coefficient throughout the tube. As mentioned in previous papers, the reason for the increase is that the thermal conductivity of the nanofluid is increased by adding nanoparticles.

Fig. 10
figure 10

Local convective heat transfer coefficient for three concentrations

The convective heat transfer coefficient along the tube for the three different Reynolds number is shown in Fig. 11 (ϕ = 0.03 and (dH/dx)/(dH/dx)s = 2). The previous papers have been mentioned that the convective heat transfer coefficient is affected by the change in Reynolds number and increases as it rises throughout the tube. (The increase in the convective heat transfer coefficient in the first part of the tube is more evident.) By the increase in the Reynolds number, the wall temperature across the tube and the bulk temperature of the flow decreases, which ultimately leads to an increase in convective heat transfer coefficient according to Eq. 27. It is also clear from this figure that, as in Fig. 9a, the magnetic field also affects the convective heat transfer coefficient and leads to increase, but with the difference that in the higher Reynolds number, the influence of the magnetic field decreases. Because, by decreasing Reynolds number, the effect of magnetic force becomes more important than the inertia force.

Fig. 11
figure 11

Local convective heat transfer coefficient for three Reynolds numbers

Figure 12 shows the temperature profile for a cross section of tube at ϕ = 0.03, Re = 500 and for different magnetic fields with negative gradient. The temperature of nanofluid in the vicinity of the wall of the tube decreases with the application of the magnetic field. The reason is that by applying the magnetic field, the amount of velocity in the vicinity of the wall increases. But the temperature of the central parts of the tube does not affect the application of the magnetic field and increase its gradient. While the flow velocity in the central section of the tube decreases with the application of the magnetic field, and this cross section is close to the tube inlet, the growth of the thermal boundary layer does not cross over this cross section. Therefore, the effect of the magnetic field is not affected.

Fig. 12
figure 12

Temperature profile at a cross section for different magnetic fields

Figure 13 shows the thermal entropy generation rate in two different cross sections (X = 0.33 and near the outlet) for ϕ = 0.03 and Re = 500. In this figure, the thermal entropy generation rate in the vicinity of the wall and in the central section of the tube is higher and lower, respectively. Because it is near the wall of the tube, there is a high temperature gradient; hence, in accordance with Eq. 22, more entropy is also generated. On the other hand, the thermal boundary layer of the nanofluid flow up to the tube outlet grows greatly, so the gradient of temperature is significant, which ultimately results in the higher thermal entropy at the outlet than the inlet proximity. It can be seen from this figure that, in the very near areas of the wall, the amount of thermal entropy generation rate decreases. (The decrease in the thermal entropy generation rate is more evident in Fig. 13b.) Because the heat flux is employed and the temperature increases along the wall and the temperature is in the denominator of Eq. 22, thermal entropy generation rate is reduced. In addition, it can be found that by applying the magnetic field, the thermal entropy generation rate changes. In Fig. 12, it is found that the magnetic field leads to decrease in the gradient of temperature in the vicinity of the wall, but the central parts of the magnetic field did not get any effect. Therefore, the thermal entropy generation rate in the vicinity of the wall is reduced by applying the magnetic field and increasing its strength. It is noteworthy that in Fig. 13a the nanofluid flow has received a greater influence on the magnetic field. Figure 14 shows the thermal entropy generation rate contour. It is seen that the highest and lowest thermal entropy generation rates occur, respectively, near the wall and in the central part of the tube. This is because the highest temperature gradients occur in the wall vicinity.

Fig. 13
figure 13

Thermal entropy generation rate at: aX = 0.33 and b near the outlet

Fig. 14
figure 14

Contour of thermal entropy generation rate near the outlet

Figure 15 shows global non-dimensional values for the thermal and frictional entropy generation rate at three different magnetic field strengths (ϕ = 0.03 and Re = 500). Here the subscript s refers to the non-magnetized state and ϕ = 0.03. From Fig. 15a, it can be found that with the increase in the strength of the magnetic field, the global frictional entropy generation rate increases. As can be seen in Fig. 7, the frictional entropy generation rate in the vicinity of the wall and the central section of the tube increases and decreases with the application of the magnetic field, respectively, which ultimately leads to increase in global frictional entropy generation rates. From Fig. 15b, it can be found that the global thermal entropy generation rate decreases with increasing magnetic field strength, because the magnetic field reduces the thermal entropy generation rate (see Fig. 13).

Fig. 15
figure 15

Integrated rates of: a frictional and b thermal entropy generation rates

The Bejan number contour is drawn (Fig. 16) near the tube outlet and inlet for ϕ = 0.03 and Re = 500. It is clear from Fig. 16a that the Bejan number is much larger near the vicinity of tube wall than the central part. As can be seen in Fig. 13, the high quantities of thermal entropy generation rate are occurred near the tube wall. This figure also shows that the nanofluid flow with movement in the tube leads to the high values of the Bejan number to the central part of the tube. In fact, hydrodynamic boundary layer growth is faster with respect to the thermal boundary layer. (For the nanofluid flow, Prandtl number is great.) Therefore, near the tube inlet, the boundary layer of the hydrodynamic develops quickly, while the boundary layer of the thermal develops in a region more distant from the tube inlet. In addition, Fig. 16b shows that the Bejan number is approximately 1 near the outlet. In fact, in this part, because of the thermal boundary layer growth, large amounts of thermal entropy are generated, which is a high value for the Bejan number indicating the predominance of thermal entropy generation rate.

Fig. 16
figure 16

Bejan number contour: a near the inlet, b near the outlet

The pressure drop at various magnetic field gradients is presented in Fig. 17 (ϕ = 0.03 and Re = 500). From this figure, it can be found that for a negative gradient, if the magnetic field is used, the pressure drops increases, and this figure also shows that the pressure drop is exacerbated by increasing the strength of the magnetic field gradient, because in the negative gradient, the magnetic force enters Fe3O4 nanoparticles in the opposite direction.

Fig. 17
figure 17

Non-dimensionless pressure drop for different magnetic fields

Conclusions

The magnetic nanofluid flow containing Fe3O4 nanoparticles is simulated by the Euler–Lagrange model. The non-uniform magnetic field is applied on a part of tube; and the constant heat flux is applied on the tube wall. In this research, entropy generation rate (locally and globally), pressure drop, convective heat transfer coefficient, and distribution of nanoparticles concentration are studied. Results show that the highest and lowest thermal entropy generation rates occur, respectively, near the wall and in the central part of the tube. The convective heat transfer coefficient enhances by increasing Reynolds number and concentration. The nanofluid flow at the concentration of 0.05 possesses a profile of flatter velocity in comparison with concentration of 0.01. Also, the current simulation shows that by applying magnetic field:

  • The velocity of the nanofluid in the tube central part and near the wall decreases and increases, respectively.

  • In the vicinity of the wall and in the central part of the tube, the frictional entropy generation rate increases and decreases, respectively.

  • In the vicinity of the wall, the thermal entropy generation rate reduces.

  • The global thermal entropy generation rate decreases.

  • The global frictional entropy generation rate enhances.

  • The convective heat transfer coefficient increases.

  • The wall temperature of the tube decreases in the part where the magnetic field is applied.

  • The pressure drop along the tube increases.

  • The temperature of the nanofluid in the vicinity of the wall decreases.