<commit_before>%        File: model_problems.tex
%
\documentclass[letterpaper,12pt]{article}
\usepackage[top=1.0in,bottom=1.0in,left=1.25in,right=1.25in]{geometry}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{tmadd,tmath}
\usepackage[mathcal]{euscript}
\usepackage[usenames]{color}
\usepackage[
naturalnames = true, 
colorlinks = true, 
linkcolor = black,
anchorcolor = black,
citecolor = black,
menucolor = black,
urlcolor = blue
]{hyperref}

%%---------------------------------------------------------------------------%%
\author{<NAME>
\\ \href{mailto:<EMAIL>}{\texttt{<EMAIL>}}
}

\date{\today}
\title{A Finite Volume Formulation for the 2D Incompressible
  Navier-Stokes and Conduction Equations}
\begin{document}
\maketitle

%%---------------------------------------------------------------------------%%
\section{Computational Domain}

%%---------------------------------------------------------------------------%%
\section{Conduction Equation}
We begin the derivation of the conduction equation by defining the
conserved quantity, energy, in terms of temperature:

\begin{equation}
  E(x,y,t) = C_p(x,y) T(x,y,t)\:,
  \label{eq:conduction_energy}
\end{equation}

where $C_P$ is the specific heat capacity of the material. We also
define the heat flux, $F$, in terms of temperature using Fick's law:

\begin{equation}
  F(T(x,y,t)) = -\beta(x,y) \nabla T(x,y,t)\:,
  \label{eq:conduction_ficks_law}
\end{equation}

where $\beta$ is the thermal conductivity of the material. With these
two relations in hand, we can then write a conservation law for energy
\cite{leveque_2002}:

\begin{equation}
  \frac{d}{dt} \iint_{C_{ij}} E(x,y,t) dx dy = -F(T(x,y,t)) |_{B_{ij}}\:.
  \label{eq:conduction_conservation}
\end{equation}

Here we balance the time rate of change in energy in the unit cell
with the flux on the cell boundaries. Inserting
Eq.~(\ref{eq:conduction_energy}) into
Eq.~(\ref{eq:conduction_conservation}) and dividing by the cell volume
recovers the cell averaged temperature and specific heat on the left
hand side:

\begin{equation}
  \frac{d}{dt} C_{P_{ij}} T_{ij} = -\frac{1}{\Delta_i
    \Delta_j}F(T(x,y,t)) |_{B_{ij}}\:.
  \label{eq:conduction_cell_averaged}
\end{equation}

We then insert Eq.~(\ref{eq:conduction_ficks_law}), difference the
left hand side, and integrate, maintaining the conservation properties
of the system:

\begin{multline}
  C_{P_{ij}} ( T^{n+1}_{ij} - T^n_{ij} ) = \frac{1}{\Delta_i \Delta_j}
  \int_{t^n}^{t^{n+1}} [ -\beta_{i-1/2,j} \nabla T_{i-1/2,j}\\
    + \beta_{i+1/2,j} \nabla T_{i+1/2,j} - \beta_{i,j-1/2} \nabla
    T_{i,j-1/2} +\beta_{i,j+1/2} \nabla T_{i,j+1/2} ] dt\:.
  \label{eq:conduction_time_integral}
\end{multline}

We choose to approximate the integral on the right hand side and use a
first order central difference for the derivative in the heat flux
terms giving a backwards Euler representation for the time
integration:

\begin{multline}
  C_{P_{ij}}( T^{n+1}_{ij} - T^n_{ij} ) = \frac{\Delta_t}{\Delta_i
    \Delta_j} -\beta_{i-1/2,j} \frac{T^{n+1}_{ij}
    -T^{n+1}_{i-1,j}}{\Delta_i} +\beta_{i+1/2,j} \frac{T^{n+1}_{i+1,j}
    -T^{n+1}_{ij}}{\Delta_i}\\
  -\beta_{i,j-1/2} \frac{T^{n+1}_{ij}
    -T^{n+1}_{i,j-1}}{\Delta_j} +\beta_{i,j+1/2} \frac{T^{n+1}_{i,j+1}
    -T^{n+1}_{i,j}}{\Delta_j}\:.
  \label{eq:conduction_fv_multline}
\end{multline}

We will define $\alpha$ as:

\begin{equation}
  \alpha_{ij} = \frac{\Delta_t}{C_{P_{ij}} \Delta_i \Delta_j}\:.
  \label{eq:conduction_coeff}
\end{equation}

Rearranging for temperature, we can then form a system of equations
amenable to matrix solutions, not yet considering boundary conditions:

\begin{multline}
 \Big[1 + \frac{\alpha_{ij}}{\Delta_i}(\beta_{i-1/2,j} +
   \beta_{i+1/2,j} + \beta_{i,j-1/2} + \beta_{i,j+1/2})\Big]
 T^{n+1}_{ij} \\
 + \Big[-\frac{\alpha_{ij}}{\Delta_i}
   \beta_{i-1/2,j}\Big] T^{n+1}_{i-1,j}
 + \Big[-\frac{\alpha_{ij}}{\Delta_i} \beta_{i+1/2,j}\Big]
 T^{n+1}_{i+1,j} \\
 + \Big[-\frac{\alpha_{ij}}{\Delta_j}
   \beta_{i,j-1/2}\Big] T^{n+1}_{i,j-1} +
 \Big[-\frac{\alpha_{ij}}{\Delta_j} \beta_{i,j+1/2}\Big]
 T^{n+1}_{i,j+1} = T^n_{ij}\:.
 \label{eq:conduction_inner_terms}
\end{multline}

Finally, we consider cell-centered thermal conductivity values as a
single material occupies an entire cell:

\begin{equation}
  \beta_{i-1/2,j} = \frac{\beta_{ij}+\beta_{i-1,j}}{2}
  \label{eq:conduction_conductivity}
\end{equation}

Applying Eq.~(\ref{eq:conduction_conductivity}), we arrive at the discrete,
time-dependent conduction equation:

\begin{multline}
 \Big[1 + \frac{\alpha_{ij}}{2\Delta_i}(\beta_{i-1,j} +
   \beta_{i+1,j} + 4 \beta_{i,j} + \beta_{i,j-1} + \beta_{i,j+1})\Big]
 T^{n+1}_{ij} \\
 + \Big[-\frac{\alpha_{ij}}{2 \Delta_i}
   (\beta_{i-1,j}+\beta_{ij})\Big] T^{n+1}_{i-1,j}
 + \Big[-\frac{\alpha_{ij}}{2 \Delta_i}(\beta_{ij}+\beta_{i+1,j})\Big]
 T^{n+1}_{i+1,j} \\
 + \Big[-\frac{\alpha_{ij}}{2 \Delta_j}
   (\beta_{i,j-1}+\beta_{ij})\Big] T^{n+1}_{i,j-1} +
 \Big[-\frac{\alpha_{ij}}{2 \Delta_j}(\beta_{ij}+\beta_{i,j+1})\Big]
 T^{n+1}_{i,j+1} = T^n_{ij}\:.
 \label{eq:conduction_discrete_equation}
\end{multline}


\subsection{Boundary Conditions}

We will consider both Neumann and Dirichlet type boundary conditions
for the conduction equation. For the Neumann condition we have a
constant temperature at the boundary:

\begin{equation}
  T_{ij} = T_0, \forall (i,j) \in \Gamma
  \label{eq:conduction_neumann}
\end{equation}

For the Dirichlet condition, we have a constant heat flux at the boundary.

\subsection{Linear System Form}

%%---------------------------------------------------------------------------%%
\section{Incompressible Navier-Stokes Equations}

\subsection{Boundary Conditions}

\subsection{Nonlinear System Form}

%%---------------------------------------------------------------------------%%
\pagebreak
\bibliographystyle{ieeetr} \bibliography{references}
\end{document}


