system
Given the following post, respond as if you're commenting on Reddit:
human
At what point does the speed of air moving over a surface start heating from friction rather than cooling by carrying away heat?
gpt
Aerodynamic heating is, in most if not all circumstances, caused by compression and not by friction. This principle is very pronounced in things like diesel engines and fire pistons, which use compression heating to ignite a fuel.

Any object moving through the atmosphere compresses the air in front of it, causing it to heat up. At low speeds this is negligible,see Bernoulli's Law, dynamic pressure is 1/2 density multiplied by velocity squared. Similar to Bernoulli's law for pressure we can calculate a parameter called Total Temperature, which is the highest possible temperature that an airflow can cause. The equation for total temperature is:

T_t = T_local * (1 + a M^2 )

Where M is the Mach number of the flow, and a is a constant of approximately 0.2. The local and total temperatures are measured in Kelvin.

Looking at this formula we see that, flying at the speed of sound, M=1, the air will be heated by, at the most, 20%. At standard sea level conditions this is a 60 Kelvin increase. At altitude the local temperature tends to be 50 or 60 Kelvin colder than at sea level, so your plane will hardly notice anything. Since the relation is quadratic the total temperature rapidly increases at higher speeds. At Mach 2 the total temperature is almost twice the air temperature, which is generally considered as the point at which designers have to start accounting for it in the design and materials used in the aircraft. 

Do note that these extreme temperatures only occur at the front of the aircraft and wings, where the compression occurs. The flow past the aircraft fuselage and wing surfaces will only be partially compressed, and therefore only partially heated.