% $Id: exercise_neutral.tex 1657 2015-09-17 18:31:36Z witha $
\input{header_tmp.tex}
%\input{../header_lectures.tex}

\usepackage[utf8]{inputenc}
\usepackage{ngerman}
\usepackage{pgf}
\usepackage{subfigure}
\usepackage{units}
\usepackage{tabto}
\usepackage{multimedia}
\usepackage{hyperref}
\newcommand{\event}[1]{\newcommand{\eventname}{#1}}
\usepackage{xmpmulti}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\usetikzlibrary{decorations.markings}             %neues paket
\usetikzlibrary{decorations.pathreplacing}        %neues paket
\def\Tiny{\fontsize{4pt}{4pt}\selectfont}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{pdfcomment}
\usepackage{graphicx}
\usepackage{listings}
\lstset{showspaces=false,language=fortran,basicstyle=
        \ttfamily,showstringspaces=false,captionpos=b}

\institute{Institute of Meteorology and Climatology, Leibniz Universität Hannover}
\selectlanguage{english}
\date{last update: \today}
\event{PALM Seminar}
\setbeamertemplate{navigation symbols}{}

\setbeamertemplate{footline}
  {
    \begin{beamercolorbox}[rightskip=-0.1cm]&
     {\includegraphics[height=0.65cm]{imuk_logo.pdf}\hfill \includegraphics[height=0.65cm]{luh_logo.pdf}}
    \end{beamercolorbox}
    \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,
      leftskip=.3cm,rightskip=0.3cm plus1fil]{title in head/foot}
      {\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor} \hfill \eventname \hfill \insertframenumber \; / \inserttotalframenumber}
    \end{beamercolorbox}
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
    \end{beamercolorbox}
  }
%\logo{\includegraphics[width=0.3\textwidth]{luhimuk_logo.pdf}}

\title[Exercise 2: Neutrally Stratified  Boundary Layer]{Exercise 2: Neutrally Stratified  Boundary Layer}
\author{PALM group}

\setbeamersize{text margin left=.2cm,text margin right=.2cm}

\begin{document}
\footnotesize
% Folie 1
\begin{frame}
\titlepage
\end{frame}

\section{Exercise}
\subsection{Exercise}

% Folie 2
\begin{frame}
   \frametitle{Exercise 2: Neutrally Stratified  Atmospheric Boundary Layer}
   \begin{itemize}
      \item A neutrally stratified atmospheric boundary layer shall be simulated.
      \item<2-> The flow shall be driven by a constant large-scale pressure gradient, i.e., a geostrophic wind.
      \item<3-> At the end of the simulation, turbulence as well as the mean flow should be in a stationary state.
   \end{itemize}
   \onslide<4->\textbf{Simulation features:}
    \begin{itemize}
          \item<4-> geostrophic wind:  \tabto{3cm} $u_\mathrm{g} = \unit[5]{m\ s^{-1}}, v_\mathrm{g} = \unit[0]{m\ s^{-1}}$
          \item<5-> initial velocity:  \tabto{3cm} try constant velocity ($u = u_\mathrm{g}, v = v_\mathrm{g}$, everywhere)\\ 
                    \tabto{3cm} or a mean vertical profile created by the 1D-model
          \item<6-> roughness length:  \tabto{3cm} $z_0 = \unit[0.1]{m}$
    \end{itemize}
\onslide<7->Please choose domain size, grid size and time to be simulated appropriately.
\end{frame}

% Folie 3
\begin{frame}
   \frametitle{Questions to be Answered:}
    \begin{itemize}
       \item<1-> How long do you have to simulate until turbulence / mean flow become stationary?
       \vspace{1em}
       \item<2-> How do the horizontally and temporally averaged vertical velocity and momentum flux profiles look like?
       \vspace{1em}
       \item<3-> Is it really a large-eddy simulation, i.e., are the subgrid-scale fluxes much smaller than the resolved-scale fluxes?
       \vspace{1em}
       \item<4-> How do the turbulence spectra of $u$, $v$, $w$ along $x$ and along $y$ look like?\\
                 Can you identify the inertial subrange?
    \end{itemize}
