Thermal convection in a porous medium composed of alternating thick and thin layers