A phase field model describing the solidification of a binary alloy is investigated. The location of the solid and liquid phases in the computational domain is described by introducing an order parameter, the phase-field, which varies smoothly from one in the solid to zero in the liquid through a slightly diffused interface. The solidification process of binary alloys is controlled by the local concentration of the alloy and the temperature. The concentration is altered by the existing flows in the melt. With temperature being a given constant, the model corresponds to coupling the phase-field equation, the concentration equation and the compressible Navier-Stokes equations. The main difficulty when solving numerically phase field models is due to the very rapid change of the phase field and the concentration field across the diffused interface, whose thickness has to be taken very small in comparison to the dimension of the computational domain in order to correctly capture the physics of the phase transformation. A high spatial resolution is therefore needed to describe the smooth transition. In this work, we present a physical model governing the solidification process. In order to reduce the number of grid points required for the reliable simulations, we introduce an adaptive algorithm that aims to build successive meshes with large aspect ratio such that the relative estimated error of the concentration and/or velocity in the H1-norm is close to a preset tolerance TOL. For this purpose, we introduce error indicators which measure the error of the concentration and the velocity in the directions of maximum and minimum stretching of the element. Finally, we apply our method to 2D and 3D simulations of the dendritic growth proving its efficiency.