Natural convection heat transfer in a square cavity with a porous medium subjected to a uniform energy generation per unit volume is studied numerically in this paper. Temperature of the vertical walls is not equal but it is constant . There are two effective parameters in this condition that appear in the nondimensionalized equations and they are functions of temperature difference between hot and cold walls and energy generation in the porous medium. Nondimensionalized governing equations are obtained based on the Darcy model. a control volume approach is used for solving these equations. The effects of the variation of two governing parameters are investigated on the heat transfer rate, fluid flow and isotherms.