Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
4f0b13d1
Commit
4f0b13d1
authored
6 years ago
by
Alexei Borissov
Browse files
Options
Downloads
Patches
Plain Diff
Updated cooling theory document
parent
457be0c7
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!593
Eagle cooling
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theory/Cooling/bibliography.bib
+15
-0
15 additions, 0 deletions
theory/Cooling/bibliography.bib
theory/Cooling/eagle_cooling.tex
+108
-39
108 additions, 39 deletions
theory/Cooling/eagle_cooling.tex
with
123 additions
and
39 deletions
theory/Cooling/bibliography.bib
0 → 100644
+
15
−
0
View file @
4f0b13d1
@ARTICLE
{
Wiersma2009
,
author
=
{{Wiersma}, R.~P.~C. and {Schaye}, J. and {Smith}, B.~D.}
,
title
=
"{The effect of photoionization on the cooling rates of enriched, astrophysical plasmas}"
,
journal
=
{\mnras}
,
archivePrefix
=
"arXiv"
,
eprint
=
{0807.3748}
,
keywords
=
{atomic processes , plasmas , cooling flows , galaxies: formation , intergalactic medium}
,
year
=
2009
,
month
=
feb
,
volume
=
393
,
pages
=
{99-107}
,
doi
=
{10.1111/j.1365-2966.2008.14191.x}
,
adsurl
=
{http://adsabs.harvard.edu/abs/2009MNRAS.393...99W}
,
adsnote
=
{Provided by the SAO/NASA Astrophysics Data System}
}
This diff is collapsed.
Click to expand it.
theory/Cooling/eagle_cooling.tex
+
108
−
39
View file @
4f0b13d1
...
...
@@ -45,7 +45,7 @@ particle would have in the absence of cooling:
hydro
}
\times
\Delta
t.
\end{equation}
We then proceed to solve the implicit equation
\begin{equation}
\begin{equation}
\label
{
implicit-eq
}
u
_{
\rm
final
}
= u
_
0 +
\lambda
(u
_{
\rm
final
}
)
\Delta
t,
\end{equation}
where
$
\lambda
$
is the cooling rate
\footnote
{
Note this is not the
...
...
@@ -151,50 +151,74 @@ ensure that we will not get negative values because of rounding errors.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section
{
Solution to the implicit cooling problem
}
In this section we describe the integration scheme used to compute the
cooling rate. It consists of an explicit solver for cases where the
cooling rate is small, a solver based on the Newton-Raphson method, and
one based on the bisection method.
\subsection
{
Explicit solver
}
\todo
{
Explain the explicit solver
}
For many particles the cooling occuring over a timestep will be small
(for example, if a particle is at the equilibrium temperature and was not
heated by other means such as shock heating). In these cases
$
\lambda
(
u
_
0
)
\simeq
\lambda
(
u
_{
final
}
)
$
, so an explicit solution to compute
$
u
_{
final
}$
may be used as a faster alternative to a more complicated implicit scheme.
More specifically, if
$
\lambda
(
u
_
0
)
dt <
\varepsilon
u
_
0
$
we set
\begin{equation}
u
_{
final
}
= u
_
0 +
\lambda
(u
_
0) dt,
\end{equation}
where
$
\varepsilon
$
is a small constant, set to
$
0
.
05
$
to be consistent
with the EAGLE simulations.
In cases where
$
\lambda
(
u
_
0
)
dt >
\varepsilon
u
_
0
$
one of two implicit
methods are used, either the Newton-Raphson method, which benefits from
faster convergence, however is not guaranteed to converge, or the
bisection method, which is slower but always converges.
\subsection
{
Newton-Raphson method
}
To prevent the occurance of negative internal energies during the
calculation we introduce
$
x
=
\log
u
$
, so that we need to solve
Equation
\ref
{
implicit-eq
}
may be rearranged so that we are trying to
find the root of
\begin{equation}
\label
{
fu-eq
}
f(u
_{
final
}
) = u
_{
final
}
- u
_
0 -
\lambda
(u
_{
final
}
) dt = 0.
\end{equation}
This may be done iteratively using the Newton-Raphson method obtaining
consecutive approximations to
$
u
_{
final
}$
by
\begin{equation}
u
_{
n+1
}
= u
_
n -
\frac
{
f(u
_
n)
}{
df(u
_
n)/du
}
.
\end{equation}
In some cases a negative value of
$
u
_{
n
+
1
}$
may be calculated. To
prevent the occurance of negative internal energies during the
calculation we introduce
$
x
=
\log
(
u
_{
final
}
)
$
, so that we solve
\begin{equation}
\label
{
fx-eq
}
f(x) = e
^
x - u
_
0 -
\lambda
(e
^
x) dt = 0
.
f(x) = e
^
x - u
_
0 -
\lambda
(e
^
x) dt = 0
\end{equation}
Using Newton's method we obtain consecutive approximations of the root
of
$
f
$
by the formula
$
x
_{
n
+
1
}
=
x
_
n
-
f
(
x
_
n
)/
f'
(
x
_
n
)
$
. This leads to
instead of
\ref
{
fu-eq
}
. Thus we obtain consecutive approximations of
the root of
$
f
$
by the formula
$
x
_{
n
+
1
}
=
x
_
n
-
f
(
x
_
n
)/
f'
(
x
_
n
)
$
. This
leads to
\begin{equation}
x
_{
n+1
}
= x
_
n -
\frac
{
1 - u
_
0 e
^{
-x
_
n
}
-
\lambda
(e
^{
x
_
n
}
)e
^{
-x
_
n
}
dt
}{
1
-
\frac
{
d
\lambda
}{
du
}
(e
^{
x
_
n
}
) dt
}
.
\end{equation}
We obtain the gradient by
\begin{equation}
\D
\lambda
u =
\frac
{
\lambda
(u
_{
high,n
}
)
-
\lambda
(u
_{
low,n
}
)
}{
u
_{
high,n
}
- u
_{
low,n
}}
,
\end{equation}
where
$
u
_{
\rm
high,n
}$
and
$
u
_{
\rm
low,n
}$
are values of the internal
energy grid bracketing the current iteration of the value of the
internal energy (
$
u
_
n
=
e
^{
x
_
n
}$
) in Newton's method (i.e.
$
u
_{
high,n
}
\ge
u
_
n
\ge
u
_{
low,n
}$
).
%\begin{figure} \begin{center} \includegraphics[width =
%0.7\textwidth]{typical_fx} \caption{Relationship of $\log|f(x)|$ from
%Equation \ref{fx-eq} to the logarithm of temperature for multiple
%values $u_0$. Solid lines indicate where the value of $f(x)$ is
%negative, while for dashed lines $f(x)$ is positive. A hydrogen
%number density of $10^{-1}$ cm$^{-1}$, solar abundances and redshift
%0 are used for evaluating the cooling
%rate.} \label{fx} \end{center} \end{figure}
The root of
$
f
$
tends to be near the location of maximum gradient, so
the initial guess for the Newton's method is chosen to be the location
where
$
g
(
x
)
=
e
^
x
-
u
_
0
-
\lambda
_
h
(
e
^
x
)
dt
$
has the greatest slope,
with
$
\lambda
_
h
$
being the contribution to the cooling from hydrogen
and helium. Since the cooling rate is dominated by hydrogen and helium
at lower temperatures, this is a suitable way of approximating the
equilibrium temperature, and supplying a guess to the Newton iteration
scheme.
The tables used for EAGLE cooling in fact depend on temperature rather
than internal energy and include a separate table to convert from
internal energy to temperature. Hence, to obtain the gradient we use
\begin{align*}
\D
\lambda
u
&
=
\D
\lambda
T
\D
T u
\\
&
=
\frac
{
\lambda
(T
_{
high,n
}
)
-
\lambda
(T
_{
low,n
}
)
}{
T
_{
high,n
}
- T
_{
low,n
}}
\frac
{
T(u
_{
high,n
}
)
- T(u
_{
low,n
}
)
}{
u
_{
high,n
}
- u
_{
low,n
}}
,
\end{align*}
where
$
T
_{
\rm
high,n
}
, u
_{
\rm
high,n
}$
and
$
T
_{
\rm
low,n
}
, u
_{
\rm
low,n
}$
are values of the temperature and internal energy grid bracketing the current
temperature and internal energy for the iteration in Newton's method
(e.g.
$
u
_{
high,n
}
\ge
u
_
n
\ge
u
_{
low,n
}$
).
The initial guess for the Newton-Raphson method is taken to be
$
x
_
0
=
\log
(
u
_
0
)
$
.
If in the first iteration the sign of the
$
\lambda
$
changes the next
guess to correspond to the equilibrium temperature (i.e.
$
10
^
4
$
K).
A particle is considered to have converged if the relative error in
the internal energy is sufficiently small. This can be formulated as
...
...
@@ -208,15 +232,56 @@ x_{n+1} - x_n = \log\frac{u_{n+1}}{u_n} &< -\log\LL 1-C \RR \simeq C.
Since the grid spacing in the internal energy of the Eagle tables is
0.045 in
$
\log
_{
10
}
u
$
we take
$
C
=
10
^{
-
2
}$
.
\subsection
{
Bissection method
}
In cases when the Newton-Raphson method doesn't converge within a specified
number of iterations we revert to the bisection method. In order to use
the Newton-Raphson method a parameter (EagleCooling:newton
\_
integration) in
the yaml file needs to be set to 1.
\todo
{
Explain the bissection method
}
\subsection
{
Bisection method
}
In order to guarantee convergence the bisection method is used to solve
equation
\ref
{
fu-eq
}
The implementation is the same as in the EAGLE
simulations, but is described here for convenience.
First a small interval is used to bracket the solution. The interval bounds
are defined as
$
u
_{
upper
}
=
\kappa
u
_
0
$
and
$
u
_{
lower
}
=
\kappa
^{
-
1
}
u
_
0
$
,
with
$
\kappa
=
\sqrt
{
1
.
1
}$
as specified in EAGLE. If the particle is cooling
(
$
\lambda
(
u
_
0
)
<
0
$
)
$
u
_{
upper
}$
and
$
u
_{
lower
}$
are iteratively decreased
by factors of
$
\kappa
$
until
$
f
(
u
_{
lower
}
)
<
0
$
. Alternatively, if the
particle is initially heating (
$
\lambda
(
u
_
0
)
>
0
$
) the bounds are iteratively
increased by factors of
$
\kappa
$
until
$
f
(
u
_{
upper
}
)
>
0
$
. Once the bounds
are obtained, the bisection scheme is performed as normal.
\section
{
EAGLE cooling tables
}
\todo
{
Summarize the content of the Wiersma tables.
}
\todo
{
Summarize the high-redshift tables.
}
\todo
{
Explain the Compton-cooling contribution.
}
We use the same cooling tables as used in EAGLE, specifically those found in
\cite
{
Wiersma2009
}
and may be found at http://www.strw.leidenuniv.nl/WSS08/.
These tables contain pre-computed values of the cooling rate for a given
redshift, metallicity, hydrogen number density and temperature produced using
the package CLOUDY. When calculating the cooling rate for particles at
redshifts higher than the redshift of reionisation the tables used do not
depend on redshift, but only on metallicity, hydrogen number density and
temperature. These tables are linearly interpolated based on the particle
based on the particle properties.
Since these tables specify the cooling rate in terms of temperature, the internal
energy of a particle needs to be converted to a temperature in a way which takes
into account the ionisation state of the gas. This is done by interpolating a
pre-computed table of values of temperature depending on redshift, hydrogen number
density, helium fraction and internal energy (again, for redshifts higher than the
redshift of reionisation this table does not depend on redshift).
Inverse Compton cooling is not accounted for in the high redshift tables, so prior
to reionisation it is taken care of by an analytical formula,
\begin{equation}
\frac
{
\Lambda
_{
compton
}}{
n
_
h
^
2
}
= -
\Lambda
_{
0,compton
}
\left
( T - T
_{
CMB
}
(1+z)
\right
) (1+z)
^
4
\frac
{
n
_
e
}{
n
_
h
}
,
\end{equation}
which is added to the cooling rate interpolated from the tables. Here
$
n
_
h
$
is the
hydrogen number density,
$
T
$
the temperature of the particle,
$
T
_{
CMB
}
=
2
.
7255
$
K
the temperature of the CMB,
$
z
$
the redshift,
$
n
_
e
$
the hydrogen and helium electron
number density, and
$
\Lambda
_{
0
,compton
}
=
1
.
0178085
\times
10
^{
-
37
}
g
\cdot
cm
^
2
\cdot
s
^{
-
3
}
\cdot
K
^{
-
5
}$
.
\section
{
Co-moving time integration
}
...
...
@@ -286,4 +351,8 @@ same calculation as in the non-cooling case:
\begin{equation}
u'
_
i(t+
\Delta
t) = u'
_
i(t) + Y'
_
i(t)
\big
|
_{
\rm
total
}
\times
{
\Delta
t
_{
\rm
therm
}}
.
\end{equation}
\bibliographystyle
{
mnras
}
\bibliography
{
./bibliography.bib
}
\end{document}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment