Often in Physics classes we solve problems involving fluid flows in pipes. Usually they are solved by a combination of Bernoulli's law and continuity law, which states that the same volume of fluid has to flow per time in every part of the pipe (assuming incompressibility).
But why does it make sense to define velocities like this? In these problems, we usually assume the velocity depends only on horizontal position, not vertical position inside the pipe. In reality, we know that there is a velocity gradient along the cross section of the pipe, which is related to viscosity.
So in the above picture for example, what are $v_1$ and $v_2$? Are they some kind of average velocities? Or do we have to assume, if we want to apply the continuity equation in the form $A_1v_1=A_2v_2$, that the velocity is the same across the cross section? If that is the case, when is it reasonable to assume this?