Solution (source code)

= Solution

A <perfect fluid in general relativity> has <stress-energy tensor>
$$
\boxed{T_{\mu\nu}=(\rho+P)u_\mu u_\nu+Pg_{\mu\nu}},
$$
where $u^\mu u_\mu=-1$. Besides the <metric tensor>, one needs the <energy density> $\rho$, the <pressure> $P$, and three independent components of the normalized <four-velocity> $u^\mu$: \b[five scalar functions of spacetime in total].

The four equations of <stress-energy conservation>, $\nabla_\mu T^{\mu\nu}=0$, split parallel and perpendicular to $u^\mu$ into
$$
\boxed{u^\mu\nabla_\mu\rho+(\rho+P)\nabla_\mu u^\mu=0},
$$
$$
\boxed{(\rho+P)u^\mu\nabla_\mu u^\alpha
+(g^{\alpha\mu}+u^\alpha u^\mu)\nabla_\mu P=0}.
$$
An <equation of state>, such as a <barotropic equation of state> $P=P(\rho)$, supplies the fifth relation needed to close the evolution.