Free convection in a square wavy porous cavity with partly magnetic field: a numerical investigation

Natural convection in a square porous cavity with a partial magnetic field is investigated in this work. The magnetic field enters a part of the left wall horizontally. The horizontal walls of the cavity are thermally insulated. The wave vertical wall on the right side is at a low temperature, while the left wall is at a high temperature. The Brinkman-Forchheimer-extended Darcy equation of motion is utilized in the construction of the fluid flow model for the porous media. The Finite Element Method (FEM) was used to solve the problem’s governing equations, and the current study was validated by comparing it to earlier research. On streamlines, isotherms, and Nusselt numbers, changes in the partial magnetic field length, Hartmann number, Rayleigh number, Darcy number, and number of wall waves have been examined. This paper will show that the magnetic field negatively impacts heat transmission. This suggests that the magnetic field can control heat transfer and fluid movement. Additionally, it was shown that heat transfer improved when the number of wall waves increased.


List of symbols
Magnitude of the magnetic field, N.A -1 .m 2 x, y Cartesian coordinates,m x ′ , y ′ Dimensionless cartesian coordinates and Ra, respectively.At low Rayleigh numbers, with the change of porosity and permeability coefficient, natural convection heat transfer change is not noticeable.Hashemi et al. 24 studied the natural convection of micropolar copper-water nanofluid in a porous chamber that produces heat.Their investigation focused on the thermal and dynamic characteristics of the nanofluid in a square chamber, where heat is produced in both the fluid and solid phases of the porous medium.They employed the Galerkin finite element method with a nonuniform structured grid to solve the governing equations and the Darcy model to simulate the flow dynamics.Finally, they showed the effect of various dimensionless parameters on velocity, temperature, and rotation.Fenghua Li et al. 25 explored the flow behavior of hybrid nanomaterials inside a permeable cavity under the influence of magnetic force.They considered the effects of permeability and external force in the Navier-Stokes equations to simulate the free convection of hybrid nanomaterials.They also evaluated the effect of various factors such as Darcy number, Hartmann number, and radiation on the fluid flow.The steady-state flow of magnetized nanofluid in the wavy cavity with radiation was examined by Nong et al. 26 .The control volume finite element (CVFE) technique is used to estimate numerical modeling.The behavior of streamlines, average Nusselt number, and isotherms was shown to be affected by magnetic force, Rayleigh number, porosity coefficient, and shape factors of nanoparticles according to them.The natural convection of a micropolar fluid was examined by Nikita et al. 27 .They reviewed their study in the wave cavity.They discussed how the flow patterns, temperature fields, and average Nusselt number in the hot corrugated wall were affected by various characteristics, including the Rayleigh number, Prandtl number, wave number, and vortex viscosity parameter.Their work is based on partial differential equations constructed in non-dimensional variables and solved with second-order precision using a finite difference approach.Mahmoud et al. 28 focused on investigating fluid flow and heat transfer in a porous media when subjected to a magnetic field.They investigated the effect of different parameters such as Darcy number, porosity parameter, radiation parameter, and Richardson number on heat transfer and flow characteristics.They applied numerical techniques and the Galerkin weighted residual finite element approach to solve the governing equations.According to their findings, there is a positive correlation between these factors and heat transfer, while an increase in the slant angle of the magnetic field causes a slight increase in velocity.In an effort to improve heat transfer, Tusi et al. 29 examined the natural motion of a water fluid containing nanocopper particles in a square cavity that was partially filled with porous media.They utilized the Darcy-Brinkman-Forchheimer relationship for fluid flow via porous media and the two-phase mixture model for simulating nanofluid flow.Additionally, they looked into how fluid flow and heat transfer were affected by the concentration of nanoparticles, Rayleigh and Darcy numbers, and the thickness ratio of the porous layer.Geridonmez et al. [30][31][32] investigated the mathematical analysis of natural convection flow in a square cavity that is exposed to a constant magnetic field.The RBF method for spatial derivatives and the backward Euler method for time derivatives are used to discretize the governing dimensionless equations.The findings demonstrate that the Lorentz force significantly reduces fluid flow and heat transfer in the affected area.In summary, this study provides significant findings regarding the aforementioned aspects.Convective heat transfer is decreased, and fluid flows more slowly as the influence area grows because of the increase in Lorentz force.As they concluded, the applied magnetic field is capable of controlling fluid flow and heat transfer.In an effort to enhance heat transfer, Several investigations were carried out to examine a cavity under various circumstances when a magnetic field was present [33][34][35][36][37][38][39][40][41][42][43][44][45][46][47] .Alsabery et al. [48][49][50] did several works in the field of heat transfer inside the porous cavity.
This paper explores the natural convection in a square, wavy, porous cavity with a partial magnetic field.Our objective is to analyze the fluid flow patterns and heat transfer behavior within the cavity through numerical simulations and mathematical modeling.This study supports existing knowledge by providing information on the influence of external factors, such as magnetic fields and porous media, on natural convection phenomena.

