The problem of the natural convection heat transfer for phase-change in a square filled with heterogeneously porous medium is solved by lattice Boltzmann method. The lattice Boltzmann equation is governed by the heat conduction equation combined with enthalpy formation. The velocity of liquid part is fully coupled with the temperature distribution through relaxation time. It is found that the high Ra number has significantly impact on the heat transfer and convection, but the low Ra number has little influence on the natural convection. The porosity of the middle porous medium is nothing to do with the heat transfer and convection. The result is of great importance to engineering interest and also provides a new solution to phase transition.