Pore level processes in porous media, such as drainage or imbibition of wetting phase, are of great importance in different branches of soil science, petroleum engineering and water research. In this work we describe a new way of modeling imbibition, based upon a physically, consistent dynamic criterion for the imbibition of a pore. We illustrate this approach in a simple but physically representative porous medium, the "ideal soil" (a. dense random packing of equal spheres). The results of geological processes, such as cementation (e.g., quartz overgrowth), are simulated in the sphere pack to yield a model of sedimentary rock. Complete knowledge of the pore space geometry in the model rock then allows making a priori predictions of pore level processes. Imbibition is simulated in a network that faithfully represents the pore-level geometry of the model rock. This approach allows studying the effects of contact angle, initial conditions (for example, different drainage endpoints), and sample geology (amount of cement). It also provides a basis for a mechanistic understanding of phenomena such as "snap-off" of non wetting phase in the pore throats. The simulations show that the capillary pressure curve is very, sensitive to the wettability conditions (value of contact angle) and geological features of the sample. Predicted capillary pressure curves are compared to experimental data, presented in the literature, and found consistent with most of them.