MAGNETIC FIELD EFFECT ON THE HEAT TRANSFER IN A NANOFLUID FILLED LID DRIVEN CAVITY WITH JOULE HEATING

In this paper, the effects of magnetic field, Joule heating and volumetric heat generation on the heat transfer and fluid flow in a Cu-Water nanofluid filled lid driven cavity using enhanced streamfunction–velocity method are investigated. The cavity is heated by a uniform volumetric heat density and side walls have constant temperature. The top wall moves with constant velocity in +x direction, while no-slip boundary conditions are imposed on the other walls of the cavity. An inclined fixed magnetic field is applied to the left side wall of the cavity. The dimensionless governing equations are solved numerically for the stream function and temperature using finite difference method for various Richardson(Ri), Reynolds(Re), Hartmann (Ha), Eckert(Ec)numbers, magnetic field angle(α) and solid volume fraction of the nanofluid() in MATLAB software. To discretize the streamfunction-velocity formulation, a five point constant coefficient second-order compact finite difference approximation which avoids difficulties inherent in the conventional streamfunction–vorticity and primitive variable formulations is used. The stream function equation is solved using fast Poisson's equation solver on a rectangular grid (POICALC function in MATLAB) and the temperature equation is solved using Jacobi bi-conjugate gradient stabilized (BiCGSTAB) method. The heat transfer within the cavity is characterized by Nusselt number (Nu1). The results show that Nu1 is significantly increased by increasing Ri and  and increasing the Reynolds number enhances convective cooling. The heat transfer within the cavity is decreased by increasing Hartmann number which improves conduction heat transfer and reduces Nu1. Joule heating has a negative effect on the convection within the cavity and convection is decreased by increasing the value of Ec. It can be investigated that Nu1 is decreased by increasing Ec due to the strong distortion effect of Joule heating on convection current of heat transfer.


