Effect of viscosity on the avalanche dynamics and flow transition of wet granular matter