Skip to content

Commit

Permalink
revert to hydrogen mass
Browse files Browse the repository at this point in the history
  • Loading branch information
psharda committed Jul 24, 2023
1 parent 2335402 commit 7a5749f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CloudyCooling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto ComputeEgasFromTgas(double rho, do
const Real mu = interpolate2d(std::log10(nH), std::log10(Tgas), tables.log_nH, tables.log_Tgas, tables.meanMolWeight);

// compute thermal gas energy
const Real Egas = (rho / (C::m_u * mu)) * C::k_B * Tgas / (gamma - 1.);
const Real Egas = (rho / ((C::m_p + C::m_e) * mu)) * C::k_B * Tgas / (gamma - 1.);
return Egas;
}

Expand All @@ -162,7 +162,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto ComputeTgasFromEgas(double rho, do

// mean molecular weight (in Grackle tables) is defined w/r/t
// hydrogen_mass_cgs_
const Real C = (gamma - 1.) * Egas / (C::k_B * (rho / C::m_u));
const Real C = (gamma - 1.) * Egas / (C::k_B * (rho / (C::m_p + C::m_e)));

// solve for mu(T)*C == T.
// (Grackle does this with a fixed-point iteration. We use a more robust
Expand Down

0 comments on commit 7a5749f

Please sign in to comment.