Solution (source code)

= Solution

A <velocity field> $\mathbf u(\mathbf x,t)$ assigns a <velocity> to each point. Following a fluid parcel rather than holding position fixed gives the material or convective <derivative>
$$
\boxed{\frac D{Dt}=\partial_t+\mathbf u\cdot\nabla.}
$$
The convective term can accelerate fluid even in a steady flow, for example as a stream narrows. Conservation of <mass> is $\partial_t\rho+\nabla\cdot(\rho\mathbf u)=0$; constant-density <incompressible flow> has $\nabla\cdot\mathbf u=0$.

For an incompressible <Newtonian fluid> of constant <density> and <viscosity>, with conservative body-force potential per <mass> $\Phi$, <momentum> balance is
$$
\frac{D\mathbf u}{Dt}=-\frac{\nabla p}{\rho}-\nabla\Phi+\nu\nabla^2\mathbf u.
$$
Neglect <viscosity> and assume steady flow. Dotting with an element along a streamline, or using $(\mathbf u\cdot\nabla)\mathbf u=\nabla(u^2/2)-\mathbf u\times(\nabla\times\mathbf u)$, gives
$$
\boxed{\frac p\rho+\frac{u^2}{2}+\Phi=B\quad\text{along a streamline}.}
$$
This is Bernoulli's equation: <pressure> <work>, <kinetic energy> and gravitational <potential energy> interconvert. In a connected irrotational region under the same assumptions, $B$ is the same for all streamlines. In a rotational flow it can vary between them. Viscous dissipation, pumps or unsteady motion require the corresponding modified balance; the steady inviscid expression cannot be applied indiscriminately.

<Vorticity> $\boldsymbol\zeta=\nabla\times\mathbf u$ measures local fluid rotation. For constant-density <incompressible flow> it evolves by
$$
\frac{D\boldsymbol\zeta}{Dt}=(\boldsymbol\zeta\cdot\nabla)\mathbf u+\nu\nabla^2\boldsymbol\zeta,
$$
showing vortex stretching and viscous diffusion. A <potential flow> has $\mathbf u=\nabla\phi$ locally, so irrotational incompressible motion satisfies $\nabla^2\phi=0$. Boundary conditions then determine flows around simple shapes. A multiply connected region can have circulation even when its local <vorticity> vanishes; ideal <potential flow> also misses no-slip <boundary layers> and viscous drag.

For a <Newtonian fluid>, <shear stress> is proportional to <strain> rate. No-slip at solid walls produces <velocity> gradients and dissipation. Fully developed laminar pipe flow, for example, has
$$
u_z(s)=\frac{\Delta p}{4\mu\ell}(R^2-s^2),\qquad
Q=\frac{\pi R^4\Delta p}{8\mu\ell}.
$$
The <Reynolds number> $\operatorname{Re}=UL/\nu$ compares inertial and viscous terms. Small values favour creeping-flow approximations; large values can permit thin <boundary layers> and <turbulence>, without guaranteeing <turbulence> in every geometry. \b[The appropriate flow model follows from conservation laws, constitutive properties, boundaries and scale comparisons.]