Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some comments to the Fermi integral calculation #1327

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
* The file NETWORK_PROPERTIES has been removed from each network,
as the legacy screening method is no longer used. (#1310)

* The rprox network was updated and the Jacobian was fixed (#1300)

* The primordial_chem EOS now can take density and pressure as
inputs (#1302)

# 23.07

* The preprocessor variable EXTRA_THERMO has been removed.
Expand All @@ -17,7 +22,7 @@
for estimating the spectral radius of our ODE system (#1222)

* removed SDC_EVOLVE_ENTHALPY -- this was not being used (#1204)

# 23.06

* Added a new Runge-Kutta-Chebyshev integrator (#1191)
Expand Down
63 changes: 41 additions & 22 deletions neutrinos/sneut5.H
Original file line number Diff line number Diff line change
Expand Up @@ -60,36 +60,55 @@ Real ifermi12(const Real f)

if (f < 4.0e0_rt) {

rn = f + a1(m1);
// build sum_{i=0, m1} a_i x**i. This is the numerator
// in Eq. 4 of Antia.
//
// with our 1-based indexing, this expression is
// a[1] + a[2] * f + a[3] * f**2 + ... a[m1+1] * f**m1
//
// we do the sum starting with the largest term and working
// on a single power of f each iteration.
//
// in the starting rn here, the leading f is actually
// a1(m1+1) * f, but that element is 1
rn = f + a1(m1);

for (int i = m1 - 1; i >= 1; --i) {
rn = rn*f + a1(i);
}

// now we do the denominator in Eq. 4. None of the coefficients
// are 1, so we loop over all
den = b1(k1+1);

for (int i = k1; i >= 1; --i) {
den = den*f + b1(i);
}

// Eq. 6 of Antia

ifermi12r = std::log(f * rn/den);

for (int i = m1 - 1; i >= 1; --i) {
rn = rn*f + a1(i);
}

den = b1(k1+1);

for (int i = k1; i >= 1; --i) {
den = den*f + b1(i);
}
} else {

ifermi12r = std::log(f * rn/den);
ff = 1.0e0_rt/std::pow(f, 1.0e0_rt/(1.0e0_rt + an));

} else {
// this construction is the same as above, but using the
// second set of coefficients

ff = 1.0e0_rt/std::pow(f, 1.0e0_rt/(1.0e0_rt + an));
rn = ff + a2(m2);
rn = ff + a2(m2);

for (int i = m2 - 1; i >= 1; --i) {
rn = rn*ff + a2(i);
}
for (int i = m2 - 1; i >= 1; --i) {
rn = rn*ff + a2(i);
}

den = b2(k2+1);
den = b2(k2+1);

for (int i = k2; i >= 1; --i) {
den = den*ff + b2(i);
}
for (int i = k2; i >= 1; --i) {
den = den*ff + b2(i);
}

ifermi12r = rn/(den*ff);
ifermi12r = rn/(den*ff);

}

Expand Down
Loading