We develop the p-adic model of propagation of fluids (e.g., oil or water) in capillary networks in a porous random medium. The hierarchic structure of a system of capillaries is mathematically modeled by endowing trees of capillaries with the structure of an ultra metric space. Considerations are restricted to the case of idealized networks represented by homogeneous p-trees with p branches leaving each vertex, where p > 1 is a prime number. Such trees are realized as the fields of p-adic numbers. We introduce and study an inhomogeneous Markov process describing the penetration of fluid into a porous random medium. (C) 2018 Elsevier B.V. All rights reserved.