Commit 2d4599dd authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Wrote the section of the documentation on the EoS.

parent 1a8f00d5
aa
In \swift, all transformations between thermodynamical quantities are
computed using a pre-defined equation of state (EoS) for the gas. This
allows user to switch EoS without having to modify the equations of
SPH. The definition of the EoS takes the form of simple relations
between thermodynamic quantities. All of them must be specified even
when they default to constants.
%#######################################################################################################
\subsection{Ideal Gas}
\label{sec:eos:ideal}
This is the simplest and most common equation of state. It corresponds
to a gas obeying a pressure law $P = (\gamma-1) \rho u$, where $u$ is
the gas' internal energy, $\rho$ its density and $\gamma$ the
(user defined) adiabatic index, often assumed to be $5/3$ or $7/5$. For such a gas,
we have the following relations between pressure ($P$), internal energy
($u$), density ($\rho$), sound speed ($c$) and entropic function ($A$):
\begin{align}
P &= P_{\rm eos}(\rho, u) \equiv (\gamma-1) \rho
u \label{eq:eos:ideal:P_from_u} \\
c &= c_{\rm eos}(\rho, u) \equiv \sqrt{\gamma (\gamma-1)
u} \label{eq:eos:ideal:c_from_u} \\
A &= A_{\rm eos}(\rho, u) \equiv(\gamma-1) u
\rho^{\gamma-1} \label{eq:eos:ideal:A_from_u} \\
~ \nonumber\\
P &= P_{\rm eos}(\rho, A) \equiv A
\rho^{\gamma} \label{eq:eos:ideal:P_from_A} \\
c &= c_{\rm eos}(\rho, A) \equiv \sqrt{\gamma \rho^{\gamma-1}
A} \label{eq:eos:ideal:c_from_A} \\
u &= u_{\rm eos}(\rho, A) \equiv A \rho^{\gamma-1} /
(\gamma-1) \label{eq:eos:ideal:u_from_A}
\end{align}
Note that highly optimised functions to compute $x^\gamma$ and other
useful powers of $\gamma$ have been implemented in \swift for the most
commonly used values of $\gamma$.
%#######################################################################################################
\subsection{Isothermal Gas}
\label{sec:eos:isothermal}
An isothermal equation of state can be useful for certain test cases
or to speed-up the generation of glass files. This EoS corresponds to
a gas with contant (user-specified) thermal energy $u_{\rm cst}$. For such a gas,
we have the following (trivial) relations between pressure ($P$), internal energy
($u$), density ($\rho$), sound speed ($c$) and entropic function ($A$):
\begin{align}
P &= P_{\rm eos}(\rho, u) \equiv (\gamma-1) \rho
u_{\rm cst} \label{eq:eos:isothermal:P_from_u} \\
c &= c_{\rm eos}(\rho, u) \equiv \sqrt{\gamma (\gamma-1)
u_{\rm cst}} = c_{\rm cst} \label{eq:eos:isothermal:c_from_u} \\
A &= A_{\rm eos}(\rho, u) \equiv(\gamma-1) u_{\rm cst}
\rho^{\gamma-1} \label{eq:eos:isothermal:A_from_u} \\
~ \nonumber\\
P &= P_{\rm eos}(\rho, A) \equiv (\gamma-1) \rho
u_{\rm cst} \label{eq:eos:isothermal:P_from_A} \\
c &= c_{\rm eos}(\rho, A) \equiv \sqrt{\gamma (\gamma-1)
u_{\rm cst}} = c_{\rm cst} \label{eq:eos:isothermal:c_from_A} \\
u &= u_{\rm eos}(\rho, A) \equiv u_{\rm
cst} \label{eq:eos:isothermal:u_from_A}
\end{align}
...@@ -241,7 +241,7 @@ The prediction step is also identical to the \MinimalSPH case with the ...@@ -241,7 +241,7 @@ The prediction step is also identical to the \MinimalSPH case with the
entropic function replacing the thermal energy. entropic function replacing the thermal energy.
\begin{align} \begin{align}
\vec{x}_i &\rightarrow \vec{x}_i + \vec{v}_i \Delta t \label{eq:sph:gadget2:drift__x} \\ \vec{x}_i &\rightarrow \vec{x}_i + \vec{v}_i \Delta t \label{eq:sph:gadget2:drift_x} \\
h_i &\rightarrow h_i \exp\left(\frac{1}{h_i} \frac{dh_i}{dt} h_i &\rightarrow h_i \exp\left(\frac{1}{h_i} \frac{dh_i}{dt}
\Delta t\right), \label{eq:sph:gadget2:drift_h}\\ \Delta t\right), \label{eq:sph:gadget2:drift_h}\\
\rho_i &\rightarrow \rho_i \exp\left(-\frac{3}{h_i} \frac{dh_i}{dt} \rho_i &\rightarrow \rho_i \exp\left(-\frac{3}{h_i} \frac{dh_i}{dt}
......
...@@ -183,11 +183,13 @@ All kernels available in \swift are shown on Fig.~\ref{fig:sph:kernels}. ...@@ -183,11 +183,13 @@ All kernels available in \swift are shown on Fig.~\ref{fig:sph:kernels}.
\includegraphics[width=\columnwidth]{kernels.pdf} \includegraphics[width=\columnwidth]{kernels.pdf}
\caption{The kernel functions available in \swift for a mean \caption{The kernel functions available in \swift for a mean
inter-particle separation $\langle x\rangle=1.5$ and a resolution inter-particle separation $\langle x\rangle=1.5$ and a resolution
$\eta=1.2348$. The corresponding kernel support radii $H$ (shown by $\eta=1.2348$ shown in linear (top) and log (bottom) units to
arrows) and number of neighours $N_{\rm ngb}$ are indicated on the highlight their differences. The corresponding kernel support radii
figure. A Gaussian kernel with the same smoothing length is shown $H$ (shown by arrows) and number of neighours $N_{\rm ngb}$ are
for comparison. Note that all these kernels have the \emph{same indicated on the figure. A Gaussian kernel with the same smoothing
resolution} despite having vastly different number of neighbours.} length is shown for comparison. Note that all these kernels have
the \emph{same resolution} despite having vastly different number of
neighbours.}
\label{fig:sph:kernels} \label{fig:sph:kernels}
\end{figure} \end{figure}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment