Mean heating of the thermosphere by tides