thermal calculation