Heuristics for the Optimal Control of Thermal Energy Storage