Where does energy at the beginning of a star's lifecycle (before any nuclear reactions) come from? David Christian's Maps of Time has this to say about the period during which the first stars started to form from the diffuse clouds of hydrogen and helium that then made up the universe:


  Under the pull of their own gravity, the clouds of hydrogen and helium began to collapse in on themselves...As gravity packed each cloud into ever smaller spaces, pressure built up in the center. Increasing pressure means increasing temperatures, and so, as they shrank, each gas cloud began to heat up (~Kindle location 1469).


The part I'm working on understanding is "Increasing pressure means increasing temperatures." Does the pressure itself cause the molecules to heat up? Or is it the kinetic energy that the particles pick up as gravity pulls them towards the center of the cloud? Or is the phenomenon here something other than increased energy per unit mass?

Of course, once the nuclear chain reaction gets started in the star it's not hard to figure out where the energy comes from. I'm talking about before that.
This is basic thermodynamics.

When you compress a gas, you inject energy into it. Think of the pump you use to inflate the tires on your bike. It takes some force to move the piston, right? That effort is not wasted, but goes directly into the air in the pump. Now the air has more energy.

But what happens to a gas when you put energy into it? It's molecules jiggle around faster. Well, faster jiggling is basically the definition of higher temperature. By putting more energy into the gas, you raise its temperature.

You can actually tell that the bike pump is getting warmer if you pump quickly and forcefully - this is something you can experience yourself.

Same with stars - the whole star is the "bike pump", and gravity is the one who's pushing the piston. Due to compression (shrinking) under gravity, the gas gets hotter and hotter. It turns out a star has A LOT of gravitational energy, so the gas can get VERY hot.

In your terms, yes, it's the acceleration that molecules experience falling into the gravity well of the star that makes them move faster. Faster moving molecules = higher temperature. Pretty straightforward phenomenon, really.



Historically, gravitational compression was thought to be the main source of energy for the stars, before the discovery of nuclear physics. Helmholtz and Lord Kelvin proposed this hypothesis in the 1800s.

The pressure-temperature relation of any gas was originally known as the Gay-Lussac law. Now we know it's just a particular case of more general phenomena (ideal gas law) tying together pressure, temperature, volume, and various kinds of energy.

A spectacular application of the p-T relation is the so-called "fire piston" or "fire syringe", which can ignite small pieces of cotton or paper by just hitting a piston really hard (extremely strong compression = big temperature rise). Search Youtube for some videos like this one:

https://www.youtube.com/watch?v=4qe1Ueifekg