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
c8545e94
Commit
c8545e94
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Use the correct expression of the FLRW metric for the case of the evolving equation of state.
parent
4730553f
No related branches found
No related tags found
1 merge request
!509
Cosmological time integration
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
src/cosmology.c
+26
-14
26 additions, 14 deletions
src/cosmology.c
theory/Cosmology/flrw.tex
+7
-3
7 additions, 3 deletions
theory/Cosmology/flrw.tex
with
34 additions
and
17 deletions
.gitignore
+
1
−
0
View file @
c8545e94
...
...
@@ -121,6 +121,7 @@ theory/Multipoles/potential.pdf
theory/Multipoles/potential_long.pdf
theory/Multipoles/potential_short.pdf
theory/Multipoles/force_short.pdf
theory/Cosmology/cosmology.pdf
m4/libtool.m4
m4/ltoptions.m4
...
...
This diff is collapsed.
Click to expand it.
src/cosmology.c
+
26
−
14
View file @
c8545e94
...
...
@@ -82,13 +82,28 @@ static INLINE double cosmology_dark_energy_EoS(double a, double w_0,
}
/**
* @brief Compute \f$ E(z) \f$.
* @brief Computes the integral of the dark-energy equation of state
* up to a scale-factor a.
*
* We follow the convention of Linder & Jenkins, MNRAS, 346, 573, 2003
* and compute \f$ \tilde{w}(a) = \int_0^a\frac{1 + w(z)}{1+z}dz \f$.
*
* @param a The current scale-factor.
* @param w_0 The equation of state parameter at z=0
* @param w_a The equation of state evolution parameter
*/
static
INLINE
double
E
(
double
Or
,
double
Om
,
double
Ok
,
double
Ol
,
double
w
,
double
a_inv
)
{
static
INLINE
double
w_tilde
(
double
a
,
double
w0
,
double
wa
)
{
return
(
a
-
1
.)
*
wa
-
(
1
.
+
w0
+
wa
)
*
log
(
a
);
}
/**
* @brief Compute \f$ E(z) \f$.
*/
static
INLINE
double
E
(
double
Or
,
double
Om
,
double
Ok
,
double
Ol
,
double
w0
,
double
wa
,
double
a
)
{
const
double
a_inv
=
1
.
/
a
;
return
sqrt
(
Or
*
a_inv
*
a_inv
*
a_inv
*
a_inv
+
Om
*
a_inv
*
a_inv
*
a_inv
+
Ok
*
a_inv
*
a_inv
+
Ol
*
pow
(
a_inv
,
-
3
.
*
(
1
.
+
w
)));
Ok
*
a_inv
*
a_inv
+
Ol
*
exp
(
3
.
*
w_tilde
(
a
,
w0
,
w
a
)));
}
/**
...
...
@@ -133,8 +148,9 @@ void cosmology_update(struct cosmology *c, const struct engine *e) {
const
double
Omega_m
=
c
->
Omega_m
;
const
double
Omega_k
=
c
->
Omega_k
;
const
double
Omega_l
=
c
->
Omega_lambda
;
const
double
w
=
c
->
w
;
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w
,
a_inv
);
const
double
w0
=
c
->
w_0
;
const
double
wa
=
c
->
w_a
;
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w0
,
wa
,
a
);
/* H(z) */
c
->
H
=
c
->
H0
*
E_z
;
...
...
@@ -165,8 +181,7 @@ double drift_integrand(double a, void *param) {
const
double
H0
=
c
->
H0
;
const
double
a_inv
=
1
.
/
a
;
const
double
w
=
cosmology_dark_energy_EoS
(
a
,
w_0
,
w_a
);
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w
,
a_inv
);
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w_0
,
w_a
,
a
);
const
double
H
=
H0
*
E_z
;
return
(
1
.
/
H
)
*
a_inv
*
a_inv
*
a_inv
;
...
...
@@ -190,8 +205,7 @@ double gravity_kick_integrand(double a, void *param) {
const
double
H0
=
c
->
H0
;
const
double
a_inv
=
1
.
/
a
;
const
double
w
=
cosmology_dark_energy_EoS
(
a
,
w_0
,
w_a
);
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w
,
a_inv
);
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w_0
,
w_a
,
a
);
const
double
H
=
H0
*
E_z
;
return
(
1
.
/
H
)
*
a_inv
*
a_inv
;
...
...
@@ -215,8 +229,7 @@ double hydro_kick_integrand(double a, void *param) {
const
double
H0
=
c
->
H0
;
const
double
a_inv
=
1
.
/
a
;
const
double
w
=
cosmology_dark_energy_EoS
(
a
,
w_0
,
w_a
);
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w
,
a_inv
);
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w_0
,
w_a
,
a
);
const
double
H
=
H0
*
E_z
;
/* Note: we can't use the pre-defined pow_gamma_xxx() function as
...
...
@@ -242,8 +255,7 @@ double time_integrand(double a, void *param) {
const
double
H0
=
c
->
H0
;
const
double
a_inv
=
1
.
/
a
;
const
double
w
=
cosmology_dark_energy_EoS
(
a
,
w_0
,
w_a
);
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w
,
a_inv
);
const
double
E_z
=
E
(
Omega_r
,
Omega_m
,
Omega_k
,
Omega_l
,
w_0
,
w_a
,
a
);
const
double
H
=
H0
*
E_z
;
return
(
1
.
/
H
)
*
a_inv
;
...
...
This diff is collapsed.
Click to expand it.
theory/Cosmology/flrw.tex
+
7
−
3
View file @
c8545e94
...
...
@@ -18,11 +18,15 @@ To allow for general expansion histories we use the full Friedmann equations
and write
\begin{align}
H(a)
&
\equiv
H
_
0 E(a)
\\
E(a)
&
\equiv\sqrt
{
\Omega
_
m a
^{
-3
}
+
\Omega
_
r
a
^{
-4
}
+
\Omega
_
k a
^{
-2
}
+
\Omega
_
\Lambda
a
^{
-3(1+w(a))
}}
,
a
^{
-4
}
+
\Omega
_
k a
^{
-2
}
+
\Omega
_
\Lambda
\exp\left
(3
\tilde
{
w
}
(a)
\right
)
}
,
\\
\tilde
{
w
}
(a)
&
= (a-1)w
_
a - (1+w
_
0 + w
_
a)
\log\left
(a
\right
),
\label
{
eq:friedmann
}
\end{align}
where the dark energy equation-of-state evolves according to the formulation of
\cite
{
Linder2003
}
:
where we followed
\cite
{
Linder2003
}
to parametrize the evolution of
the dark-energy equation-of-state
\footnote
{
Note that
$
\tilde
{
w
}
(
z
)
\equiv
\int
_
0
^
z
\frac
{
1
+
w
(
z'
)
}{
1
+
z'
}
dz'
$
, which leads to the analytic
expression we use.
}
as:
\begin{equation}
w(a)
\equiv
w
_
0 + w
_
a~(1-a).
\end{equation}
...
...
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