A fractal model of the porous microstructure of earth-based materials