mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Finished cleaning up group indices off-by-ones. Still have to to delayed groups
This commit is contained in:
parent
05fac29164
commit
64dbaff587
3 changed files with 131 additions and 222 deletions
|
|
@ -78,25 +78,5 @@ void set_mg_interface_nuclides_and_temps();
|
|||
// After macro XS have been read, materials can be marked as fissionable
|
||||
void mark_fissionable_mgxs_materials();
|
||||
|
||||
//==============================================================================
|
||||
// Mgxs tracking/transport/tallying interface methods
|
||||
//==============================================================================
|
||||
|
||||
double
|
||||
get_nuclide_xs(int index, int xstype, int gin, const int* gout,
|
||||
const double* mu, const int* dg);
|
||||
|
||||
inline double
|
||||
get_nuclide_xs(int index, int xstype, int gin)
|
||||
{return get_nuclide_xs(index, xstype, gin, nullptr, nullptr, nullptr);}
|
||||
|
||||
double
|
||||
get_macro_xs(int index, int xstype, int gin, const int* gout,
|
||||
const double* mu, const int* dg);
|
||||
|
||||
inline double
|
||||
get_macro_xs(int index, int xstype, int gin)
|
||||
{return get_macro_xs(index, xstype, gin, nullptr, nullptr, nullptr);}
|
||||
|
||||
} // namespace openmc
|
||||
#endif // OPENMC_MGXS_INTERFACE_H
|
||||
|
|
|
|||
|
|
@ -287,40 +287,4 @@ void mark_fissionable_mgxs_materials()
|
|||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
// Mgxs tracking/transport/tallying interface methods
|
||||
//==============================================================================
|
||||
|
||||
double
|
||||
get_nuclide_xs(int index, int xstype, int gin, const int* gout,
|
||||
const double* mu, const int* dg)
|
||||
{
|
||||
int gout_c;
|
||||
const int* gout_c_p;
|
||||
if (gout != nullptr) {
|
||||
gout_c = *gout;
|
||||
gout_c_p = &gout_c;
|
||||
} else {
|
||||
gout_c_p = gout;
|
||||
}
|
||||
return data::mg.nuclides_[index].get_xs(xstype, gin, gout_c_p, mu, dg);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
||||
double
|
||||
get_macro_xs(int index, int xstype, int gin, const int* gout,
|
||||
const double* mu, const int* dg)
|
||||
{
|
||||
int gout_c;
|
||||
const int* gout_c_p;
|
||||
if (gout != nullptr) {
|
||||
gout_c = *gout;
|
||||
gout_c_p = &gout_c;
|
||||
} else {
|
||||
gout_c_p = gout;
|
||||
}
|
||||
return data::mg.macro_xs_[index].get_xs(xstype, gin, gout_c_p, mu, dg);
|
||||
}
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
|
|
@ -1374,15 +1374,15 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
p_g = p->g_;
|
||||
}
|
||||
|
||||
// To significantly reduce de-referencing, point matxs to the macroscopic
|
||||
// Mgxs for the material of interest
|
||||
data::mg.macro_xs_[p->material_].set_angle_index(p_u);
|
||||
// For shorthand, assign pointers to the material and nuclide xs set
|
||||
Mgxs* nuc_xs = &data::mg.nuclides_[i_nuclide];
|
||||
Mgxs* macro_xs = &data::mg.macro_xs_[p->material_];
|
||||
|
||||
// Do same for nucxs, point it to the microscopic nuclide data of interest
|
||||
// Find the temperature and angle indices of interest
|
||||
macro_xs->set_angle_index(p_u);
|
||||
if (i_nuclide >= 0) {
|
||||
// And since we haven't calculated this temperature index yet, do so now
|
||||
data::mg.nuclides_[i_nuclide].set_temperature_index(p->sqrtkT_);
|
||||
data::mg.nuclides_[i_nuclide].set_angle_index(p_u);
|
||||
nuc_xs->set_temperature_index(p->sqrtkT_);
|
||||
nuc_xs->set_angle_index(p_u);
|
||||
}
|
||||
|
||||
for (auto i = 0; i < tally.scores_.size(); ++i) {
|
||||
|
|
@ -1426,14 +1426,12 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
}
|
||||
//TODO: should flux be multiplied in above instead of below?
|
||||
if (i_nuclide >= 0) {
|
||||
score *= flux * atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_TOTAL, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_TOTAL, p_g);
|
||||
score *= flux * atom_density * nuc_xs->get_xs(MG_GET_XS_TOTAL, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_TOTAL, p_g);
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = get_nuclide_xs(i_nuclide, MG_GET_XS_TOTAL, p_g)
|
||||
* atom_density * flux;
|
||||
score = atom_density * flux * nuc_xs->get_xs(MG_GET_XS_TOTAL, p_g);
|
||||
} else {
|
||||
score = p->macro_xs_.total * flux;
|
||||
}
|
||||
|
|
@ -1455,21 +1453,17 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
score = p->wgt_last_;
|
||||
}
|
||||
if (i_nuclide >= 0) {
|
||||
score *= flux
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_INVERSE_VELOCITY, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_TOTAL, p_g);
|
||||
score *= flux * nuc_xs->get_xs(MG_GET_XS_INVERSE_VELOCITY, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_TOTAL, p_g);
|
||||
} else {
|
||||
score *= flux
|
||||
* get_macro_xs(p->material_, MG_GET_XS_INVERSE_VELOCITY, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_TOTAL, p_g);
|
||||
score *= flux * macro_xs->get_xs(MG_GET_XS_INVERSE_VELOCITY, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_TOTAL, p_g);
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = flux
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_INVERSE_VELOCITY, p_g);
|
||||
score = flux * nuc_xs->get_xs(MG_GET_XS_INVERSE_VELOCITY, p_g);
|
||||
} else {
|
||||
score = flux
|
||||
* get_macro_xs(p->material_, MG_GET_XS_INVERSE_VELOCITY, p_g);
|
||||
score = flux * macro_xs->get_xs(MG_GET_XS_INVERSE_VELOCITY, p_g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -1483,19 +1477,18 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
// weight entering the collision as the estimator for the reaction rate
|
||||
score = p->wgt_last_ * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_SCATTER_FMU_MULT,
|
||||
p->g_last_, &p->g_, &p->mu_, nullptr)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_SCATTER_FMU_MULT,
|
||||
p->g_last_, &p->g_, &p->mu_, nullptr);
|
||||
score *= atom_density * nuc_xs->get_xs(
|
||||
MG_GET_XS_SCATTER_FMU_MULT, p->g_last_, &p->g_, &p->mu_, nullptr)
|
||||
/ macro_xs->get_xs(
|
||||
MG_GET_XS_SCATTER_FMU_MULT, p->g_last_, &p->g_, &p->mu_, nullptr);
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = atom_density * flux * get_nuclide_xs(
|
||||
i_nuclide, MG_GET_XS_SCATTER_MULT, p_g, nullptr, &p->mu_, nullptr);
|
||||
score = atom_density * flux * nuc_xs->get_xs(
|
||||
MG_GET_XS_SCATTER_MULT, p_g, nullptr, &p->mu_, nullptr);
|
||||
} else {
|
||||
score = flux * get_macro_xs(
|
||||
p->material_, MG_GET_XS_SCATTER_MULT, p_g, nullptr, &p->mu_, nullptr);
|
||||
score = flux * macro_xs->get_xs(
|
||||
MG_GET_XS_SCATTER_MULT, p_g, nullptr, &p->mu_, nullptr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -1514,17 +1507,16 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
// adjust the score by the actual probability for that nuclide.
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_SCATTER_FMU,
|
||||
p->g_last_, &p->g_, &p->mu_, nullptr)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_SCATTER_FMU,
|
||||
p->g_last_, &p->g_, &p->mu_, nullptr);
|
||||
* nuc_xs->get_xs(MG_GET_XS_SCATTER_FMU, p->g_last_, &p->g_,
|
||||
&p->mu_, nullptr)
|
||||
/ macro_xs->get_xs(MG_GET_XS_SCATTER_FMU, p->g_last_, &p->g_,
|
||||
&p->mu_, nullptr);
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = atom_density * flux * get_nuclide_xs(
|
||||
i_nuclide, MG_GET_XS_SCATTER, p_g);
|
||||
score = atom_density * flux * nuc_xs->get_xs(MG_GET_XS_SCATTER, p_g);
|
||||
} else {
|
||||
score = flux * get_macro_xs(p->material_, MG_GET_XS_SCATTER, p_g);
|
||||
score = flux * macro_xs->get_xs(MG_GET_XS_SCATTER, p_g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -1544,14 +1536,13 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
score = p->wgt_last_ * flux;
|
||||
}
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_ABSORPTION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= atom_density * nuc_xs->get_xs(MG_GET_XS_ABSORPTION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = atom_density * flux
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_ABSORPTION, p_g);
|
||||
* nuc_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
} else {
|
||||
score = p->macro_xs_.absorption * flux;
|
||||
}
|
||||
|
|
@ -1575,20 +1566,17 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
score = p->wgt_last_ * flux;
|
||||
}
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= atom_density * nuc_xs->get_xs(MG_GET_XS_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
} else {
|
||||
score *=
|
||||
get_macro_xs(p->material_, MG_GET_XS_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= macro_xs->get_xs(MG_GET_XS_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = get_nuclide_xs(i_nuclide, MG_GET_XS_FISSION, p_g)
|
||||
* atom_density * flux;
|
||||
score = atom_density * flux * nuc_xs->get_xs(MG_GET_XS_FISSION, p_g);
|
||||
} else {
|
||||
score = get_macro_xs(p->material_, MG_GET_XS_FISSION, p_g) * flux;
|
||||
score = flux * macro_xs->get_xs(MG_GET_XS_FISSION, p_g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -1610,13 +1598,11 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
// nu-fission
|
||||
score = p->wgt_absorb_ * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_NU_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= atom_density * nuc_xs->get_xs(MG_GET_XS_NU_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
} else {
|
||||
score *=
|
||||
get_macro_xs(p->material_, MG_GET_XS_NU_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= macro_xs->get_xs(MG_GET_XS_NU_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
}
|
||||
} else {
|
||||
// Skip any non-fission events
|
||||
|
|
@ -1628,17 +1614,16 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
// score.
|
||||
score = simulation::keff * p->wgt_bank_ * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_FISSION, p_g);
|
||||
score *= atom_density * nuc_xs->get_xs(MG_GET_XS_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_FISSION, p_g);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = get_nuclide_xs(i_nuclide, MG_GET_XS_NU_FISSION, p_g)
|
||||
* atom_density * flux;
|
||||
score = atom_density * flux
|
||||
* nuc_xs->get_xs(MG_GET_XS_NU_FISSION, p_g);
|
||||
} else {
|
||||
score = get_macro_xs(p->material_, MG_GET_XS_NU_FISSION, p_g) * flux;
|
||||
score = flux * macro_xs->get_xs(MG_GET_XS_NU_FISSION, p_g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -1660,13 +1645,12 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
// prompt-nu-fission
|
||||
score = p->wgt_absorb_ * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_PROMPT_NU_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= atom_density *
|
||||
nuc_xs->get_xs(MG_GET_XS_PROMPT_NU_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
} else {
|
||||
score *=
|
||||
get_macro_xs(p->material_, MG_GET_XS_PROMPT_NU_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= macro_xs->get_xs(MG_GET_XS_PROMPT_NU_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
}
|
||||
} else {
|
||||
// Skip any non-fission events
|
||||
|
|
@ -1681,18 +1665,16 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
auto prompt_frac = 1. - n_delayed / static_cast<double>(p->n_bank_);
|
||||
score = simulation::keff * p->wgt_bank_ * prompt_frac * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_FISSION, p_g);
|
||||
score *= atom_density * nuc_xs->get_xs(MG_GET_XS_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_FISSION, p_g);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = get_nuclide_xs(i_nuclide, MG_GET_XS_PROMPT_NU_FISSION, p_g)
|
||||
* atom_density * flux;
|
||||
score = atom_density * flux *
|
||||
nuc_xs->get_xs(MG_GET_XS_PROMPT_NU_FISSION, p_g);
|
||||
} else {
|
||||
score = get_macro_xs(p->material_, MG_GET_XS_PROMPT_NU_FISSION, p_g)
|
||||
* flux;
|
||||
score = flux * macro_xs->get_xs(MG_GET_XS_PROMPT_NU_FISSION, p_g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -1712,7 +1694,8 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
// No fission events occur if survival biasing is on -- need to
|
||||
// calculate fraction of absorptions that would have resulted in
|
||||
// delayed-nu-fission
|
||||
if (get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g) > 0) {
|
||||
double abs_xs = macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
if (abs_xs > 0.) {
|
||||
if (tally.delayedgroup_filter_ != C_NONE) {
|
||||
auto i_dg_filt = tally.filters()[tally.delayedgroup_filter_];
|
||||
const DelayedGroupFilter& filt
|
||||
|
|
@ -1723,18 +1706,15 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
auto d = filt.groups()[d_bin] - 1;
|
||||
score = p->wgt_absorb_ * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *=
|
||||
get_nuclide_xs(i_nuclide, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= nuc_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g,
|
||||
nullptr, nullptr, &d)
|
||||
/ abs_xs;
|
||||
} else {
|
||||
score *=
|
||||
get_macro_xs(p->material_, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= macro_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g,
|
||||
nullptr, nullptr, &d)
|
||||
/ abs_xs;
|
||||
}
|
||||
score_fission_delayed_dg(i_tally, d_bin, score,
|
||||
score_index);
|
||||
score_fission_delayed_dg(i_tally, d_bin, score, score_index);
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
|
|
@ -1743,13 +1723,11 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
// delayed-nu-fission xs to the absorption xs
|
||||
score = p->wgt_absorb_ * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *=
|
||||
get_nuclide_xs(i_nuclide, MG_GET_XS_DELAYED_NU_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= nuc_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g)
|
||||
/ abs_xs;
|
||||
} else {
|
||||
score *=
|
||||
get_macro_xs(p->material_, MG_GET_XS_DELAYED_NU_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= macro_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g)
|
||||
/ abs_xs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1774,9 +1752,8 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
score = simulation::keff * p->wgt_bank_ / p->n_bank_
|
||||
* p->n_delayed_bank_[d-1] * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_FISSION, p_g);
|
||||
score *= atom_density * nuc_xs->get_xs(MG_GET_XS_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_FISSION, p_g);
|
||||
}
|
||||
score_fission_delayed_dg(i_tally, d_bin, score, score_index);
|
||||
}
|
||||
|
|
@ -1788,9 +1765,8 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
score = simulation::keff * p->wgt_bank_ / p->n_bank_ * n_delayed
|
||||
* flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_FISSION, p_g);
|
||||
score *= atom_density * nuc_xs->get_xs(MG_GET_XS_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_FISSION, p_g);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1804,24 +1780,21 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
for (auto d_bin = 0; d_bin < filt.n_bins(); ++d_bin) {
|
||||
auto d = filt.groups()[d_bin] - 1;
|
||||
if (i_nuclide >= 0) {
|
||||
score = flux * atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d);
|
||||
score = flux * atom_density * nuc_xs->get_xs(
|
||||
MG_GET_XS_DELAYED_NU_FISSION, p_g, nullptr, nullptr, &d);
|
||||
} else {
|
||||
score = flux
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d);
|
||||
score = flux * macro_xs->get_xs(
|
||||
MG_GET_XS_DELAYED_NU_FISSION, p_g, nullptr, nullptr, &d);
|
||||
}
|
||||
score_fission_delayed_dg(i_tally, d_bin, score, score_index);
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = flux * atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DELAYED_NU_FISSION, p_g);
|
||||
score = flux * atom_density *
|
||||
nuc_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g);
|
||||
} else {
|
||||
score = flux
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DELAYED_NU_FISSION, p_g);
|
||||
score = flux * macro_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1834,7 +1807,8 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
// No fission events occur if survival biasing is on -- need to
|
||||
// calculate fraction of absorptions that would have resulted in
|
||||
// delayed-nu-fission
|
||||
if (get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g) > 0) {
|
||||
double abs_xs = macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
if (abs_xs > 0) {
|
||||
if (tally.delayedgroup_filter_ != C_NONE) {
|
||||
auto i_dg_filt = tally.filters()[tally.delayedgroup_filter_];
|
||||
const DelayedGroupFilter& filt
|
||||
|
|
@ -1845,22 +1819,17 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
auto d = filt.groups()[d_bin] - 1;
|
||||
score = p->wgt_absorb_ * flux;
|
||||
if (i_nuclide >= 0) {
|
||||
score *=
|
||||
get_nuclide_xs(i_nuclide, MG_GET_XS_DECAY_RATE,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= nuc_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g,
|
||||
nullptr, nullptr, &d)
|
||||
* nuc_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g,
|
||||
nullptr, nullptr, &d) / abs_xs;
|
||||
} else {
|
||||
score *=
|
||||
get_macro_xs(p->material_, MG_GET_XS_DECAY_RATE,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
score *= macro_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &d)
|
||||
* macro_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g,
|
||||
nullptr, nullptr, &d) / abs_xs;
|
||||
}
|
||||
score_fission_delayed_dg(i_tally, d_bin, score,
|
||||
score_index);
|
||||
score_fission_delayed_dg(i_tally, d_bin, score, score_index);
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
|
|
@ -1872,18 +1841,16 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
for (auto d = 0; d < data::mg.num_delayed_groups_; ++d) {
|
||||
if (i_nuclide >= 0) {
|
||||
score += p->wgt_absorb_ * flux
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DECAY_RATE,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
* nuc_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &d)
|
||||
* nuc_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g,
|
||||
nullptr, nullptr, &d) / abs_xs;
|
||||
} else {
|
||||
score += p->wgt_absorb_ * flux
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DECAY_RATE,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
* macro_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &d)
|
||||
* macro_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g,
|
||||
nullptr, nullptr, &d) / abs_xs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1906,14 +1873,14 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
if (g != -1) {
|
||||
if (i_nuclide >= 0) {
|
||||
score += simulation::keff * atom_density * bank.wgt * flux
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DECAY_RATE, p_g,
|
||||
nullptr, nullptr, &g)
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_FISSION, p_g);
|
||||
* nuc_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr, nullptr,
|
||||
&g)
|
||||
* nuc_xs->get_xs(MG_GET_XS_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_FISSION, p_g);
|
||||
} else {
|
||||
score += simulation::keff * bank.wgt * flux
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DECAY_RATE, p_g,
|
||||
nullptr, nullptr, &g);
|
||||
* macro_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &g);
|
||||
}
|
||||
if (tally.delayedgroup_filter_ != C_NONE) {
|
||||
auto i_dg_filt = tally.filters()[tally.delayedgroup_filter_];
|
||||
|
|
@ -1925,7 +1892,7 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
auto d = filt.groups()[d_bin];
|
||||
if (d == g + 1)
|
||||
score_fission_delayed_dg(i_tally, d_bin, score,
|
||||
score_index);
|
||||
score_index);
|
||||
}
|
||||
score = 0.;
|
||||
}
|
||||
|
|
@ -1944,16 +1911,16 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
auto d = filt.groups()[d_bin] - 1;
|
||||
if (i_nuclide >= 0) {
|
||||
score += atom_density * flux
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DECAY_RATE,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d);
|
||||
* nuc_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &d)
|
||||
* nuc_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g, nullptr,
|
||||
nullptr, &d);
|
||||
} else {
|
||||
score += flux
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DECAY_RATE,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d);
|
||||
* macro_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &d)
|
||||
* macro_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g, nullptr,
|
||||
nullptr, &d);
|
||||
}
|
||||
score_fission_delayed_dg(i_tally, d_bin, score, score_index);
|
||||
}
|
||||
|
|
@ -1963,16 +1930,16 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
for (auto d = 0; d < data::mg.num_delayed_groups_; ++d) {
|
||||
if (i_nuclide >= 0) {
|
||||
score += atom_density * flux
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DECAY_RATE,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d);
|
||||
* nuc_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr, nullptr,
|
||||
&d)
|
||||
* nuc_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g, nullptr,
|
||||
nullptr, &d);
|
||||
} else {
|
||||
score += flux
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DECAY_RATE,
|
||||
p_g, nullptr, nullptr, &d)
|
||||
* get_macro_xs(p->material_, MG_GET_XS_DELAYED_NU_FISSION,
|
||||
p_g, nullptr, nullptr, &d);
|
||||
* macro_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr,
|
||||
nullptr, &d)
|
||||
* macro_xs->get_xs(MG_GET_XS_DELAYED_NU_FISSION, p_g, nullptr,
|
||||
nullptr, &d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1997,25 +1964,23 @@ score_general_mg(const Particle* p, int i_tally, int start_index,
|
|||
}
|
||||
if (i_nuclide >= 0) {
|
||||
score *= atom_density
|
||||
* get_nuclide_xs(i_nuclide, MG_GET_XS_KAPPA_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
* nuc_xs->get_xs(MG_GET_XS_KAPPA_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
} else {
|
||||
score *=
|
||||
get_macro_xs(p->material_, MG_GET_XS_KAPPA_FISSION, p_g)
|
||||
/ get_macro_xs(p->material_, MG_GET_XS_ABSORPTION, p_g);
|
||||
macro_xs->get_xs(MG_GET_XS_KAPPA_FISSION, p_g)
|
||||
/ macro_xs->get_xs(MG_GET_XS_ABSORPTION, p_g);
|
||||
}
|
||||
} else {
|
||||
if (i_nuclide >= 0) {
|
||||
score = get_nuclide_xs(i_nuclide, MG_GET_XS_KAPPA_FISSION, p_g)
|
||||
* atom_density * flux;
|
||||
score = atom_density * flux * nuc_xs->get_xs(MG_GET_XS_KAPPA_FISSION,
|
||||
p_g);
|
||||
} else {
|
||||
score = get_macro_xs(p->material_, MG_GET_XS_KAPPA_FISSION, p_g)
|
||||
* flux;
|
||||
score = flux * macro_xs->get_xs(MG_GET_XS_KAPPA_FISSION, p_g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case SCORE_EVENTS:
|
||||
// Simply count the number of scoring events
|
||||
score = 1.;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue