I want to know if and why the temperature of an expanding universe decreases with time.
Universe setup. My universe is modeled as the manifold $]0,\infty[\times\mathbb T^3$, where $$\mathbb T^3 = (\mathbb R/\mathbb Z)^3\simeq[0,1[^3$$ is the canonical $3$-torus, describing space, and $]0,\infty[$ is the time ($0$ marking the big bang). The coordinates are cartesian $(t,x,y,z)$.
This manifold shall be equipped with a pseudo-Riemannian metric of the flat Friedmann type (in cartesian coordinates):
$$g = c^2 \,\mathrm dt^2 - a(t)^2 (\mathrm d x^2+\mathrm dy^2+\mathrm dz^2).$$
I will allow ourselves to pick the scale factor $a:]0,\infty[\to]0,\infty[$ to be any smooth function (i.e. we ignore that the Friedmann equation may be violated).
Please also ignore any quantum-mechanical effects in the following.
The universe shall be filled with a, say, ideal gas, consisting of $n\in\mathbb N$ point particles with mass $m\in]0,\infty[$.
Question. Does the temperature of the universe decrease if the scale factor $a$ increases?
My thoughts.
- In the rest frame of the particles (which, if I understood correctly, is the frame in which the sum of all velocity vectors of the particles add up to $0$ ?), the temperature is a constant times the average kinetic energy of the particles: $$\frac{3 k_B}2 T = \frac m2 \sqrt{\frac{\lvert v_1\rvert^2+\dots+\lvert v_n\rvert^2}{n}},$$ where $v_i$ is the velocity vector of the $i$-th particle, $T$ is the temperature and $k_B$ is the Boltzmann constant. This kinetic energy doesn't seem to decrease with time...
- There is an obvious loophole in this, namely that I would have to read a bunch of 40-page publications in the Annals of Physics from 40 years ago in order to do proper relativistic thermodynamics, which I can't do.
- (In fact, $v_i$ is non-relativistically used above, so it isn't actually properly defined in the setting that we are in.)
- Also, in a Joule expansion, the temperature stays constant.
So then I would think that the temperature doesn't change.
But obviously something is totally wrong here, no? I've heard plenty of times that the universe cools as it expands and that shortly after the big bang the universe was very hot.
So, what am I missing? Is the temperature indeed constant in my model above? Or am I wrongly applying thermodynamics?