A numerical scheme to simulate three-phase fluid flows with phase change is proposed. By combining the Cahn-Hilliard model for water-air interface, Allen-Cahn equation for ice and fluid and Navier-Stokes equation for momentum, we solve the evolution of the water-air interface and water-ice interface simultaneously, including the volume expansion associated with solidification and due to the density difference between water and ice. Unlike existing schemes assuming a divergence-free flow field, the proposed continuous formulation allows for density changes while ensuring mass conservation. A Poisson equation for the pressure field is derived from mass conservation with constant coefficients, which can efficiently be solved without any pre-co...