## 1 Introduction  
Convective flows have been widely investigated for various applications in engineering, such as heat exchangers, drying processes, solar collectors, nanofluids, _etc._ With the recent development and interest in nano-fields, studies on convection were extended to include electrohydrodynamic and magnetohydrodynamic convection flows [1,2], besides natural convection, which is widely treated in the literature. Despite this, natural convection problems [3,4] are still of considerable interest in many applications, especially in heat transfer systems. In natural convection problems, hydrodynamic and thermal mechanisms are coupled and strongly affected by the fluid thermo-physical properties and the temperature gradients present in the system. Thermal gradients, shearing, phase changes, chemical reactions, _etc._, are irreversible processes that are frequently encountered in thermodynamic systems. They are generally provoked by losses emanating from two main causes: the transmission of heat through a limited temperature difference and the pressure drop caused by friction [5]. The sum of all of these losses induces what is called the entropy generation within the system. Therefore, design criteria and optimum efficiency for thermodynamic systems can be obtained by analyzing the entropy production. Therefore, this production should be better understood [6]. Indeed, the quest for deeper understanding of the entropy generation in enclosures has been underway for a long time and gave rise to fruitful research. However, up to date, studies involving entropy generation during phase changes remain sparse. All of this motivates this paper to perform the current research. Concerning entropy generation in natural convection, one can quote the works of [PERSON] _et al._[7], [PERSON] _et al._[8], [PERSON] [9] and [PERSON] _et al._[10], among others. The main aim of the present work is to study the entropy generation during melting with natural convection in a cavity via a numerical simulation. Here, we intend to analyze variations of the entropy generation in relation to the relevant parameters of the study, namely the Rayleigh number, the Prandtl number and the irreversibility's coefficient. With this parametric study, we seek to deepen our understanding of these mechanisms to better assess the performance of the considered system. The objective here is to depict the effect of the presence of a phase change on the variation of entropy generation. Note that any achieved decrease in the total entropy production would give a further advantage of the use of latent heat over the sensible heat in mechanical systems. Furthermore, given that the analysis of the entropy production was used as a thermodynamic optimization tool, it seems advisable, hence, to give a new perspective based on the second law of thermodynamics to the heat transfer. To perform simulations of heat transfer with convection and phase change, we use the single relaxation lattice Boltzmann model (SRT-LBM). This approach is a discrete particle-based method that numerically solves the Boltzmann equation as opposed to conventional methods that are based on the Navier-Stokes (NS) equations. Its principle is to assign a distribution function (DF) that provides the probability to find a pseudo-particle at a position with a given velocity [11]. However, its extension to flows with heat transfer is not straightforward due to the numerical instabilities engendered. In the thermal lattice Boltzmann method (TLBM), a separate DF is used to solve for the temperature [12,13]. In other words, two sets of distribution functions are defined, one for the velocity field and the other for the temperature. Thereby, such an approach can easily handle arbitrary Prandtl numbers. This double distribution function (DDF) approach has been successfully used to solve thermal problems intwo dimensions [3,14]. Nevertheless, it only applies when the fluid density depends weakly on the temperature. This is the approach we have adopted here to conduct this work.