How the tap work? And how we can apply equation of continuity to the water flow when we turn the knob and when we cover the tap with thumb
The tap works by changing the minimum cross-sectional area of the flow. For a given pressure difference (upstream pressure minus downstream pressure) flow rate is a function of minimum cross-sectional area. Using your thumb would do the same thing. You can stop the flow with your thumb if you are strong relative to the force of the flow.
http://people.uncw.edu/lugo/MCP/DIFF_EQ/deproj/orifice/orifice.htm
Where am getting wrong with my understanding of the Hydraulic analogy.
Probably you are misunderstanding the Equation of Continuity. The Equation of Continuity only means that the mass flow rate in equals the mass flow rate out. It does not mean that the flow in and the flow out never change. Flow rate in and flow rate out can change simultanteously. Your statement "On the other hand removing pipe 2 will not change water flow [rate]" is incorrect. Removing pipe 2 will make a big difference in total flow if it is large in cross section compare to pipe 1. It will make a small difference in total flow if it is small in cross section compare to pipe 1. Your statement "When we decrease the area of the mouth of tap by our thumb the amount of water flowing out remains same" is also incorrect. Instead, the flow rate approaches zero as you make the cross-sectional area of the unblocked portion of the mouth small.
From my understanding, what's happeneing is the adverse streamwise
pressure gradient precludes the boundary layer from progressing
downstream past a certain point, and the upstream flow subsequently
has nowhere to go but up and off of the body.
This is correct, in a sense. The effect of an adverse pressure gradient is to decelerate the flow near the body surface. This can be seen, for example, by examining the boundary layer equation in two dimensions.
$$\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}+v \frac{\partial u}{\partial y}=\nu\frac{\partial^2 u}{\partial y^2}-\frac{1}{\rho}\frac{\partial p}{\partial x}$$
If you consider steady flow and assume normal velocities to be small, then by inspection, we can see that an adverse pressure gradient causes $u$ to decrease in the streamwise ($x$) direction.
As you suspected, separation requires that the flow near the boundary stagnates. Moreover, separation occurs when the flow actually reverses.
$$ \frac{\partial u}{\partial y}_{y=0}=0; \quad \text{Flow Stagnation / Impending Reversal} $$
Additionally, it requires that the pressure gradient be simultaneously adverse, so that the the flow does not accelerate again.
$$ \frac{\partial p}{\partial x}>0 \quad \text{Adverse Pressure Gradient}$$
So, in short, you're correct. However...
This is a very different causal relationship from the first
explanation, where the flow lacks a sufficient streamwise-normal
pressure gradient to overcome the centrifugal forces of a curved
streamline.
The two statements are essentially the same - there are any number of ways to physically describe what's going on- but I think you've got the causality mixed between the two. The curvature of a body, and thus its attending streamlines, jacks up the adversity of the pressure gradient along that body (assuming you're past the point of minimum pressure). So it's the adverse pressure gradient that ultimately leads to separation. In a perfect world, where viscosity didn't exist, the flow would speed up as it hits the forward part of a curved body. The pressure would drop as it reaches the widest point of the body, streamlines are "squeezed" together, and the flow reaches a maximum velocity. On the afterbody, the flow would decelerate and the pressure would increase until both reach their upstream values. It's a simple trade between kinetic energy (velocity) and potential energy (pressure). In a real viscous flow, some of that kinetic energy is dissipated in the heat-generating nuisance that is a boundary layer, so that when the transfer from kinetic back to potential energy occurs on the afterbody of a curved surface, there isn't enough kinetic energy, the flow stagnates and reverses, and you get flow separation.
I can't comment on shock-induced separation, as I work in hydrodynamics and don't worry about compressibility. I'm no authority in that area, either, so if somebody takes issue with my explanation, feel free to criticize.
Best Answer
The Bernoulli equation, with friction, has the following form: $$ p_1+\frac{1}{2}{\rho}v_1^2+{\rho}gz_1=p_2+\frac{1}{2}{\rho}v_2^2+{\rho}gz_2+\left(f\frac{L}{D}+{\sum}K\right)\frac{1}{2}{\rho}v_2^2 $$ where $p$ is pressure, $\rho$ desity, $v$ velocity, $z$ height, $g$ the acceleration due to gravity, $f$ the friction factor, $L$ the length of the tube, $D$ the hydraulic diameter and $K$ additional sources of local friction.
A tap falls under the category of additional sources of local friction. Adjusting the tap (its $K$ value) will change the flow-rate, because this factor gets multiplied by the velocity squared.