Mathematical modeling of phase transition and separation in fluids: a unified approach