Capillary phenomena in porous media: Pore and grain scale studies