Natural convection in differentially heated rectangular cavities with time periodic boundary condition on one side