|
| 1 | +\documentclass{article} |
| 2 | + |
| 3 | +\usepackage[dvipsnames]{xcolor} |
| 4 | + |
| 5 | +\begin{document} |
| 6 | + |
| 7 | +% Only use these colors for labels. |
| 8 | +\definecolor{cell_centered_color}{named}{Orange} |
| 9 | +\definecolor{node_color}{named}{Red} |
| 10 | +\definecolor{x_face_color}{named}{OliveGreen} |
| 11 | +\definecolor{y_face_color}{named}{Blue} |
| 12 | + |
| 13 | +\newcommand{\nodecolor}[1]{\textcolor{node_color}{#1}} |
| 14 | +\newcommand{\cellcolor}[1]{\textcolor{cell_centered_color}{#1}} |
| 15 | +\newcommand{\xfacecolor}[1]{\textcolor{x_face_color}{#1}} |
| 16 | +\newcommand{\yfacecolor}[1]{\textcolor{y_face_color}{#1}} |
| 17 | + |
| 18 | +\begin{Huge} |
| 19 | + |
| 20 | + Legend: |
| 21 | + \begin{tabular}{ c l } |
| 22 | + \color{cell_centered_color}{$\bullet$} & \color{cell_centered_color}{Cell Centered} \\ |
| 23 | + \color{node_color}{$\bullet$} & \color{node_color}{Node} \\ |
| 24 | + \color{x_face_color}{$\bullet$} & \color{x_face_color}{X Face} \\ |
| 25 | + \color{y_face_color}{$\bullet$} & \color{y_face_color}{Y Face} |
| 26 | + \end{tabular} |
| 27 | + |
| 28 | + \begin{tabular}{ c l } |
| 29 | + \color{cell_centered_color}{} & \color{cell_centered_color}{Cell Centered} \\ |
| 30 | + \color{node_color}{} & \color{node_color}{Node} \\ |
| 31 | + \color{x_face_color}{} & \color{x_face_color}{X Face} \\ |
| 32 | + \color{y_face_color}{} & \color{y_face_color}{Y Face} |
| 33 | +\end{tabular} |
| 34 | + |
| 35 | + \vspace{1in} |
| 36 | + Cell Center Values: |
| 37 | + \color{cell_centered_color}{ |
| 38 | + $$ \psi_{i,j} $$ |
| 39 | + $$ \psi_{i+1,j} $$ |
| 40 | + $$ \psi_{i,j+1} $$ |
| 41 | + $$ \psi_{i+1,j+1} $$ |
| 42 | + $$ \psi_{i-1,j} $$ |
| 43 | + $$ \psi_{i,j-1} $$ |
| 44 | + $$ \psi_{i-1,j-1} $$ |
| 45 | + |
| 46 | + $$ \eta_{i,j}$$ |
| 47 | + |
| 48 | + $$ z $$ |
| 49 | + } |
| 50 | + |
| 51 | + \color{node_color}{ |
| 52 | + $$ p_{i,j} $$ |
| 53 | + $$ p_{i+1,j} $$ |
| 54 | + $$ p_{i,j+1} $$ |
| 55 | + $$ p_{i+1,j+1} $$ |
| 56 | + |
| 57 | + $$ h $$ |
| 58 | + $$ h_{i,j} $$ |
| 59 | + } |
| 60 | + |
| 61 | + |
| 62 | + \color{y_face_color}{ |
| 63 | + $$ u_{i,j} $$ |
| 64 | + $$ u_{i,j+1} $$ |
| 65 | + $$ u_{i-1,j} $$ |
| 66 | + |
| 67 | + $$ cu $$ |
| 68 | + } |
| 69 | + |
| 70 | + |
| 71 | + \color{x_face_color}{ |
| 72 | + $$ v_{i,j} $$ |
| 73 | + $$ v_{i+1,j} $$ |
| 74 | + $$ v_{i,j-} $$ |
| 75 | + |
| 76 | + $$ cv $$ |
| 77 | + } |
| 78 | + |
| 79 | + \color{black}{ |
| 80 | + Initial Conditions: |
| 81 | + $$\vec{V}_0$$ |
| 82 | + $$P_0$$ |
| 83 | + |
| 84 | + Mesh: \\ |
| 85 | + Nx \\ |
| 86 | + Ny \\ |
| 87 | + dx \\ |
| 88 | + dy \\ |
| 89 | + dx = dy = 10,000 \\ |
| 90 | + N$_\mathrm{ghost}$ = 1 \\ |
| 91 | + N$_\mathrm{grow}$ = 1 \\ |
| 92 | + } |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +\end{Huge} |
| 97 | + |
| 98 | +The shallow water equations are: |
| 99 | +$$ \frac{\partial{\vec{V}}}{\partial t} + \eta \hat{N} \times P \vec{V} + \nabla \left( P + \frac{1}{2}\vec{V} \cdot \vec{V} \right) = 0$$ |
| 100 | + |
| 101 | +$$ \frac{\partial{P}}{\partial t} + \nabla \cdot \left( P \vec{V} \right) = 0$$ |
| 102 | + |
| 103 | +where: |
| 104 | + |
| 105 | +$$ \eta = \frac{\nabla \times \vec{V}}{P} $$ |
| 106 | + |
| 107 | +Where in component form we get: |
| 108 | + |
| 109 | + |
| 110 | +$$ \textcolor{y_face_color}{ \frac{\partial u}{\partial t} }= \eta P v - \frac{\partial}{\partial x} \left( P + \frac{1}{2} (u^2 + v^2) \right)$$ |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | +$$ \textcolor{x_face_color}{ \frac{\partial v}{\partial t} } = -\eta P u - \frac{\partial}{\partial y} \left( P + \frac{1}{2} (u^2 + v^2) \right)$$ |
| 115 | + |
| 116 | + |
| 117 | +$$ \nodecolor{ \frac{\partial P}{\partial t} } = -\frac{\partial}{\partial x}\left(Pu\right) - \frac{\partial}{\partial y} (Pv) $$ |
| 118 | + |
| 119 | +$$ \textcolor{cell_centered_color}{\eta} = \frac{ \frac{\partial v}{\partial x} + \frac{\partial u}{\partial y} }{P} $$ |
| 120 | + |
| 121 | +$$ \textcolor{node_color}{h_{i,j}} = \textcolor{node_color}{P_{i,j}} + \frac{1}{2} \left( \frac{\textcolor{y_face_color}{u_{i-1,j}}^2 + \textcolor{y_face_color}{u_{i,j}}^2}{2} + \frac{\textcolor{x_face_color}{v_{i,j-1}}^2 + \textcolor{x_face_color}{v_{i,j}}^2}{2} \right) $$ |
| 122 | + |
| 123 | + |
| 124 | +$$ \textcolor{y_face_color}{[Pu]_{i,j}} = \frac{ \textcolor{node_color}{P_{i,j}} + \textcolor{node_color}{P_{i+1,j}} }{2} \textcolor{y_face_color}{u_{i,j}} $$ |
| 125 | + |
| 126 | + |
| 127 | +$$ \textcolor{x_face_color}{[Pv]_{i,j}} = \frac{\textcolor{node_color}{P_{i,j}} + \textcolor{node_color}{P_{i,j+1}}}{2} \textcolor{x_face_color}{v_{i,j}}$$ |
| 128 | + |
| 129 | +$$ \textcolor{cell_centered_color}{\eta_{i,j}} = \frac{ \frac{ \textcolor{x_face_color}{v_{i+1,j}} - \textcolor{x_face_color}{v_{i,j}}}{dx} + \frac{ \textcolor{y_face_color}{u_{i,j+1}} - \textcolor{y_face_color}{u_{i,j}} }{dy} }{\frac{ \textcolor{node_color}{P_{i,j}} + \textcolor{node_color}{P_{i+1,j}} + \textcolor{node_color}{P_{i,j+1}} + \textcolor{node_color}{P_{i+1,j+1}} }{4} } $$ |
| 130 | + |
| 131 | +$$ \frac{\partial \yfacecolor{u_{i,j}}}{\partial t} = \left( \frac{ \cellcolor{\eta_{i,j-1}} + \cellcolor{\eta_{i,j}} }{2} \right) \left( \frac{ \xfacecolor{[P v]_{i,j-1}} + \xfacecolor{[P v]_{i,j}} + \xfacecolor{[P v]_{i+1,j-1}} + \xfacecolor{[P v]_{i+1,j}} }{4} \right) - \left(\frac{ \nodecolor{ h_{i+1,j} } - \nodecolor{ h_{i,j} } }{dx} \right) $$ |
| 132 | + |
| 133 | +$$ \frac{\partial \xfacecolor{v_{i,j}}}{\partial t} = \left( \frac{ \textcolor{cell_centered_color}{\eta_{i-1,j}} + \textcolor{cell_centered_color}{\eta_{i,j}} }{2} \right) \left( \frac{ \yfacecolor{[P u]_{i-1,j}} + \yfacecolor{[P u]_{i-1,j+1}} + \yfacecolor{[P u]_{i,j}} + \yfacecolor{[P u]_{i,j+1}} }{4} \right) - \left( \frac{ \nodecolor{h_{i,j+1}} - \nodecolor{h_{i,j}} }{dy} \right) $$ |
| 134 | + |
| 135 | +$$ \frac{\partial \nodecolor{P_{i,j}}}{\partial t} = - \left( \frac{ \yfacecolor{[Pu]_{i,j}} - \yfacecolor{[Pu]_{i-1,j}} }{dx} \right) - \left( \frac{ \xfacecolor{[Pv]_{i,j}} - \xfacecolor{[Pu]_{i,j-1}}}{dy} \right) $$ |
| 136 | + |
| 137 | +\end{document} |
0 commit comments