This paper is concerned with the modelling and numerical simulation of temperature-induced phase separation (TIPS) coupled with non-uniform temperature fields. The spontaneous phase separation of an initially homogeneous blend can be used, in principle, as a reliable and scalable process to reproduce specific morphologies at the microscopic scale in two-phase composite materials, such as rubber-reinforced resins, or in microstructured porous media. The size of the microstructures that are formed and the degree of anisotropy can be controlled through the imposition of an adequate temperature field. In order to understand the potential use of a temperature gradient to control phase separation, we developed a qualitative model for TIPS based on the Cahn–Hilliard approach and we proposed a computational strategy to obtain numerical solutions for phase separation in confined domains taking into account the thermal interaction with the walls. While the method is based on a volume penalization technique, the novelty of the proposed approach relies on the fact that the penalization term of the equation is constructed on the same theoretical basis from which the Cahn–Hilliard equation is derived. The advantage offered by this technique is that the same pseudo-spectral Fourier discretization schemes that are classically used to solve the Cahn–Hilliard equation in periodic domains can be straightforwardly applied to the case of bounded domains. The application examples shown in this paper emphasize the key role of the dimensionless number given by the ratio of the characteristic heat propagation time and the characteristic time of the phase separation, and demonstrate how control of the microstructure anisotropy could be achieved through TIPS.