In this paper, we tackle a topology optimization problem which consists in finding the optimal shape of a solid located inside a fluid that minimizes a given cost function. The motion of the fluid is modeled thanks to the Boussinesq system which involves the unsteady Navier-Stokes equation coupled to a heat equation. In order to cover several models presented in the literature, we choose a non-smooth formulation for the outlet boundary conditions and an optimization parameter of bounded variations. This paper aims at proving existence of solutions to the resulting equations, along with the study of a relaxation scheme of the non-smooth conditions. A second part covers the topology optimization problem itself for which we proved the existence of optimal solutions and provides the definition of first order necessary optimality conditions.