Non-equilibrium Thermodynamics of Heterogeneous Systems