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

\usepackage[utf8]{inputenc}
\usepackage{ngerman}
\usepackage{pgf}
\usepackage{subfigure}
\usepackage{units}
\usepackage{multimedia}
\usepackage{hyperref}
\newcommand{\event}[1]{\newcommand{\eventname}{#1}}
\usepackage{xmpmulti}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,decorations.pathreplacing}
\def\Tiny{\fontsize{4pt}{4pt}\selectfont}

%---------- neue Pakete
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{pdfcomment}
\usepackage{xcolor}

\institute{Institute of Meteorology and Climatology, Leibniz Universität Hannover}
\selectlanguage{english}
\date{last update: \today}
\event{PALM Seminar}
\setbeamertemplate{navigation symbols}{}
\setbeamersize{text margin left=.5cm,text margin right=.2cm}
\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.eps}}

\title[Exercise - Topography]{Exercise - Topography}
\author{PALM group}

% Notes:
% jede subsection bekommt einen punkt im menu (vertikal ausgerichtet.
% jeder frame in einer subsection bekommt einen punkt (horizontal ausgerichtet)
\begin{document}
% Folie 1
\begin{frame}
\titlepage
\end{frame}

\section{Exercise}
\subsection{Exercise}

% Folie 2
\begin{frame}
   \frametitle{Exercise}
   Please carry out \textbf{two runs} with following conditions.
   \begin{itemize}
      \item<2->{Single cube}
      \begin{itemize}
         \item[1.)]{First run ''generic'' using {\tt topography = 'single\_building'}}
         \item[2.)]{Second run ''raster'' using {\tt topography = 'read\_from\_file'}
                   with ASCII file ...\_topo}
      \end{itemize}
      \item<3->{Neutral boundary layer in a channel}
      \item<4->{Constant bulk velocity}
      \item<5->{No Coriolis force}
      \item<6->{Simulation features:}
      \begin{itemize}
         \item{domain size: (80 m)$^3$ (x/y/z)}
         \item{grid size: 2 m equidistant}
         \item{cube: size (40 m)$^3$, location centered in the domain center}
         \item{simulated time: 7200 s}
         \item{initial velocity: u = 1, v = 0 m/s}
      \end{itemize}
   \end{itemize}
   \onslide<7->\textbf{Please use the same building (size, location) for both runs!}
\end{frame}

% Folie 3
\begin{frame}
   \frametitle{Questions to be Answered}
   \small
   \begin{enumerate}
      \item<2->{Can you identify any interesting flow patterns around the cube and what do they tell us?}
      \begin{itemize}
         \item{What kind of output do you need to answer this?}
      \end{itemize}
      \item<3->{How do the horizontally and temporally averaged velocity and momentum flux profiles look like?}
      \begin{itemize}
         \item{How long should the averaging time interval be?}
      \end{itemize}
      \item<4->{Is it really a fully developed large-eddy simulation?}
      \begin{itemize}
         \item{Are the subgrid-scale fluxes much smaller than the resolved-scale fluxes?}
         \item{How do the total kinetic energy and the maximum velocity components change
               with time?}
      \end{itemize}
      \item{\onslide<5->\textbf{Final question:} Do the results of both runs agree?}
   \end{enumerate}
\end{frame}

