\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 3}
\lhead{Section Notes}
\rfoot{\thepage}

\begin{document}

\section{Section Agenda}
\begin{enumerate}
\item Shear flow dispersion overview
\item Numerical methods overview
\end{enumerate}

\section{Shear Flow Dispersion}
The lecture notes for this section have a lot of math, try not to get overwhelmed by the derivation! I'm going to provide a highly qualitative description of shear flow dispersion first. Once you have a good understanding of that, then focus on Taylor's analysis. 

\subsection{Qualitatively...}

Picture this: you have a blob of pollutant in a river. For now, we assume the flow is laminar. If the streamwise velocity profile is uniform (meaning the streamwise velocity is the same at each point, from one bank of the river across to the next bank), then the primary motion you will see is a pure translation of the pollutant downstream, i.e. uniform advection of every part of that pollutant blob. 

However, velocity profiles rarely look like that. More commonly, we see profiles like the one pictured below, where different parts of the fluid move at different rates. This is called a sheared flow, or differential advection. 

\begin{figure}[h]
\captionsetup{justification=centering}
    \includegraphics[width=\textwidth]{image1.jpg}
\end{figure}

How will that affect our blob of pollutant? It will make some parts of the blob move very quickly (e.g. at the center of the profile), and other parts move much slower (e.g. at the edges). This will bring fluid parcels with very different concentrations into close proximity with one another. This increases local concentration gradients, and leads to more diffusion. 

So here's the big takeaway: When we have a sheared flow in the streamwise direction, and diffusion in the transverse direction (i.e. across the river), this will lead to \textbf{enhanced effective diffusion in the streamwise direction}. We call this process Shear Flow Dispersion. 

Below is a diagram that shows what's happening:
\begin{figure}[h]
\captionsetup{justification=centering}
    \includegraphics[width=\textwidth]{sfd.png}
\end{figure}

\subsection{Equations}

Moving on from the qualitative description, let's look at how it's described mathematically. As usual, see the lecture notes for the full derivation, but the big reveal is the 1-D advection-dispersion equation:
\begin{equation*}
\frac{\partial \overline{C}}{\partial t} + \overline{u}\frac{\partial \overline{C}}{\partial x} = K\frac{\partial^2 \overline{C}}{\partial x^2}\\
\end{equation*}
Here, $\overline{C}$ is the cross-sectionally averaged concentration, $\overline{u}$ is mean advective velocity, and $K\, [m^2/s]$ is the dispersion coefficient . $K$ can be calculated with the following (slightly horrific) triple integral:
\begin{equation*}
K = -\frac{1}{hD}\int_0^hu'(y)\int_0^y \int_0^yu'(y)\,dy\,dy\,dy
\end{equation*}
Here, $h\,[m]$ is the transverse length (could be width of stream, or depth if we're talking about vertical shear), $D\, [m^2/s]$ is the diffusion coefficient, and $u'(y) = u(y) - \overline{u}(y)\, [m/s]$ is the velocity perturbation. 

Note that the dispersion coefficient is \textit{inversely} proportional to the diffusion coefficient. At first, this might seem counterintuitive, but think about it this way: if the diffusion coefficient is very large, then transverse mixing will occur very quickly, and individual fluid particles will all move closer to the mean advective speed, which reduces the effects of shear. However, when the diffusion coefficient is small, transvere diffusion takes a lot longer, which give the pollutant patch more time to be distorted by the sheared advection. This will lead to more shear flow dispersion. 

So when does the advection-dispersion equation apply? Is it valid as soon as we drop a blob of pollutant into a river? Actually, no. Recall that our qualitative argument relies on both streamwise advective transport, and transverse diffusive transport. Thus (and see the math in the notes for the details--this is pretty hand-wavey), the time scale after which we can start assuming that SFD takes hold is the diffusive time scale in the transverse direction, given by:
\begin{equation*}
T_{diff} = \frac{h^2}{D}
\end{equation*}

After this amount of time, we can assume that the  cloud of pollutant has mixed transversely, is normally distributed, moves downstream at a mean speed $\overline{u}$, and continues to spread with a variance described by: 
\begin{equation*}
\frac{d\sigma^2}{dt}=2K
\end{equation*}

This means that if we plot the variance over time, the slope of the linear portion of the plot will be twice the dispersion coefficient (approximately). Again, this was a very high-level description of shear flow dispersion; I recommend that you go through the derivation to really understand the assumptions that go into it and when it applies. 

\newpage
\section{Numerical Solutions to Advection-Diffusion}
When you take Oliver's modeling class you will study this material in detail. This will be a brief overview of how the A-D equation can be solved using numerical methods.

\subsection{Numerical Methods: What and Why}
Numerical methods are techniques for finding approximate solutions to ordinary and partial differential equations. Most of the equations we have looked at so far have analytical solutions, meaning we can calculate an exact, smooth solution for given inital and boundary conditions. However, the full Navier-Stokes equations are an example of equations that we can't solve analytically. Instead, we replace all derivatives with algabraic approximations; this process is called ``discretizing''. If we are careful about the discretization technique and solve the equations on a fine enough grid, we can get very close to an exact solution for equations as complicated as Navier-Stokes. 

\subsection{Diffusion}
Starting with the diffusion equation:
\begin{equation*}
\frac{\partial C}{\partial t}=D\frac{\partial^2 C}{\partial x^2}
\end{equation*}
We can discretize this using Forward in Time, Centered in Space (FTCS). This looks like:
\begin{equation*}
\frac{C_j^{n+1}-C_j^n}{\Delta t}= D \frac{C_{j+1}^n-2C_j^n+C_{j-1}^n}{\Delta x^2}
\end{equation*}
The j indices represent space on the grid, while the n superscript represents a step in time. Rearranging this we find:
\begin{equation*}
C_j^{n+1}= C_j^n +\frac{D \Delta t}{\Delta x^2}\left(C_{j-1}^n - 2C_j^n + C_{j+1}^n\right)
\end{equation*}
And now, as long as we know the diffusion coefficient, and the concentration at the previous time step, we can figure out the concentration at the next time step. Of course, it's not \textit{exactly} that simple...we'll look at some complications in the stability section below.
\subsection{Advection}
Starting with the 1-D advection equation:
\begin{equation*}
\frac{\partial C}{\partial t}+U\frac{\partial C}{\partial x}=0
\end{equation*}
For this one, we use a method called ``first-order upwinding". On a grid, this looks like:
\begin{equation*}
\frac{C_j^{n+1}-C_j^n}{\Delta t} = U\frac{C_j^n-C_{j-1}^n}{\Delta x}
\end{equation*}
Rearranging, we have:
\begin{equation*}
C_j^{n+1}=C_j^n +\frac{U\Delta t}{\Delta x}\left(C_j^n - C_{j-1}^n\right)
\end{equation*}
\subsection{Stability}
There are some complications that arise with each of the above discretizations. For diffusion, solutions will only be stable if the following condition is satisfied:
\begin{equation*}
\frac{D\Delta t}{\Delta x^2}<0.5
\end{equation*}
and for advection, we require:
\begin{equation*}
\frac{U \Delta t}{\Delta x}<1
\end{equation*}
How do we satisfy these requirements? Well, either with a small time step (which can get expensive), or a larger grid (which is less accurate). There are, of course, other numerical methods (like some implicit ones) with less stringent requirements, but then you have to solve a tridiagonal matrix (can also get expensive). Recall the 1st law of CFD: you can never win!

\end{document}