cloudy
trunk
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
cosmology.cpp
Go to the documentation of this file.
1
/* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and
2
* others. For conditions of distribution and use see copyright notice in license.txt */
3
/*ParseCosmology parse cosmological parameters and options */
4
#include "
cddefines.h
"
5
#include "
radius.h
"
6
#include "
rfield.h
"
7
#include "
parse.h
"
8
#include "
physconst.h
"
9
#include "
cosmology.h
"
10
11
t_cosmology
cosmology
;
12
13
realnum
GetHubbleFactor
(
realnum
z)
14
{
15
realnum
H_z, H_z_squared;
16
17
DEBUG_ENTRY
(
"GetHubbleFactor()"
);
18
19
/* NB - the factor of (1e5/MEGAPARSEC) converts from km/s/Mpc to km/s/km */
20
H_z_squared =
POW2
(cosmology.
H_0
* (
realnum
)(1e5/
MEGAPARSEC
)) * (
21
cosmology.
omega_lambda
+
22
cosmology.
omega_matter
*
POW3
( 1.f + z ) +
23
cosmology.
omega_rad
*
POW4
( 1.f + z ) +
24
cosmology.
omega_k
*
POW2
( 1.f + z ) );
25
26
H_z = sqrt( H_z_squared );
27
28
return
H_z;
29
}
30
31
realnum
GetDensity
(
realnum
z)
32
{
33
realnum
density;
34
35
DEBUG_ENTRY
(
"GetHubbleFactor()"
);
36
37
fixit
();
// this should be abund.aprim[1] by default, but controlled by command line option
38
cosmology.
f_He
= 0.079f;
39
40
/* from Switzer & Hirata 2007, equation 2 */
41
density = 1.123e-5f * (cosmology.
omega_baryon
*cosmology.
h
*cosmology.
h
) / (1.f + 3.9715f*cosmology.
f_He
) *
42
pow( 1.f + z, (
realnum
)3.f );
43
44
return
density;
45
}
GetDensity
realnum GetDensity(realnum z)
Definition:
cosmology.cpp:31
t_cosmology::h
realnum h
Definition:
cosmology.h:38
t_cosmology
Definition:
cosmology.h:23
parse.h
cosmology.h
radius.h
t_cosmology::H_0
realnum H_0
Definition:
cosmology.h:38
POW2
#define POW2
Definition:
cddefines.h:933
t_cosmology::f_He
realnum f_He
Definition:
cosmology.h:42
realnum
float realnum
Definition:
cddefines.h:107
t_cosmology::omega_baryon
realnum omega_baryon
Definition:
cosmology.h:31
t_cosmology::omega_lambda
realnum omega_lambda
Definition:
cosmology.h:31
t_cosmology::omega_k
realnum omega_k
Definition:
cosmology.h:31
cddefines.h
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition:
cddefines.h:688
cosmology
t_cosmology cosmology
Definition:
cosmology.cpp:11
t_cosmology::omega_rad
realnum omega_rad
Definition:
cosmology.h:31
GetHubbleFactor
realnum GetHubbleFactor(realnum z)
Definition:
cosmology.cpp:13
MEGAPARSEC
const double MEGAPARSEC
Definition:
physconst.h:141
rfield.h
physconst.h
POW3
#define POW3
Definition:
cddefines.h:940
fixit
void fixit(void)
Definition:
service.cpp:991
t_cosmology::omega_matter
realnum omega_matter
Definition:
cosmology.h:31
POW4
#define POW4
Definition:
cddefines.h:947
Generated on Sat Oct 19 2013 10:43:09 for cloudy by
1.8.5