  Segregation and dissolution behavior of Mg alloyed with Ca and Al are studied
by performing density functional theory calculations considering an extensive
set of surface structures and compositions. Combining ab initio surface science
approaches with cluster expansion for ordered surface structures we construct
surface phase diagrams for these alloys. We utilize these diagrams to study
segregation phenomena and chemical trends for surfaces in contact with a dry
environment or with an aqueous electrolyte. We show that the presence of water
dramatically impacts the stability and chemical composition of the considered
metallic surfaces. We furthermore find that the two alloying elements behave
qualitatively different: whereas Ca strongly segregates to the surface and
becomes dissolved upon exposure of the surface to water, Al shows an
anti-segregation behavior, i.e., it remains in Mg bulk. These findings provide
an explanation for the experimentally observed increase/decrease in corrosion
rates when alloying Mg with Al/Ca.
