Flow transitions and pattern selection of the rayleigh-bénard problem in rectangular enclosures