Viscosity arise because of fluid deformation, which causes shear within it. Momentum is then diffused down the velocity gradient. What I can't seem to understand, is how the heating arises.
I'm not 100% certain of what I'll be saying here. Let us consider a shear flow in the x direction with a velocity gradient in the z direction, with velocity increasing in the increasing z direction. Within an infinitesimally thin slab of fluid perpendicular to the z direction, the fluid is instantenously in thermal equilibrium with a certain Maxwellian distribution, but from what I understand, it has a certain independant velocity superposed to it in the x direction. For simplicity's sake, let us consider a monoatomic ideal fluid. At any time, an atom from above can penetrate into this slab. This atom comes from a region where the Maxwellian distribution might be the same, but the mean velocity is higher. When this atom arrives in the slab, the difference in the mean velocities makes it have an excess velocity in the x direction. The atom then suffers elastic collisions with the atoms of the slab, increasing the x component of their velocities. And analogously for atoms coming from under. There is energy interchange. What I don't understand, is where the losses come from. Intuitively, I'd say some of it gets absorbed by the thermal (Maxwellian) motions. But how? Isn't the mean velocity vector of a Maxwellian distribution supposed to be 0? If momentum is conserved, then isn't the x-velocity excess supposed to be 100% converted into fluid mass motion?
EDIT (To make sure I understand Thomas' answer.
Let's consider 2 contiguous slabs of fluid in the above shear flow. So the upper one is faster, and the lower one slower. They have the same number of atoms and so the same total mass $M$ (where $m$ is the mass of an individual atom). Let's separate the total momentum (in the x direction) of the individual slabs in 2 contributions: $$p_1=\sum p_{v1}+\sum p_{u1}$$ and similarly for 2. 1 being the upper faster fluid, and 2 the lower slower fluid. The sum is over all particles in the slab. The first term is the momentum due to the random velocities, and the second one is the momentum due to the fluid flow. The total momentum of the system is then: $$p=p_1+p_2.$$ Suppose that the total momentum due to the random velocities of both slabs is equal to 0. That is: $$\sum p_{v1}=\sum p_{v2}=0.$$ We also have: $$\sum p_{u1}=Mu_1$$ and similarly for slab 2. The total momentum of the system is then: $$p=M(u_1+u_2).$$ Now let's introduce one atom from slab 1 into slab 2, and one atom from slab 2 into slab 1. Without taking into account collisions, the equations of the contributions of the total momentum of slab 2 becomes: $$p_{v2}=m(v_1-v_2)$$ $$p_{u2}=Mu_2+m(u_1-u_2)$$ and similarly for slab 1. And when the contributions to the total momentum of both slabs are added, momentum is obviously conserved as we get our previous expressions. Here, it is pure exchange of momentum from both slabs and slab 2 is accelerated. Now, collisions randomize part of the flow velocity associated to the atom from slab 1 that penetrated into slab 2, so we have a transfer of momentum from the $p_{u2}$ to the thermal contribution $p_{v2}$, let's say by a factor $a$: $$p_{v2}=m(v_1-v_2)+am(u_1-u_2)$$ $$p_{u2}=Mu_2+(1-a)m(u_1-u_2).$$ $a$ would depend on the viscosity of the medium. The greater it is, the greater the heat loses. But it would at the same time minimize momentum transfer? And a low viscosity would maximize momentum transfer? That doesn't seem right. Where did I go wrong?