  Polycrystalline thin films can be unstable with respect to island formation
(agglomeration) through grooving where grain boundaries intersect the free
surface and/or thin film-substrate interface. We develop a phase-field model to
study the evolution of the phases, composition, microstructure and morphology
of such thin films. The phase-field model is quite general, describing
compounds and solid solution alloys with sufficient freedom to choose
solubilities, grain boundary and interface energies, and heats of segregation
to all interfaces. We present analytical results which describe the interface
profiles, with and without segregation, and confirm them using numerical
simulations. We demonstrate that the present model accurately reproduces the
theoretical grain boundary groove angles both at and far from equilibrium. As
an example, we apply the phase-field model to the special case of a Ni(Pt)Si
(Ni/Pt silicide) thin film on an initially flat silicon substrate.
