A numerical study is performed on the transient natural convection with a temperature-dependent viscosity inside a square partially porous cavity with a local heat-generating and heat-conducting source. The vertical walls of the cavity are kept at constant cooling temperature while the horizontal walls are adiabatic. The discrete heat-conducting and heat-generating source is located on the bottom wall. A porous layer is located under the clear fluid layer. Governing equations formulated in dimensionless stream function, vorticity and temperature variables with corresponding initial and boundary conditions are solved using implicit finite difference schemes of the second order. The control parameters are the Darcy number, Ostrogradsky number, viscosity variation parameter, height of the porous layer, and dimensionless time. The effects of these parameters on the average Nusselt number along the heat source surface, average temperature of the heater, fluid flow rate inside the cavity, as well as on the streamlines and isotherms are analyzed. The results show that porous layer thickness and viscosity of the working fluid are very good control parameters for optimization of the passive cooling system.