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

\begin{document}

\section{Section Agenda}
\begin{enumerate}
\item Nondimensionalization of A-D
\item Advection-diffusion equation and solutions
\end{enumerate}

\section{Nondimensionalization}
Nondimensionalization is one of the most useful tools in fluid mechanics, as it lets us examine the relative sizes of different terms in the PDEs of interest. Often, some terms are much much smaller than others, allowing us to simplify the equations and sometimes even solve them. Going through this for the advection diffusion equation in 1D:

\begin{equation*}
\frac{\partial c}{\partial t} + u \frac{\partial c}{\partial x} = D \frac{\partial^2 c}{\partial x^2}
\end{equation*}

We can define our variables in terms of their nondimensional counterparts (denoted by a * superscript), and an arbitrary scale:
\begin{align*}
c = C c^*\\
u = U u^*\\
x = L x^*\\
t = T t^*
\end{align*}

Plugging these into our original equation, we obtain:

\begin{equation*}
\frac{C}{T}\frac{\partial c^*}{\partial t^*} + \frac{CU}{L} u^* \frac{\partial c^*}{\partial x^*} = \frac{DC}{L^2} \frac{\partial^2 c^*}{\partial x^{*2}}
\end{equation*}

Dividing through by $C$, we obtain:

\begin{equation*}
\frac{1}{T}\frac{\partial c^*}{\partial t^*} +  \frac{U}{L} u^* \frac{\partial c^*}{\partial x^*} = \frac{D}{L^2} \frac{\partial^2 c^*}{\partial x^{*2}}
\end{equation*}

The coefficients in front of each term all have units of inverse time, suggesting that advective and diffusive processes have natural time scales associated with them defined by:

\begin{align*}
T_{adv} = L/U\\
T_{diff} = L^2/D
\end{align*}

Next we can define the Peclet number as the ratio of the diffusive to advective time scales:

\begin{equation*}
\textrm{Pe}=T_{diff}/T_{adv}=UL/D
\end{equation*}

Qualitatively, a small Pe means a short diffusive time scale, meaning diffusion dominates. Conversely, a large Pe means that we have a small advective time scale, and advection dominates.  We can examine this mathematically using our scaled equation. First, what if time scales like $T=L^2/D$? Plugging this in:

\begin{equation*}
\frac{D}{L^2}\frac{\partial c^*}{\partial t^*} +  \frac{U}{L} u^* \frac{\partial c^*}{\partial x^*} = \frac{D}{L^2} \frac{\partial^2 c^*}{\partial x^{*2}}
\end{equation*}

And dividing through by $D/L^2$, we obtain:

\begin{equation*}
\frac{\partial c^*}{\partial t^*} +  \textrm{Pe}\,u^* \frac{\partial c^*}{\partial x^*} = \frac{\partial^2 c^*}{\partial x^{*2}}
\end{equation*}

Now in the limit where Pe $<<1$, which is what we would expect if diffusion is dominant, we can ignore the advective term and the equation effectively becomes the diffusion equation:

\begin{equation*}
\frac{\partial c^*}{\partial t^*} = \frac{\partial^2 c^*}{\partial x^{*2}}
\end{equation*}

Conversely, if time scales like $T = L/U$, we obtain:
\begin{equation*}
\frac{\partial c^*}{\partial t^*} +  u^* \frac{\partial c^*}{\partial x^*} = \frac{1}{\textrm{Pe}} \frac{\partial^2 c^*}{\partial x^{*2}}
\end{equation*}

Now in the limit where Pe $>>1$, which is what we would expect if advection is dominant, we can ignore the diffusive term and the equation effectively becomes the advection equation:

\begin{equation*}
\frac{\partial c^*}{\partial t^*} +  u^* \frac{\partial c^*}{\partial x^*} = 0
\end{equation*}


\section{Advection and Diffusion Together}
In the previous set of notes, we were just looking at diffusion. Now we're going to include advection as well. We'll start with some theoretical scaling analysis, and then go into various problems that we can solve with this equation.
\subsection{Scaling, Timescales, and Peclet Number}
This may seem simple, but it's actually one of the most important concepts that we're going to cover in this class. When we're looking at the advection-diffusion equation, there are two main timescales of interest:
\begin{enumerate}
\item Advective Timescale: $T_{adv}=L/U$
\item Diffusive Timescale: $T_{diff}=L^2/D$
\end{enumerate}
The ratio of these two timescales is called the Peclet number:
\begin{equation*}
\textrm{Pe}=T_{diff}/T_{adv}=UL/D
\end{equation*}
If the Peclet number is large, that means that advection dominates. If the Peclet number is small, that means that diffusion dominates. Remember, this will only be meaningful if you choose the proper length scales, velocity, and diffusion coefficient! 

