A finite-element toolbox for the simulation of solid-liquid phase-change systems with natural convection

Abstract We present and distribute a new numerical system using classical finite elements with mesh adaptivity for computing two-dimensional liquid–solid phase-change systems involving natural convection. The programs are written as a toolbox for FreeFem++ (www3.freefem.org), a free finite-element software available for all existing operating systems. The code implements a single domain approach. The same set of equations is solved in both liquid and solid phases: the incompressible Navier–Stokes equations with Boussinesq approximation for thermal effects. This model describes naturally the evolution of the liquid flow which is dominated by convection effects. To make it valid also in the solid phase, a Carman–Kozeny-type penalty term is added to the momentum equations. The penalty term brings progressively (through an artificial mushy region) the velocity to zero into the solid. The energy equation is also modified to be valid in both phases using an enthalpy (temperature-transform) model introducing a regularized latent-heat term. Model equations are discretized using Galerkin triangular finite elements. Piecewise quadratic (P2) finite-elements are used for the velocity and piecewise linear (P1) for the pressure. For the temperature both P2 and P1 discretizations are possible. The coupled system of equations is integrated in time using a second-order Gear scheme. Non-linearities are treated implicitly and the resulting discrete equations are solved using a Newton algorithm. An efficient mesh adaptivity algorithm using metrics control is used to adapt the mesh every time step. This allows us to accurately capture multiple solid–liquid interfaces present in the domain, the boundary-layer structure at the walls and the unsteady convection cells in the liquid. We present several validations of the toolbox, by simulating benchmark cases of increasing difficulty: natural convection of air, natural convection of water, melting of a phase-change material, a melting-solidification cycle, and, finally, a water freezing case. Other similar cases could be easily simulated with this toolbox, since the code structure is extremely versatile and the syntax very close to the mathematical formulation of the model. Programm summary Program Title: PCM-Toolbox-2D Program Files doi: http://dx.doi.org/10.17632/phby62rhgv.1 Licensing provisions: Apache License, 2.0 Programming language: FreeFem + + (free software, www3.freefem.org) Nature of problem: The software computes 2D configurations of liquid–solid phase-change problems with convection in the liquid phase. Natural convection, melting and solidification processes are illustrated in the paper. The software can be easily modified to take into account different related physical models. Solution method: We use a single domain approach, solving the incompressible Navier–Stokes equations with Boussinesq approximation in both liquid and solid phases. A Carman–Kozeny-type penalty term is added to the momentum equations to bring the velocity to zero into the solid phase. An enthalpy model is used in the energy equation to take into account the phase change. Discontinuous variables (latent heat, material properties) are regularized through an intermediate (mushy) region. Space discretization is based on Galerkin triangular finite elements. Piecewise quadratic (P2) finite-elements are used for the velocity and piecewise linear (P1) for the pressure. For the temperature both P2 and P1 discretizations are possible. A second order Gear scheme is used for the time integration of the coupled system of equations. Non-linear terms are treated implicitly and the resulting discrete equations are solved using a Newton algorithm. A mesh adaptivity algorithm is implemented to reduce the computational time and increase the local space accuracy when (multiple) interfaces are present.

[1]  D. Hartree,et al.  The calculation of variable heat flow in solids , 1946, Philosophical Transactions of the Royal Society of London. Series A, Mathematical and Physical Sciences.

[2]  Ionut Danaila,et al.  Existence and numerical modelling of vortex rings with elliptic boundaries , 2013 .

[3]  Chin Hsien Li A Finite-element Front-tracking Enthalpy Method for Stefan Problems , 1983 .

[4]  Vaughan R Voller,et al.  The Phase-Field Method in the Sharp-Interface Limit , 1997 .

[5]  Ionut Danaila,et al.  A Newton method with adaptive finite elements for solving phase-change problems with natural convection , 2014, J. Comput. Phys..

[6]  M. Fortin,et al.  Mixed Finite Element Methods and Applications , 2013 .

[7]  V. Voller,et al.  A fixed grid numerical modelling methodology for convection-diffusion mushy region phase-change problems , 1987 .

[8]  Joseph C. Mollendorf,et al.  A new density relation for pure and saline water , 1977 .

[9]  Vaughan R Voller,et al.  ENTHALPY-POROSITY TECHNIQUE FOR MODELING CONVECTION-DIFFUSION PHASE CHANGE: APPLICATION TO THE MELTING OF A PURE METAL , 1988 .

[10]  A. Karma,et al.  Phase-Field Simulation of Solidification , 2002 .

[11]  M. Rebow,et al.  Freezing of Water in a Differentially Heated Cubic Cavity , 1999 .

