On the optimal control of the process of thermal blooming