-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the final-2018-final_project_ke_paige_narges wiki!
\documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amsthm,amssymb,amsfonts,bm} \usepackage{graphicx} \newcommand{\Rey}{\mathit{Re}} \newcommand{\Ra}{\mathit{Ra}} \newcommand{\Ri}{\mathit{Ri}} \newcommand{\Gr}{\mathit{Gr}} \newcommand{\Pe}{\mathit{Pe}} \newcommand{\Nu}{\mathit{Nu}} \newcommand{\Ek}{\mathit{E}} \renewcommand{\Pr}{\mathit{Pr}}
\begin{document} \title{Dynamics in a Stratified Lid-driven Cavity} \author{Paige Weisman,Narges Masoumi, Ke Wu} \maketitle
\section{Problem Description}
Consider the flow in a rectangular cavity of depth
\begin{figure}[t]
\centering{\includegraphics[width=0.85\linewidth]{D2cavity_Schematics}}
\caption{Schematic of the system, indicating the non-dimensional
coordinate system and boundary conditions. The top boundary moves to
the right (positive
\section{Approach}
The governing equations \eqref{goveq} are discretized using a
spectral-collocation method in both spatial directions, which is
proposed by \cite{HuRa98}. Both velocity
components and pressure are approximated by Chebyshev polynomials of
the first kind with degree less than
\section{Objective}
In this project, we are going to fix the
\section{Appendix}
A pseudospectal collocation-Chebyshev method is implemented, each variable is expanded
in the approximation space
\begin{equation} T(x,y) = \sum_{m=0}^{M}\sum_{n=0}^{N}\hat{T}{mn}T{m}(2x)T_{n}(2y) \end{equation}
\begin{equation} u(x,y) = \sum_{m=0}^{M}\sum_{n=0}^{M}\hat{u}{mn}T{m}(2x)T_{n}(2y) \end{equation}
\begin{equation} v(x,y) = \sum_{m=0}^{M}\sum_{n=0}^{N}\hat{v}{mn}T{m}(2x)T_{n}(2y) \end{equation}
\begin{equation} p(x,y) = \sum_{m=0}^{M}\sum_{n=0}^{M}\hat{p}{mn}T{m}(2x)T_{n}(2y) \end{equation}
All the partial derivatives are evaluated directly by the Chebyshev differentiation matrix.
Since the computational domain is
\begin{equation} \frac{\partial^{2} u}{\partial x^{2}} = 4D^{2}u \end{equation}
Since we use the Chebyshev collocation method, so all the values are directly evaluated at the Chebyshev-Gauss-Lobatto collocation points. Also note that since the aspect ratio we choose is 1, so there is a factor of 2 when we take the first partial derivative, and there is a factor of 4 when we take the second partial derivative.\
Temporal scheme:\ \begin{equation} \frac{3\vec{u}^{n+1} - 4\vec{u}^{n} + \vec{u}^{n-1}}{2\delta t} =
- \nabla p^{n+1} - 2NL(\vec{u}^{n})
- NL(\vec{u}^{n-1}) - \triangle \vec{u}^{n+1} + GrT^{n+1}\vec{e}_{y} \end{equation}
\begin{equation} \frac{3T^{n+1} - 4T^{n}+T^{n-1}}{2\delta t} =
- 2NL(\vec{u}^{n},T^{n})
- NL(\vec{u}^{n-1},T^{n-1}) + \frac{1}{Pr} \triangle T^{n+1} \end{equation}
The time integration used is second order accurate and is based on a combination of Adams-Bashforth and backward differentiation formula (AB2/BDF) schemes.\ In order to improve the stability, the viscous term need to be written as
\begin{equation} L(\vec{u})=\Delta \vec{u} = \nabla(\nabla \cdot \vec{u})-\nabla \times (\nabla \times \vec{u})= -\nabla \times (\nabla \times \vec{u}) \end{equation}
which is due to divergence free.\
\
\centerline{Code Implementation}
Every quantity is evaluated directly on the Chebyshev-Gauss-Lobatto grid points,
Let DX,DY denote the Chebyshev differentiation matrix with dimension
\begin{description}
\item[step 1:] compute the temperature
- NL(\vec{u}^{n-1},T^{n-1}) - \frac{4T^{n}-T^{n-1}}{2\delta t} } \end{equation}
with boundary conditions: \
$ T(x, 1/2) = 0.5$,
$ T(x,-1/2) =-0.5$,
$ \frac{\partial T}{\partial n}(-1/2,y) = 0
Formulation of the linear systems:\
The indices
- \frac{4T^{n}-T^{n-1}}{2\delta t} } \end{align}
\begin{multline} asp^{2}\sum_{k=0}^{M}DX^{2}{i,k}T{k,j}^{n+1} + 4\sum_{k=0}^{N}T_{i,k}^{n+1}(DY^{2})^{T}
- \frac{3Pr}{2\delta t}T_{i,j}^{n+1} = RHS_{i,j}\
asp^{2}\sum_{k=1}^{M-1}DX^{2}{i,k}T{k,j}^{n+1}
+asp^{2}*DX^{2}{i,0}T{0,j}^{n+1} +asp^{2}*DX^{2}{i,M}T{M,j}^{n+1}+\ 4\sum_{k=1}^{N+1}T_{i,k}^{n+1}(DY^{2})^{T}{k,j} +4T{i,0}^{n+1}(DY^{2})^{T}{0,j} +4T{i,N}^{n+1}(DY^{2})^{T}{N,j} -\frac{3Pr}{2\delta t}T{i,j}^{n+1} = RHS_{i,j} \end{multline}
\begin{equation} T_{0,j}^{n+1} = -\sum_{k=1}^{M-1}\frac{DX_{MM}DX_{0k}-DX_{0M}DX_{Mk}} {DX_{00}DX_{MM}-DX_{M0}DX_{0M}} T_{k,j}^{n+1} \end{equation}
\begin{equation} T_{M,j}^{n+1} = -\sum_{k=1}^{M-1}\frac{DX_{M0}DX_{0k}-DX_{00}DX_{Mk}} {DX_{M0}DX_{0M}-DX_{00}DX_{MM}} T_{k,j}^{n+1} \end{equation}
Note that the left and right temperature values at boundary points are expressed as
a linear combination of interior points. Plug
\item[step 2:] compute the preliminary presssure $P^{}$\
\begin{equation}
\triangle {p}^{} = \nabla \cdot {-2NL(\vec{u}^{n}) + NL(\vec{u}^{n-1}) + GrT^{n+1}\vec{e}{y} }
\end{equation}
with boundary conditions:\
\begin{equation}
\frac{\partial {p}^{*}}{\partial{n}}= \vec{n} \cdot {\frac{-3\vec{w}+4\vec{u}^{n}-\vec{u}^{n-1}}{2\delta t}
-2NL(\vec{u}^{n}) + NL(\vec{u}^{n-1}) + GrT^{n+1}\vec{e}{y} + 2L(\vec{u}^{n})-L(\vec{u}^{n-1}) }
\end{equation}
where
\begin{equation} RHS = asp*DX{-2NL(u^{n}+NL(u^{n-1}) } +2{-2NL(v^{n})+NL(v^{n-1})+GrT^{n+1} } DY^{T} \end{equation}
\begin{align} asp^{2}\sum_{k=1}^{M-1}DX^{2}{i,k}P^{*}{k,j}
- asp^{2}DX^{2}_{i,0}P^{}{0,j}+asp^{2}*DX^{2}{i,M}P^{*}_{M,j}\
- 4\sum_{k=1}^{N-1}P^{*}{i,k}(DY^{2})^{T}{k,j}
- 4P^{*}{i,0}(DY^{2})^{T}{0,j}
- 4P^{}{i,N}(DY^{2})^{T}{N,j} = RHS_{i,j}\ \end{align} \begin{align} P^{}{0,j} = \frac{\frac{1}{asp}rhs1{0,j}DX_{MM}-\frac{1}{asp} rhs1_{M,j}DX_{0M}}{DX_{00}DX_{MM}-DX_{0M}DX_{M0}} -\sum_{k=1}^{M-1}\frac{DX_{MM}DX_{0k}-DX_{0M}DX_{Mk}} {DX_{00}DX_{MM}-DX_{M0}DX_{0M}} P^{}_{k,j}\ P^{}{M,j} = \frac{\frac{1}{asp} rhs1{0,j}DX_{M0}-\frac{1}{asp}rhs1_{M,j}DX_{00}}{DX_{M0}DX_{0M}-DX_{00}DX_{MM}} -\sum_{k=1}^{M-1}\frac{DX_{M0}DX_{0k}-DX_{00}DX_{Mk}} {DX_{M0}DX_{0M}-DX_{00}DX_{MM}} P^{}_{k,j}\ P^{}{i,0} = \frac{\frac{1}{2}rhs2{i,0}DY^{T}{NN}-\frac{1}{2} rhs2{i,N}DY^{T}{N0}}{DY^{T}{00}DY^{T}{NN}-DY^{T}{0N}DY^{T}{N0}} -\sum{k=1}^{N-1}P^{}{i,k}\frac{DY^{T}{NN}DY^{T}{k0}-DY^{T}{N0}DY^{T}{kN}} {DY^{T}{00}DY^{T}{NN}-DY^{T}{0N}DY^{T}_{N0}} \ P^{}{i,N} = \frac{\frac{1}{2}rhs2{i,0}DY^{T}{0N}-\frac{1}{2} rhs2{i,N}DY^{T}{00}}{DY^{T}{0N}DY^{T}{N0}-DY^{T}{00}DY^{T}{NN}} -\sum{k=1}^{N-1}P^{*}{i,k}\frac{DY^{T}{0N}DY^{T}{k0}-DY^{T}{00}DY^{T}{kN}} {DY^{T}{0N}DY^{T}{N0}-DY^{T}{00}DY^{T}_{NN}} \end{align}
Plug the boundary $P^{}$ values into the poisson equation, the linear system can be written as following:\ \begin{align} asp^{2}\sum_{k=1}^{M-1}DX^{2}_{i,k}P^{}{k,j} -asp^{2}DX^{2}{i,0} \sum_{k=1}^{M-1}\frac{DX_{MM}DX_{0k}-DX_{0M}DX_{Mk}} {DX_{00}DX_{MM}-DX_{M0}DX_{0M}} P^{}{k,j}\ -asp^{2}DX^{2}{i,M}\sum_{k=1}^{M-1}\frac{DX_{M0}DX_{0k}-DX_{00}DX_{Mk}} {DX_{M0}DX_{0M}-DX_{00}DX_{MM}} P^{}{k,j}\ +4\sum{k=1}^{N-1}P^{}{i,k}(DY^{2})^{T}{k,j} -4\sum_{k=1}^{N-1}P^{}{i,k}\frac{DY^{T}{NN}DY^{T}{k0}-DY^{T}{N0}DY^{T}{kN}} {DY^{T}{00}DY^{T}{NN}-DY^{T}{0N}DY^{T}{N0}}(DY^{2})^{T}{0,j}\ -4\sum_{k=1}^{N-1}P^{}{i,k}\frac{DY^{T}{0N}DY^{T}{k0}-DY^{T}{00}DY^{T}{kN}} {DY^{T}{0N}DY^{T}{N0}-DY^{T}{00}DY^{T}{NN}}(DY^{2})^{T}{N,j}\ = RHS_{i,j}-aspDX^{2}{i,0}\frac{rhs1{0,j}DX_{MM} - rhs1_{M,j}DX_{0M}}{DX_{00}DX_{MM}-DX_{0M}DX_{M0}}\ -aspDX^{2}{i,M}\frac{rhs1{0,j}DX_{M0}-rhs1_{M,j}DX_{00}}{DX_{M0}DX_{0M}-DX_{00}DX_{MM}}\ -2(DY^{2})^{T}{0,j}\frac{rhs2{i,0}DY^{T}{NN}- rhs2{i,N}DY^{T}{N0}}{DY^{T}{00}DY^{T}{NN}-DY^{T}{0N}DY^{T}{N0}}\ -2*(DY^{2})^{T}{N,j}\frac{rhs2_{i,0}DY^{T}{0N}- rhs2{i,N}DY^{T}{00}}{DY^{T}{0N}DY^{T}{N0}-DY^{T}{00}DY^{T}_{NN}} \end{align}
\item[step 3:] compute the predictor velocity field $\vec{u}^{}$ from the momentum equation
\begin{equation}
\frac{3\vec{u}^{}-4\vec{u}^{n}+\vec{u}^{n-1}}{2\delta t} +2NL(\vec{u}^{n})-NL(\vec{u}^{n-1})
=-\nabla p^{}+\Delta \vec{u}^{}+GrT^{n+1}\hat{e}{y}
\end{equation}
Re-write the above equation and group all the $\vec{u}^{}$ terms.
\begin{equation}
(\Delta -\frac{3}{2\delta t})\vec{u}^{}= \nabla p^{*} + 2NL(\vec{u}^{n}) - NL(\vec{u}^{n-1})
-GrT^{n+1}\vec{e}{y} - \frac{4\vec{u}^{n}-\vec{u}^{n-1}}{2\delta t}
\end{equation}
with prescribed Dirichlet boundary conditions. Write the above equation in component form
\item[step 4:] correct the preliminary pressure and preliminary velocity through
evaluating an intermediate variable
\begin{equation}
\frac{3\vec{u}^{n+1}-3\vec{u}^{}}{2\delta t} = -\nabla (p^{n+1}-{p}^{})
\end{equation}
Apply the continuity equation and define the intermediate variable
\begin{equation} \frac{\partial \phi}{\partial n} =0 \end{equation}
\begin{align} RHS = \frac{\partial u^{}}{\partial x} + \frac{\partial v^{}}{\partial y}\ RHS = (2DXU^{} + 2V^{}(DY)^{T}) \end{align}
\begin{equation}
4\sum_{k=0}^{M}DX^{2}{i,k}\phi{k,j} + 4\sum_{k=0}^{N}\phi_{i,k}(DY^{2})^{T}{k,j}= RHS{i,j}
\end{equation}
Express the boundary values of
- \sum_{k=1}^{N-1}\phi_{i,k}(DY^{2})^{T}{k,j} -\sum{k=1}^{N-1}\frac{DY^{T}{NN}DY^{T}{k0}-DY^{T}{N0}DY^{T}{kN}} {DY^{T}{00}DY^{T}{NN}-DY^{T}{0N}DY^{T}{N0}}(DY^{2})^{T}{0,j}\ -\sum{k=1}^{N-1}\phi_{i,k}\frac{DY^{T}{0N}DY^{T}{k0}-DY^{T}{00}DY^{T}{kN}} {DY^{T}{0N}DY^{T}{N0}-DY^{T}{00}DY^{T}{NN}}(DY^{2}{N,j})\ = \frac{1}{4}RHS{i,j} \end{align}
\item[step 5:] finally correct the pressure field on the entire domain and update velocity on the entire domain.\ \begin{align} p^{n+1}={p}^{} + \frac{3}{2\delta t}\phi \ \vec{u}^{n+1} = \vec{u}^{} - \nabla \phi \end{align}
\end{description} \bibliography{final_project.bib} \bibliographystyle{plain} \end{document}