Microwave heating of a porous medium with a nonuniform porosity is numerically investigated based on a proposed numerical model. A two-dimensional variation of porosity of the medium is considered. The generalized non-Darcian model developed takes into account the presence of a solid drag and the inertial effect. The transient Maxwell’s equations are solved by using the finite difference time domain method to describe the electromagnetic field in the waveguide and medium. The temperature profile and velocity field within a medium are determined by solution of the momentum, energy, and Maxwell’s equations. The coupled nonlinear set of these equations is solved using the SIMPLE algorithm. In this work, a detailed parametric study is conducted on heat transport inside a rectangular enclosure filled with a saturated porous medium of constant or variable porosity. The numerical results agree well with the experimental data. Variations in porosity significantly affect the microwave heating process as well as the convective flow pattern driven by microwave energy.