INTRODUCTION
Magnetic field effects on the heat transfer and fluid flow in fluids and nanofluids have important applications in many engineering areas and have been investigated by a number of researchers. In industrial problems, flow of an electrically conducting fluid, subjected to a magnetic field, is used, thus the fluid experiences a Lorentz force, and its effect is to reduce the flow velocities which affect the heat transfer rate. The study in [1] shows that the magnetic field suppresses the natural-convection currents and the magnetic field strength is one of the most important factors for crystal formation. The transient convective motion and heat transfer in a square cavity are investigated in [2] where the horizontal walls are adiabatic and the vertical walls are maintained at different constant temperatures. An analytical solution to the magneto-hydrodynamic (MHD) flow equations is proposed in [3] and the effect of a transverse magnetic field on buoyancy driven convection is modeled. The natural convection within rectangular cavity with a transverse magnetic field is studied numerically in [4] where one vertical wall is cooled and the other one heated while the top and bottom walls are insulated. The transient MHD equations are solved using the control volume algorithm in [5][6][7]. The solutions of the two-dimensional steady state magneto-hydrodynamic flows are proposed in [8][9][10][11][12][13], using finite difference and finite element methods (FDM and FEM). Steady state laminar natural convection MHD flow equations in a rectangular enclosure are solved numerically for the stream function, vorticity and temperature in [14][15][16][17].
Magnetic field effect on mixed convection heat transfer of nanofluids flow in a wavy channel is studied using mixture model and so, the effects of nano-particle volume fraction, sine wave amplitude, Reynolds number, Grashof number and Hartman number on fluid flow and heat transfer characteristics are studied in [18]. The results of [18] show that the average Nusselt number increases and average Poiseuille number decreases by adding the nano-particles to the base fluid. Transient, laminar, natural-convection flow of a micropolar-nanofluid (Al2O3/water) in the presence of a magnetic field in an inclined rectangular enclosure is considered in [19]. Authors show that circulation and convection become stronger by increasing Rayleigh and microrotation numbers but they are significantly suppressed by the presence of a strong magnetic field. In [20] heat transfer and fluid flow analysis in a straight channel utilizing nano-fluid are numerically studied, while flow field is under magnetic field. Usage of nano-particles in the base fluid and also applying magnetic field transverse to fluid velocity are two ways recommended in this paper to enhance heat exchange in straight duct.
Influence of external magnetic source to two-dimensional Fe3O4-water nanomaterial in a half circular shape cavity and semi annulus enclosure with sinusoidal hot wall are numerically addressed in [21,22] and numerical solution is carried out using control volume based finite element method (CVFEM). It has been found that augmenting nanofluid volume fraction, Rayleigh and magnetic numbers leads to improve of the temperature gradient while it reduces with augment of Lorentz forces. The natural convection of CuO-water nanofluid flow and heat transfer in a cavity which is heated from below under the magnetic field effect is proposed in [23], and the governing equations are solved using the lattice Boltzmann method. Their results have indicated that enhancement in heat transfer has direct relationship with Hartmann number and heat source length but it has reverse relationship with Rayleigh number.
In [24] MHD mixed convection in a CuO-nanofluid filled lid-driven cavity having an elastic side wall and volumetric heat generation is numerically investigated. The left vertical wall moves with constant velocity in +y direction. The left vertical wall of the cavity is maintained at constant cold temperature while the right vertical wall is at hot temperature and the other walls of the cavity are insulated. Better thermal transport of the fluid within the cavity is seen due to the increment of effective thermal conductivity of the nanofluid as the volume fraction of the solid nanoparticles increases. Authors in [25,26] propose mixed convection and MHD natural convection flow numerical study in a flexible sided, partially heated fluid-filled (and nanofluid-filled) triangular cavity with internal heat generation.
Influence of an inclined uniform magnetic field on mixed convection in an oscillating lid-driven cavity filled with nanofluid is numerically investigated in [27]. The cavity is heated from below and cooled from above while side walls are assumed to be adiabatic. The top wall velocity varies sinusoidally while no-slip boundary conditions are imposed on the other walls of the cavity. Their results have shown that the convection within the cavity is suppressed when the strength of the magnetic field is higher such that the corresponding Hartmann number is greater than 20. Authors in [28] also numerically studied the mixed convection of CuO-water nanofluid filled lid driven cavity having its upper and lower triangular domains under the influence of inclined magnetic fields. The top horizontal wall of the cavity moves with constant speed in +x direction while no-slip boundary conditions are imposed on the other walls. The top wall of the cavity has constant cold temperature while the bottom wall is at hot temperature and the other walls of the cavity are adiabatic. In [29] MHD free convection has been proposed in an inclined wavy enclosure filled with a Cu-water nanofluid in the presence of an isothermal corner heater and an inclined uniform magnetic field. The cavity is heated from the left bottom corner and cooled from the top wavy wall while the rest walls are adiabatic. It has been found that the heat transfer rate increases with nanoparticles volume fraction and variation of the cavity inclination angle leading to essential changes in the fluid flow and heat transfer. The conjugate effect of Joule heating and magnetic field on MHD natural convection and the entropy generation are studied numerically inside a sinusoidal heated lid-driven cavity filled by Fe3O4-water nanofluid in [30]. It is shown that the increase of both Hartmann and Eckert number results in a decrease and increase in average Nusselt number and the entropy generation, respectively. The effect of inclination angle on the heat transfer of Al2O3-water nanofluid for mixed convection flows in a partially heated double lid driven inclined cavity is numerically simulated in [31]. At the lower wall of the cavity, two heat sources are fixed with the condition that the remaining part of the bottom wall is kept insulated. Top wall and vertically moving walls are maintained at constant cold temperature. Authors in [32] also studied entropy generation in the same configuration in [31] under the influence of inclined magnetic field.
The unsteady MHD mixed convection flows of SWCNT-water and Au-water nanofluids are investigated within a horizontal grooved channel with two heat generating solid cylinders in reference [33]. It has been found that the fluid flow and temperature are significantly affected by groove area and groove shape. On the other hand, the heat transfer rate is shown to be higher in the case of the Au-water nanofluid at low Reynolds number, but at high Reyolds number, the heat transfer rate is higher in the case of the SWCNT-water nanofluid. The constant magnetic field and slip effects on developing laminar forced convection of the mixture of FMWNT carbon nanotubes suspended in water in the microchannels are proposed in [34]. Slip velocity is supposed as the hydrodynamic boundary condition while the microchannel's lower wall is insulated and the top wall is under the effect of a constant heat flux.
The inclined magnetic field effect on mixed convection in Cu-water nanofluid filled lid-driven cavity is examined in [35]. Slip velocity is considered along the lid horizontal walls and a constant heat flux source is supposed on the left wall, meanwhile the right vertical wall is cooled isothermally. The remainder walls are thermally insulted. They show that the orientation of the magnetic field can be considered as a key control of the convective heat transfer where the suppression used by the magnetic field on the Nusselt number decreases by increasing the orientation of the applied magnetic field. Authors in reference [36] consider the effects of magnetic field on the flow field, heat transfer and entropy generation in a Cu-water nanofluid filled trapezoidal enclosure. The top wall of the enclosure is cold and moves toward right (or left) and the bottom wall is hot and the side walls are insulated. In [37] the effect of an external oriented magnetic field on heat transfer and entropy generation of Cu-water nanofluid flow in an open cavity heated from below is also investigated and the governing equations are solved numerically by finite-volume method. Authors in [38][39][40][41][42][43] have also proposed entropy generation, natural convection, MHD free and mixed convection and heat transfer of Cu-Water, CuO-Water and Water-Fe3O4 nanofluids in a C-shaped cavity and lid-driven square porous enclosure with partial slip and heat sink.
Although considerable papers have studied heat transfer enhancement of nanofluid in a square cavity, but based on the discussion about the literature and the author's best knowledge, the problem of MHD mixed convection inside a lid driven cavity filled by nanofluid, with internal Joule heating and volumetric heat generation has not been proposed. In addition, no proper study is found in the literature which uses the streamfunction-velocity formulation for numerical simulation of nanofluid filled cavity. Therefore, in this paper the effects of magnetic field, Joule heating and volumetric heat generation are investigated on heat transfer and fluid flow in a Cu-Water nanofluid filled lid driven cavity using enhanced streamfunction-velocity method. The dimensionless governing equations are solved numerically for the stream function and temperature using finite difference method for various Richardson(Ri), Reynolds(Re), Hartmann (Ha), Eckert(Ec)numbers, magnetic field angle(α) and solid volume fraction of the nanofluid() in MATLAB software. To discrete the streamfunction-velocity formulation five point constant coefficient second-order compact finite difference approximations are used which avoids difficulties inherent in the conventional streamfunction-vorticity and primitive variable formulations. The stream function equation is solved using fast Poisson's equation solver on a rectangular grid (POICALC function in MATLAB) and the temperature equation is solved using Jacobi bi-conjugate gradient stabilized (BiCGSTAB) method. The paper is organized as follows: Section 2 describes the problem geometry and mathematical formulations. Discretizations of the governing equations and the solution method are presented in section 3. Grid independency test and code validation are brought in section 4. Results and discussion are provided in detail in section 5. Finally, conclusion is in section 6.

