Skip to content

Commit

Permalink
Refactor CalculateRhoGamma
Browse files Browse the repository at this point in the history
  • Loading branch information
vollous committed Feb 17, 2025
1 parent fd4659a commit ad70328
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
9 changes: 9 additions & 0 deletions include/BSMPT/bounce_solution/bounce_solution.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,15 @@ class BounceSolution
*/
double CalcTransitionTemp(const int &which_transition_temp);

/**
* @brief Calculate \f$ \rho_R = \rho_\gamma = g_\star \frac{\pi^2}{30} T_*^4
* \f$
*
* @param T temperature
* @return double
*/
double CalculateRhoGamma(const double &T) const;

/**
* @brief GetPTStrength Get PT strength alpha
*/
Expand Down
13 changes: 8 additions & 5 deletions src/bounce_solution/bounce_solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,11 @@ struct resultErrorPair Nintegrate_Outer(BounceSolution &obj)
return res;
}

double BounceSolution::CalculateRhoGamma(const double &T) const
{
return this->GetGstar() * std::pow(M_PI, 2) / 30 * std::pow(T, 4);
}

void BounceSolution::CalculatePTStrength()
{
if (not percolation_temp_set)
Expand Down Expand Up @@ -973,9 +978,8 @@ void BounceSolution::CalculatePTStrength()
Tperc,
-1); // temperature-derivative at true vacuum const

double rho_gam =
this->GetGstar() * std::pow(M_PI, 2) / 30 * std::pow(Tperc, 4);
alpha = 1 / rho_gam * (Vi - Vf - Tperc / 4. * (dTVi - dTVf));
double rho_gam = CalculateRhoGamma(Tperc);
alpha = 1 / rho_gam * (Vi - Vf - Tperc / 4. * (dTVi - dTVf));
CalculateWallVelocity(false_min, true_min);
if (abs(alpha / old_alpha - 1) < 1e-7) return; // Found a solution
}
Expand Down Expand Up @@ -1009,8 +1013,7 @@ void BounceSolution::CalculateWallVelocity(const Minimum &false_min,
double Vf =
true_min
.potential; // potential at true vacuum and percolation temperature
double rho_gam =
this->GetGstar() * std::pow(M_PI, 2) / 30 * std::pow(Tperc, 4);
double rho_gam = CalculateRhoGamma(Tperc);

double v_ChapmanJouget = 1. / (1 + alpha) *
(modelPointer->SMConstants.Csound +
Expand Down

0 comments on commit ad70328

Please sign in to comment.