[12]  A. K. Mohanty,et al.  NATURAL CONVECTION DURING MELTING AND SOLIDIFICATION OF PURE METALS IN A CAVITY , 1996 .

[13]  K. Luo,et al.  Lattice Boltzmann Simulation of Convection Melting in Complex Heat Storage Systems Filled with Phase Change Materials , 2015, KnE Materials Science.

[14]  Fulvio Stella, Marilena Giangi MELTING OF A PURE METAL ON A VERTICAL WALL: NUMERICAL SIMULATION , 2000 .

[15]  Francis Agyenim,et al.  A review of materials, heat transfer and phase change problem formulation for latent heat thermal energy storage systems (LHTESS) , 2010 .

[16]  Irina Singer-Loginova,et al.  The phase field technique for modeling multiphase materials , 2008 .

[17]  Frédéric Hecht,et al.  Mesh adaption by metric control for multi-scale phenomena and turbulence , 1997 .

[18]  Frédéric Hecht,et al.  Anisotropic adaptive mesh generation in two dimensions for CFD , 1996 .

[19]  Youssef Belhamadia,et al.  Anisotropic mesh adaptation for the solution of the Stefan problem , 2004 .

[20]  Ionut Danaila,et al.  A finite-element toolbox for the stationary Gross-Pitaevskii equation with rotation , 2016, Comput. Phys. Commun..

[21]  Chie Gau,et al.  Melting and solidification of a metal system in a rectangular cavity , 1984 .

[22]  V. Alexiades,et al.  A reference solution for phase change with convection , 2005 .

[23]  Won Soon Chang,et al.  A numerical analysis of Stefan problems for generalized multi-dimensional phase-change structures using the enthalpy transforming model , 1989 .

[24]  Frédéric Hecht,et al.  New Progress in Anisotropic Grid Adaptation for Inviscid and Viscous Flows Simulations , 1995 .

[25]  Vasilios Alexiades,et al.  RESOLVING THE CONTROVERSY OVER TIN AND GALLIUM MELTING IN A RECTANGULAR CAVITY HEATED FROM THE SIDE , 2003 .

[26]  R. Temam,et al.  Navier-Stokes equations: theory and numerical analysis: R. Teman North-Holland, Amsterdam and New York. 1977. 454 pp. US $45.00 , 1978 .

[27]  Jean E. Roberts,et al.  Mixed and hybrid finite element methods , 1987 .

[28]  A. Fortin,et al.  A two-dimensional adaptive remeshing method for solving melting and solidification problems with convection , 2019, Numerical Heat Transfer, Part A: Applications.

[29]  Wei Gong,et al.  Numerical Simulation of Melting with Natural Convection Based on Lattice Boltzmann Method and Performed with CUDA Enabled GPU , 2015 .

[30]  R. I. L. Guthrie,et al.  Natural Convective Heat Transfer Rates During the Solidification and Melting of Metals and Alloy Systems , 1974 .

[31]  Anirban Bhattacharya,et al.  An enthalpy method for modeling eutectic solidification , 2014, J. Comput. Phys..

[32]  T. A. Kowalewski,et al.  SIMULATIONS OF THE WATER FREEZING PROCESS - NUMERICAL BENCHMARKS , 2003 .

[33]  Zhanhua Ma,et al.  Solid velocity correction schemes for a temperature transforming model for convection phase change , 2006 .

[34]  Frédéric Hecht,et al.  New development in freefem++ , 2012, J. Num. Math..

[35]  Youssef Belhamadia,et al.  AN ENHANCED MATHEMATICAL MODEL FOR PHASE CHANGE PROBLEMS WITH NATURAL CONVECTION , 2012 .

[36]  M. Bercovier Perturbation of mixed variational problems. Application to mixed finite element methods , 1978 .

[37]  Frédéric Hecht,et al.  Anisotropic unstructured mesh adaption for flow simulations , 1997 .

[38]  Thomas Scanlon,et al.  Finite element moving mesh analysis of phase change problems with natural convection , 2005 .

[39]  Roland W. Lewis,et al.  An improved algrorithm for heat conduction problems with phase change , 1978 .

[40]  A. Quarteroni,et al.  Numerical Approximation of Partial Differential Equations , 2008 .

[41]  Dieter Brüggemann,et al.  A comprehensive benchmark of fixed-grid methods for the modeling of melting , 2017 .

[42]  G. Tryggvason,et al.  A front-tracking method for viscous, incompressible, multi-fluid flows , 1992 .

[43]  M. Fortin,et al.  A stable finite element for the stokes equations , 1984 .

[44]  Jonathan A. Dantzig,et al.  MODELLING LIQUID-SOLID PHASE CHANGES WITH MELT CONVECTION , 1989 .

