<commit_before>\section{Computational Methods and Software}
\label{sec:software}

% \begin{itemize}
%  \item \st{discretized equations, finite elements, stabilized}
%  \item penalty formulation, also consider discussing sep model
%  \item \st{software (GRINS+Libmesh)}
%  \item \st{verification of software}
%  \item \st{tool-chain, simulation machine and hardware}
%  \item \st{simulation geometry and boundary conditions for wind/thermal-only}
% \end{itemize}

\subsection{Discretization Scheme}

To instantiate the Navier-Stokes equations on computer, we utilize a
Galerkin finite element discretization (FEM), with linear basis functions for
both the velocity and pressure. Unlike the typical FEM formulations,
this scheme circumvents the Babuska-Brezzi conditions and permits use of
equal-order elements for velocity and 
pressure through the introduction of a stabilization term first
introduced by Hughes\cite{Hughes198685} and expanded to a natural
convection domain (with sane choices of stabilization parameters) by
Becker and Braack\cite{Becker2002428}. 

Newton iterations are then used for solving the nonlinear problem. 
The resulting system of ODEs are discretized in time using a theta-method. 
The unsteady solver used is typically backward Euler for the corresponding
stability regardless of timestep size. 

\subsection{Penalty Method Implementation}
\todo{write me!}
Talk about penalty method here
cite babuska
cite immersed bounday methods?


\subsection{Simulation Geometry and Boundary Conditions}

%
% be sure to mention the 'sponge' layer. would also be nice to have
% references to papers on it! 
%


All simulations are perfomed in a cuboid domain, with 6 faces. We
utilize a uniform mesh in the lateral directions, and a non-uniform mesh
in height to resolve the boundary layer. The meshes are scaled by system
diameter. So the same number of grid points are used for every
simulation, with the total domain extents scaled up with system size. In
this way the ratio of the domain diameter to system diameter remains
fixed. Likewise, the diffusivities are proportionally scaled with grid
size in order to ensure that the cell Reynolds number is maintained for
every simulation. After operation, solutions are evaluated to ensure
that the qualitative character of the solution does not change. 


%
%explain how cell reynolds number is maintained for each grid
%

For the ``thermal-only'' case study (no mean wind), the simulation
utilizes periodic boundary conditions on the four sides, a modified
neumann condition on the top boundary, and dirichlet boundary conditions
on the bottom (the ground). These are shown schematically in Figure
\ref{fig:thermalbc}. On the ground, a ``no-slip'' velocity boundary
condition is imposed on the velocity field, and a dirichlet condition
uniformly fixes the temperature of the surface. 

The modified neumann condition is necessary due to the precence of both
inflow and outflow across the face. In the region approximately above
the vanes, the concentrated hot plume is lifted by buoyancy
upward and out of the simulation domain. However, the radial inflow
towards the apparatus is drawn in by large scale convection cells larger
than the system diameter. Thus, our boundary conditions must permit
inflow along the areas above and external to the vanes. To prevent the
problem being ill-posed, the ``v'' and ``u'' components of inflow
velocity are set to zero. 

Finally, a ``sponge layer'' is labeled near the top boundary. This layer
artificially increases the momentum diffusivity by ten times the nominal
value. This was designed in response to instabilities in the modified
neumann boundary condition that occured when small, high velocity fluid
parsels would exit the top. This would create high velocity inflows, and
the feedback loop would result in numerical blow-up. Mindful of the fact
that the character of solution not important in this region, and that
our physical interest remains focused on the region inside and
in immediate proximity to the vanes, we introduced a higher diffusivity
``sponge'' region that would diffuse the high velocity exiting jets
sufficiently to prevent numerically un-physical behavior. 

\begin{figure}[!htb]
  \begin{center}
    \includegraphics[width = 8 cm]{figs/thermal_only}
    \caption{Boundary conditions for the thermal-only scenario. }
    \label{fig:thermalbc}
  \end{center}
\end{figure}

The wind cases are diagrammed in figures \ref{fig:windstream} and
\ref{fig:windspan}. The wind case has a proscribed inlet boundary layer
for both the temperature profile as well as the velocity. The velocity
boundary layer is set to the common 7th power function for a
turbulent boundary layer,  
\begin{equation*}
  u_{in}(z) = U \text{ min }\left(\left(\frac{z}{\delta}\right)^7,1\right)
\end{equation*}
where $\delta$, the boundary layer thickness, is set based on data
measured by our experimental partners in the field. 
The thermal boundary layer is assumed to have a similar boundary layer,
but, as observed in real atmospheric flows, there remains a vertical
temperature gradient outside the thin boundary layer. Based on
literature a $2/3$ Kelvin per meter gradient has been
selected\cite{}. The sides, outflow and top are all set to modified
neumann boundary conditions, as described above. The outlfow region in
the back also needs the modified neumann as it does occassionally
exhibit mild inflow on account of the unsteady wake. Sponge layers are
set along the top and back of the box. 

%
%335+18*tanh(-z/0.1)-z*2/3
%
\begin{figure}[!htb]
  \begin{center}
    \includegraphics[width = 8 cm]{figs/wind_streamwise}
    \caption{Boundary conditions for the wind and thermal scenario, in
   the streamwise direction.} 
    \label{fig:windstream}
  \end{center}
\end{figure}

\begin{figure}[!htb]
  \begin{center}
    \includegraphics[width = 8 cm]{figs/wind_spanwise}
    \caption{Boundary conditions for the wind and thermal scenario, in
   the spanwise direction. } 
    \label{fig:windspan}
  \end{center}
\end{figure}


\subsection{Software}
<commit_msg>notes to write towards and editing<commit_after>\section{Computational Methods and Software}
\label{sec:software}

