\documentclass[12pt]{article}

\renewcommand\thesubsection{\alph{subsection}}

\usepackage{float}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{fancyhdr}
\usepackage{enumerate}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{cancel}
\usepackage[justification=centering]{caption}
\usepackage{parskip}
\usepackage{array}
\usepackage{tabu}
\usepackage{subcaption}
\usepackage[style=ieee]{biblatex}
\usepackage{setspace}
\usepackage[section]{placeins}
\pagestyle{fancy}
\fancyhf{}
\rhead{CEE 262B Week 7}
\lhead{Section Notes}
\rfoot{\thepage}

\begin{document}
\section{TA Section Agenda}
\begin{itemize}
\item Pressure splitting
\item Lecture notes summary
\end{itemize}

\section{Pressure Splitting}
In previous years this material was covered in 262A, but since it wasn't emphasized as much this year I made this worksheet so that we're all on the same page before we start talking about the different types of pressure gradients that affect estuarine flows.

We start with a very general open channel flow with a free surface at $z=\eta$. Invoking the Boussinesq approximation and using standard vector notation, our momentum equations are: 

\begin{equation}\label{eq:NS}
\frac{D \vec{u}}{Dt} = -\frac{1}{\rho_0} \nabla p -\frac{\rho}{\rho_0} g \hat{k} + \nu \nabla^2 \vec{u}
\end{equation}

Here are the key decompositions. First, we split the density into three parts: $\rho = \rho_0 + \overline{\rho}(z) + \rho'(\vec{x},t)$. $\rho_0$ is the constant background density field. $\overline{\rho}(z)$ is the part of the density that varies with depth. And $\rho'(\vec{x},t)$ is the perturbation density, which arises from any other effect such as spatial or temporal (i.e. time dependent) changes in salinity or temperature. 

Next, we split the pressure into two parts: $p = p_h + q$. $p_h$ is the hydrostatic pressure balancing the weight of the fluid, which we can define with:
\begin{equation}\label{eq:hydrostatic}
\frac{\partial p_h}{\partial z} = -\rho g
\end{equation}

And $q$ is the nonhydrostatic pressure, which encompasses the rest of the pressure field. We'll come back to its strict definition later, but for now think of it as ``everything else'' that affects pressure aside from hydrostatic effects. Going back to equation \ref{eq:hydrostatic}, we can integrate it from some arbitrary depth $z$ up to the free surface $\eta$ to solve for the hydrostatic pressure field:

\begin{equation*}
\int_z^{\eta} \frac{\partial p_h}{\partial z} dz' = \int_z^{\eta} -(\rho_0 + \overline{\rho} + \rho')g dz'
\end{equation*}