[45]  Ali C. Kheirabadi,et al.  THE EFFECT OF THE MUSHY-ZONE CONSTANT ON SIMULATED PHASE CHANGE HEAT TRANSFER , 2015 .

[46]  F. Thomasset Finite element methods for Navier-Stokes equations , 1980 .

[47]  Ionut Danaila,et al.  A finite element method with mesh adaptivity for computing vortex states in fast-rotating Bose-Einstein condensates , 2010, J. Comput. Phys..

[48]  Sylvain Laizet,et al.  High-order compact schemes for incompressible flows: A simple and efficient method with quasi-spectral accuracy , 2009, J. Comput. Phys..

[49]  F. Stella,et al.  Modelling Methodologies for Convection-Diffusion Phase-Change Problems , 2004 .

[50]  Frédéric Hecht,et al.  A full discretisation of the time-dependent Boussinesq (buoyancy) model with nonlinear viscosity , 2018, Calcolo.

[51]  Patrick J. Roache,et al.  Verification and Validation in Computational Science and Engineering , 1998 .

[52]  Philippe Angot,et al.  A penalization method to take into account obstacles in incompressible viscous flows , 1999, Numerische Mathematik.

[53]  P. LeQuéré,et al.  Accurate solutions to the square thermally driven cavity at high Rayleigh number , 1991 .

[54]  Marcel Lacroix,et al.  Melting driven by natural convection A comparison exercise: first results , 1999 .

[55]  Charles M. Elliott,et al.  Error Analysis of the Enthalpy Method for the Stefan Problem , 1987 .

[56]  Julia Kowalski,et al.  Monolithic simulation of convection-coupled phase-change - verification and reproducibility , 2017, ArXiv.

[57]  Vaughan R Voller,et al.  Towards a general numerical scheme for solidification systems , 1997 .

[58]  M. M. Cerimele,et al.  Numerical modelling of liquid/solid phase transitions: Analysis of a gallium melting test , 2002 .

[59]  S. C. Gupta,et al.  A moving grid numerical scheme for multi-dimensional solidification with transition temperature range , 2000 .

[60]  Ricardo Ruiz-Baier,et al.  New Mixed Finite Element Methods for Natural Convection with Phase-Change in Porous Media , 2019, J. Sci. Comput..

[61]  T. Shih,et al.  Effects of grid staggering on numerical schemes , 1989 .

[62]  F. Stella,et al.  Natural convection during ice formation : numerical simulation vs. experimental results , 2000 .

[63]  David R. Clarke,et al.  Annual review of materials research , 2001 .

[64]  M. Okada,et al.  Analysis of heat transfer during melting from a vertical wall , 1984 .

[65]  J. Tinsley Oden,et al.  PENALTY-FINITE ELEMENT METHODS FOR THE ANALYSIS OF STOKESIAN FLOWS* , 1982 .

[66]  Dominique Gobin,et al.  MELTING from an ISOTHERMAL VERTICAL WALL. Synthesis of a numerical comparison exercise , 2000 .

[67]  T. L. Bergman,et al.  Numerical Modeling of Alternate Melting and Solidification , 2010 .

[68]  I. Danaila,et al.  Numerical modelling of a melting-solidification cycle of a phase-change material with complete or partial melting , 2019, International Journal of Heat and Fluid Flow.

[69]  M. Cross,et al.  An enthalpy method for convection/diffusion phase change , 1987 .

[70]  A. Faghri,et al.  A numerical analysis of phase-change problems including natural convection , 1990 .

[71]  D. J. Krishna,et al.  Influence of Mushy Zone Constant on Thermohydraulics of a PCM , 2017 .

[72]  Milton E. Rose,et al.  A method for calculating solutions of parabolic equations with a free boundary , 1960 .

[73]  Thomas Scanlon,et al.  A numerical analysis of buoyancy-driven melting and freezing , 2004 .

[74]  Hong Luo,et al.  Fully-implicit orthogonal reconstructed Discontinuous Galerkin method for fluid dynamics with phase change , 2016, J. Comput. Phys..

[75]  Ephraim M Sparrow,et al.  Analysis of melting in the presence of natural convection in the melt region , 1977 .

[76]  L. Duchemin,et al.  Rayleigh–Bénard convection with a melting boundary , 2018, Journal of Fluid Mechanics.

[77]  Amir Faghri,et al.  A comprehensive numerical model for melting with natural convection , 2010 .

[78]  Ricardo Ruiz-Baier,et al.  Stability and finite element approximation of phase change models for natural convection in porous media , 2019, J. Comput. Appl. Math..

[79]  Wei Shyy,et al.  Computational Fluid Dynamics with Moving Boundaries , 1995 .