Problem formulation
A cavity with porous material and a partially imposed magnetic field is being considered for a laminar, incompressible natural convection flow.The configuration of the problem can be seen in Fig. 1.The cavity's top and bottom walls are thermally insulated, while the left wall is the heat source (T = T h ), and the right wavy wall is the cold boundary (T = T c ).The cavity's length (L) and height (H) are in unity.The values of the parameters related to the right wall are: a = 0.9, b = 0.1, and k′ is the wave number.The porous material inside the cavity is uniform and has isotropic properties.The fluid and porous material reach a local thermal equilibrium.The current analysis does not account for the effects of radiation effects, viscous dissipation, Joule heating, or the induced magnetic field.
Darcy's law alone may not be sufficient in various scenarios, such as when dealing with more porous materials, high velocities, or high Reynolds number effects.In 1901, Forchheimer introduced the concept of a quadratic drag term (also known as the inertial or Forchheimer term) to Darcy's law.Later, Brinkmann further expanded on the model to incorporate larger porosity and account for viscous effects.It's worth mentioning that this study excludes certain factors, such as induced magnetic fields and Joule heating.
Brinkman-Forchheimer-extended Darcy's model is utilized in this study to analyze the porous material within the cavity.The problem's configuration involves a laminar, incompressible natural convection flow with a partially applied magnetic field.This study's governing equations are the continuity, momentum, and energy expressed in the u-v-p-T form.These nonlinear equations capture the complex dynamics of the system and provide insights into the fluid flow, pressure distribution, and temperature distribution within the porous material-filled cavity, as follows 31 : (1) ∇.u = 0, Vol:.( 1234567890 In which µ corresponds to the dynamic viscosity of the fluid, the effective dynamic viscosity is µ e , the fluid's density is ρ f , the norm of the velocity vector (u 2 + v 2 ) is |u| , g is the gravitational acceleration, the thermal expansion coefficient is β , the pressure is defined by p , the porosity of a porous medium is measured by ǫ p , the magnitude of the applied magnetic field is referred to as B 0 , the fluid's electrical conductivity is defined as σ, the effective thermal diffusivity is 150(1−ǫ p ) 2 refers to the permeability of the porous medium, d p is the size of a solid particle in a porous medium, and the heat capacity ratio , is considered one in this model.Additionally, the fluid (f ) and solid (s) are assumed to have the same thermal conductivity and thermal diffusivity.That means, k e = k f = k s and α e = α f = α .In addition, µ e = µ is assumed.Air fluid was used for the present work.The physical properties of air are given in Table 1.
The boundary conditions are outlined below: The dimensionless quantities are defined below: (2)  where T = T h − T c .By setting the stream function ψ as u = ∂ψ/∂y, v = −∂ψ/∂x , it eliminates the continu- ity equation due to satisfying the continuity condition, and the pressure term is removed by using the vorticity definition ω = ∇ × u in the momentum equations.Non-dimension equations are deduced from the effects of stream and vorticity functions: In the case of the incoming magnetic field, δ B , is defined as: The reduced boundary conditions are as follows: The average Nusselt number for the warm wall is determined as follows:

Method of solution and numerical results
The Eqs. ( 12)-( 14) have been solved using the Finite Element Method with boundary conditions (16).The reliability of this method is a result of its high strength and flexibility.Once the initial meshing is done, the solution continues continuously.To achieve acceptable accuracy, it may also alter the mesh structure.This process continues until the convergence condition is met.The convergence condition for the present work is to reach 10 -5 accuracy.The Finite Element Method (FEM) operates on a fundamental principle: breaking down a complex problem domain into discrete sub-regions that are called finite elements.Each of these elements possesses a distinct geometry and is characterized mathematically through a set of equations that describe the behavior of the system within that particular section.This approach simplifies the solution of complex governing equations, which would be arduous or nearly impossible to solve manually.Shape functions are used in FEM to interpolate element-level solutions based on nodal values.In this study, FEM serves as a numerical tool for solving the governing equations related to fluid flow and heat transfer due to natural convection of a square wavy cavity with a magnetic field and porous media.To improve understanding of the numerical solution technique, Fig. 2 displays the flowchart of the numerical method.Through FEM, a more precise and detailed solution for the natural convection of a square wavy cavity with a magnetic field and porous media can be obtained.Figure 3 shows a good match between the streamlines and isotherm lines compared to the work of Geridonmez et al. 31 .
In order to obtain a mesh-independent solution, mesh independence is investigated.The grid-independent solution was examined by providing a solution for natural convection in a square cavity with one side having a cosine wave with a magnetic field applied to a portion of the square side.Five of the grids have been tested.As can be seen in Table 2, with the number of cells 3006, the solution becomes independent and reaches an accuracy of 10 -5 .The optimal mesh is shown in Fig. 4.

