Calculate thermal term in J integral