\end{frame}

% Folie 4
 \begin{frame}
    \frametitle{Hints (I)}
     \begin{itemize}
        \item<1-> Please remember hints given for the previous exercise!
        \item<2-> \textbf{Initial profiles:}
        \begin{itemize}
           \tiny
           \item<3-> The 1D-model (\texttt{\textcolor{blue}{initializing\_actions} = 'set\_1d-model\_profiles'}) is mainly controlled by parameters \texttt{\textcolor{blue}{end\_time\_1d}} and \texttt{\textcolor{blue}{damp\_level\_1d}}. Please keep in mind that the profiles from the 1D-model should also be in a stationary state.
           \vspace{0.5em}
            \item<3-> Output of vertical profile data generated by the 1D-model is controlled by parameter \texttt{\textcolor{blue}{dt\_pr\_1d}}. It is in ASCII-format and it is written into a separate file. You can include the profiles of the 1D-model, which are used to initialize the 3D-model, in the standard profile data output of the 3D-model (which is controlled by parameter \texttt{\textcolor{blue}{data\_output\_pr}}) by adding a \texttt{'\#'} sign to the respective output quantity, e.g. \texttt{\textcolor{blue}{data\_output\_pr} = '\#u'}.
           \vspace{0.5em}
            \item<3-> For the 1D-model, please set \texttt{\textcolor{blue}{mixing\_length\_1d} = 'blackadar'} and \texttt{\textcolor{blue}{dissipation\_1d} = 'detering'} in order to get a correct mean boundary layer wind profile. The default settings of these parameters would switch the turbulence parameterization of the 1D-model to the SGS-parameterization of the 3D-LES-model, which represents only the SGS-parts of turbulence. However, for this exercise the 1D-model has to parameterize all scales of turbulence (i.e., it should be used as a RANS-model).
        \end{itemize}

        \item<4-> \textbf{Stationary state:}
        \begin{itemize}
           \tiny
           \item<4-> You probably will find it difficult to get the mean flow to a stationary state (for the 1D-model as well as for the 3D-model. Can you identify the mechanism responsible for this? Try parameters \texttt{\textcolor{blue}{damp\_level\_1d}} (for the 1D-model) and \texttt{\textcolor{blue}{rayleigh\_damping\_factor}} (for the 3D-model; this is a \texttt{inipar}-parameter!) to overcome this problem.
           \vspace{0.5em}
           \item<5-> You can switch on a Galilei-transformation in order to save CPU-time (see parameter \texttt{\textcolor{blue}{galilei\_transformation}}).
        \end{itemize}

     \end{itemize}
 \end{frame}

% Folie 5
 \begin{frame}
    \frametitle{Hints (II)}
     \begin{itemize}
        \item<1-> \textbf{Spectra:}
        \begin{itemize}
           \scriptsize
           \item<2-> Output of spectra requires to switch on the spectra-package using \textbf{mrun}-option \texttt{-p}:\\
                     \texttt{mrun ... -p spectra -r \dq d3\# sp\# ...\dq}
           \vspace{0.5em}
           \item<3-> Spectra output is controlled by parameters \texttt{\textcolor{blue}{data\_output\_sp}}, \texttt{\textcolor{blue}{dt\_dosp}}, etc. These package-parameters have to be given     in a separate NAMELIST-block which has to follow the \texttt{d3par}-block:\\
                     \texttt{\&d3par end\_time = ... /}\\
                     \texttt{\&spectra\_par data\_output\_sp = ... /}\\
        \end{itemize}
     \end{itemize}
 \end{frame}

\bgroup
\setbeamercolor{background canvas}{bg=white}
\begin{frame}[plain,noframenumbering]{}
\end{frame}
\egroup

% Folie 6
\section{Results}
\subsection{Results}

% Folie 7
\begin{frame}
   \frametitle{Time series of TKE, umax and wmax}
   \begin{center}
      \includegraphics[width=0.62\textwidth]{exercise_neutral_figures/ts_tke_umax_wmax.eps}
   \end{center}
\end{frame}

% Folie 8
\begin{frame}
   \frametitle{Vertical profiles of $\overline{w}$, $\overline{wu}$, $\overline{wv}$}
   \begin{center}
      \includegraphics[width=1.0\textwidth]{exercise_neutral_figures/pr_w_wu_wv.eps}
   \end{center}
\end{frame}

% Folie 9
\begin{frame}
   \frametitle{Vertical profiles of $\overline{w'u'}$, $\overline{w'v'}$, 
               $\overline{w``u''}$ and $\overline{w``v''}$}
   \begin{center}
      \includegraphics[width=0.55\textwidth]{exercise_neutral_figures/pr_wu_wv_sgs_res.eps}
   \end{center}
\end{frame}

% Folie 10
\begin{frame}
   \frametitle{Spectra of $u$, $v$ and $w$}
   \begin{center}
      \includegraphics[angle=90,width=0.7\textwidth]{exercise_neutral_figures/sp_u_v_w.eps}
   \end{center}
\end{frame}


\subsection{Answers}
% Folie 11
\begin{frame}
   \frametitle{Answers to question I}
   \footnotesize
   How long do you have to simulate until turbulence / mean flow become stationary?
   \begin{itemize}
    \item As can be seen in frame 6, a simulation time of about 48~h should at least be taken to obtain a roughly constant kinetic energy.
    \item The time series of E shows an oscillation with a period of roughly 14~h. This can be attributed to the inertial oscillation 
          affecting the air parcels due to the Coriolis force. This oscillation is damped with time.
    \item umax and wmax do not change much in time after the spin-up time of roughly 6~h.
   \end{itemize}
\end{frame}

% Folie 12
\begin{frame}
   \frametitle{Answers to question II}
   \footnotesize
   How do the horizontally and temporally averaged vertical velocity and momentum flux profiles look like?
   \begin{itemize}
    \item The profiles are shown in frame 7. The horizontally averaged vertical velocity is practically zero as the usage of incompressible 
          equations together with cyclic boundary conditions (horizontal homogeneity) suggest.  
    \item wu an wv decrease with height since friction decelerates the flow at the surface. Due to the turning of the wind vector 
          with height (Ekman spiral), 
          the meridional velocity component is non-zero evoking also a non-zero vertical momentum flux of the v-velocity component.
    \item The non-convergence of the single profiles can be attributed to the inertial oscillation.
   \end{itemize}
\end{frame}

% Folie 13
\begin{frame}
   \frametitle{Answers to question III}
   \footnotesize
   Is it really a large-eddy simulation?
   \begin{itemize}
    \item Frame 8 shows sub-grid and resolved momentum flux profiles. 
    \item The simulation is an LES since resolved momentum fluxes are the dominant components to the total flux except for the near 
          vicinity of the surface where the unresolved, sub-grid fluxes dominate.
   \end{itemize}
\end{frame}


% Folie 14
\begin{frame}
   \frametitle{Answers to question IV}
   \footnotesize
   Can you identify the inertial subrange?
   \begin{itemize}
    \item In PALM, the spectral density is normalized by means of the variance and additionally multiplied by the wave number. Thus, the spectral density appearing 
          on the ordinate of the plots in frame 9 is dimensionless.
    \item The spectra show a maximum spectral density for small wave numbers. Thus, the largest eddies contain the highest variance 
          (or turbulence kinetic energy, TKE). For higher wave numbers the inertial subrange follows where the spectra follow a -2/3 
          slope in the plot (indicated by a black line). There, the variance follows the energy cascade where larger eddies break-up 
          into smaller eddies. For the highest wave numbers, the spectra depart from the -2/3 slope indicating that dissipation takes place.
    \item The spectra also show that the production range is not well developed (very flat maxima). This suggests that the modeling domain 
          might be too small to capture relevant larger scales.
   \end{itemize}
\end{frame}

\end{document}
