Perfect fluids in cosmology? In cosmology, it is often assumed that the equation of state of a cosmological fluid is of the form $p=w\rho$. Why is this? Is it the equation of a perfect fluid?
Why does $w=0$ for matter $1/3$ for radiation and $-1$ for a cosmological constant? 
 A: The Wikipedia article on the equation of state discusses this.
Matter
Consider non-relativistic matter first, because this is easy. We write the pressure as:
$$ p = \rho_m \space RT = \rho_m \space C^2 $$
where $\rho_m$ is the mass density, $RT$ is the thermal energy of the matter (or whatever) in your fluid, and $C$ is some sort of characteristic velocity. The justification for replacing $RT$ by $C^2$ is that kinetic energy is proportional to the square of velocity.
$\omega$ is given by:
$$ \omega = \frac{p}{\rho_e} $$
where $\rho_e$ is the energy density $\approx \rho_mc^2$, and substituting this into the above equation we get:
$$ \omega = \frac{\rho_m C^2}{\rho_m c^2} = \frac{C^2}{c^2} $$
and for non-relativistic matter $C \ll c$ so $\omega \approx 0$.
Radiation
Now consider radiation, which is harder because we can't relate $p$ to a mass density. I don't know of an intuitive way to show this, but this article goes into the details of calculating radiation pressure (it's complicated!!), and the final result turns out to be:
$$ p = \frac{1}{3} \rho_e $$
and obviously we immediately get $\omega$ = 1/3.
Cosmological constant
Start with the Friedmann equation with a non-zero cosmological constant, $\Delta$:
$$ 3\frac{\ddot{a}}{a} = \Delta - 4\pi G(\rho + 3p) $$
we want to treat $\Delta$ as an effective pressure and energy density so we define:
$$ p_{eff} = p - \frac{\Delta}{8 \pi G} $$
$$ \rho_{eff} = \rho + \frac{\Delta}{8 \pi G} $$
We do this because now the Friedmann equation simplifies to:
$$ 3\frac{\ddot{a}}{a} = - 4\pi G(\rho_{eff} + 3p_{eff}) $$
as you can see by just substituting for $p_{eff}$ and $\rho_{eff}$ to get back the original Friedmann equation. So now we get an effective value for $\omega$:
$$ \omega_{eff} = \frac{p_{eff}}{\rho_{eff}}  = \frac{p - \frac{\Delta}{8 \pi G}}{\rho + \frac{\Delta}{8 \pi G}} $$
and if we assume that the cosmological constant is dominant, i.e. $p \approx 0$ and $\rho \approx 0$, we get the value of $\omega$ for just dark energy is -1.
