We introduce a PDE problem modeling a solidification/melting process in bounded two- or three-dimensional domains, coupling a phase-field equation and a Navier--Stokes--Boussinesq system, where the latent heat effect is considered via a modification of the Caginalp model. Moreover, the convection in the nonsolid and solid regions is treated via a phase-dependent viscosity of the material that degenerates in the solid phase, letting only rigid motions in this phase. Then we prove the existence of global-in-time weak solutions (of a regularized problem in three-dimensional domains) based on a limit process of a sequence of dissipative problems furnished truncating the viscosity.