  In recent years, space missions such as Kepler and TESS have discovered many
close-in planets with significant atmospheres consisting of hydrogen and
helium: mini-Neptunes. This indicates that these planets formed early in
gas-rich disks while avoiding the runaway gas accretion that would otherwise
have turned them into hot-Jupiters. A solution is to invoke a long
Kelvin-Helmholtz contraction (or cooling) timescale, but it has also been
suggested that thermodynamical cooling can be prevented by hydrodynamical
planet atmosphere-disk recycling. We investigate the efficacy of the recycling
hypothesis in preventing the collapse of the atmosphere, check for the
existence of a steady state configuration, and determine the final atmospheric
mass to core mass ratio. We use three-dimensional radiation-hydrodynamic
simulations to model the formation of planetary proto-atmospheres. Equations
are solved in a local frame centered on the planet. Ignoring small oscillations
that average to zero over time, the simulations converge to a steady state
where the velocity field of the gas becomes constant in time. In a steady
state, the energy loss by radiative cooling is fully compensated by the
recycling of the low entropy gas in the planetary atmosphere with high entropy
gas from the circumstellar disk. For close-in planets, recycling naturally
halts the cooling of planetary proto-atmospheres, preventing them from
contracting toward the runaway regime and collapsing into gas giants.