PROBLEM GEOMETRY AND MATHEMATICAL FORMULATIONS
The geometry of the problem is schematically shown in Fig. 1. The inclined constant magnetic field with flux density B is applied, with respect to the coordinate system. The top and bottom walls of the cavity are adiabatic, and the side walls are kept at a constant temperature T=Tc. The top horizontal wall of the cavity moves with constant speed in +x direction while no-slip boundary conditions are imposed on the other walls (table 1). The cavity is filled with Cu-water nanofluid under the influence of the inclined magnetic field. Thermo-physical properties of water and copper at the reference temperature are presented in table 2. The nano-fluid is taken to be Newtonian, incompressible and laminar and the nano-particles are assumed to have a uniform shape and size. Moreover, it is assumed that both the fluid phase and nano-particles are in thermal equilibrium state and the slip velocity between the phases is ignored. Therefore, nano-fluid is modeled with single phase approach. In the other hand, the buoyancy force in the momentum equation is approximated by using the Boussinesq approximation. Thus Continuity, momentum and energy equations in scalar form considering internal joule heating effect and volumetric heat generation in two dimensional Cartesian coordinate system are written as follows:  ( kg·m -1 ·s −1 ) 1.003e-3 --- where and are the velocity in the x any y directions, and are the magnetic flux density in the x any y directions, p is the pressure, T is the temperature and is the gravitational acceleration in y direction. , , , ( ) and are the density, the viscosity, the thermal conductivity, the specific heat and the electrical conductivity of the nanofluid respectively. q is volumetric heat density. The terms − ( − ) and + ( − )appearing in (2) and (3), respectively, represent the Lorentz force per unit volume in the x and y directions and occur due to the electrical conductivity of the fluid. Also the term ( − ) 2 in (4) represents the Joule heating. The effective density, specific heat, thermal expansion coefficient and electrical conductivity of nanofluid are given by the following formulas [25]: The equation (11) is for nanofluids containing spherical nanoparticles with volume fraction between1% to 8% and base fluid could be water or ethylene glycol. Us is The Brownian motion velocity. df and ds are the water molecules and copper nanoparticles diameter (df=2×10 -10 and ds=100×10 -9 ). The effective viscosity of the nanofluid is given by [27]: The continuity, momentum, and energy equations are expressed in the non-dimensional form using the following dimensionless parameters: Where dimensionless numbers Pr, Gr, Re, Ha , Ec and Ri are Prandtl, Grashof, Reynolds, Hartmann , Eckert and Richardson numbers, respectively. Therefore, dimensionless form of the governing equations can be expressed as: Journal of Thermal Engineering, Research Article, Vol. 6, No. 4, pp. 521-543, July, 2020

