A penalty finite element analysis with bi-quadratic rectangular elements is performed to investigate the influence of uniform and non-uniform heating of wall(s) on natural convection flows in a square cavity. In the present investigation, one vertical wall and the bottom wall are uniformly and non-uniformly heated while the other vertical wall is maintained at constant cold temperature and the top wall is well insulated. Parametric study for a wide range of Rayleigh number (Ra), 103 ≤ Ra ≤ 106 and Prandtl number (Pr), 0.2 ≤ Pr ≤ 100 shows consistent performance of the present numerical approach to obtain the solutions as stream functions and temperature profiles. Heat transfer rates at the heated walls are presented in terms of local Nusselt number. © 2005 Elsevier Ltd. All rights reserved.