<commit_msg>fixed equation in model problem doc<commit_after>%        File: model_problems.tex
%
\documentclass[letterpaper,12pt]{article}
\usepackage[top=1.0in,bottom=1.0in,left=1.25in,right=1.25in]{geometry}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{tmadd,tmath}
\usepackage[mathcal]{euscript}
\usepackage[usenames]{color}
\usepackage[
naturalnames = true, 
colorlinks = true, 
linkcolor = black,
anchorcolor = black,
citecolor = black,
menucolor = black,
urlcolor = blue
]{hyperref}

%%---------------------------------------------------------------------------%%
\author{<NAME>
\\ \href{mailto:<EMAIL>}{\texttt{<EMAIL>}}
}

\date{\today}
\title{A Finite Volume Formulation for the 2D Incompressible
  Navier-Stokes and Conduction Equations}
\begin{document}
\maketitle

%%---------------------------------------------------------------------------%%
\section{Computational Domain}

%%---------------------------------------------------------------------------%%
\section{Conduction Equation}
We begin the derivation of the conduction equation by defining the
conserved quantity, energy, in terms of temperature:

\begin{equation}
  E(x,y,t) = C_p(x,y) T(x,y,t)\:,
  \label{eq:conduction_energy}
\end{equation}

where $C_P$ is the specific heat capacity of the material. We also
define the heat flux, $F$, in terms of temperature using Fick's law:

\begin{equation}
  F(T(x,y,t)) = -\beta(x,y) \nabla T(x,y,t)\:,
  \label{eq:conduction_ficks_law}
\end{equation}

where $\beta$ is the thermal conductivity of the material. With these
two relations in hand, we can then write a conservation law for energy
\cite{leveque_2002}:

\begin{equation}
  \frac{d}{dt} \iint_{C_{ij}} E(x,y,t) dx dy = -F(T(x,y,t)) |_{B_{ij}}\:.
  \label{eq:conduction_conservation}
\end{equation}

Here we balance the time rate of change in energy in the unit cell
with the flux on the cell boundaries. Inserting
Eq.~(\ref{eq:conduction_energy}) into
Eq.~(\ref{eq:conduction_conservation}) and dividing by the cell volume
recovers the cell averaged temperature and specific heat on the left
hand side:

\begin{equation}
  \frac{d}{dt} C_{P_{ij}} T_{ij} = -\frac{1}{\Delta_i
    \Delta_j}F(T(x,y,t)) |_{B_{ij}}\:.
  \label{eq:conduction_cell_averaged}
\end{equation}

We then insert Eq.~(\ref{eq:conduction_ficks_law}), difference the
left hand side, and integrate, maintaining the conservation properties
of the system:

\begin{multline}
  C_{P_{ij}} ( T^{n+1}_{ij} - T^n_{ij} ) = \frac{1}{\Delta_i \Delta_j}
  \int_{t^n}^{t^{n+1}} [ -\beta_{i-1/2,j} \nabla T_{i-1/2,j}\\
    + \beta_{i+1/2,j} \nabla T_{i+1/2,j} - \beta_{i,j-1/2} \nabla
    T_{i,j-1/2} +\beta_{i,j+1/2} \nabla T_{i,j+1/2} ] dt\:.
  \label{eq:conduction_time_integral}
\end{multline}

We choose to approximate the integral on the right hand side and use a
first order central difference for the derivative in the heat flux
terms giving a backwards Euler representation for the time
integration:

\begin{multline}
  C_{P_{ij}}( T^{n+1}_{ij} - T^n_{ij} ) = \frac{\Delta_t}{\Delta_i
    \Delta_j} -\beta_{i-1/2,j} \frac{T^{n+1}_{ij}
    -T^{n+1}_{i-1,j}}{\Delta_i} +\beta_{i+1/2,j} \frac{T^{n+1}_{i+1,j}
    -T^{n+1}_{ij}}{\Delta_i}\\
  -\beta_{i,j-1/2} \frac{T^{n+1}_{ij}
    -T^{n+1}_{i,j-1}}{\Delta_j} +\beta_{i,j+1/2} \frac{T^{n+1}_{i,j+1}
    -T^{n+1}_{i,j}}{\Delta_j}\:.
  \label{eq:conduction_fv_multline}