SOLUTION METHOD
The typical difficulty of the stream-function-vorticity formulation is the lack of the simple physical boundary conditions for the vorticity field at the no-slip boundaries. In order to avoid the drawbacks associated with the vorticity values at the boundary, the streamfunction-velocity or the stream-function formulation-based methodology for the solution of the 2D incompressible fluid flows, which eliminates the need to calculate the vorticity as a part of the computational process, has been utilized for solving Navier-Stokes equations. The stream-function formulation includes the stream function and its first derivatives resulting in a fourth-order differential equation in stream function. The boundary conditions for stream function and velocities are generally known and are easy to be implemented computationally; thus the computational schemes are found to be very efficient. When the stream-function-velocity formulation, which is a fourth-order partial differential equation, is solved by finite differences, a uniform grid with 13 points must be needed to obtain a classical second-order finite difference approximation. This difference discretization using 13 grid points needs to be modified at grid points near the boundaries and must bring about difficulties for the solution of the resulting linear systems. In order to overcome the above drawback, the stream-function () is established on a uniform grid using the four nearest neighbors' values of  and is the constant coefficient second-order compact scheme.
In this paper, an efficient compact finite difference approximation (five point constant coefficient secondorder compact (5PCC-SOC) scheme), is used for the stream-function formulation of the steady incompressible Navier-Stokes equations, in which the grid values of stream-function and the values of its first derivatives (velocities) are carried as the unknown variables. Stream function is defined as: = (19) = − (20) Therefore, from (15) to (17) Where subscript 0 refers to the point (xi,yj) in the cavity, while h is the grid spacing. We can obtain the following relations at an interior grid point (xi,yj) for a sufficiently smooth solution Ψ using the Taylor series [45]: We can obtain from (23): Substituting (24) into (21) and using (22), and omitting the truncation error, we can obtain the following second-order compact finite difference formulation: Fourth order compact approximations for Vx and Vy are given, respectively, by [45]:

