Flow-driven compaction of a fibrous porous medium