On numerical modeling of capillary barriers