Skip to content

Commit

Permalink
Change StepanovParameters::xs_o to xs_zero
Browse files Browse the repository at this point in the history
  • Loading branch information
whokion authored and sethrj committed Apr 18, 2024
1 parent e4dab84 commit cf3b106
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/celeritas/neutron/data/NeutronInelasticData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct NeutronInelasticScalars
*/
struct StepanovParameters
{
real_type xs_o; //!< nucleon-nucleon cross section at the zero energy
real_type xs_zero; //!< nucleon-nucleon cross section at the zero energy
real_type slope; //!< parameter used for the low energy threshold
Real3 coeffs; //!< coefficients of a second order Stepanov's function
};
Expand Down
8 changes: 4 additions & 4 deletions src/celeritas/neutron/xs/NucleonNucleonXsCalculator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ NucleonNucleonXsCalculator::NucleonNucleonXsCalculator(ParamsRef const& shared)
* SF(E) = coeffs[0] + coeffs[1]/E + coeffs[2]/E^{2}
* \f]
* where the kinetic energy of the incident nucleon, \em E is in [1, 10] MeV.
* Below 1 MeV, \f$ SF(E) = slope/E \f$ down to \f$ E = slope/xs_o \f$ while
* \f$ SF(E) = xs_o \f$ if \em E is in [0, slope/xs_o] MeV.
* Below 1 MeV, \f$ SF(E) = slope/E \f$ down to \f$ E = slope/xs_zero \f$ while
* \f$ SF(E) = xs_zero \f$ if \em E is in [0, slope/xs_zero] MeV.
*/
CELER_FUNCTION
auto NucleonNucleonXsCalculator::operator()(ChannelId ch_id,
Expand All @@ -97,9 +97,9 @@ auto NucleonNucleonXsCalculator::operator()(ChannelId ch_id,

result = (energy > this->low_otf_energy())
? StepanovFunction(par.coeffs)(inv_energy)
: (energy.value() > par.slope / par.xs_o)
: (energy.value() > par.slope / par.xs_zero)
? par.slope * inv_energy
: par.xs_o;
: par.xs_zero;
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions test/celeritas/neutron/NeutronInelastic.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ TEST_F(NeutronInelasticTest, nucleon_xs)
size_type num_channels = shared.scalars.num_channels();
EXPECT_EQ(num_channels, 3);

std::vector<real_type> xs_o;
std::vector<real_type> xs_zero;
std::vector<real_type> xs;
for (auto ch_id : range(ChannelId{num_channels}))
{
xs_o.push_back(shared.xs_params[ch_id].xs_o);
xs_zero.push_back(shared.xs_params[ch_id].xs_zero);
for (real_type inc_e : {0.01, 0.1, 1., 10., 100., 320.})
{
xs.push_back(calc_xs(ch_id, MevEnergy{inc_e}).value());
}
}
real_type const expected_xs_o[] = {17.613, 20.36, 17.613};
real_type const expected_xs_zero[] = {17.613, 20.36, 17.613};
real_type const expected_xs[] = {17.613,
17.613,
4.0,
Expand All @@ -170,7 +170,7 @@ TEST_F(NeutronInelasticTest, nucleon_xs)
0.8633,
0.0691,
0.0351};
EXPECT_VEC_SOFT_EQ(expected_xs_o, xs_o);
EXPECT_VEC_SOFT_EQ(expected_xs_zero, xs_zero);
EXPECT_VEC_SOFT_EQ(expected_xs, xs);
}

Expand Down

0 comments on commit cf3b106

Please sign in to comment.