Results and discussions
Figure 5 shows the impact of the entranced magnetic field length on the left wall.As the magnetic field length increases, the main vortex is compressed towards the lower left nook of the cavity, but the upper part of the vortex is stretched towards the upper right nook of the cavity because of the increased Lorentz force area introduced by the magnetic field.The vortex's strength decreases with the magnetic field's length.On the other hand, the buoyancy force slows down.The temperature difference in the isotherms decreases.In addition, the isotherm lines tend to flatten, indicating the magnetic force's inhibition of natural convection.
The velocity and temperature distribution based on the variable magnetic field length can be seen in Fig. 6.It is concluded that by raising the magnetic field length, the velocity decreases, and the temperature increases from the bottom of the cavity to its center, but this process is the opposite for the upper half.The maximum velocity u belongs to L B = 0.5.
Figure 7 shows the effect of the Rayleigh number on streamlines and isothermal lines.L B = 0.5, as defined, means that the magnetic field affects the left wall of the cavity from the top to the center.Therefore, the streamlines show the natural convection at the bottom of the cavity, while the upper part of the cavity shows the lagging impact of the Lorentz force.Because of the dominance of Lorentz force over the buoyancy force, the second Table 2. Mesh independent review with Ra = 10 5 , Da = 0.01, ϵ p = 0.9, Ha = 50, L B = 0.  vortex is seen in the streamlines at Ra = 10 4 , while it is not observed at Ra = 10 5 or 10 6 due to the high buoyancy force.The isotherm lines are approximately 90 degrees to the upper wall for Ra = 10 4 , 10 5 .With the increase of Rayleigh, the isotherm lines tend to bend more from the flat state, and heat penetrates more in the upper half.The velocity and temperature distribution based on the Rayleigh number change can be seen in Fig. 8. Raising the Rayleigh number lowered the temperature in the cavity's lower region while increasing the maximum velocity, but this trend changes for the upper part of the cavity, and the temperature increases.
Figure 9 shows the effect of the Hartmann number on streamlines and isothermal lines.In case there's no magnetic field due to the non-existence of Lorentz force delay, the streamlines show natural convection in all parts of the cavity.With the augmentation of the Hartmann number, the vortex tends to the lower side of the cavity.Also, the increase in Hartmann reduces the strength of the vortex.
The isotherm lines are almost perpendicular to the top wall for Ra = 10 5 , 10 6 .As the Rayleigh increases, the isotherm lines tend to bend less from the flat state, and heat penetrates less in the upper half, indicating that the magnetic field was controlling the heat transfer and fluid flow.
The velocity and temperature distribution due to the Hartmann number change is shown in Fig. 10.In the absence of a magnetic field, u has the lowest value, and with the augmentation of the Hartmann number, u and v decrease.With increasing the Hartmann number, the temperature trend for the cavity's lower half increases, but this trend is reversed for the upper half, and the temperature decreases.The influence of Darcy number on streamlines and isotherm lines was examined, and it is shown as a contour in Fig. 11.At the Darcy number close to zero, the vorticity tends to the center, and the isothermal lines are almost parallel to each other because the Lorentz force loses its effect at a low Darcy number.With the increase of Darcy, the penetration of heat increases, and as a result, the fluid moves at a higher speed, and the vortex is transferred downwards.
The velocity and temperature distribution due to the Darcy number change can be seen in Fig. 12.With increasing the Darcy number, the magnitude of u and v increase, and it can be said that the temperature also has an increasing trend, and in Darcy 10 -4 , the temperature changes are insignificant.
The impact of wave number on streamlines and isotherm lines was studied, and the outcomes are shown in Fig. 13.As the wave number increases, the eddy tends to rise less, and the fluid moves with a higher partial velocity.The number of waves has no noticeable effect on isothermal lines.Nonetheless, there is a certain increase in the Nusselt number as the wave number rises.The behavior of velocity in horizontal and vertical, as well as temperature distribution in the vertical case, is shown.See Fig. 14 for better understanding.
Average Nusselt is influenced by magnetic field length, Rayleigh, Hartmann, and Darcy number, as shown in Fig. 15.The average Nusselt is proportional to the Rayleigh and Darcy numbers and increases with the increase of Rayleigh and Darcy.At the same time, it has an inverse relationship with the Hartmann number and the length of the magnetic field.Figures 16 and 17 show the simultaneous effect of magnetic field length, Rayleigh number, and Hartmann and Darcy numbers on the average Nusselt.The average Nusselt number reached its highest point when there was no magnetic field, and the Rayleigh and Darcy numbers were high.
In summary, the set of average Nusselt number and maximum psi value is given in Table 3. 1.As the magnetic field's length increases, heat transfer decreases.As the length of the magnetic field increases from 0.3 to 0.7, the Nusselt number decreases by 36.6%, and the value of maximum psi decreases by 34%. 2. As the Rayleigh number increases, the Nusselt number also increases.In fact, with the increase of the Rayleigh number, the buoyancy force increases, and the buoyancy force increases the heat transfer and fluid      Table 3.The values of average Nusselt number and maximum psi with Ra = 10 5 , Da = 0.01, ϵ p = 0.9, Ha = 50, L B = 0.

Figure 2 .Figure 3 .
Figure 2. The flowchart of the numerical method.