% vim: tw=50
% 24/01/2023 10AM

\subsection{Conservation of Mass}

Example
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/942f21ac9bcf11ed.png}
\end{center}
Experience says OK if fluid is air, because air is
compressible, velocities make density go
up (and pressure goes up). Problem if fluid is
water because density of water is approximately
constant, so velocities would imply mass
destroyed.

\myskip
Suggests there must be a relationship between
$\rho(\bf{x}, t)$ and $\bf{u}(\bf{x}, t)$ as
mass is not destroyed or created. Consider an
arbitrary volume $V$, \emph{fixed in space},
bounded by a surface $\partial V$ with outward
normal $\bf{n}$. Mass in $V$, $\int_V \rho \dd V$,
can only change due to flow of mass across the
bounding surface $\partial V$.
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/d431033c9bd011ed.png}
\end{center}
 Volume out over $\delta A$ in time $\delta t$ is
 $\bf{u} \delta t \cdot \bf{n} \delta A$. Mass out
 is $\rho \bf{u} \cdot \bf{n} \delta A \delta t$
 \[ \dfrac{}{t} \int_V \rho \dd V = -\int \rho
 \bf{u} \cdot \bf{n} \dd A \]
 \[ \int_V \pfrac{\rho}{t} \dd V = -\int_V \nabla
 \cdot (\rho \bf{u}) \dd V \]
The two left expressions are equal for fixed $V$,
and the two right expressions are equal by
Divergence Theorem. Since this is true for
arbitrary $V$,
\[ \boxed{\pfrac{\rho}{t} + \nabla \cdot (\rho
\bf{u}) = 0} \]
$\rho \bf{u}$ is the \emph{mass flux}. Using
$\nabla \cdot (\rho \bf{u}) = \bf{u} \cdot \nabla
\rho + \rho \nabla \cdot \bf{u}$ can rewrite as
\[ \boxed{\Dfrac{\rho}{t} =-\rho \nabla \cdot
\bf{u}} \]
The density of blob decreases if the velocity is
divergent (spreading out). If a fluid is
\emph{incompressible}, i.e. the density of a fluid
particle can't change, $\Dfrac{\rho}{t} = 0$
\[ \implies \boxed{\nabla \cdot \bf{u} = 0} \]
\emph{incompressible flow}. This course considers
flows where the density of a fluid is constant and
uniform: $\rho = \text{const}$.

\begin{note*}[Non-examinable]
    Incompressibility is a very good approximation
    if
    \[ |\bf{u}| \ll \text{sound speed } c \]
    and
    \[ \text{timescale} \ll
    \frac{\text{lengthscale}}{c} \]
    $c = 330\mathsf{ms^{-1}}$ (air), $c =
    1500\mathsf{ms^{-1}}$ (water).
\end{note*}

\subsection{Kinematic Boundary Condition}

Mass conservation at a boundary. Suppose the
material boundary of a body of fluid has velocity
$\bf{}(\bf{x}, t)$.
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/1d97ff1a9bd311ed.png}
\end{center}
At a point $\bf{x}$ on boundary, fluid velocity
relative to the moving boundary is $\bf{u}(\bf{x},
t) - \bf{U}(\bf{x}, t)$. Condition that there is
no mass flux across boundary $\rho(\bf{u} -
\bf{U}) \cdot \bf{n} \delta D \delta t = 0$, i.e.
\[ \bf{u} \cdot \bf{n} = \bf{U} \cdot \bf{n} \]
For example:
\begin{enumerate}[(1)]
    \item At a stationary rigid boundary
        $\bf{U} = \bf{0} \implies \bf{u} \cdot \bf{n} -
        0$. So a fixed boundary is a streamline.
    \item Water waves (Section 5) have an
        air-water interface $z = \zeta(x, y, t)$.
        Think of the water surface as a contour of
        the function
        \[ F(x, y, z, t) = z - \zeta(x, y, t) \]
        \begin{center}
            \includegraphics[width=0.6\linewidth]
            {images/e49e45c49bd311ed.png}
        \end{center}
        Then $\bf{n} \parallel \nabla F =
        (-\zeta_x, -\zeta_y, 1)$. Can take $\bf{U}
        = (0, 0, \zeta_t)$, $\bf{u} = (u, v, w)$
        hence
        \[ -u \zeta_x - v \zeta_y + w = \zeta_t \]
        (at $z = \zeta$). Equivalent to
        $\Dfrac{}{t} (z - \zeta) = 0$, i.e. fluid
        particles on a surface remain on surface.
