Numerical simulation of cometary nuclei: III. Internal temperatures of cometary nuclei