Commit bf69b5b9 authored by Matthieu Tristram's avatar Matthieu Tristram
Browse files

Correct Units

parent dccdc700
......@@ -722,15 +722,8 @@ double ClassEngine::get_DMod(double z){
double ClassEngine::critical_density( double z)
// const in critical density in cgs units (g cm^-3)
//Units are Msun/Mpc3
{
// const double G = 6.67408e-11; //m3.kg-1.s-2
// const double critdens_const = 3. / (8. * CLHEP::pi * G * 1000);
// double Hz = get_H(z) * CLHEP::km/CLHEP::s/(1e6*CLHEP::parsec) * CLHEP::s;
// return( critdens_const * Hz * Hz);
double tau;
int index;
......@@ -740,11 +733,11 @@ double ClassEngine::critical_density( double z)
//pvecback must be allocated
background_at_tau(&ba,tau,ba.long_info,ba.inter_normal, &index, pvecback);
double rhoc = pvecback[ba.index_bg_rho_crit] / CLHEP::kg * CLHEP::cm * CLHEP::cm * CLHEP::cm;
// std::cout << "critical: " << critdens_const * Hz * Hz << " " << rhoc << std::endl;
const double G = 4.30091e-3; //pc.Msun-1.(km/s)^2
double to_Msun_per_Mpc3 = 3.*_c_*_c_/8./M_PI/G; //Msun/Mpc.(m/s)^2
double rhoc = pvecback[ba.index_bg_rho_crit]; //units are 3c^2/8piG
return( rhoc);
return( rhoc * to_Msun_per_Mpc3);
}
double ClassEngine::get_Om(double z)
......
Markdown is supported
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