Optimisation and control of thermal recovery for a hybrid vehicle