The sun will never run out of oxygen because it does not use oxygen in its process in the first place.
What does the sun burn then?
The sun does not burn thanks to a chemical combustion such as the flame fed by oxygen. The sun carries out nuclear fusion instead of using oxygen. The sun is not like a giant ball of fire, it is more like a gigantic hydrogen bomb.
That is quite close to earth… but far enough away for the effects to be minimal. Stars are full of hydrogen and work the same way that a hydrogen bomb would.
How does a fire ‘work’?
A fire obeys the rules of standard carbon combustion, the sun does not. But a campfire does. This is where the carbon atoms in the wood, or the fuel of use, will move closer to the oxygen atoms in the air around the wood to bond together. They will bond to make carbon dioxide and carbon monoxide.
There are also hydrogen atoms in the fuel that will bond with water from the surrounding air to create water molecules. These combustions are the main processes in a carbon-based fire.
Heat is released thanks to this combustion, a form of energy that is felt by us as we sit around a campfire. Light is also given off by the flame of the fire, and we experience them both in a regular fire like a campfire, or any other kind that relies on carbon combustion; like candle flames, forest fires and even gas furnaces.
Carbon combustion will always require oxygen, so it follows that when the oxygen runs out, so will the fire, since the combustion will come to a halt.
How does the sun ‘work’?
The sun does not use carbon combustion like a regular fire, it uses nuclear fusion. This is where the nuclei (plural of nucleus) of two atoms will join together to create larger nuclei. The basics are that a nucleus of an atom and its ratio of neutrons to protons will determine what the atom is.
This also determines how it behaves compared to other atoms. A change to this, or a fusion of a nucleus with another one, will cause an alteration and a new element.
This is what happens in the sun and in other stars too. Nuclear fusion does not need oxygen at all, since it is not carbon-based combustion. There just needs to be a certain amount of pressure that can squeeze the nuclei of two atoms together to create another element by surpassing the electrostatic repulsion.
In nuclear bombs, this pressure level is provided by other bombs, but in stars this occurs naturally.
The pressure in stars is caused by gravity. This is because a star will have such a large mass that the gravity caused as a result of this mass will push in on the star just enough to ignite the nuclear fusion that we are talking about. This is the fusion of two hydrogen atoms into a helium one.
What happens after the nuclear fusion is ignited?
Once there is enough pressure for nuclear fusion to occur, the sun will release an immense amount of energy. Much like the energy that is released in carbon combustion, we see the nuclear fusion energy released as light and heat. In the sun, the core temperature can reach highs of 16 million Kelvin.
And the pressure that the sun is under is around 25 thousand trillion Newtons in each square meter. This is the high pressure that allows nuclear fusion to occur.
How does nuclear fusion work?
The two main forces involved are electromagnetic force and strong nuclear force. The electromagnetic force is the one that causes repulsion between the two nuclei of the hydrogen atoms.
This is quite a weak force. The strong nuclear force is stronger. When two nuclei get closer and closer thanks to the pressure of the sun due to gravity, the strong attractive nuclear force will dominate and cause the nuclei to bond together despite the electromagnetic repulsion.
It takes a massive amount of pressure to get atoms close enough for the nuclei to stick together despite the electromagnetic repulsion.
What can be fused together?
Theoretically, any two nuclei are able to be fused together into one new nucleus. But it is just easier to fuse two nuclei that have only a small amount of electromagnetic repulsion.
This is because there is less electric charge in the two nuclei. This shows why stars are so common, because they use the fusion of hydrogen, an atom with a small electric charge. In most stars, hydrogen is fusing with other hydrogen atoms repeatedly, or even with other light elements.
Where does gravity come in?
Gravity is important in the fusion of stars. The larger the star, the greater the mass, and therefore the greater the gravitational force that acts inwardly on the star itself.
This inward gravity is what causes the pressure. So, the greater the mass, the greater the effect of gravity, and the greater the pressure, meaning more nuclear fusion.
There is no oxygen in stars. At least, none that is used in nuclear fusion. The only oxygen present in stars would be residual from hydrogen atoms fusing so often that they create oxygen.
But the sun uses nuclear fusion and not carbon-based combustion, therefore there is no oxygen ‘used up’.