Bubble generation and two-phase flow patterns in microchannels