\begin{equation}\label{eq:press}
p_h(\vec{x},t) = \underbrace{p_h(z = \eta)}_{\text{Surface pressure} = p_s(x,y,t)} +\underbrace{\rho_0 g(\eta - z)}_{\text{Barotropic pressure}} + \underbrace{\int_z^{\eta} (\overline{\rho} + \rho')g dz'}_{\text{Baroclinic pressure}}
\end{equation}

The surface pressure is merely the pressure at the free surface (i.e. atmospheric pressure), which can vary horizontally and in time. The barotopic pressure is what we classically think of as hydrostatic pressure: it's the pressure due to the weight of the fluid above a point in the water column at depth $z$. The new one is the baroclinic pressure, which arises from nonuniform densities, either vertically or horizontally due to things like temperature and salinity variations, or increased pressure compressing the fluid. 

Now that we have solved for the hydrostatic pressure, we can take gradients of equation \ref{eq:press} to find the pressure gradients, which we can then plug back into equation \ref{eq:NS}. These look like:

\begin{align*}      
\frac{\partial p_h}{\partial x} &= \frac{\partial p_s}{\partial x} + \rho_0 g \frac{\partial \eta}{\partial x} + \frac{\partial}{\partial x}\int_z^{\eta} \rho'g dz'\\
\frac{\partial p_h}{\partial y} &= \frac{\partial p_s}{\partial y} + \rho_0 g \frac{\partial \eta}{\partial y} + \frac{\partial}{\partial y}\int_z^{\eta} \rho'g dz'\\
\frac{\partial p_h}{\partial z} &= -\rho g
\end{align*}     

More generally, we can combine all of these into one equation:

\begin{equation}\label{eq:fullhydro}
\nabla p_h = \nabla_H p_s +\rho_0 g \nabla_H \eta + \nabla_H \int_z^{\eta} \rho'g dz' - \rho g \hat{k}
\end{equation}

where $\nabla_H$ is the horizontal gradient operator, $\frac{\partial}{\partial x} \hat{i} + \frac{\partial}{\partial y} \hat{j}$. 

Now we have an equation for the hydrostatic pressure gradients split into components due to surface pressure variations, barotropic pressure variations, and baroclinic pressure variations. Going back to our original equation for the pressure, $p = p_h + q$, we can write the total pressure gradient as:

\begin{equation}\label{eq:fullpress}
\nabla p = \nabla p_h + \nabla q
\end{equation}

Combining equations \ref{eq:fullpress} and \ref{eq:fullhydro} and plugging into equation \ref{eq:NS}, we obtain: 

\begin{equation}
\frac{D \vec{u}}{Dt} = -\frac{1}{\rho_0}\nabla q -\frac{1}{\rho_0} \nabla_H p_s - g\nabla_H \eta -\frac{1}{\rho_0} \nabla_H \int_z^{\eta} \rho'g dz' + \nu \nabla^2 \vec{u}
\end{equation}

Now we can see there was a lot wrapped up in that seemingly simple $-\frac{1}{\rho_0}\nabla p$ term! In this class, we really only need to worry about the hydrostatic pressure gradients, as nonhydrostatic pressure is generally much smaller. However, just to give you a better idea of what it actually is and where it comes from, we'll switch to Einstein notation. Now, Navier-Stokes looks like:

\begin{equation}\label{eq:einstein}
\frac{\partial u_i}{\partial t} +u_j \frac{\partial u_i}{\partial x_j} = -\frac{1}{\rho_0}\frac{\partial p}{\partial x_i} -\frac{\rho}{\rho_0}g \delta_{i3} + \nu \frac{\partial^2 u_i}{\partial x_j \partial x_j}
\end{equation}

Taking the divergence of equation \ref{eq:einstein}:

\begin{equation}
\frac{\partial}{\partial t}\left(\frac{\partial u_i}{\partial x_i}\right) + \frac{\partial u_j}{\partial x_i} \frac{\partial u_i}{\partial x_j} + u_j \frac{\partial}{\partial x_j}\left(\frac{\partial u_i}{\partial x_i}\right) = -\frac{1}{\rho_0}\frac{\partial^2 p}{\partial x_i \partial x_i} -\frac{\partial}{\partial x_3}\left(\frac{\rho}{\rho_0}g\right)  + \nu \frac{\partial^2}{\partial x_j \partial x_j}\left(\frac{\partial u_i}{\partial x_i}\right)
\end{equation}

Because the flow is divergence free, $\frac{\partial u_i}{\partial x_i} = 0$, leaving us with:

\begin{equation}\label{eq:elliptic}
\frac{\partial u_j}{\partial x_i} \frac{\partial u_i}{\partial x_j} = -\frac{1}{\rho_0}\frac{\partial^2 p}{\partial x_i \partial x_i} -\frac{g}{\rho_0}\frac{\partial \rho}{\partial x_3}
\end{equation}

Here we split the pressure again into $p = p_h + q$ and note that from above, 

\begin{equation*}
\frac{\partial^2 p_h}{\partial x_3^2} = -g\frac{\partial \rho}{\partial x_3}
\end{equation*}

Thus,

\begin{align*}
\frac{\partial^2 p}{\partial x_i \partial x_i} = \frac{\partial^2 p_h}{\partial x_i \partial x_i} + \frac{\partial^2 q}{\partial x_i \partial x_i} = \left(\frac{\partial^2 p_h}{\partial x_i \partial x_i}\right)_{i=1,2} + \frac{\partial^2 p_h}{\partial x_3^2} + \left(\frac{\partial^2 q}{\partial x_i \partial x_i}\right) = ...\\
 \left(\frac{\partial^2 p_h}{\partial x_i \partial x_i}\right)_{i=1,2} - g\frac{\partial \rho}{\partial x_3} + \left(\frac{\partial^2 q}{\partial x_i \partial x_i}\right)
\end{align*}

Now we just substitute this into equation \ref{eq:elliptic}, obtaining:

\begin{equation}
\frac{\partial u_j}{\partial x_i} \frac{\partial u_i}{\partial x_j} = -\frac{1}{\rho_0}\left(\frac{\partial^2 p_h}{\partial x_i \partial x_i}\right)_{i=1,2} -\frac{1}{\rho_0}\left(\frac{\partial^2 q}{\partial x_i \partial x_i}\right)
\end{equation}
 
Or, rearranging to better see the form of the nonhydrostatic pressure: 

\begin{equation}
\frac{1}{\rho_0}\left(\frac{\partial^2 q}{\partial x_i \partial x_i}\right) = -\frac{\partial u_j}{\partial x_i} \frac{\partial u_i}{\partial x_j} -\frac{1}{\rho_0}\left(\frac{\partial^2 p_h}{\partial x_i \partial x_i}\right)_{i=1,2}
\end{equation}

Or if you prefer vector form...

\begin{equation}
\frac{1}{\rho_0}\nabla^2q = -\nabla \vec{u}^T :\nabla \vec{u} - \frac{1}{\rho_0} \nabla_H^2p_h
\end{equation}

Thus, the nonhydrostatic pressure is determined by an elliptic PDE that's a function of the velocity gradient and hydrostatic pressure gradient. As previously stated we won't worry about it much here (it's really hard to solve for!), but it will show up in Oliver's modeling class. 


\section{Mixing in Rivers I}
This is the first of two lectures focused on mixing in riverine environments. The ideas here are pretty similar to what we've looked at previously, just applied to slightly more complex geometries. 

\subsection{A Qualitative Look at Timescales}
This slide is in your notes, but I found it particularly useful in thinking about the different timescales involved in a 3D mixing situation. 

\begin{figure}[H]
    \includegraphics[width=0.8\textwidth]{mixing.png}
    \centering
\end{figure}

The takeaway from this picture is that vertical mixing occurs first (i.e. over the depth), followed by transverse mixing, and then longitudinal mixing. There is a mixing coefficient, or diffusivity associated with mixing in each of these directions. The first regime, nearfield dilution, will not be examined in great detail, but you should know that there are many design techniques geared towards controlling how pollutants are mixed at the point of discharge (e.g. diffusers on desal plant outfalls). 

\subsection{Open Channel Flow}
If you've taken a hydraulics class then you may be familiar with some of this material. If not, don't worry, it's just a couple more equations! 

Below is \textbf{Manning's Equation}:
\begin{equation*}
Q = \frac{A}{n}R_h^{2/3} S^{1/2}
\end{equation*}
Here, $Q$ [$m^3/s$] is the flow rate, $A$ [$m^2$] is the cross sectional area, $n$ [$s/m^{1/3}$] is a roughness coefficient called ``Manning's n", $S$ is the surface slope, and $R_h$ [$m$] is the hydraulic radius defined by $R_h = A/P$, where $P$ is the wetted perimeter. 

In order to obtain $u_*$, we balance friction with the pressure gradient, i.e. 
\begin{equation*}
Pu_* = gSA
\end{equation*}

I'll spare you the algebra, and go right to the nice result:

\begin{equation*}
u_* = \sqrt{g d S}
\end{equation*}

\subsection{Vertical Mixing}
Recall that this happens most quickly, and is arguably the simplest. Thus we can find the vertical diffusivity pretty easily: 

\begin{equation*}
\epsilon_z = \kappa u_* d \left(\frac{z}{d}\right)\left(1-\frac{z}{d}\right)
\end{equation*}
This is our standard parabolic eddy diffusivity distribution, which goes to 0 at the top and bottom, and reaches a maximum value of $0.25 \kappa u_* d $ at $z = 0.5 d$.  Averaging over the depth, we obtain what we got in the last section:
\begin{equation*}
\overline{\epsilon_z} \approx 0.07 u_* d
\end{equation*}

\subsection{Transverse Mixing}
This one's not as easy! As mentioned in the lecture, the transverse diffusivity can be highly dependent channel meanderings, secondary circulation, turbulence, etc. Thus, there is no standard theoretical prediction for $\epsilon_t$. As such, we rely on field and lab measurements. 

\subsubsection{Straight, Uniform, Rectangular Channel}
For this case we can approximate the transverse mixing as: 
\begin{equation*}
\epsilon_t \approx 0.15 d u_* \qquad \pm 50\%
\end{equation*}

This value was derived from lab experiments, but could be used for very idealized cases in a natural setting. 

\subsubsection{Irregular/Natural Channels}

Here, the range in $\epsilon_t / d u_*$ is approximately $0.4 - 0.8$. So, a natural choice for a standard transverse mixing coefficient is: 
\begin{equation*}
\epsilon_t \approx 0.6 d u_* \qquad \pm 50\%
\end{equation*}


The takeaway from all of this is that diffusivity values are highly uncertain and these equations should be used primarily as order of magnitude estimates. 

\newpage

\section{Mixing in Rivers II}
You'll notice that we didn't talk about longitudinal mixing in the previous section. That will be the focus of this section. 

\subsection{Beyond Elder's Result}
Recall from the turbulent SFD section that we found the dispersion coefficient could be estimated as:
\begin{equation*}
K = 5.93 d u_*
\end{equation*}
However, this assumed a logarithmic velocity profile, and didn't account for shear in the transverse direction. In real streams, we often find dispersion coefficients on the order of $(100-500) d u_* $, due to major effects from transverse shear. As such, the expression below often serves as better estimates of the longitudinal dispersion coefficient: 

\begin{equation*}
K = - \frac{1}{A} \int_0^W u' d \int_0^y \frac{1}{\epsilon_t d} \int_0^y u' \,dy\,dy\,dy
\end{equation*}

Luckily, we don't need to crank through this every time, as it can be pretty accurately estimated by:

\begin{equation*}
K = I \frac{W^2 \overline{u'^2}}{\epsilon_t} \approx \frac{0.011 \overline{u^2} W^2 }{d u_*}
\end{equation*}
Where $I$ is the dimensionless integral from a couple lectures back (look up specific values in table), and $W$ is the transverse width of the stream. Note that as in the laminar SFD case, the dispersion coefficient is inversely proportional to the transverse diffusion coefficient. 

\subsection{Determining K from Field Measurements}
Recall that we can also determine the dispersion coefficient by measuring the variance of dye concentration, e.g. in a dye study:
\begin{equation*}
K = \frac{1}{2}\frac{d \sigma^2}{dt}
\end{equation*}

However, this idealized case can be difficult to implement in the field. See the notes for a description of the ``routing" procedure that Fischer thought up of for something slightly more realistic. 

\subsection{Complications}

What are some of the complications in real systems that can alter the dispersive behavior? Don't worry about calculations based on these complications, just focus on the qualitative effects. 

\begin{itemize}
\item Bends/Meanders: River bends can initiate transverse circulation, increasing the transverse mixing coefficient, which in turn \textit{decreases} the longitudinal dispersion. However, large velocity gradients between the inside of the bend and outside of the bend can case increased shear, and increased dispersion. In short, things are complicated, and we have to look at rivers on a case by case basis!
\item Dead zones: Dead zones are areas of a river where water (or a pollutant) gets trapped, and is temporarily insulated from the main part of the flow. There are few quantitative metrics to describe how dead zones affect dispersion, but it is safe to say that they can play a large role in the dispersive behavior.
\end{itemize}



\end{document}