% Folie 4
\begin{frame}
   \frametitle{Hints (I)}
   \scriptsize
   \begin{itemize}
      \item<2->{\textbf{Domain size}}
      \begin{itemize}
         \scriptsize
         \item{Is controlled by grid size (\textbf{dx}, \textbf{dy}, \textbf{dz}) and number of grid points 
               (\textbf{nx}, \textbf{ny}, \textbf{nz}). Since the first grid point along one of the directions has
               index 0, the total number of grid points used are \textbf{nx}+1, \textbf{ny}+1, \textbf{nz}+1.
               The total domain size in case of cyclic horizontal boundary conditions is
               (\textbf{nx}+1)$\cdot$\textbf{dx}, (\textbf{ny}+1)$\cdot$\textbf{dy}.}
         \end{itemize}
      \item<3->{\textbf{Initial profiles}}
      \begin{itemize}
         \scriptsize
         \item{Constant with height. See parameter \textbf{initializing\_actions} for available
               initialization methods. See \textbf{ug\_surface}, \textbf{vg\_surface} for initial values of
               velocity.}
      \end{itemize}
      \item<4->{\textbf{Boundary conditions}}
      \begin{itemize}
         \scriptsize
         \item{For channel boundary condition, see \textbf{bc\_uv\_t}.}
      \end{itemize}
      \item<5->{\textbf{Forcing}}
      \begin{itemize}
         \scriptsize
         \item{For constant bulk velocity, see \textbf{conserve\_volume\_flow}.}
         \item{For Coriolis force, see \textbf{omega}.}
         \item{For neutral flow, see \textbf{neutral}.}
      \end{itemize}
      \item<6->{\textbf{Topography}}
      \begin{itemize}
         \scriptsize
         \item{For generic topography, see \textbf{building\_height}, \textbf{building\_length\_x} and
               \textbf{building\_length\_y}.}
         \item{For raster topography, please use a text editor to manually create an
               ASCII ''raster\_topo'' file that contains the same building.}
      \end{itemize}      
    \end{itemize}
 \end{frame}

% Folie 5
\begin{frame}
   \frametitle{Hints (II)}
   \footnotesize
   \begin{itemize}
      \item<2->{\textbf{Simulation time}}
      \begin{itemize}  
         \footnotesize       
         \item{See parameter \textbf{end\_time}.}
      \end{itemize}
      \item<3->{\textbf{Variables}}
      \begin{itemize}
         \footnotesize
         \item{Output variables are chosen with parameters \textbf{data\_output} (3d-data or 
               2d-cross-sections) and \textbf{data\_output\_pr} (profiles).}
         \item{Time series are activated using \textbf{dt\_dots}.}         
      \end{itemize}
      \item<4->{\textbf{Output intervals}}
      \begin{itemize}
         \footnotesize
         \item{Output intervals are set with parameter \textbf{dt\_data\_output}. This parameter
               affects all output (cross-sections, profiles, etc.). Individual temporal
               intervals for the different output quantities can be assigned using
               parameters \textbf{dt\_do3d}, \textbf{dt\_do2d\_xy}, \textbf{dt\_do2d\_xz}, \textbf{dt\_do2d\_yz}, \textbf{dt\_dopr},
               etc. }
      \end{itemize}
      \item<5->{\textbf{Time averaging}}
      \begin{itemize}
         \footnotesize
         \item{Time averaging is controlled with parameters \textbf{averaging\_interval},
               \textbf{averaging\_interval\_pr}, \textbf{dt\_averaging\_input}, \textbf{dt\_averaging\_input\_pr}.}
      \end{itemize}
   \end{itemize}
\end{frame}

