Mathematical and numerical modeling of liquids dynamics in a horizontal capillary