What is the physics of a gas mass subject to gravity in space?
The formula for the change of pressure with altitude is the same-you need hydrostatic equilibrium.  This means that at constant temperature and over small height differences (so gravity can be considered constant) the pressure falls exponentially with the scale height.  You have $\frac {dp}{dz}=-{\rho g}$  You can compute the local $g$ by taking everything closer to the center as a point mass and ignoring all the mass outside the current radius.  You can consider the compression adiabatic, but need to use the appropriate value of $\gamma$ in $PV^\gamma=k$ for the local temperature.  Calculating the radiation is hard unless there is enough dust around, in which case the grains can be black bodies.  If you assume rotational symmetry, you have a 2D problem, which you can model on a grid and step through.