Grid independency test and validation
A grid independence test is performed for this study, with Pr=6.837, Gr=10 6 , Re=100, Ha=100, Ec=0, = 0.05 and α=45 (angle of flux density B) in order to determine the proper grid size. The following seven mesh-grid sizes are considered for the grid independence study. These mesh-grid densities are 4040, 6464, 8080, 100100, 128128, 144144 and 160160. The maximum temperature θmax, the maximum stream function max of the fluid and the averaged Nusselt number Nuavg on the right side wall of the cavity are used as a sensitivity measure of the solution accuracy, and are selected as the monitoring variables for the grid independence study. Table 3 shows the dependence of the quantities θmax, max and Nuavg on the grid size. Considering the accuracy of the numerical values, the following calculations are performed with structural uniform quadrilateral (square) 128128 grid. The numerical code is benchmarked with a differently heated cavity problem filled with pure fluid, which is maintained at cooled condition, by the right wall.  Table 4. The parameters considered are the maximum value of the horizontal velocity component (Vxmax) on the vertical mid-plane (X = 0.5); the maximum value of the vertical velocity component (Vymax) on the horizontal mid-plane (Y = 0.5) and Nuavg values on the heated side wall (X = 0). The obtained results of the proposed code show an acceptable agreement with the others. Furthermore, the present solver is validated against the existing numerical results of [20,28,54,55]. The comparison of streamline contours and isotherm lines obtained from the present code and those of [20,28,54,55] for natural convection through the enclosure under magnetic field are shown in Fig.2 for (Ra=7000 and Ha=25) and (Ra=7×10 5 and Ha=100). Comparisons confirm agreement accuracy with those of the literature. ------------16.520

Results and discussion
The natural and forced convection in a Cu-Water nanofluid filled lid driven cavity with volumetric heat generation, Joule heating and in the presence of an external magnetic field are considered in this study. Parametric numerical simulations are performed in the following range of parameter values: 10 4  Gr  10 7 ; 0 Re  100; 0Ha100; 0Ec0.08; 0 0.08; 0 α  135. The fluid flow and thermal fields are analyzed through the streamlines and isotherm contours. The heat transfer within the cavity is characterized by Nusselt number. The resulting Nusselt number for the cases under consideration Nu1 is defined as 1/θmax [56].

Effect of Richardson number
To study the influence of Richardson number, it is varied between 1 Ri  1000, while Re=100, Ha= 0, Ec=0 and 0 0.08. The effect of Richardson numbers on streamlines and isotherms are shown in Fig.3 and Fig.4. The ratio of natural to forced convection is measured by Richardson number. For low Ri range (Ri=1) the forced convection is dominant. Figures 3(a) and 4(a) indicate that the buoyancy effect is overpowered by shear effect due to the movement of the top lid in lid-driven cavity. The streamlines behavior in the lid-driven cavity is distinguished by a primary recirculating cell occupying most of the cavity generated by the lid. The flow due to the moving lid penetrates more into the cavity at low Ri. Furthermore, for value of Ri = 10 mixed convection is dominant. Figures 3(b) and 4(b) point out the buoyancy effect has magnitude relatively comparable with the shear effect. The flow streamlines still show a primary re-circulating cell of the size of the cavity generated by the moving top lid and two secondary eddies near the bottom corners with the one near the left bottom corner bigger and stronger than the one in the right bottom corner of the cavity. The center of the primary cell moves towards the top moving wall. For values of Ri = 100 and 1000 the buoyancy effect is dominant, the isotherms move towards the top wall, secondary recirculation zone near the left wall of the cavity can be seen, θmax decreases, and the rotating vortices become larger. In this case the effect of natural convection becomes important and the convection is enhanced. The effect of internal heating becomes more important when Ri is high and the isotherms become parallel to the horizontal walls indicating the dominance of convection inside the cavity. Figure 4 indicate that, an increase in solid volume fraction to 0.08 increases the values of Ψmax. The effects of Richardson number and volume fraction of the nano-particles on the Nu1 are shown in Fig. 5. It is clear that the Nu1 significantly increases by increasing Ri and .

