Double-diffusive natural convection (DDNC) refers to the combined effects of buoyancy-driven fluid flow and the simultaneous transport of heat and mass. Different flow patterns and convective cells develop in DDNC fluids due to buoyancy forces caused by temperature and concentration variations. There are several uses for natural convection, including in geothermal systems [
1,
2], chemical engineering, crystal formation, and separation processes [
3,
4]. Natural convection is the movement of fluid driven by buoyancy force due to mass and heat transfer. In engineering applications, natural convection is important for cooling systems, sun collectors, and many other thermal devices that need to move heat efficiently. Natural convection is a fundamental mechanism for heat transfer in geothermal systems, as the heat is transferred from the hotter regions to the cooler regions, and buoyancy forces are generated, leading to the formation of convective cells and flow patterns. This phenomenon has numerous industrial applications and natural processes including contaminant transport [
5,
6], drying methods [
7], and chemical reactors [
8]. An irregular cavity can further complicate the natural convection patterns in geothermal systems, resulting in complex flow and heat transfer phenomena. The interplay between natural convection and the irregularities of the cavity can have an important impact on the efficiency and performance of the system. The complex interplay between heat and mass transfer, porous effects, and irregular cavities has generated significant interest among researchers in various fields, from geothermal systems to chemical engineering. Numerous studies have examined cavities of varying shapes, such as, trapezoids [
9,
10], triangles [
11,
12,
13], irregular wall cavities [
14], and more unusual shapes [
15]. Izadi et al. [
16] conducted a detailed discussion on mixed convection in enclosures of various shapes and summarized the key findings regarding the enhancement of heat transfer and the effects on pumping power. The dynamics of fluid movement and thermal conduction in these cavities and how they are affected by their shape were the focus of these analyses. All the above studies conclude that the Soret and Dufour effects are two critical physical phenomena that significantly influence the thermal, diffusive transport characteristics and the fluid flow behavior in DDNC. The study of thermal and diffusive transport characteristics in porous media under DDNC was first initiated by Bejan et al. [
17]. They analyzed the effect of Lewis numbers in a porous medium. Later on, Goyeau et al. [
18] analyzed an enclosure filled with a saturated porous medium and applied the Darcy–Brinkman model to describe the flow within it. They investigated the impact of porosity and Darcy’s number on double-diffusive natural convection (DDNC) within the porous cavity. The simulation findings from their study indicated that while the influence of porosity on the heat and mass transfer rate was negligible at low Darcy numbers, a higher porosity significantly increased the rates of thermal energy transfer and mass transport at high Darcy numbers. Mondal et al. [
19] investigated non-steady-state DDNC in porous media and examined the variation in the buoyancy ratio on heat and mass transfer rate. Chamkha et al. [
20] studied DDNC in a tilted porous cavity using the finite difference method (FDM). Their results demonstrated that thermal and diffusive transport is affected not only by Darcy’s number and the buoyancy ratio but also by the tilt angle and aspect ratio of a square cavity. Moreover, porous media in cavities used in industrial production are often accompanied by a composite layer. Numerical research on DDNC in a porous cavity with irregular porosity was discussed by He et al. [
21], which comprised two parallel porous layers having distinct porosity levels. The investigation conducted by Vijaybabu et al. [
22] focused on analyzing the influence of MHD (magnetohydrodynamic) and porous circular cylinders on DDNC and an irreversibility analysis within an enclosure. The researcher Astanina et al. [
23] focused on thermogravitational convection in a porous cube with a non-uniform heating of the vertical wall. The mathematical modeling of fluid flow in the heated center of a wavy-shaped cavity as discussed by Rashid et al. [
24], focusing on the thermal and diffusive transport in a MHD Casson fluid flow. This study is part of the significant attention given to DDNC in various fields, such as oceanography, metallurgy, and astrophysics.
Magnetohydrodynamics is an important physical phenomenon that has garnered a lot of interest due to its numerous applications in various fields, including engineering and environmental sciences. Numerous studies have investigated the influence of magnetohydrodynamics on heat transfer in enclosures to assess the impact of magnetic fields on heat transfer, whether it occurs via conduction or convection. An FEM was investigated by Rahman et al. [
25] to explore the combined impact of magnetohydrodynamics and joule heating on DDNC within a horizontal channel featuring an open enclosure. Teamah et al. [
26] explored the effects of the magnetic field and heat source on the DDNC flow in a rectangular enclosure. The researchers observed that increasing the magnetic field resulted in a decrease in fluid circulation and thermal and diffusive transport rates within the cavity. Kumar et al. [
27] studied the thermal and diffusive transport in the 2D MHD free convection process, considering the thermal diffusion. The process occurred in a Darcy porous enclosure in a stratified thermal and mass fluid. Bayareh et al. [
28] explored the effects of magnetic fields on the thermodynamic efficiency of nanofluid-filled cavities, detailing the role of AI in optimizing system performance and forecasting future advancements. Seyyedi et al. [
29] discussed natural convection and entropy generation within a square inclined cavity affected by magnetohydrodynamic (MHD) forces, revealing peaks in entropy generation at specific inclination angles and Hartmann numbers. Ali et al. [
30] explained the MHD behavior of mixed convection in a hexagonal enclosure.
The main objective of this research is to investigate the heat and mass transfer in an irregularly shaped porous cavity using the finite element method. To the best of our knowledge, based on a thorough literature review, there are no studies on irregularly shaped enclosures using hybrid mesh techniques. The hybrid mesh consists of both triangular and rectangular shapes. The novelty of the work lies in how an inclined magnetic field influences double-diffusive natural convection (DDNC) within a porous system with an irregularly shaped cavity, taking into account various multiphysical conditions. Therefore, various parameters can be utilized to control heat and mass transfer. This study has applications in heat exchangers, crystallization, microelectronics, food processing, and biomedical systems.