Fix a bug in the calculation of the thermal energy in the outercore