Numerical simulation of heterogeneous phase transformations