Three-phase flow in a temperature gradient