Advances made during the last decades in the microfluidic held have drawn attention to the need of an increased theoretical and computational eort. This thesis combines a theoretical study of two-phase and three-phase ows with numerical simulations of actual bubbles in microstructures. The theoretical understanding of eects related to surface tension such as contact angle, wetting phenomenon, moving bubbles, and the so-called clogging pressure is essential. Moreover the specic impact of dierent channel geometries on the behavior of bubbles is studied. A Matlab program developed by the author and the commercial CFD-ACE+ software are utilized for that purpose. During the thesis work a great amount of insight into CFD-ACE+ is gained. The free surface handling VOF-method (Volume-Of-Fluid) is investigated thoroughly in several examples. Shortcomings regarding the free surface module are pinpointed and commented. The properties of two types of channel contractions, the sudden contraction and the tapered channel, are compared. The tapered channel geometry exhibits many advantages. Based on the insights gained a novel bubble trap is developed and simulated. The thesis work both pinpoints several important geometric features having an inuence on bubble motion in microchannels and identies lacks in the numerical implementation of boundary conditions at contact lines.