My proposal for the test kernel.
Jeffrey Oldham
oldham at codesourcery.com
Tue Mar 27 01:42:25 UTC 2001
Attached are the algorithmic outline I wrote for myself as I read the
paper. Skip over Section 1 to Secton 2.
I guess the Section 2 algorithm is more complicated because you
suggest using only one (or a small constant) predictor steps so the
cells do not change shape.. Is this the correct interpretation of
The corner forces going into the velocity update and the energy update
are all calculated based upon the initial geometry of the test
problem. (One might consider using the velocity update to update the
coordinates which would have then updated all the cell volumes and
face areas, density etc.---fortunately this complexity is not in the
model.)
?
Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
Attached (all the same material but in different formats):
1. PDF file
2. PostScript file
3. LaTeX file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hydrodynamics-outline.pdf
Type: application/pdf
Size: 39300 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/pooma-dev/attachments/20010326/f8ed249a/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hydrodynamics-outline.ps
Type: application/postscript
Size: 84528 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/pooma-dev/attachments/20010326/f8ed249a/attachment.ps>
-------------- next part --------------
%%% Oldham, Jeffrey D.
%%% 2001Mar22
%%% Pooma
%%%
%%% Outline of Hydrodynamics Algorithm
\documentclass[12pt]{article}
%\usepackage{vmargin}
%\setpapersize{USletter}
%\setmarg{0.75in}{0.5in}{7.0in}{9.0in}
%\usepackage{tabularx}
\usepackage{amsmath}
\renewcommand{\thefootnote}{\arabic{footnote}} % Permits good HTML footnotes.
%\usepackage{times} % for PDF only
\usepackage[english]{babel}
\selectlanguage{english}
%% Definitions and Declarations
\newcommand{\assign}{\ensuremath{\leftarrow}}
% Produces an assignment symbol.
% Requires no parameters.
\newcommand{\coordinate}[1]{\ensuremath{\vec{r}_{#1}}}
% Produces a coordinate position.
% Requires: 1. the subscript
\newcommand{\cornerMass}[2]{\ensuremath{m^{#1}_{#2}}}%
% Produces a corner mass.
% Requires: 1. the superscript
% 2. the subscript
\newcommand{\density}[1]{\ensuremath{\rho_{#1}}}
% Produces a notation of density.
% Requires: 1. the subscript
\newcommand{\deriv}[3]{\ensuremath{\frac{#1 #2}{#1 #3}}}%
% Produces a derivative.
% Requires: 1. the derivative symbol, e.g., d
% 2. the term of which to take derivative
% 3. the variable for the derivative
\newcommand{\energy}[1]{\ensuremath{E_{#1}}}
% Produces an energy.
% Requires: 1. the subscript
\newcommand{\force}[2]{\ensuremath{\vec{f}^{#1}_{#2}}}%
% Produces a corner force.
% Requires: 1. the superscript
% 2. the subscript
\newcommand{\intEnergy}[1]{\ensuremath{e_{#1}}}
% Produces a specific internal energy.
% Requires: 1. the subscript
\newcommand{\mass}[1]{\ensuremath{M_{#1}}}
% Produces a mass.
% Requires: 1. the subscript
\newcommand{\normal}[1]{\ensuremath{\vec{a}_{#1}}}
% Produces a notation for a normal vector.
% Requires: 1. a subscript
\newcommand{\point}{\ensuremath{p}}
% Produces a point.
% Requires no parameters.
\newcommand{\pressure}[1]{\ensuremath{P_{#1}}}
% Produces a pressure.
% Requires: 1. an optional subscript
\newcommand{\tim}{\ensuremath{t}}
% Produces a time.
% Requires no parameters.
\newcommand{\timeStep}{\ensuremath{n}}
% Produces a notation for a timestep.
% Requires no parameters.
\newcommand{\velocity}[1]{\ensuremath{\vec{v}_{#1}}}
% Produces a velocity.
% Requires: 1. an optional subscript
\newcommand{\volume}[1]{\ensuremath{V_{#1}}}
% Produces a volume.
% Requires: 1. an optional subscript
\newcommand{\zone}{\ensuremath{z}}
% Produces a zone.
% Requires no parameters.
\begin{document}
\title{Outline of Hydrodynamics Algorithm}
\author{Jeffrey~D. Oldham}
\date{2001 Mar~26}
\maketitle
\section{Equations}
\subsection{Momentum Equations}
\paragraph{integral and corner force form}
\begin{equation}
\mass{\point} \deriv{d}{\velocity{\point}}{\tim} =
- \int_{\volume{\point}} \vec{\nabla} \pressure{} d\volume{} = - \oint_b
\pressure{} d\vec{S} = \sum_{\zone} \force{\point}{\zone} \equiv
\vec{F}_{\point}
\tag{7}
\end{equation}
\paragraph{discrete form}
\begin{equation}
\mass{\point} \Delta \velocity{\point}
= \sum_{\zone} \force{\point,\sigma}{\zone} \Delta \tim
\tag{17}
\end{equation}
\subsection{Specific Internal Energy Equations}
\paragraph{corner force form}
\begin{equation}
\mass{z} \deriv{d}{\intEnergy{\zone}}{\tim} =
- \sum_{\point} \force{\zone}{\point} \cdot \velocity{\point}
\tag{12}
\end{equation}
\paragraph{coordinate form}
\begin{equation}
\mass{z} \deriv{d}{\intEnergy{\zone}}{\tim} =
- \pressure{\zone}
\left(
(\normal{8} + \normal{1}) \cdot \velocity{1} +
(\normal{2} + \normal{3}) \cdot \velocity{2} +
(\normal{4} + \normal{5}) \cdot \velocity{3} +
(\normal{6} + \normal{7}) \cdot \velocity{4}
\right)
\tag{13}
\end{equation}
\paragraph{discrete form}
\begin{equation}
\Delta \intEnergy{\zone} =
-\sum_{\point}
\force{\zone,\sigma}{\point} \cdot \velocity{\point}^{n+1/2}
\Delta \tim / \mass{\zone}
\tag{20}
\end{equation}
\subsection{Energy Equations}
\paragraph{time-dependent form}
\begin{equation}
\energy{T}(\tim) =
\energy{T}(0) + \sum_{m = 1\ldots n} \Delta \tim_m
\sum_i \force{\sigma}{bd,i} \cdot \velocity{bd,i}^{m+1/2}
\tag{15}
\end{equation}
\section{Algorithm}
\subsection{Don Marshall's Memo}
\label{don-marshall-section}
\begin{itemize}
\item Use $xy$-Cartesian geometry.
\item The mesh will have five radial lines in $\pi/2$ radians, i.e.,
four cells in the angular direction. Use ten equally spaced radial
shells with an outermost radius of~1.0.
\item For the pressure~\pressure{}, use gamma law (ideal gas) equation
of state
\[ \pressure{} = (\gamma - 1) \density{} \intEnergy{}. \]
$\gamma$ is a constant, e.g., $5/3$ or $4/3$.
\item initial $\intEnergy{\zone} = 1$
\item initial $\density{\zone} = 1$
\item initial $\velocity{\point} = \vec{0}$
\item Use a predictor corrector method.
\end{itemize}
\subsection{Mesh Values}
\begin{center}
\begin{tabular}{r|l}
value & location \\ \hline
corner force \force{\zone}{\point} & point \\
corner mass \cornerMass{\zone}{\point} & point \\
coordinate positions \coordinate{\point}& point \\
density \density{\zone} & zone \\
internal energy \intEnergy{\zone} & zone \\
mass \mass{\zone} & zone \\
pressure \pressure{\zone} & zone \\
velocity \velocity{\point} & point \\
\end{tabular}
\end{center}
Initially, $\cornerMass{\zone}{\point} = \density{\zone} *
\text{corner volume}$.
\subsection{Constants}
\begin{itemize}
\item $\gamma$, e.g., $4/3$ or $5/3$
\item mass $\mass{\zone} = \sum_{\point} \cornerMass{\zone}{\point}$,
where $\cornerMass{\zone}{\point} = \density{\zone} * \text{corner
volume}$.
\item timestep $\Delta \tim = 0.01$, divided by two for predictor and
corrector phases
\end{itemize}
\subsection{Boundary Conditions}
Use a velocity of $\vec{0}$ for all cell vertices at the origin.
Velocity vectors along axes should have zero normal components. (I
should use a Pooma ?`enforce?\ condition. John Hall knows more about
this.)
\subsection{What An Iteration Impacts}
The algorithm consists of a series of iterations, one for each time
period. We number each time period, e.g.,~\timeStep. Each iteration
takes a set of values as input and performs some computations,
changing some values.
\begin{center}
\begin{tabular}{r|ccc}
values & predictor & corrector & output \\ \hline
coordinate positions \coordinate{\point}& \timeStep & $\timeStep +1/2$ & y \\
density \density{\zone} & \timeStep & $\timeStep + 1$ & y \\
internal energy \intEnergy{\zone} & \timeStep & $\timeStep + 1$ & y \\
mass \mass{\zone} & constant & constant & n \\
constant timestep $\Delta \tim$ & 0.005 & 0.005 & n \\
velocity \velocity{\point} & \timeStep & $\timeStep + 1$ & y \\
\end{tabular}
\end{center}
Both the predictor and corrector iterations have the same form, but
they use input values from different iterations. These are listed in
the above table. The ``output'' column has a ``y'' if an iteration
changes the corresponding value.
The Marshalls say to use only the predictor iterations, not the
corrector iterations.
\subsection{Preparation Before Beginning the Iterations}
Before starting the iterations, initial values for the input values
must be computed.
\begin{enumerate}
\item Compute the coordinate positions~\coordinate{\point}. Use the
mesh description listed in Section~\ref{don-marshall-section}.
\item Use an initial internal energy~\intEnergy{\zone}\ of one.
\item Use an initial pressure density~\density{\zone}\ of one.
\item The initial masses~\mass{\zone}\ can be computed using the
density~\density{\zone}\ and the initial volume.
\begin{gather}
\mass{\zone} = \density{\zone} \volume{\zone} \\
\volume{\zone} =
\frac{1}{2} \left( (r_2 - r_4)(z_3 - z_1) + (r_1 - r_3)(z_2 - z_4) \right)
\tag{56}
\end{gather}
\item The timestep $\Delta \tim$ is a constant.
\item Use an arbitrary initial velocity~\velocity{\point}, e.g., zero.
\end{enumerate}
\subsection{An Iteration}
The steps of an iteration include:
\begin{enumerate}
\item Compute zone pressures~\pressure{\zone}.
\begin{equation*}
\pressure{\zone} = (\gamma - 1) \density{\zone} \intEnergy{\zone}
\end{equation*}
\item Compute the outward normals.
\begin{equation}
\normal{2i-1} = \normal{2i} =
\frac{1}{2} (z_{i+1} - z_{i}) \hat{r} -
\frac{1}{2} (r_{i+1} - r_{i}) \hat{z}
\tag{60}
\end{equation}
where the coordinate subscripts $i = 1, \ldots, 4$ are computed modulo~4.
\item Compute the corner forces.
\begin{eqnarray*}
\force{1}{\zone} & = & \pressure{\zone} (\normal{8} + \normal{1}) \\
\force{2}{\zone} & = & \pressure{\zone} (\normal{2} + \normal{3}) \\
\force{3}{\zone} & = & \pressure{\zone} (\normal{4} + \normal{5}) \\
\force{4}{\zone} & = & \pressure{\zone} (\normal{6} + \normal{7}), \\
\end{eqnarray*}
using the notation of Fig.~1.
\item Change velocity using Eq.~(17).
\begin{equation}
\Delta \velocity{\point}
= \frac{\Delta \tim}{\mass{\point}}
\sum_{\zone} \force{\point,\sigma}{\zone}
\tag{$17'$}
\end{equation}
Thus, one has $\velocity{\point}^{n}$ and $\velocity{\point}^{n+1}$.
\item Change the specific internal energy using Eq.~(20).
\begin{gather}
\Delta \intEnergy{\zone} =
- \frac{\Delta \tim}{\mass{\zone}} \sum_{\point}
\force{\zone,\sigma}{\point} \cdot \velocity{\point}^{n+1/2}
\tag{$20'$} \\
\velocity{\point}^{n+1/2} =
(\velocity{\point}^{n} + \velocity{\point}^{n+1})/2 \notag
\end{gather}
\item Change coordinates.
\begin{equation*}
\coordinate{\point} \assign
\coordinate{\point} + \velocity{\point}^{n+1/2} \Delta \tim
\end{equation*}
\item Update volume.
\begin{equation}
\volume{\zone} =
\frac{1}{2} \left( (r_2 - r_4)(z_3 - z_1) + (r_1 - r_3)(z_2 - z_4) \right)
\tag{56}
\end{equation}
\item Update density.
\begin{equation*}
\density{\zone}(\tim) = \mass{\zone} / \volume{\zone}(\tim)
\end{equation*}
\end{enumerate}
\subsection{Termination}
For the kernel, we will just run the algorithm for a fixed number of
iterations, e.g., 1 or 2 or~3.
\end{document}
More information about the pooma-dev
mailing list