We investigate the process of formation of large-scale structures in a
turbulent flow confined in a thin layer. By means of direct numerical
simulations of the Navier-Stokes equations, forced at an intermediate scale, we
obtain a split of the energy cascade in which one fraction of the input goes to
small scales generating the three-dimensional direct cascade. The remaining
energy flows to large scales producing the inverse cascade which eventually
causes the formation of a quasi two-dimensional condensed state at the largest
horizontal scale. Our results shows that the connection between the two actors
of the split energy cascade in thin layers is tighter than what was established
before: the small scale three-dimensional turbulence acts as an effective
viscosity and dissipates the large-scale energy thus providing a
viscosity-independent mechanism for arresting the growth of the condensate.
This scenario is supported by quantitative predictions of the saturation energy
in the condensate