% Folie 6
\begin{frame}
   \frametitle{Further Hints}
   \scriptsize
   Please see under \\
   \textbf{http://palm.muk.uni-hannover.de/trac/wiki/doc/app/netcdf}  \\ 
   \par\medskip  
   where the complete PALM netCDF-data-output and the respective steering parameters are described. 
   \par\medskip
   For topography, see \\
   \textbf{http://palm.muk.uni-hannover.de/trac/wiki/doc/app/inipar\#topo}\\
   \par\medskip
   and especially for raster topography, see also
   \textbf{http://palm.muk.uni-hannover.de/trac/wiki/doc/app/iofiles\#TOPOGRAPHY\_DATA} \\
   \par\medskip
   as well as the presentation ''Using topography (I)''.
\end{frame}

% Folie 7
\begin{frame}
   \frametitle{Proceeding}
   Please proceed as follows:
   \begin{itemize}
      \item<2->[1.]{Please run with the ''generic'' topography case first.}
      \item<3->[2.]{Check your results to answer all questions – except the final question.}
      \item<4->[3.]{After this run has finished, use ncview, ncdump etc. to check the precise
               location of the building (look at 2D array \textit{zusi} that is contained in 2D xy
               cross-sections and 3D volume data).}
      \item<5->[4.]{Use this information to manually create the ''raster\_topo'' file.}
      \item<6->[5.]{Run the ''raster'' topography case.}
      \item<7->[6.]{Compare both simulation results to answer the final question.}
   \end{itemize} 
\end{frame}

% Folie 8
\begin{frame}
   \frametitle{How to Start?}
   \footnotesize
   \begin{itemize}
      \item<2->{Create two \textbf{INPUT} directories for both new runs: \\
            {\tt cd $\sim$/palm/current\_version} \\            
            {\tt mkdir -p JOBS/generic/INPUT} \\
            {\tt mkdir -p JOBS/raster/INPUT}} 
      \item<3->{Create the parameter files and {\tt raster\_topo} file and set the required
            parameters in \\
            {\tt JOBS/generic/INPUT/generic\_p3d} \\
            {\tt JOBS/raster/INPUT/raster\_p3d}}
      \item<4->{Start the runs one by one with mrun-commands \\
            {\tt mrun -d generic -K parallel ...} \\
            {\tt mrun -d raster -K parallel ...}}
      \item<5->{and analyze the output files in \\
            {\tt JOBS/generic/OUTPUT} \\
            {\tt JOBS/raster/OUTPUT}}
   \end{itemize}
\end{frame}

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

\section{Results}
\subsection{Results}

% Folie 9
\begin{frame}
   \frametitle{Question 1: Flow patterns (I)}
   \par\smallskip
   \footnotesize
   \textbf{Horizontal cross sections of 1-h averaged velocity components \textit{u} and \textit{v}}
   \includegraphics[width=0.45\textwidth]{exercise_topography_figures/cross_sections/u_xy.eps} \hspace{0.8cm}
   \includegraphics[width=0.45\textwidth]{exercise_topography_figures/cross_sections/v_xy.eps} 
\end{frame}

% Folie 10
\begin{frame}
   \frametitle{Question 1: Flow patterns (II)}
   \par\smallskip
   \footnotesize
   \textbf{Horizontal and streamwise vertical cross sections of 1-h averaged \\ velocity component \textit{w}}
   \par\smallskip
   \includegraphics[width=0.45\textwidth]{exercise_topography_figures/cross_sections/w_xy.eps} \hspace{0.8cm}
   \includegraphics[width=0.45\textwidth]{exercise_topography_figures/cross_sections/w_xz.eps} 
\end{frame}

% Folie 11
\begin{frame}
   \frametitle{Question 1: Flow patterns (III)}
   \par\smallskip
   \footnotesize
   \textbf{Streamlines (1-h average) for the same cross sections as seen in Frame 10 \\ for the \textit{w}-velocity}
   \par\smallskip
   \includegraphics[width=0.45\textwidth]{exercise_topography_figures/streamlines/streamlines_xy.eps} \hspace{0.8cm}
   \includegraphics[width=0.45\textwidth]{exercise_topography_figures/streamlines/streamlines_xz.eps} \hspace{0.8cm}
\end{frame}


% Folie 12
\begin{frame}
   \frametitle{Question 2: Velocity and momentum flux profiles}
   \par\smallskip
   \footnotesize
   \textbf{Vertical profiles of 1-h and horizontally averaged \textit{u}-, \textit{v}- and \textit{w}-velocity}
   \par\smallskip
   \includegraphics[width=\textwidth]{exercise_topography_figures/profiles/profile_uvw.png}
\end{frame}

% Folie 13
\begin{frame}
   \frametitle{Question 2: Velocity and momentum flux profiles}
   \par\smallskip
   \footnotesize
   \textbf{Vertical profiles of 1-h and horizontally averaged total turbulent momentum \\ fluxes $wu$ and $wv$}
   \par\smallskip
   \includegraphics[width=0.45\textwidth]{exercise_topography_figures/profiles/wu_time_pr.eps} \hspace{0.8cm}
   \includegraphics[width=0.45\textwidth]{exercise_topography_figures/profiles/wv_time_pr.eps}
\end{frame}

% Folie 14
\begin{frame}
   \frametitle{Question 3: LES? - Fluxes}
   \par\smallskip
   \footnotesize
   \textbf{Vertical profiles of 1-h and horizontally averaged momentum fluxes: total ($wu$), resolved-scale ($w^{*}u^{*}$) and subgrid-scale ($w''u''$) fluxes}
   \par\smallskip
   \begin{center}
      \includegraphics[width=0.6\textwidth]{exercise_topography_figures/profiles/wu_comp_pr.eps}
   \end{center}   
\end{frame}

% Folie 15
\begin{frame}
   \frametitle{Question 3: LES? - Time Series (I)}
   \par\smallskip
   \footnotesize
   \textbf{Total kinetic energy \textit{E} of the flow and maximum \textit{u}-velocity in the model domain}
   \par\smallskip
   \begin{center}
      \includegraphics[width=0.95\textwidth]{exercise_topography_figures/timeseries/E_ts.eps} \\
      \includegraphics[width=0.95\textwidth]{exercise_topography_figures/timeseries/umax_ts.eps} 
   \end{center}
\end{frame}

% Folie 16
\begin{frame}
   \frametitle{Question 3: LES? - Time Series (II)}
   \par\smallskip
   \footnotesize
   \textbf{Maximum \textit{v}- and \textit{w}-velocity in the model domain}
   \par\smallskip
   \begin{center}
      \includegraphics[width=\textwidth]{exercise_topography_figures/timeseries/vmax_ts.eps} \\
      \includegraphics[width=\textwidth]{exercise_topography_figures/timeseries/wmax_ts.eps}
   \end{center}
\end{frame}

\subsection{Answers}

% Folie 17
\begin{frame}
   \frametitle{Answer to question 1 (I)}
   \footnotesize
   \textbf{Can you identify any interesting flow patterns around the cube and what do they tell us?}
   \par\smallskip
   \footnotesize
   The 1-h-averaged near-surface horizontal velocity components \textit{u} and \textit{v} show (see Frame 9):
   \scriptsize
   \begin{itemize}
      \item{reversed streamwise flow in the gap between leeward and windward cube wall,}
      \item{diverging spanwise flow in the gap with nearly same magnitude as reversed spanwise flow.}
   \end{itemize}
   \par\smallskip
   \footnotesize
   The \textit{w}-velocity fields complete the picture (see Frame 10), we see:
   \scriptsize
   \begin{itemize}
      \item{descending mean flow near the windward cube wall,}
      \item{ascending mean flow near the leeward cube wall.}
   \end{itemize}
\end{frame}

% Folie 18
\begin{frame}
   \frametitle{Answer to question 1 (II)}
   \footnotesize
   \textbf{Can you identify any interesting flow patterns around the cube and what do they tell us?}
   \par\smallskip
   \footnotesize
   Streamlines in Frame 11 show an overall view of the mean horizontal (left; near surface) and the mean streamwise-vertical (right; center of cube wall) flow:
   \scriptsize
   \begin{itemize}
    \item{left: in the gap between leeward and windward cube wall, streamlines are directed in opposite direction to the prescribed flow direction, and they diverge in the spanwise direction,}
    \item{left: starting at the corners of the leeward cube wall, these diverging streamlines converge with the streamlines of the flow forced around the side walls of the cube,}
    \item{right: above the cube roof, the mean flow is horizontal and directed as prescribed,} 
    \item{right: in the streamwise gap, we find a rotor-like vortex, explaining the mean downward motion in the largest part of the gap, the upward motion at the leeward cube wall, and the reversed streamwise flow, covering almost fully the gap dimensions.}
   \end{itemize}
   \par\smallskip
   \footnotesize
   \textbf{Note:} Flow patterns can change significantly when the size of the gaps between buildings changes (see e.g. Oke, T. R. \textit{Street Design and Urban Canopy Layer Climate}. Energy and Buildings, 11 (1988)).
\end{frame}

% Folie 19
\begin{frame}
   \frametitle{Answer to question 2 (I)}
   \footnotesize
   \textbf{How do the horizontally and temporally averaged velocity and momentum flux profiles look like?}
   \par\smallskip
   \footnotesize
   Frame 12 shows 1-h and horizontally averaged vertical profiles of velocity components \textit{u}, \textit{v} and \textit{w}:
   \scriptsize
   \begin{itemize}
      \item{\textit{u}: Channel flow causes zero velocity at bottom and top domain wall. Upper domain half: Velocities increase with distance from upper channel wall, peaks at around 60m, and decreases quickly closer towards cube top. Lower domain half: \textit{u} further decreases towards bottom channel wall, due to roughness of the wall, and \textit{u} is much smaller here than in upper domain half, due to presence of cube.}
      \item{\textit{v}: In the horizontal average, \textit{v}-component is much smaller than \textit{u}, and it fluctuates around zero. Time average should be increased to further eliminate these fluctuations. Flow is forced by \textit{u}-component}, and cube does not induce significant \textit{v} in horizontal mean.
      \item{\textit{w}: Zero above, small negative values below cube top. In fully developed LES with sufficient domain size and averaging, horizontally averaged \textit{w} profile should be zero.}
   \end{itemize}
\end{frame}

% Folie 20
\begin{frame}
   \frametitle{Answer to question 2 (II)}
   \footnotesize
   \textbf{How do the horizontally and temporally averaged velocity and momentum flux profiles look like?}
   \par\smallskip
   \footnotesize
   Frame 13 shows 1-h and horizontally averaged vertical profiles of \textit{u} and \textit{v} components of total turbulent vertical momentum flux, for two ouput times:
   \scriptsize
   \begin{itemize}
      \item{\textit{wv} is one order of magnitude smaller than \textit{wu} (flow is forced with the \textit{u}-component), hence, the \textit{wv} profile is not smooth, it strongly fluctuates with heigt and time.}
      \item{In contrast, the \textit{wu} profile is smooth and barely changes from one 1-h average to the next, indicating sufficient averaging time.}
   \end{itemize}
\end{frame}

% Folie 21
\begin{frame}
   \frametitle{Answer to question 2 (III)}
   \footnotesize
   \textbf{How does the horizontally and temporally averaged momentum flux profile look like?}
   \par\smallskip
   \scriptsize
   \begin{itemize}
      \item{This \textit{wu} profile of channel flow around a cube strongly deviates from the typical \textit{wu profile} in a neutral obstacle-free atmospheric boundary layer (ABL). In the latter, \textit{wu} takes largest negative values at the surface and increases towards zero at the top the boundary layer. This means, the flow is decelerated everywhere within the ABL due to surface friction. In the cube-flow, the \textit{wu} profile can be split into three regions:}
      \begin{itemize}
       {\scriptsize
         \item{z=40 to 80m: linear increase with height, i.e. the flow is decelerated in this part. Up to 65m, \textit{wu} is negative, i.e. the roughness of the cube top causes the deceleration. Above, \textit{wu} is positive, i.e. the flow is decelerated due to the no-slip boundary condition at the domain top.}
         \item{z=15 to 40m: decreasing with height, i.e. the flow is accelerated here, which can be attributed to the above-cube flow.}
         \item{z=0 to 15m: increasing with height, meaning flow deceleration, due to surface friction.}}
      \end{itemize}
   \end{itemize}
   \par\bigskip
   \scriptsize
   \textbf{Note: Such momentum flux profiles (\textit{wu}) are typical for urban and vegetation canopy flows.}
\end{frame}


% Folie 22
\begin{frame}
   \frametitle{Answer to question 3}
   \footnotesize
   \textbf{Is it really a fully developed large-eddy simulation?}
   \par\smallskip
   \scriptsize
   \begin{itemize}
      \item{Frame 14: Except near the surface and at the domain top, subgrid-scale momentum flux \textit{w``u''} is one order of magnitude smaller than the resolved-scale counterpart \textit{w*u*}, hence we can conclude, that the  grid spacing is sufficiently small in order to resolve the energy-containing eddies within this neutral flow around a solid cube.}
      \item{Frame 15: Timeseries of the kinetic energy \textit{E} and the maximum \textit{u} value in the flow indicate that two hours of simulation time are sufficient for the spin up of the model. Both quantities level out towards the end of the simulation.}
      \item{Frame 16: The temporal evolution of maximum \textit{v} and \textit{w} values indicates that the flow shows turbulent features, since both components frequently change signs.}
   \end{itemize}
\end{frame}

\end{document}
