Numerical simulation of laminar and turbulent buoyancy-driven flows using a lattice Boltzmann based algorithm