1 | % $Id: numerics_bc.tex 1226 2013-09-18 13:19:19Z fricke $ |
---|
2 | \input{header_tmp.tex} |
---|
3 | %\input{header_lectures.tex} |
---|
4 | |
---|
5 | \usepackage[utf8]{inputenc} |
---|
6 | \usepackage{ngerman} |
---|
7 | \usepackage{pgf} |
---|
8 | \usetheme{Dresden} |
---|
9 | \usepackage{subfigure} |
---|
10 | \usepackage{units} |
---|
11 | \usepackage{multimedia} |
---|
12 | \usepackage{hyperref} |
---|
13 | \newcommand{\event}[1]{\newcommand{\eventname}{#1}} |
---|
14 | \usepackage{xmpmulti} |
---|
15 | \usepackage{tikz} |
---|
16 | \usetikzlibrary{shapes,arrows,positioning} |
---|
17 | \def\Tiny{\fontsize{4pt}{4pt}\selectfont} |
---|
18 | \usepackage{amsmath} |
---|
19 | \usepackage{amssymb} |
---|
20 | \usepackage{multicol} |
---|
21 | \usepackage{pdfcomment} |
---|
22 | |
---|
23 | \institute{Institut fÌr Meteorologie und Klimatologie, Leibniz UniversitÀt Hannover} |
---|
24 | \date{last update: \today} |
---|
25 | \event{PALM Seminar} |
---|
26 | \setbeamertemplate{navigation symbols}{} |
---|
27 | |
---|
28 | \setbeamertemplate{footline} |
---|
29 | { |
---|
30 | \begin{beamercolorbox}[rightskip=-0.1cm]& |
---|
31 | {\includegraphics[height=0.65cm]{imuk_logo.pdf}\hfill \includegraphics[height=0.65cm]{luh_logo.pdf}} |
---|
32 | \end{beamercolorbox} |
---|
33 | \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex, |
---|
34 | leftskip=.3cm,rightskip=0.3cm plus1fil]{title in head/foot} |
---|
35 | {\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor} \hfill \eventname \hfill \insertframenumber \; / \inserttotalframenumber} |
---|
36 | \end{beamercolorbox} |
---|
37 | \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot} |
---|
38 | \end{beamercolorbox} |
---|
39 | } |
---|
40 | %\logo{\includegraphics[width=0.3\textwidth]{luhimuk_logo.pdf}} |
---|
41 | |
---|
42 | \title[Numerics and Boundary Conditions]{Numerics and Boundary Conditions\\ |
---|
43 | (used in PALM) |
---|
44 | } |
---|
45 | \author{Siegfried Raasch} |
---|
46 | |
---|
47 | \begin{document} |
---|
48 | |
---|
49 | % Folie 1 |
---|
50 | \begin{frame} |
---|
51 | \titlepage |
---|
52 | \end{frame} |
---|
53 | |
---|
54 | % Folie 2 |
---|
55 | \begin{frame} |
---|
56 | \frametitle{Overview} |
---|
57 | \scriptsize PALM is (almost) using simple, standard and fast numerical schemes: |
---|
58 | \begin{itemize} |
---|
59 | \scriptsize |
---|
60 | \item<2-> \textbf{Spatial and temporal discretization by finite differences}\\ |
---|
61 | \item<3-> \textbf{Explicit timestep methods:}\\ |
---|
62 | - Euler\\ |
---|
63 | - \underline{Runge-Kutta}, second or \underline{third order} |
---|
64 | \item<4-> \textbf{Advection method}\\ |
---|
65 | - Upstream\\ |
---|
66 | - Piacsek-Williams (second order central finite differences)\\ |
---|
67 | - Bott-Chlond-scheme (monotone, positiv definit, for scalars only)\\ |
---|
68 | - \underline{5th-order scheme of Wicker and Skamarock}, (as used in WRF model) |
---|
69 | \item<5-> \textbf{Poisson-equation for pressure}\\ |
---|
70 | - \underline{Direct FFT-method}\\ |
---|
71 | - Multigrid-method |
---|
72 | \item<6-> \textbf{Lagrangian particle model included} |
---|
73 | \item<7-> \textbf{Boundary conditions:}\\ |
---|
74 | - \underline{Cyclic} and non-cyclic horizontal boundary conditions\\ |
---|
75 | - Surface layer with Monin-Obukhov similarity\\ |
---|
76 | - Topography\\ |
---|
77 | - Turbulent inflow (for non-cyclic horizontal boundary conditions) |
---|
78 | |
---|
79 | \end{itemize} |
---|
80 | \end{frame} |
---|
81 | |
---|
82 | |
---|
83 | \section{Numerics} |
---|
84 | \subsection{Numerics} |
---|
85 | |
---|
86 | % Folie 3 |
---|
87 | \begin{frame} |
---|
88 | \frametitle{Numerical Grid} |
---|
89 | \footnotesize |
---|
90 | \vspace{2mm} |
---|
91 | \includegraphics[width=\textwidth]{numerics_bc_figures/numerical_grid.png} |
---|
92 | \begin{itemize} |
---|
93 | \item<1->Equations are spatially discretized on an Arakawa-C grid. |
---|
94 | \item<2->All scalar variables s (e.g. , $p^*$, $e$, $K_{\mathrm{m}}$, |
---|
95 | $K_{\mathrm{h}}$) are defined at the cell centers. |
---|
96 | \item<3->Velocity components ($u$, $v$, $w$) are shifted by half of the grid spacing. |
---|
97 | \item<4->Spacings are equidistant, stretching along $z$ is possible. |
---|
98 | \end{itemize} |
---|
99 | |
---|
100 | \tikzstyle{plain} = [rectangle, draw, fill=white!20, text width=0.33\textwidth, font=\small] |
---|
101 | \begin{tikzpicture}[remember picture, overlay] |
---|
102 | \node at (current page.north west){% |
---|
103 | \begin{tikzpicture}[overlay] |
---|
104 | \node[plain, draw,anchor=west] at (88mm,-55mm) { |
---|
105 | \noindent \scriptsize general definition (cylic):\\ |
---|
106 | $\Psi$(0:nz+1,-1:ny+1,-1:nx+1)\\ |
---|
107 | $\Psi$(:,-1,:) $=\Psi$(:,ny,:)\\ |
---|
108 | $\Psi$(:,ny+1,:) $=\Psi$(:,0,:) |
---|
109 | |
---|
110 | }; |
---|
111 | \end{tikzpicture} |
---|
112 | }; |
---|
113 | \end{tikzpicture} |
---|
114 | \end{frame} |
---|
115 | |
---|
116 | % Folie 4 |
---|
117 | \begin{frame} |
---|
118 | \frametitle{Timestep Methods (I)} |
---|
119 | \footnotesize |
---|
120 | \begin{itemize} |
---|
121 | \item<1->\textbf{Euler}\\ |
---|
122 | \vspace{3mm} |
---|
123 | $\dfrac{\partial \psi(t)}{\partial t} = F (\psi(t)) \rightarrow |
---|
124 | \dfrac{\psi(t + \Delta t) - \psi(t)}{\Delta t} |
---|
125 | \approx F (\psi(t))$ \hspace{8mm} |
---|
126 | \onslide<2-> $u\dfrac{\Delta t}{\Delta x}=C<1$\\ |
---|
127 | \begin{flushright} |
---|
128 | for stability |
---|
129 | \end{flushright} |
---|
130 | |
---|
131 | \onslide<1->$\psi (t+\Delta t) = \psi(t) |
---|
132 | + \Delta t \cdot F(\psi(t)) \hspace{28mm} \mathcal{O}(\Delta t)$\\ |
---|
133 | (used for SGS-TKE in special cases) |
---|
134 | |
---|
135 | \vspace{3mm} |
---|
136 | \item<3-> \textbf{Runge-Kutta, third-order}\\ |
---|
137 | \vspace{2mm} |
---|
138 | $k_1=F(\psi(t))$\\ |
---|
139 | \vspace{1mm} |
---|
140 | $k_2=F \left( \psi(t) + \frac{1}{3} \Delta t \cdot k_1 \right)$\\ |
---|
141 | \vspace{1mm} |
---|
142 | $k_3=F \left( \psi(t) - \frac{3}{16} \Delta t \cdot k_1 |
---|
143 | + \frac{15}{16} \Delta t \cdot k_2 \right)$\\ |
---|
144 | \vspace{1mm} |
---|
145 | $\psi(t + \Delta t) = \psi(t) + \frac{1}{30}\Delta t (5 k_1 + 9 k_2 + 16 k_3)$ |
---|
146 | \hspace{12mm} $\mathcal{O}(\Delta t^2)$ \hspace{3mm} $C \le 0.9$\\ |
---|
147 | \end{itemize} |
---|
148 | \end{frame} |
---|
149 | |
---|
150 | % Folie 5 |
---|
151 | \begin{frame} |
---|
152 | \frametitle{Timestep Methods (II)} |
---|
153 | \footnotesize |
---|
154 | \onslide<1->In the PALM code, the different timestep schemes are treated by one |
---|
155 | equation using switches: |
---|
156 | $\psi (t + \Delta t ) = (1 - c_1) \cdot \psi (t - \Delta t ) + c_1 \cdot \psi (t) |
---|
157 | + \Delta t \cdot \left[ c_2 \cdot F (\psi (t) ) + c_3 \cdot F (\psi (t - |
---|
158 | \Delta t ) ) \right]$ |
---|
159 | \vspace{1mm} |
---|
160 | |
---|
161 | \onslide<2-> |
---|
162 | \begin{centering} |
---|
163 | \begin{table} |
---|
164 | \begin{tabular}{cccc} |
---|
165 | \bf{Scheme} & \bf{c$_1$} & \bf{c$_2$} & \bf{c$_3$}\\ |
---|
166 | Euler & 1 & 1 & 0\\ |
---|
167 | RK (1st step) & 1 & 1/3 & 0\\ |
---|
168 | RK (2nd step) & 1 & 15/16 & -25/48\\ |
---|
169 | RK (3rd step) & 1 & 8/15 & 1/15\\ |
---|
170 | \end{tabular} |
---|
171 | \end{table} |
---|
172 | \end{centering} |
---|
173 | |
---|
174 | \onslide<3-> |
---|
175 | \begin{align*} |
---|
176 | \psi (t - \Delta t) &= \psi (t) \hspace{15mm} \textbf{after each RK substep}\\ |
---|
177 | \psi (t) &= \psi (t + \Delta t) |
---|
178 | \end{align*} |
---|
179 | \end{frame} |
---|
180 | |
---|
181 | % Folie 6 |
---|
182 | \begin{frame} |
---|
183 | \frametitle{Advection Methods (I)} |
---|
184 | \small |
---|
185 | \begin{itemize} |
---|
186 | \item<1-> Piacsek Williams C3 (1970, J. Comput. Phy., 6, 392). |
---|
187 | \item<2-> Scheme of 2nd order accuracy. |
---|
188 | \item<3-> Conserves integrals of linear and quadratic quantities. |
---|
189 | \item<4-> Requires incompressibility $\rightarrow$ flux form of advection term. |
---|
190 | \onslide<4-> \includegraphics[width=0.8\textwidth]{numerics_bc_figures/advection_methods.png} |
---|
191 | \end{itemize} |
---|
192 | $$\left.\frac{\partial (u \psi)}{\partial x}\right\vert_i = \frac{1}{2 \Delta x} |
---|
193 | \left( u_{i+\frac{1}{2}} \psi_{i+1} - u_{i-\frac{1}{2}} \psi_{i-1} \right)$$ |
---|
194 | \begin{itemize} |
---|
195 | \item<5-> In case of momentum advection (e.g. $\psi=u$), $u_{i-1}$ and |
---|
196 | $u_{i+1}$ have to be obtained by linear interpolation. |
---|
197 | \item<5-> May cause $2 \Delta x$ wiggles in case of sharp gradients. |
---|
198 | \end{itemize} |
---|
199 | \end{frame} |
---|
200 | |
---|
201 | % Folie 7 |
---|
202 | \begin{frame} |
---|
203 | \frametitle{Advection Methods (II)} |
---|
204 | \begin{itemize} |
---|
205 | |
---|
206 | \item<1-> \small Bott-Chlond\\ \scriptsize |
---|
207 | \onslide<1-> - Chlond (1994)\\ |
---|
208 | \onslide<2-> - Monotone, positive definit. Can only be used for scalars\\ |
---|
209 | \onslide<3-> - Conserves sharp gradients\\ |
---|
210 | \onslide<4-> - Numerically expensive\\ |
---|
211 | \onslide<5-> - Not optimized for use on cache-based machines. |
---|
212 | \par\bigskip |
---|
213 | \item<6-> \small Default: Wicker and Skamarock scheme (5th order)\\ \scriptsize |
---|
214 | \onslide<6-> - Much better accuracy than Piacsek Williams\\ |
---|
215 | \onslide<7-> - Much simpler algorithm than Bott-Chlond\\ |
---|
216 | \onslide<8-> - Requires additional ghost layers\\ |
---|
217 | \onslide<9-> - Adds additional numerical dissipation |
---|
218 | |
---|
219 | \end{itemize} |
---|
220 | \end{frame} |
---|
221 | |
---|
222 | % Folie 8 |
---|
223 | \begin{frame} |
---|
224 | \frametitle{Advection Methods â Wicker/Skamarock (I)} |
---|
225 | \footnotesize |
---|
226 | \begin{itemize} |
---|
227 | \item Wicker and Skamarock (2002, Mon. Wea. Rev. 130, 2088 â 2097). |
---|
228 | \item Based on flux form of advection term |
---|
229 | \item Difference of fluxes at the edge of the grid cell is used to |
---|
230 | discretise advection term |
---|
231 | \end{itemize} |
---|
232 | |
---|
233 | \begin{columns}[T] |
---|
234 | \begin{column}{0.55\textwidth} |
---|
235 | \hspace{8mm}\includegraphics[width=0.8\textwidth]{numerics_bc_figures/numerical_grid_small.png} |
---|
236 | \end{column} |
---|
237 | \begin{column}{0.45\textwidth} |
---|
238 | $\frac{ \partial \psi}{\partial t} = - \nabla (u_i \psi) \approx |
---|
239 | - \frac{F_{i+\frac{1}{2}} - F_{i-\frac{1}{2}}}{\Delta x}$ |
---|
240 | \end{column} |
---|
241 | \end{columns} |
---|
242 | |
---|
243 | \tikzstyle{plain} = [rectangle, text width=0.1\textwidth, font=\small] |
---|
244 | \begin{tikzpicture}[remember picture, overlay] |
---|
245 | \node at (current page.north west){% |
---|
246 | |
---|
247 | \begin{tikzpicture}[overlay] |
---|
248 | \node[plain, anchor=west] at (2mm,-68mm) { |
---|
249 | \tikz |
---|
250 | { |
---|
251 | \draw[blue, -latex', line width=5pt] (1,0) -- (2,0); |
---|
252 | } |
---|
253 | |
---|
254 | $F_{i-\frac{1}{2}}$ |
---|
255 | }; |
---|
256 | \end{tikzpicture} |
---|
257 | |
---|
258 | \begin{tikzpicture}[overlay] |
---|
259 | \node[plain, anchor=west] at (62mm,-68mm) { |
---|
260 | \tikz |
---|
261 | { |
---|
262 | \draw[blue, -latex', line width=5pt] (,0) -- (2,0); |
---|
263 | } |
---|
264 | $F_{i+\frac{1}{2}}$ |
---|
265 | }; |
---|
266 | \end{tikzpicture} |
---|
267 | |
---|
268 | }; |
---|
269 | \end{tikzpicture} |
---|
270 | \end{frame} |
---|
271 | |
---|
272 | % Folie 9 |
---|
273 | \begin{frame} |
---|
274 | \frametitle{Advection Methods â Wicker/Skamarock (II)} |
---|
275 | |
---|
276 | |
---|
277 | |
---|
278 | \textbf{Finite difference approximation of 6$^{\text{th}}$ order} |
---|
279 | \begin{tikzpicture}[scale=2] |
---|
280 | \tikzstyle{ann} = [draw=none,fill=none,right] |
---|
281 | \matrix[nodes={draw, thick, fill=blue!20}, row sep=0.3cm,column sep=0.5cm]{ |
---|
282 | \node[rectangle, rounded corners]{ |
---|
283 | $F^{\text{6th}}_{i-\frac{1}{2}} = \frac{1}{60} u_{i-\frac{1}{2}} \left( 37 |
---|
284 | (\Psi_i + \Psi_{i-1}) - 8 (\Psi_{i+1} + \Psi_{i-2}) + (\Psi_{i+2} |
---|
285 | + \Psi_{i-3}) \right)$ |
---|
286 | };\\ |
---|
287 | }; |
---|
288 | \end{tikzpicture} |
---|
289 | |
---|
290 | \vspace{5mm} |
---|
291 | |
---|
292 | \textbf{Artificially added numerical dissipation term} |
---|
293 | \begin{tikzpicture}[scale=2] |
---|
294 | \tikzstyle{ann} = [draw=none,fill=none,right] |
---|
295 | \matrix[nodes={draw, thick, fill=blue!40}, row sep=0.3cm,column sep=0.5cm]{ |
---|
296 | \node[rectangle, rounded corners]{ |
---|
297 | $-\frac{1}{60} \left| u_{i-\frac{1}{2}} \right| \left( 10 (\Psi_i - |
---|
298 | \Psi_{i-1}) - 5 (\Psi_{i+1} - \Psi_{i-2}) + (\Psi_{i+2} - \Psi_{i-3}) \right)$ |
---|
299 | };\\ |
---|
300 | }; |
---|
301 | \end{tikzpicture} |
---|
302 | \end{frame} |
---|
303 | |
---|
304 | % Folie 10 |
---|
305 | \begin{frame} |
---|
306 | \frametitle{Advection Methods â Wicker/Skamarock (III)} |
---|
307 | |
---|
308 | \begin{tikzpicture}[scale=2] |
---|
309 | \tikzstyle{ann} = [draw=none,fill=none,right] |
---|
310 | \matrix[nodes={draw, thick, fill=blue!20}, row sep=0.3cm,column sep=0.5cm]{ |
---|
311 | \node[rectangle, rounded corners]{ |
---|
312 | $F^{\text{6th}}_{i-\frac{1}{2}} = \frac{1}{60} u_{i-\frac{1}{2}} |
---|
313 | \left( 37 (\Psi_i + \Psi_{i-1}) - 8 (\Psi_{i+1} + \Psi_{i-2}) + (\Psi_{i+2} + |
---|
314 | \Psi_{i-3}) \right)$ |
---|
315 | };\\ |
---|
316 | }; |
---|
317 | \end{tikzpicture} |
---|
318 | |
---|
319 | \begin{columns}[T] |
---|
320 | \begin{column}{0.7\textwidth} |
---|
321 | \includegraphics[width=1\textwidth]{numerics_bc_figures/numerical_oscillations.png} |
---|
322 | \end{column} |
---|
323 | \begin{column}{0.3\textwidth} |
---|
324 | Centered Finite Differences produces numerical oscillations (''wiggles'') |
---|
325 | near sharp gradients. |
---|
326 | \end{column} |
---|
327 | \end{columns} |
---|
328 | \end{frame} |
---|
329 | |
---|
330 | % Folie 11 |
---|
331 | \begin{frame} |
---|
332 | \frametitle{Advection Methods â Wicker/Skamarock (IV)} |
---|
333 | \footnotesize |
---|
334 | |
---|
335 | \begin{tikzpicture}[scale=2] |
---|
336 | \tikzstyle{ann} = [draw=none,fill=none,right] |
---|
337 | \matrix[nodes={draw, thick, fill=blue!40}, row sep=0.3cm,column sep=0.5cm]{ |
---|
338 | \node[rectangle, rounded corners]{ |
---|
339 | $F^{\text{5th}}_{i-\frac{1}{2}} = F^{\text{6th}}_{i-\frac{1}{2}} |
---|
340 | - \frac{1}{60} \left| u_{i-\frac{1}{2}} \right| \left( 10 (\Psi_i - \Psi_{i-1}) - |
---|
341 | 5 (\Psi_{i+1} - \Psi_{i-2}) + (\Psi_{i+2} - \Psi_{i-3}) \right)$ |
---|
342 | };\\ |
---|
343 | }; |
---|
344 | \end{tikzpicture} |
---|
345 | |
---|
346 | \begin{columns}[T] |
---|
347 | \begin{column}{0.7\textwidth} |
---|
348 | \includegraphics[width=1\textwidth]{numerics_bc_figures/numerical_oscillations_2.png} |
---|
349 | \end{column} |
---|
350 | \begin{column}{0.3\textwidth} |
---|
351 | \vspace{3mm} |
---|
352 | \underline{Advantage}\\ |
---|
353 | Numerical Dissipation damps small scale oscillations.\\ |
---|
354 | \vspace{3mm} |
---|
355 | \underline{Disadvantage}\\ |
---|
356 | In a turbulent flow numerical dissipation removes energy from small scales. |
---|
357 | |
---|
358 | \end{column} |
---|
359 | \end{columns} |
---|
360 | \end{frame} |
---|
361 | |
---|
362 | % Folie 12 |
---|
363 | \begin{frame} |
---|
364 | \frametitle{Advection Methods â Wicker/Skamarock (V)} |
---|
365 | |
---|
366 | \begin{columns}[T] |
---|
367 | \begin{column}{0.6\textwidth} |
---|
368 | \includegraphics[width=1\textwidth]{numerics_bc_figures/numerical_properties.png} |
---|
369 | \end{column} |
---|
370 | \begin{column}{0.4\textwidth} |
---|
371 | \includegraphics[width=1\textwidth]{numerics_bc_figures/pw_ws.png} |
---|
372 | \end{column} |
---|
373 | \end{columns} |
---|
374 | |
---|
375 | \begin{itemize} |
---|
376 | \item Better resolution of larger scales $(> 8\,\Delta x)$ and hence less |
---|
377 | numerical energy transfer from larger to smaller scales compared to lower |
---|
378 | order schemes. |
---|
379 | \item Less spectral energy at smaller scales. |
---|
380 | \end{itemize} |
---|
381 | |
---|
382 | \end{frame} |
---|
383 | |
---|
384 | % Folie 13 |
---|
385 | \begin{frame} |
---|
386 | \frametitle{Pressure Solver (I)} |
---|
387 | \footnotesize |
---|
388 | \begin{itemize} |
---|
389 | \item<1-> Governing equations of PALM require incompressibility |
---|
390 | \item<2-> Incompressibility is reached by a predictor-corrector method\\ |
---|
391 | \scriptsize |
---|
392 | 1. Momentum equations are solved without the pressure term giving a |
---|
393 | provisional velocity field which is not free of divergence.\\ |
---|
394 | \vspace{2mm} |
---|
395 | $\overline{u}^{t+\Delta t}_{i_{\mathrm{prov}}} = \overline{u}^t_i + |
---|
396 | \Delta t \left( - \frac{\partial}{\partial x_k} \overline{u}^t_k |
---|
397 | \overline{u}^t_i - (\varepsilon_{ijk} f_j \overline{u}^t_k |
---|
398 | - \varepsilon_{i3k} f_3 u_{\mathrm{g}_k}) |
---|
399 | + g \frac{\overline{\theta^*}^t}{\theta_0} \delta_{i3} |
---|
400 | - \frac{\partial}{\partial x_k} \overline{u'_k u'_i}^t \right)$\\ |
---|
401 | \vspace{2mm} |
---|
402 | \onslide<3-> 2. Assign all remaining divergences to the (perturbation) |
---|
403 | pressure $p^*$ so that the new corrected velocity field is the sum of the |
---|
404 | provisional, divergent field and the perturbation pressure term.\\ |
---|
405 | \vspace{2mm} |
---|
406 | $\overline{u}^{t+\Delta t}_{i} = |
---|
407 | \overline{u}^{t+\Delta t}_{i_{\mathrm{prov}}} + |
---|
408 | \Delta t \left(-\frac{1}{\rho_0} \frac{\partial \overline{p^*}^t}{\partial x_i} \right)$\\ |
---|
409 | \vspace{2mm} |
---|
410 | \onslide<4-> 3. The divergence operator is applied to this equation. |
---|
411 | Demanding a corrected velocity field free of divergence, this leads to a |
---|
412 | Poisson equation for the perturbation pressure.\\ |
---|
413 | \vspace{2mm} |
---|
414 | $\frac{\partial^2 \overline{p^*}^t}{\partial x_i^2} = \frac{\rho_0} |
---|
415 | {\Delta t} \frac{\partial \overline{u}_{i_{\mathrm{prov}}}^{t + \Delta t}} |
---|
416 | {\partial x_i}$\\ |
---|
417 | \vspace{2mm} |
---|
418 | \onslide<5-> 4. After solving the Poisson equation, the final velocity field |
---|
419 | is \\ |
---|
420 | calculated as given in step 2.\\ |
---|
421 | |
---|
422 | \end{itemize} |
---|
423 | \end{frame} |
---|
424 | |
---|
425 | % Folie 14 |
---|
426 | \begin{frame} |
---|
427 | \frametitle{Pressure Solver (II)} |
---|
428 | \small |
---|
429 | |
---|
430 | \begin{itemize} |
---|
431 | \item FFT-solver\\ |
---|
432 | \onslide<1-> 1. Discretization of the Poisson-equation by central differences\\ |
---|
433 | \onslide<2-> 2. 2D discrete FFT in both horizontal directions\\ |
---|
434 | \onslide<3-> 3. Solving the resulting tridiagonal set of linear equations\\ |
---|
435 | \onslide<4-> 4. Inverse 2D discrete FFT in both horizontal directions leading |
---|
436 | to the perturbation pressure |
---|
437 | |
---|
438 | \begin{itemize} |
---|
439 | \item<5-> Very fast and accurate, $\mathcal{O}(n \log n)$, $n$: |
---|
440 | number of gridpoints |
---|
441 | \item<6-> CPU requirement $<$ 50\% of total CPU time |
---|
442 | \item<7-> Due to non-locality of the FFT, transpositions are required |
---|
443 | on parallel computers |
---|
444 | \item<8-> Requires periodic boundary conditions and uniform grids |
---|
445 | along $x$ and $y$ |
---|
446 | \end{itemize} |
---|
447 | \end{itemize} |
---|
448 | \end{frame} |
---|
449 | |
---|
450 | % Folie 15 |
---|
451 | \begin{frame} |
---|
452 | \frametitle{Pressure Solver (III)} |
---|
453 | \scriptsize |
---|
454 | \begin{columns} |
---|
455 | \begin{column}{1.03\textwidth} |
---|
456 | \begin{itemize} |
---|
457 | \item<1-> Multigrid-method\\ |
---|
458 | \begin{itemize}\scriptsize |
---|
459 | \item Iterative solver\\ |
---|
460 | \scriptsize |
---|
461 | basic idea: Poisson equation is transformed to a fixed point problem:\\ |
---|
462 | $\vec{p}^{k+1} = T \cdot \vec{p}^k + \vec{c}^k$\\ |
---|
463 | \vspace{1mm} |
---|
464 | \onslide<2-> starting from a first guess, the solution will be |
---|
465 | improved by repeated execution of the fixed point problem:\\ |
---|
466 | $\begin{array}{rcl} |
---|
467 | \vec{p}^{1} &=&T \cdot \vec{p}^0 + \vec{c}^0\\ |
---|
468 | \vec{p}^{2} &=&T \cdot \vec{p}^1 + \vec{c}^1 |
---|
469 | \vspace{-2mm}\\ |
---|
470 | |
---|
471 | &\vdots& |
---|
472 | \vspace{-1.5mm}\\ |
---|
473 | |
---|
474 | \vec{p}^{k} &=&T \cdot \vec{p}^{k-1} + \vec{c}^{k-1}\\ |
---|
475 | \vec{p}^{k+1} &=&T \cdot \vec{p}^k + \vec{c}^k\\ |
---|
476 | \end{array}$\\ |
---|
477 | \vspace{1mm} |
---|
478 | \onslide<3-> Depending on the structure of the matrix $T$ and vector |
---|
479 | $c$ different iterative solvers can be defined, e.g.: Jacobi-scheme |
---|
480 | (here on 2D-uniform grid):\\ |
---|
481 | $p^{k+1}_{i,j} = \frac{1}{4} \cdot \left( p^k_{i-1,j} + p^k_{i+1,j} |
---|
482 | + p^k_{i,j-1} + p^k_{i,j+1} - \Delta x^2 f(i,j,k) \right)$\\ |
---|
483 | \scriptsize \vspace{2mm} |
---|
484 | \item<4-> With each iteration step $k$ the improved solution converges towards |
---|
485 | the exact solution. |
---|
486 | \item<5-> Iterative schemes are 'local schemes' $\rightarrow$ information |
---|
487 | is needed \\ only from neighboring grid-points. |
---|
488 | \item<6-> Very low convergence: $\mathcal{O}(n^2)$. |
---|
489 | \end{itemize} |
---|
490 | \end{itemize} |
---|
491 | \end{column} |
---|
492 | \end{columns} |
---|
493 | \end{frame} |
---|
494 | |
---|
495 | % Folie 16 |
---|
496 | \begin{frame} |
---|
497 | \frametitle{Pressure Solver (IV)} |
---|
498 | \begin{itemize} |
---|
499 | \item<1-> Multigrid-method\\ |
---|
500 | \begin{itemize} |
---|
501 | \item Due to their locality, iterative solvers show a frequency-dependent |
---|
502 | reduction of the residual: low frequencies are reduced slower than high |
---|
503 | frequencies. |
---|
504 | \item<2-> The main idea of the multigrid method is to reduce errors of different |
---|
505 | frequencies on grids with different grid spacing: |
---|
506 | \begin{itemize} |
---|
507 | \item errors of high frequency are reduced on fine grids |
---|
508 | \item errors of low frequency are reduced on coarse grids. |
---|
509 | \end{itemize} |
---|
510 | \end{itemize} |
---|
511 | \end{itemize} |
---|
512 | \onslide<2-> |
---|
513 | \begin{figure}[htp] |
---|
514 | \centering |
---|
515 | \includegraphics[scale=0.35]{numerics_bc_figures/errors.png} |
---|
516 | \end{figure} |
---|
517 | \end{frame} |
---|
518 | |
---|
519 | % Folie 17 |
---|
520 | \begin{frame} |
---|
521 | \frametitle{Pressure Solver (V)} |
---|
522 | |
---|
523 | \begin{columns}[T] |
---|
524 | \begin{column}{0.65\textwidth} |
---|
525 | \begin{itemize} |
---|
526 | \item<1-> Multigrid-method\\ |
---|
527 | \begin{itemize} |
---|
528 | \footnotesize |
---|
529 | \item On each grid-level an approximate solution of the fixed point |
---|
530 | equation is obtained performing a few iterations. |
---|
531 | \item<2-> The solution is transmitted to the next coarser grid-level |
---|
532 | where it is used as the first guess to solve the fixed point problem. |
---|
533 | \item<3-> This procedure is performed up to the coarsest grid-level |
---|
534 | containing two grid-points in each direction. |
---|
535 | \item<4-> From the coarsest grid-level the procedure is passed in |
---|
536 | backward order to get the final solution. |
---|
537 | \item<5-> For large grids faster than FFT method. |
---|
538 | \item<6-> V- and W-cycles are implemented. |
---|
539 | \end{itemize} |
---|
540 | \end{itemize} |
---|
541 | \end{column} |
---|
542 | \begin{column}{0.5\textwidth} |
---|
543 | \onslide<2-> |
---|
544 | \includegraphics[width=1\textwidth]{numerics_bc_figures/multigrid.png} |
---|
545 | \end{column} |
---|
546 | \end{columns} |
---|
547 | \end{frame} |
---|
548 | |
---|
549 | |
---|
550 | |
---|
551 | \section{Boundary Conditions} |
---|
552 | \subsection{Boundary Conditions} |
---|
553 | |
---|
554 | % Folie 18 |
---|
555 | \begin{frame} |
---|
556 | \frametitle{Boundary Conditions (I)} |
---|
557 | |
---|
558 | \begin{itemize} |
---|
559 | \item<1-> Lateral $(xy)$ boundary conditions:\\ |
---|
560 | \begin{itemize} |
---|
561 | \item Cyclic by default, allowing undisturbed evolution / advection of turbulence. |
---|
562 | \begin{columns}[T] |
---|
563 | \begin{column}{0.2\textwidth} |
---|
564 | %leer |
---|
565 | \end{column} |
---|
566 | \begin{column}{0.5\textwidth} |
---|
567 | \includegraphics[width=1\textwidth]{numerics_bc_figures/lateral_bc.png}\\ |
---|
568 | \vspace{2mm} |
---|
569 | \end{column} |
---|
570 | \begin{column}{0.4\textwidth} |
---|
571 | $\begin{array}{rcl} |
---|
572 | \Psi(-1) &=& \Psi(n)\\ |
---|
573 | \Psi(n+1) &=& \Psi(0)\\ |
---|
574 | \end{array}$ |
---|
575 | \end{column} |
---|
576 | \end{columns} |
---|
577 | |
---|
578 | \item<2-> Dirichlet (inflow) and radiation (outflow) conditions are allowed along |
---|
579 | either $x$- or $y$-direction. |
---|
580 | |
---|
581 | \item<3-> In case of a Dirichlet condition, the inflow is laminar (by default) and |
---|
582 | the domain has to be extended to allow for the development of a turbulent |
---|
583 | state, if neccessary. |
---|
584 | \item<4-> Non-cyclic lateral conditions require the use of the multigrid-method |
---|
585 | for solving the Poisson-equation. |
---|
586 | |
---|
587 | \end{itemize} |
---|
588 | \end{itemize} |
---|
589 | \end{frame} |
---|
590 | |
---|
591 | % Folie 19 |
---|
592 | \begin{frame} |
---|
593 | \frametitle{Boundary Conditions (II)} |
---|
594 | |
---|
595 | \begin{columns}[T] |
---|
596 | \begin{column}{0.7\textwidth} |
---|
597 | \scriptsize |
---|
598 | \begin{itemize} |
---|
599 | \item<1-> Surface boundary condition: |
---|
600 | \begin{itemize} |
---|
601 | \scriptsize |
---|
602 | \item<1-> Monin-Obukhov-similarity is used by default, i.e. a Prandtl-layer is |
---|
603 | assumed between the surface and the first grid layer.\\ |
---|
604 | $\frac{\partial \overline{u}}{\partial z} = \frac{u_{*}}{\kappa z} |
---|
605 | \Phi_{\mathrm{m}}$; \hspace{3mm} $u_{*} = \sqrt{- \overline{w' u'_0}} |
---|
606 | = \sqrt{\frac{\tau_0}{\overline{\rho}}}$\\ |
---|
607 | $\frac{\partial \overline{\theta}}{\partial z} = \frac{\vartheta_{*}} |
---|
608 | {\kappa z} \Phi_{\mathrm{h}}$; \hspace{3mm} $\vartheta_{*} = |
---|
609 | \frac{\overline{w' \theta'_0}}{u_{*}}$\\ |
---|
610 | \vspace{2mm} |
---|
611 | \item<2-> Integration between $z=z_0$ (roughness height) and $z=z_{\mathrm{p}}$ |
---|
612 | (top of Prandtl-layer, $k=1$) gives the only unknowns $u_{*}$ and |
---|
613 | $\theta_{*}$ which then define the surface momentum and heat flux, |
---|
614 | used as the real boundary conditions.\\ |
---|
615 | \vspace{2mm} |
---|
616 | \item<3-> $\Phi_{\mathrm{m}}$, $\Phi_{\mathrm{h}}$: Dyer-Businger functions\\ |
---|
617 | \onslide<4->$\Phi_{\mathrm{m}} = \left\{ \begin{array}{cc} |
---|
618 | 1+5\,\mathrm{Rif} & \text{stable}\\ |
---|
619 | 1 & \text{neutral}\\ |
---|
620 | (1-16\,\mathrm{Rif})^{-1/4} & \text{unstable}\\ |
---|
621 | \end{array} \right. $ |
---|
622 | |
---|
623 | \end{itemize} |
---|
624 | \end{itemize} |
---|
625 | \end{column} |
---|
626 | \begin{column}{0.3\textwidth} |
---|
627 | \onslide<1-> |
---|
628 | \includegraphics[width=1\textwidth]{numerics_bc_figures/surface_bc.png}\\ |
---|
629 | \vspace{-2mm} |
---|
630 | Prandtl-layer\\ |
---|
631 | \vspace{8mm} |
---|
632 | \onslide<5-> |
---|
633 | $\mathrm{Rif} = \frac{\frac{g}{\tilde{\theta}} |
---|
634 | \overline{w' \theta'_0}}{\overline{w' u'} |
---|
635 | \frac{\partial \overline{u}}{\partial z}}$\\ |
---|
636 | \scriptsize Richardson flux number |
---|
637 | \end{column} |
---|
638 | \end{columns} |
---|
639 | \end{frame} |
---|
640 | |
---|
641 | % Folie 20 |
---|
642 | \begin{frame} |
---|
643 | \frametitle{Boundary Conditions (III)} |
---|
644 | |
---|
645 | \begin{itemize} |
---|
646 | \item<1-> Surface boundary condition: |
---|
647 | \begin{itemize} |
---|
648 | \footnotesize |
---|
649 | \item<1-> Monin-Obukhov-similarity is only valid for a |
---|
650 | horizontal surface with homogeneous conditions. |
---|
651 | \item<2-> The surface temperature has to be prescribed. |
---|
652 | Alternatively, the surface heat flux can be prescribed. |
---|
653 | \item<3-> Instead of MO-similarity, no-slip conditions or |
---|
654 | free-slip conditions can be used |
---|
655 | \begin{equation*} |
---|
656 | u(z=0) = 0, \quad v(z=0)=0 \hspace{15mm} |
---|
657 | \frac{\partial u}{\partial z} = 0, \quad |
---|
658 | \frac{\partial v}{\partial z} = 0 \qquad |
---|
659 | \end{equation*} |
---|
660 | realized by |
---|
661 | \begin{flalign*} |
---|
662 | u(k=0)=-u(k=1) \hspace{18mm} u(k=0)=u(k=1)\\ |
---|
663 | v(k=0)=-v(k=1) \hspace{18mm} v(k=0)=v(k=1) |
---|
664 | \end{flalign*} |
---|
665 | \item<4-> Pressure boundary condition: |
---|
666 | $\dfrac{\partial p}{\partial z} = 0$ |
---|
667 | in order to guarantee $w(z=0)=0$ |
---|
668 | \item<5-> SGS-TKE condition $\dfrac{\partial e}{\partial z}=0$ |
---|
669 | \end{itemize} |
---|
670 | \end{itemize} |
---|
671 | \end{frame} |
---|
672 | |
---|
673 | % Folie 21 |
---|
674 | \begin{frame} |
---|
675 | \frametitle{Boundary Conditions (IV)} |
---|
676 | |
---|
677 | \begin{itemize} |
---|
678 | \item<1-> Boundary conditions at the top (default) |
---|
679 | \begin{itemize} |
---|
680 | \item<1-> Dirichlet conditions for velocities: $u=u_{\mathrm{g}}, |
---|
681 | \quad v=v_{\mathrm{g}}, \quad w=0$ |
---|
682 | \item<2-> Neumann conditions (temporal constant gradients) for scalars: |
---|
683 | $$\frac{\partial \theta}{\partial z} = |
---|
684 | \left. \frac{\partial \theta}{\partial z} \right\vert_{t=0}$$ |
---|
685 | \item<3-> Pressure: Dirichlet $p=0$ |
---|
686 | or Neumann $\dfrac{\partial p}{\partial z} = 0$ |
---|
687 | \item<4-> SGS-TKE: Neumann $\dfrac{\partial e}{\partial z} = 0$ |
---|
688 | \item<5-> A damping layer can be switched on in order to absorb |
---|
689 | gravity waves. |
---|
690 | \end{itemize} |
---|
691 | \end{itemize} |
---|
692 | \end{frame} |
---|
693 | |
---|
694 | % Folie 22 |
---|
695 | \begin{frame} |
---|
696 | \frametitle{Initial Conditions} |
---|
697 | |
---|
698 | All 3D-arrays are initialized with vertical profiles (horizontally homogeneous).\\ |
---|
699 | \quad \\ |
---|
700 | Two different profiles can be chosen: |
---|
701 | \begin{itemize} |
---|
702 | \item<2-> \textbf{constant (piecewise linear) profiles} |
---|
703 | \begin{itemize} |
---|
704 | \footnotesize |
---|
705 | \item \textbf{e.g.} $u=0, v=0, \dfrac{\partial \theta}{\partial z}=0$ |
---|
706 | \textbf{up to} $z=\unit[1000]{m}$, |
---|
707 | $\dfrac{\partial \theta}{\partial z}=+1.0$ \textbf{up to top} |
---|
708 | \end{itemize} |
---|
709 | \item<3-> \textbf{velocity profiles calculated by a 1D-model (which is a part of PALM)} |
---|
710 | \begin{itemize} |
---|
711 | \footnotesize |
---|
712 | \item \textbf{constant (piecewise linear) temperature profile is used |
---|
713 | for the 1D-model} |
---|
714 | \end{itemize} |
---|
715 | \end{itemize} |
---|
716 | \onslide<4-> |
---|
717 | \underline{Under horizontally homogeneous initial conditions, random}\\ |
---|
718 | \underline{fluctuations have to be added in order to generate turbulence!} |
---|
719 | \end{frame} |
---|
720 | |
---|
721 | \end{document} |
---|