Effect of Reynolds number
To study the influence of Reynolds number, it is varied between 1 Re  100, while α =0, Ha=0, 0 0.08 and Ec=0.04. Figures 6 and 7 show the effect of Reynolds number on isotherm and streamline contours. As can be noticed from these figures, for Re=1 the flow is almost symmetric along the vertical midline of the cavity and with two counter-rotating cells. Eddies become asymmetric, Ψmax decreases, and one eddy moves up toward the top wall by increasing the Reynolds number. As it can be observed from the isotherm plots at low Reynolds numbers (Re=1), the contours are almost parallel. However, more increasing of the Reynolds number enhances convective cooling. The isotherm contours change significantly and become asymmetric. The location of the maximum temperature moves down from the top wall of the cavity by increasing the Reynolds number. Effect of Reynolds number on Nusselt number with different nanoparticle volume fraction is shown in Fig. 8. It is observed that Nusselt number Nu1 increases by increasing the nanoparticle volume fraction. But increase of Re from 50 to 100 play a little role for enhancement of Nu1 in a constant nanoparticle volume fraction.

Effect of magnetic field orientation
To study the influence of magnetic field angle, it is considered 0 α  135, 25 Ha 100, while Re=100, Gr= 10 6 , Ec=0, =0.04. Fig. 9 shows the isotherms and streamlines for various values of α. It is shown that for α=0,

Effect of Eckert number
To study the influence of Eckert number, it is varied between 0 Ec  0.08, while Re=100, Gr= 10 6 , Ha=50, =0.04 and 0 α  90. Figure 17 shows the effect of Eckert number on isotherm and streamline contours. It can be observed that the size of the primary vortices enhances with increase of Eckert number due to the increase of the heat generation inside the cavity and when Eckert number is increased vortices becomes bigger. Isotherms start to move away from the left wall to the right wall of the cavity and convection is decreased by increasing Ec value, therefore, Joule heating has a negative effect on the convection within the cavity. The effects of Eckert number and magnetic field angle on Nusselt number is shown in Figure 18. It can be investigated that Nu is decreased by increasing Joule heating effect due to the strong distortion effect of Joule heating on convection current of heat transfer. It can also be seen that the Nusselt number is almost constant when magnetic field angle is varied between 70<α<90 at a constant Eckert number.  1 Ri  1000, Reynolds number 0  Re  100, Hartmann number 0  Ha 100, Eckert number 0  Ec  0.08, magnetic field angle 0  α  135 and solid volume fraction of the nanofluid 0    0.08. The present study leads to the following results: • For low Ri range (Ri=1) the forced convection is dominant. Furthermore, for value of Ri = 10 mixed convection is dominant and for values of Ri = 100 and 1000 the buoyancy effect is dominant, the isotherms move towards to the top wall, θmax decreases, and the rotating vortices become larger. • The Nusselt number is significantly increased by increasing Richardson number and solid volume fraction of the nanofluid. • It can be observed from the isotherm plots at low Reynolds numbers (Re = 1), the contours are almost parallel.
However, more increasing of the Reynolds number enhances convective cooling. It is also observed that Nusselt number Nu1 increases by increasing the nanoparticle volume fraction. • Increasing the Reynolds number enhances convective cooling but, increase of Re from 50 to 100 play a little role for enhancement of Nusselt number in a constant nanoparticle volume fraction. • When inclination angle is increased from 0 to 90, isotherms moves toward the top of the cavity and the streamlines are deformed from their original shape and the cluster of streamlines is shifted to the right vertical wall. It is also observed that the Nu1 decreases with the increase of Ha and also increases for α= 90 at the same Ha. • The isotherms are transmitted from convection model to vertical pattern by increasing Ha due to the magnetic force effect which points out to the suppression of the convection. The existence of the metallic nanoparticles in the base fluid improves the thermal conductivity of the nanofluid and the thermal buoyancy forces are enhanced. • The heat transfer within the cavity is decreased by increasing Hartmann number and so reduces Nu1 value.
On the other hand, it can be seen that increasing the magnetic field angle improves a small amount convective heat transfer across the cavity. • Joule heating has a negative effect on the convection within the cavity and convection is decreased by increasing Eckert number. It can also be investigated that Nu1 is decreased by increasing Joule heating effect. In addition, It can be seen that the Nusselt number is almost constant when magnetic field angle is varied between 70 < α < 90 at a constant Eckert number.