We study a liquid-gas front propagation in a modulated Hele-Shaw cell by means of multiphase computational fluid mechanics based on the three-dimensional Navier-Stokes equations. In the simulations an obstacle that partially fills the gap is placed at the center of the cell, and the liquid-gas interface is driven at a constant velocity. We study the morphological differences between imbibition and drainage for a wide range of capillary numbers, and explore how the wetting properties of the constriction affect the amount of liquid that remains trapped in the draining process. We observe increasing remaining volumes with increasing capillary number and decreasing contact angle. The present CFD implementation for a single mesa defect provides insight into a wide number of practical applications.