\end{enumerate}

\subsection{Stream Function for 2D Incompressible Flow}

Incompressible $\equiv$ $\nabla \cdot \bf{u} = 0
\iff \bf{u} = \nabla \times \bf{A}$ for some
vector potential $\bf{A}$. For a 2D flow, $\bf{u}
= (u(x, y), v(x, y), 0)$ can take
\[ \bf{A} = (0, 0, \psi(x, y)) \implies \bf{u} =
\left( \pfrac{\psi}{y}, -\pfrac{\psi}{x}, 0 \right) \]
\[ \pfrac{u}{x} + \pfrac{v}{y} = 0 \]
The scalar $\psi(x, y)$ is the \emph{stream
function}.

\subsubsection*{Properties of the stream function}

Exercises on Question 4 of Example Sheet 1:
\begin{enumerate}[(i)]
    \item The streamlines are given by $\psi =
        \text{const}$ ($\bf{u}$ is parallel to the
        contours of $\psi$).
    \item $|\bf{u}| = |\nabla \psi|$ so flow
        faster when streamlines are closer.
    \item $\psi(\bf{x}_1) - \psi(\bf{x}_0) =
        \int_{x_0}^{x_1} \bf{u} \cdot \bf{n} \dd
        l = \text{volume flux crossing line from
        $\bf{x}_0$ to $\bf{x}_1$}$.
        \begin{center}
            \includegraphics[width=0.6\linewidth]
            {images/958505349bd511ed.png}
        \end{center}
        $\bf{n} \dd l = (+\dd y, -\dd x)$.
    \item $\psi = \text{const}$ on a stationary
        rigid boundary. (k.b.c and iii)
\end{enumerate}

\begin{example*}
    $\bf{u} = (y, x)$, $\nabla \cdot \bf{u} = 0$ so
    a stream function exists. $\pfrac{\psi}{y} =
    y$ so $\psi = \half y^2 + f(x)$.
    $-\pfrac{\psi}{x} = x$ so $f(x) = -\half x^2$.
    Streamlines are $\half(y^2 - x^2) =
    \text{const}$.
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/455d99629bd611ed.png}
    \end{center}
\end{example*}

\subsubsection*{2D Incompressible Flow in Polar Coordinates}

\[ \bf{u} = (u_r(r, \theta), u_\theta(r, \theta),
0) \]
\[ \bf{A} = (0, 0, \psi(r, \theta)) \]
\[ \implies \bf{u} = \nabla \times \bf{A} = \left(
\frac{1}{r} \pfrac{\psi}{\theta},
-\pfrac{\psi}{r}, 0\right) \]
\[ \nabla \cdot \bf{u} = \frac{1}{r} \pfrac{}{r}
(ru) + \frac{1}{r} \pfrac{u_\theta}{\theta} = 0 \]

\begin{note*}[Non-examinable]
    Axisymmetric Flow, in spherical polar
    coordinates $(r, \theta, \phi)$, has
    \[ u_\phi = \pfrac{}{\phi} = 0 \]
    If $\nabla \cdot \bf{u} = 0$ and we take
    $\bf{A} = \left( 0, 0, \pfrac{\Psi(r,
    \theta}{r\sin\theta} \right)$ then
    \[ \bf{u} = \left( \frac{1}{r^2\sin\theta}
    \pfrac{\Psi}{\theta}, -\frac{1}{r\sin\theta}
    \pfrac{\Psi}{r} , 0 \right) \]
    is parallel to contours of $\Psi$. The Stokes
    stream function $\Psi(r, \theta)$ -- stream
    tubes. (see textbooks for other properties).
\end{note*}
