As molecules in adjacent layers with different average velocities collide, they transfer momentum between the layers. The rate of change of momentum produces a shear stress in the fluid. At the surface of a body, molecules transfer momentum to the surface as they collide, resulting in a tangential, shear force.

When molecules hit the surface of a body, they bounce around among the surface molecules and finally leave with a tangential velocity which is, on average, that of the surface itself. Thus, the average tangential velocity near the surface of a body is zero with respect to the body. This is the so-called no-slip condition.

This layer of slow moving fluid near the body surface is called the boundary layer, and the viscosity of the fluid causes a distribution of tangential velocity above the surface as shown here. As the tangential momentum of the air molecules is transferred to the surface, a shear stress is produced.

This shear stress is related to the viscosity and velocity gradient by the expression:

τ = µ dU/dy

We can see more quantitatively how the transfer of tangential momentum between fluid layers leads to this relation by considering a small section in the boundary layer.

Molecules starting near the top of the box and moving to the bottom, lose momentum in the amount:

m h dU/dy

Since the shear stress, τ, is the rate of change of momentum:

τ = n m h dU/dy

where n is the number of molecules passing through this area per unit time.

Now n is related to the average molecular velocity, c, and the density, ρ so:

m n = ρ c

and the shear stress is:

τ = ρ c h dU/dy

so that: µ = ρ c h

The height, h, over which molecules transfer their momentum is related to the mean free path, λ , with more detailed calculations showing that:

µ = 0.49 ρ c λ

Now the mean free path decreases almost in proportion to density and the average molecular speed varies with T, so we expect that µ varies with T and does not depend on pressure. This is approximately true for most fluids.