\end{multline}

We will define $\alpha$ as:

\begin{equation}
  \alpha_{ij} = \frac{\Delta_t}{C_{P_{ij}} \Delta_i \Delta_j}\:.
  \label{eq:conduction_coeff}
\end{equation}

Rearranging for temperature, we can then form a system of equations
amenable to matrix solutions, not yet considering boundary conditions:

\begin{multline}
 \Big[1 + \frac{\alpha_{ij}}{\Delta_i}(\beta_{i-1/2,j} +
   \beta_{i+1/2,j} + \beta_{i,j-1/2} + \beta_{i,j+1/2})\Big]
 T^{n+1}_{ij} \\
 + \Big[-\frac{\alpha_{ij}}{\Delta_i}
   \beta_{i-1/2,j}\Big] T^{n+1}_{i-1,j}
 + \Big[-\frac{\alpha_{ij}}{\Delta_i} \beta_{i+1/2,j}\Big]
 T^{n+1}_{i+1,j} \\
 + \Big[-\frac{\alpha_{ij}}{\Delta_j}
   \beta_{i,j-1/2}\Big] T^{n+1}_{i,j-1} +
 \Big[-\frac{\alpha_{ij}}{\Delta_j} \beta_{i,j+1/2}\Big]
 T^{n+1}_{i,j+1} = T^n_{ij}\:.
 \label{eq:conduction_inner_terms}
\end{multline}

Finally, we consider cell-centered thermal conductivity values as a
single material occupies an entire cell:

\begin{equation}
  \beta_{i-1/2,j} = \frac{\beta_{ij}+\beta_{i-1,j}}{2}\:.
  \label{eq:conduction_conductivity}
\end{equation}

Applying Eq.~(\ref{eq:conduction_conductivity}), we arrive at the discrete,
time-dependent conduction equation:

\begin{multline}
 \Big[1 + \frac{\alpha_{ij}}{2\Delta_i}(\beta_{i-1,j} +
   \beta_{i+1,j} + 4 \beta_{i,j} + \beta_{i,j-1} + \beta_{i,j+1})\Big]
 T^{n+1}_{ij} \\
 + \Big[-\frac{\alpha_{ij}}{2 \Delta_i}
   (\beta_{i-1,j}+\beta_{ij})\Big] T^{n+1}_{i-1,j}
 + \Big[-\frac{\alpha_{ij}}{2 \Delta_i}(\beta_{ij}+\beta_{i+1,j})\Big]
 T^{n+1}_{i+1,j} \\
 + \Big[-\frac{\alpha_{ij}}{2 \Delta_j}
   (\beta_{i,j-1}+\beta_{ij})\Big] T^{n+1}_{i,j-1} +
 \Big[-\frac{\alpha_{ij}}{2 \Delta_j}(\beta_{ij}+\beta_{i,j+1})\Big]
 T^{n+1}_{i,j+1} = T^n_{ij}\:.
 \label{eq:conduction_discrete_equation}
\end{multline}


\subsection{Boundary Conditions}

We will consider both Neumann and Dirichlet type boundary conditions
for the conduction equation. For the Neumann condition we have a
constant temperature at the boundary:

\begin{equation}
  T_{ij} = T_0, \forall (i,j) \in \Gamma
  \label{eq:conduction_neumann}
\end{equation}

For the Dirichlet condition, we have a constant heat flux at the boundary.

\subsection{Linear System Form}

%%---------------------------------------------------------------------------%%
\section{Incompressible Navier-Stokes Equations}

\subsection{Boundary Conditions}

\subsection{Nonlinear System Form}

%%---------------------------------------------------------------------------%%
\pagebreak
\bibliographystyle{ieeetr} \bibliography{references}
\end{document}



{'fraction_non_alphanumeric': 0.247528043207312, 'fraction_numerical': 0.018778562525965933, 'mean_word_length': 3.4347826086956523, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4424351', 'n_tokens_mistral': 4662, 'n_tokens_neox': 4487, 'n_words': 935}