This paper is organized in two parts. First, phase diagrams for dense binary mixtures are computed with the density functional theory (DFT). The method of calculation is reviewed and the different approximations which are used are clearly stated. The DFT is then applied to several mixtures of astrophysical interest. A comparison is made between several existing phase diagrams and the origin of some discrepancies among them is discussed. In a second part, the consequences of these phase diagrams on the cooling of white dwarfs are presented in a pedagogical way starting from the simple Mestel theory. The importance of the partial separation of carbon and oxygen at crystallisation is emphasized and the possible effect of minor species such as 22Ne or Fe is also considered. The separation of carbon and oxygen adds 1 – 2 Gyr to age of the galactic disk estimated from the white dwarf luminosity function while the delay resulting from the presence of minor species is probably negligible when the chemical evolution of the Galaxy is properly taken into account.