Pore-scale investigation of flow in saturated and unsaturated media: computational tools and upscaling