Comparison between two- and three-dimensional RayleighBØnard convection