We developed a low-cost method for fabricating "soil-on-a-chip"micromodels with 2D and 2.5D pore structures by stacking layers made with a conventional low-cost tabletop CNC router followed by tape bonding. The pore structure was extracted from an X-ray micro-computed tomography scanning image of a medium-grain sandstone sample. The imbibition experiments performed in the 2D and 2.5D micromodels showed the trends of the residual saturation versus capillary number (Ca). The channels showed opposing trends for low-aspect-ratio 2D and high-aspect-ratio 2.5D micromodels. As the channel aspect ratio increased, the location of air entrapment changed from dead-end pores to transport pores. The sizes of trapped air bubbles in the transport pores decreased as the injection flow rates increased. To show the relationship between the air trapped size and Ca, we derived equations that described the competition between the bulk menisci and the corner flow in the channels for different Ca based on the "supply principle."The relative contributions of the piston displacement and corner film flow, which were dependent on the cross-sectional shapes of the pores and Ca, determined the size and location of the air bubbles trapped in the 2.5D micromodel.