% \begin{itemize}
%  \item \st{discretized equations, finite elements, stabilized}
%  \item penalty formulation, also consider discussing sep model
%  \item \st{software (GRINS+Libmesh)}
%  \item \st{verification of software}
%  \item \st{tool-chain, simulation machine and hardware}
%  \item \st{simulation geometry and boundary conditions for wind/thermal-only}
% \end{itemize}

\subsection{Discretization Scheme}

To instantiate the Navier-Stokes equations on computer, we utilize a
Galerkin finite element discretization (FEM), with linear basis functions for
both the velocity and pressure. Unlike the typical FEM formulations,
this scheme circumvents the Babuska-Brezzi conditions and permits use of
equal-order elements for velocity and 
pressure. This is accomplished through the introduction of a
stabilization term first described by Hughes\cite{Hughes198685} and
expanded to a natural convection domain (with sane choices of
stabilization parameters) by Becker and Braack\cite{Becker2002428}. 

Newton iterations are then used for solving the nonlinear problem. 
The resulting system of ODEs are discretized in time using a theta-method. 
The unsteady solver used is typically backward Euler for the corresponding
stability regardless of timestep size. 

\subsection{Penalty Method Implementation}
\todo{write me!}
Talk about penalty method here
cite babuska
cite immersed bounday methods?


\subsection{Simulation Geometry and Boundary Conditions}

%
% be sure to mention the 'sponge' layer. would also be nice to have
% references to papers on it! 
%


All simulations are perfomed in a cuboid domain, with 6 faces. We
utilize a uniform mesh in the lateral directions, and a non-uniform mesh
in height to resolve the boundary layer. The meshes are scaled by system
diameter. So the same number of grid points are used for every
simulation, with the total domain extents scaled up with system size. In
this way the ratio of the domain diameter to system diameter remains
fixed. Likewise, the diffusivities are proportionally scaled with grid
size in order to ensure that the cell Reynolds number is maintained for
every simulation. After operation, solutions are evaluated to ensure
that the qualitative character of the solution does not change. 


%
%explain how cell reynolds number is maintained for each grid
%

For the ``thermal-only'' case study (no mean wind), the simulation
utilizes periodic boundary conditions on the four sides, a modified
neumann condition on the top boundary, and dirichlet boundary conditions
on the bottom (the ground). These are shown schematically in Figure
\ref{fig:thermalbc}. On the ground, a ``no-slip'' velocity boundary
condition is imposed on the velocity field, and a dirichlet condition
uniformly fixes the temperature of the surface. 

The modified neumann condition is necessary due to the precence of both
inflow and outflow across the face. In the region approximately above
the vanes, the concentrated hot plume is lifted by buoyancy
upward and out of the simulation domain. However, the radial inflow
towards the apparatus is drawn in by large scale convection cells larger
than the system diameter. Thus, our boundary conditions must permit
inflow along the areas above and external to the vanes. To prevent the
problem being ill-posed, the ``v'' and ``u'' components of inflow
velocity are set to zero. 

Finally, a ``sponge layer'' is labeled near the top boundary. This layer
artificially increases the momentum diffusivity by ten times the nominal
value. This was designed in response to instabilities in the modified
neumann boundary condition that occured when small, high velocity fluid
parsels would exit the top. This would create high velocity inflows, and
the feedback loop would result in numerical blow-up. Mindful of the fact
that the character of solution not important in this region, and that
our physical interest remains focused on the region inside and
in immediate proximity to the vanes, we introduced a higher diffusivity
``sponge'' region that would diffuse the high velocity exiting jets
sufficiently to prevent numerically un-physical behavior. 

\begin{figure}[!htb]
  \begin{center}
    \includegraphics[width = 8 cm]{figs/thermal_only}
    \caption{Boundary conditions for the thermal-only scenario. }
    \label{fig:thermalbc}
  \end{center}
\end{figure}

The wind cases are diagrammed in figures \ref{fig:windstream} and
\ref{fig:windspan}. The wind case has a proscribed inlet boundary layer
for both the temperature profile as well as the velocity. The velocity
boundary layer is set to the common 7th power function for a
turbulent boundary layer,  
\begin{equation*}
  u_{in}(z) = U \text{ min }\left(\left(\frac{z}{\delta}\right)^7,1\right)
\end{equation*}
where $\delta$, the boundary layer thickness, is set based on data
measured by our experimental partners in the field. 
The thermal boundary layer is assumed to have a similar boundary layer,
but, as observed in real atmospheric flows, there remains a vertical
temperature gradient outside the thin boundary layer. Based on
literature a $2/3$ Kelvin per meter gradient has been
selected\cite{}. The sides, outflow and top are all set to modified
neumann boundary conditions, as described above. The outflow region in
the back also needs the modified neumann as it does occassionally
exhibit mild inflow on account of the unsteady wake. Sponge layers are
set along the top and back of the box. 

%
%335+18*tanh(-z/0.1)-z*2/3
%
\begin{figure}[!htb]
  \begin{center}
    \includegraphics[width = 8 cm]{figs/wind_streamwise}
    \caption{Boundary conditions for the wind and thermal scenario, in
   the streamwise direction.} 
    \label{fig:windstream}
  \end{center}
\end{figure}

\begin{figure}[!htb]
  \begin{center}
    \includegraphics[width = 8 cm]{figs/wind_spanwise}
    \caption{Boundary conditions for the wind and thermal scenario, in
   the spanwise direction. } 
    \label{fig:windspan}
  \end{center}
\end{figure}


\subsection{Software}

{'fraction_non_alphanumeric': 0.05795081967213115, 'fraction_numerical': 0.005081967213114754, 'mean_word_length': 4.749764373232799, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6418926', 'n_tokens_mistral': 3308, 'n_tokens_neox': 3106, 'n_words': 1644}