\documentclass{article}

\newlength{\tableWidth} \newlength{\maxVarWidth} \newlength{\paraWidth} \newlength{\descWidth} \begin{document}

\title{EOS\_Polytrope}
\author{Ian Hawke}
\date{22/4/2002}
\maketitle

% Do not delete next line
% START CACTUS THORNGUIDE

\abstract{EOS\_Polytrope} 

\section{The equations}
\label{sec:eqn}

This equation provides a polytropic equation of state to thorns using
the CactusEOS interface found in EOS\_Base. As such it's a fake, as
EOS\_Base assumes that, e.g., the pressure is a function of both
density and specific internal energy. Here the pressure is just a
function of the density, and is set appropriately (the specific
internal energy is always ignored).

The two fluid constants are $K$ ({\tt eos\_k}) and $\Gamma$ ({\tt
  eos\_gamma}), which default to 100 and 2 respectively. The formulas
that are applied under the appropriate EOS\_Base function calls are

\begin{eqnarray}
  \label{eq:eosformulas}
  P & = & K \rho^{\Gamma} \\
  \epsilon & = & \frac{K \rho^{\Gamma-1}}{\Gamma - 1} \\
  \rho & = & \frac{P}{(\Gamma - 1) \epsilon} \\
  \frac{\partial P}{\partial \rho} & = & K \Gamma \rho^{\Gamma-1} \\
  \frac{\partial P}{\partial \epsilon} & = & 0.
\end{eqnarray}

To calculate the units of the Cactus quantities and back, remember that
$G=c=M_{\odot}=1$ in Cactus.\\
Here is one example how to calculate densities:
\begin{equation}
 \rho_{\mbox{\tiny Cactus}}=\frac{G^3M_{\odot}^2}{c^6}\cdot \rho
 \approx1.6167\cdot10^{-21}\frac{\mbox{m}^3}{\mbox{kg}}\cdot\rho=
        1.6167\cdot10^{-18}\frac{\mbox{cm}^3}{\mbox{g}}\cdot\rho
\end{equation}
and one example for calculating $K$ (for $\Gamma=2$):
\begin{equation}
 K_{\mbox{\tiny Cactus}}=\frac{c^4}{G^3M_{\odot}^2}\cdot K
 \approx6.8824\cdot10^{-11}\frac{\mbox{m}^5}{\mbox{kg}\cdot\mbox{s}^2}\cdot K=
        6.8824\cdot10^{-4}\frac{\mbox{cm}^5}{\mbox{g}\cdot\mbox{s}^2}\cdot K
\end{equation}

% Do not delete next line
% END CACTUS THORNGUIDE



\section{Parameters} 


\parskip = 0pt

\setlength{\tableWidth}{160mm}

\setlength{\paraWidth}{\tableWidth}
\setlength{\descWidth}{\tableWidth}
\settowidth{\maxVarWidth}{eos\_gamma}

\addtolength{\paraWidth}{-\maxVarWidth}
\addtolength{\paraWidth}{-\columnsep}
\addtolength{\paraWidth}{-\columnsep}
\addtolength{\paraWidth}{-\columnsep}

\addtolength{\descWidth}{-\columnsep}
\addtolength{\descWidth}{-\columnsep}
\addtolength{\descWidth}{-\columnsep}
\noindent \begin{tabular*}{\tableWidth}{|c|l@{\extracolsep{\fill}}r|}
\hline
\multicolumn{1}{|p{\maxVarWidth}}{eos\_gamma} & {\bf Scope:} restricted & REAL \\\hline
\multicolumn{3}{|p{\descWidth}|}{{\bf Description:}   {\em Adiabatic Index for Ideal Fluid}} \\
\hline{\bf Range} & &  {\bf Default:} 2.0 \\\multicolumn{1}{|p{\maxVarWidth}|}{\centering :} & \multicolumn{2}{p{\paraWidth}|}{} \\\hline
\end{tabular*}

\vspace{0.5cm}\noindent \begin{tabular*}{\tableWidth}{|c|l@{\extracolsep{\fill}}r|}
\hline
\multicolumn{1}{|p{\maxVarWidth}}{eos\_k} & {\bf Scope:} restricted & REAL \\\hline
\multicolumn{3}{|p{\descWidth}|}{{\bf Description:}   {\em Polytropic constant}} \\
\hline{\bf Range} & &  {\bf Default:} 80.0 \\\multicolumn{1}{|p{\maxVarWidth}|}{\centering :} & \multicolumn{2}{p{\paraWidth}|}{} \\\hline
\end{tabular*}

\vspace{0.5cm}\noindent \begin{tabular*}{\tableWidth}{|c|l@{\extracolsep{\fill}}r|}
\hline
\multicolumn{1}{|p{\maxVarWidth}}{gamma\_ini} & {\bf Scope:} restricted & REAL \\\hline
\multicolumn{3}{|p{\descWidth}|}{{\bf Description:}   {\em Polytropic Gamma used for the initial model (e.g., by RNSID)}} \\
\hline{\bf Range} & &  {\bf Default:} 2.0 \\\multicolumn{1}{|p{\maxVarWidth}|}{\centering :} & \multicolumn{2}{p{\paraWidth}|}{} \\\hline
\end{tabular*}

\vspace{0.5cm}\noindent \begin{tabular*}{\tableWidth}{|c|l@{\extracolsep{\fill}}r|}
\hline
\multicolumn{1}{|p{\maxVarWidth}}{use\_cgs} & {\bf Scope:} restricted & BOOLEAN \\\hline
\multicolumn{3}{|p{\descWidth}|}{{\bf Description:}   {\em Use the CGS units}} \\
\hline & & {\bf Default:} no \\\hline
\end{tabular*}

\vspace{0.5cm}\parskip = 10pt 

\section{Interfaces} 


\parskip = 0pt

\vspace{3mm} \subsection*{General}

\noindent {\bf Implements}: 

eos\_2d\_polytrope
\vspace{2mm}

\noindent {\bf Inherits}: 

eos\_base
\vspace{2mm}

\vspace{5mm}

\noindent {\bf Uses header}: 

EOS\_Base.h

EOS\_Base.inc
\vspace{2mm}\parskip = 10pt 

\section{Schedule} 


\parskip = 0pt


\noindent This section lists all the variables which are assigned storage by thorn EinsteinEOS/EOS\_Polytrope.  Storage can either last for the duration of the run ({\bf Always} means that if this thorn is activated storage will be assigned, {\bf Conditional} means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.


\subsection*{Storage}NONE
\subsection*{Scheduled Functions}
\vspace{5mm}

\noindent {\bf CCTK\_STARTUP} 

\hspace{5mm} eos\_polytrope\_startup 

\hspace{5mm}{\it setup the polytropic eos } 


\hspace{5mm}

 \begin{tabular*}{160mm}{cll} 
~ & Language:  & fortran \\ 
~ & Type:  & function \\ 
\end{tabular*} 



\vspace{5mm}\parskip = 10pt 
\end{document}
