Statistical geometry in the study of fluids and porous media