Three-dimensional natural convection in a confined porous medium with internal heat generation