Optimal porosity for impact squeeze of soft layers imbibed with liquids