Another short note. It was reported over on the Peak Oil thread that a UKIP candidate wondered what would happen when renewable sources of energy run out. The answer which is commonly given, is: "The sun goes red (giant) and the Earth fries, but not for about 5 billion years or so".
That's true, but the earth will be toast long before it eventually is wholly consumed by an expanding sun. To see why, we'll look at the reason for the red giant phase, and then work our way backwards.
A common layman's explanation for why older stars become red giants is that they have run out of hydrogen fuel to convert to helium, and must now convert helium to heavier elements. That's not quite true -- those other processes will eventually occur in older stars but the transition to red gianthood occurs while we are still at the end stages of hydrogen burning.
There are two nuclear fusion reactions by which hydrogen can be converted to helium. Both of them start with four hydrogen nuclei (i.e. protons) plus two electrons, and end up with one helium nucleus consisting of two protons and two neutrons. Both of the reactions involve several intermediate steps whose details need not concern us just now. They are called, respectively, the proton-proton (PP) chain reaction, and the Carbon-Nitrogen-Oxygen (CNO) cycle. (Don't worry about the CNO in the CNO cycle ... those other elements are involved in intermediate steps but are not ultimately consumed in the reaction and can be thought of as catalysts; the PP chain also involves other intermediate products -- deuterium, Helium-3, and/or lithium, beryllium and boron).
The main point is that although both hydrogen-burning reactions occur in stars, the rates of the PP chain and CNO cycle reactions are exquisitely temperature dependent. For most of a star's life, the reaction which dominates will depend on the star's mass, which determines the rate at which gravity tries to collapse it, and thus the temperature of the star's core. For low mass stars such as our sun, the dominant reaction is the PP chain. Larger stars with higher core temperatures will have a dominant CNO cycle.
I mentioned the temperature dependence of the reaction rates. This is particularly the case for the CNO cycle -- its reaction rate is proportional to the seventeenth power of the temperature!!! A doubling of temperature would result in a 130,000-fold increase in the reaction rate! Even a 1% increase in temperature results in a 20% increase in reaction rate and power output.
When an aging solar-mass star has converted a substantial amount of its core hydrogen fuel to helium, the core temperature increases to a level where the CNO cycle begins to dominate in its hottest regions. But because of the extreme temperature dependence, the CNO dominance occurs only in a narrow shell of hydrogen surrounding the core, and this results in a very high temperature gradient between the core and outer layers of the star. What happens when you get a high temperature gradient in a fluid? You've seen it when you boil your eggs ... hot fluid starts to rise to the surface, and cold fluid sinks to replace it. This is the onset of convection.
You've probably heard that it takes tens of thousands of years for light produced in the core of the sun to escape its surface. This is because of radiative diffusion -- photons produced in the dense core don't travel very far before they are absorbed and have to be re-emitted. The convective outer layers of the sun, which we see in photographs of its turbulent, roiling surface, only reach a third of the way down to the core. Once energy from the core reaches the convective zone, it can be transported more efficiently by convection than by radiative diffusion.
In an older star where shell hydrogen burning has commenced, the high temperature gradient due to the CNO cycle creates a much deeper convective zone. Since energy is transported more efficiently, the outer layers of the star heat up and expand. Counterintuitively, the surface actually cools, but this is because it is now much larger and further away from the core. The overall luminosity of the star has increased. We have entered the red giant phase.
So the transition to red giant occurs when the CNO cycle comes to dominate in shell hydrogen burning, due to higher core temperatures. But why did the higher temperature occur in the first place? The rapid increase in convection and swelling of the star turns out to be only the end stages of a process that has been occurring throughout the star's life. This process does not initially result in the star changing size, but it does involve a gradual increase in temperature and luminosity. This is because of the dependence of the core temperature on the chemical composition of the star.
A bit of mathematical physics is required here. We'll skip over it lightly. It is possible to combine the basic ideal gas law -- which relates the pressure, volume and temperature of a gas -- with the equation for hydrostatic equilibrium. The latter relates the pressure and density of a star whose internal pressure is constantly in balance with the gravitational forces trying to compress it. We end up with a rather simple relation:
This tells us that the core temperature of the star is proportional to its mass and inversely proportional to its radius. It is also proportional to a less obvious quantity called Image (Greek letter mu), which is the average mass per particle, which we'll come back to. We are able to use this result with a rather complicated equation for the rate of radiative diffusion to calculate the overall luminosity of the star. In this calculation, the radius of the star cancels out and we end up with the even simpler relation:
This tells us that the luminosity of the star is proportional to the cube of its mass times the fourth power of the average mass per particle. Now, the mass of the sun stays relatively constant over its lifetime. Although the nuclear fusion process converts mass into energy, it does it so efficiently that the total energy output of the sun over its lifetime corresponds to only a negligible fraction of its mass. The chemical composition of the sun, and thus the average mass per particle, is a different matter. We calculate that quantity as follows:
This slightly intimidating looking equation is really rather simple. It says that if we have i different types of particles, the average mass per particle is the number of each type of particle multiplied by the mass of that particle in atomic mass units, with the sum for all the particles then divided by the total number of particles.
It's easier if we look at an actual example. You probably know that although we sometimes refer to the sun as a "ball of gas", it is actually a plasma, with electrons stripped from atoms due to the high temperature. So, some of the particles we are referring to are electrons, in addition to atomic nuclei. There are always the same number of negatively charged electrons as there are positively charged protons in atomic nuclei. You'll also recall I mentioned that fusion converts four protons plus two electrons into a helium nucleus containing two protons and two neutrons. Since the neutrons are electrically neutral, the number of positive and negative charges still balances after fusion.
Lets consider the primordial post-Big Bang mixture of elements, which consists of 93% hydrogen (by number of particles) and 7% Helium. Now, suppose a star forms from this mixture (ignoring that later generations of stars form from a slightly metal-enriched mixture). We end up with a plasma where there is one electron in addition to the proton for each hydrogen nucleus, and two electrons in addition to each helium nucleus. So we have:
Now, I mentioned that we must express the masses of the particles in atomic mass units. An amu is the average mass of a nucleon (proton or neutron) in an atomic nucleus. It is defined as one twelfth the mass of a Carbon-12 nucleus. The surprising thing about nucleons is that they weigh different amounts depending on what nucleus they are part of. This is why nuclear fusion produces energy -- the difference in mass between nucleons in the fusion inputs and outputs is liberated as energy according to Einstein's famous Image formula. But for simplicity, we'll define the masses of the proton and the helium nucleus to be 1 and 4 amu respectively, which is close enough to the real value. Electrons are very light, weighing only 1/1837 amu. They contribute almost none of the mass, but more than half of the particle number:
So the average mass per particle of the primordial material from which our sun formed is 0.58 amu. Now consider what happens after our sun has converted 10% of its original 93% hydrogen into helium. (That's the point at which it starts to rapidly transition to the red-giant stage).
Now, in an earlier equation we saw that the luminosity (i.e. power output) of the sun is related to the fourth power of the average mass per particle. And we see above that the average mass per particle increases gradually over the lifetime of the sun by a factor of 0.69/0.58 = 1.18. Raising that to the power of four means that the sun's power output almost doubles over its so-called main sequence lifetime. The final end, when the sun will expand to engulf the earth, is five billion years away. But a significant warming will occur before then, just as it has since the sun formed five billion years ago.
How will this affect the earth? In the past, an almost miraculous balancing act occurred. The early earth had higher levels of carbon dioxide in its atmosphere. This greenhouse gas kept the earth warmer at a time when the suns energy output was smaller. The evolution of plant life on earth started to reduce the CO2 levels. For a time, both CO2 and oxygen (a by-product of photosynthesis) were higher than today's levels. This was a warm and oxygen-rich period when we know from insects found preserved in amber that there were dragon flies with 30 cm wingspans, which couldn't survive in today's atmosphere. With CO2 depleted by photosynthesis, today's greenhouse effect is diminished, but it is compensated for by a warmer sun.
So what happens in the future? In the next billion years, the amount of solar energy will increase by 8%. It doesn't sound like a lot, but it will have all of the effects you've probably heard about that can result from global warming. The oceans will give up their dissolved CO2 so that the greenhouse effect is greatly increased. The oceans themselves will start to evaporate, and water vapour is a much more potent GHG than CO2. All ice on earth will melt, so that the earth's albedo -- its reflectivity -- will decrease. All of this could add up to an 80 °C average surface temperature, completely incompatible with life on earth apart from extremophile bacteria. Long before that, life on land will probably have disappeared, with the remaining life retreating to the oceans with their more moderate temperatures.
All in all, things look pretty gloomy for us in just a few hundred million years. By then, we'll have to have gone somewhere else, probably off-planet. It'll give a whole new meaning to the term "sunshine holiday".