\subsection{Solutions to A-D: Coordinate Transformations}
Let's look at the solution for 1D advection-diffusion of a blob in a pipe. We have the PDE:
\begin{equation*}
\frac{\partial C}{\partial t} + U \frac{\partial C}{\partial x} = D \frac{\partial^2 C}{\partial x^2}
\end{equation*}
Where $U \: [m/s]$ is the flow velocity.

We have an initial condition such that that there is a uniform concentration for $x < 0$:
 \begin{displaymath}
   C(x,t=0) = \left\{
     \begin{array}{lr}
       0 &  x >0\\
       C_0 & x<0
     \end{array}
   \right.
\end{displaymath} 
After doing a coordinate transformation by plugging in $x' = x - Ut$ (see the notes), the PDE that we're solving is:
\begin{equation*}
\frac{\partial C}{\partial t}= D \frac{\partial^2 C}{\partial x'^2}
\end{equation*}

The solution ends up looking a lot like it did for the pure diffusion problem with a similar initial condition, because the equation we are solving is identical. We just have to account for the coordinate transformation:
\begin{equation}\label{eq:ADtrans}
C(x,t)=\frac{C_0}{2}\left[1 - \textrm{erf}\left(\frac{x-Ut}{\sqrt{4Dt}}\right)
\right]
\end{equation}

What if we have a pulse of stuff between two positions $x=-h$ and $x=+h$? This will look pretty similar again, we just add two solutions together: 
\begin{equation}\label{eq:addtogether}
C(x,t)=\frac{C_0}{2}\left[\textrm{erf}\left(\frac{x+h-Ut}{\sqrt{4Dt}}\right)- \textrm{erf}\left(\frac{x-h-Ut}{\sqrt{4Dt}}\right)\right]
\end{equation}

Now let's look at a case where we have advection and \textit{lateral} diffusion, i.e. solving the following PDE:
\begin{equation*}
U\frac{\partial C}{\partial x}=D\frac{\partial^2 C}{\partial y^2}
\end{equation*}
with boundary conditions:
 \begin{displaymath}
   C(x=0,y) = \left\{
     \begin{array}{lr}
       0 &  y \geq 0\\
       C_0 & y<0
     \end{array}
   \right.
\end{displaymath} 

and $C(x,y\rightarrow \infty) = 0$, $C(x,y \rightarrow -\infty) = C_0$

Letting $t=x/U$, this too looks very much like a diffusion problem, with solution: 
\begin{equation}
C(x,t) = \frac{C_0}{2}\left[1 - \textrm{erf}\left(\frac{y}{\sqrt{4Dx/U}}\right)\right]
\end{equation}

If we introduce some unsteadiness:
 \begin{displaymath}
     \begin{array}{lr}
       C(x=0,t)=C_0 &  0<t<\infty \\
       C(x,t=0)=0 & 0<x<\infty
     \end{array}
\end{displaymath} 

Then the solution to the PDE:
\begin{equation*}
\frac{\partial C}{\partial t} + U \frac{\partial C}{\partial x} = D \frac{\partial^2 C}{\partial x^2}
\end{equation*}

is given by:

\begin{equation}
C(x,t)=\frac{C_0}{2}\left[\textrm{erfc}\left(\frac{x-Ut}{\sqrt{4Dt}}\right) + \textrm{erfc}\left(\frac{x+Ut}{\sqrt{4Dt}}\right)\textrm{exp}\left(\frac{Ux}{D}\right)\right]
\end{equation}

Those are the primary solutions that you'll need to know. The rest of the notes go into some special cases which I won't write out here, but will discuss if you need them to solve any problems. 


\subsection{Gaussian Plume}
Now let's look at the case where a steady (i.e. $\frac{\partial}{\partial t} = 0$) plume is being discharged from a source at some rate $\dot{M}\: [kg/s]$. The plume is being advected in the x-direction, so let's ignore diffusion in that direction (i.e. assume advection dominates). However, since it is not being advected in the other directions we should account for diffusion in y and z. Thus the PDE that we're solving is:
\begin{equation*}
U\frac{\partial C}{\partial x}= D\left(\frac{\partial^2 C}{\partial y^2} + \frac{\partial^2 C}{\partial z^2}\right)
\end{equation*}

The solution here (note change of units from previous examples) will be:
\begin{gather}
C(x,y,z)=\frac{\dot{M}}{4\pi D x}\textrm{exp}\left(-U\left\lbrace\frac{y^2 + z^2}{4 D x}\right\rbrace\right)
\end{gather}
\begin{gather*}
[C] = [\frac{kg}{m^3}]
\end{gather*}

If we have a 2D Guassian plume, e.g. the case where a pollutant is instantly mixed over the vertical, the concentration is described by:
\begin{equation}
C(x,y) = \frac{\dot{M}}{d\sqrt{4 \pi D x U}}\exp\left(-\frac{y^2U}{4 D x}\right)
\end{equation}

There's an interesting example in the notes that goes over the case where you have multiple sources. Go over that on your own if you'd like. If you need to solve a problem similar to that, I'll provide further details. 


\end{document}