mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Updated Mgxs::calculate_xs interface to use the particle, matching interface for continuous energy equivalent
This commit is contained in:
parent
7d285b4186
commit
fe8cbcc487
3 changed files with 15 additions and 21 deletions
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "openmc/constants.h"
|
||||
#include "openmc/hdf5_interface.h"
|
||||
#include "openmc/particle.h"
|
||||
#include "openmc/xsdata.h"
|
||||
|
||||
|
||||
|
|
@ -167,15 +168,9 @@ class Mgxs {
|
|||
|
||||
//! \brief Calculates cross section quantities needed for tracking.
|
||||
//!
|
||||
//! @param gin Incoming energy group.
|
||||
//! @param sqrtkT Temperature of the material.
|
||||
//! @param u Incoming particle direction.
|
||||
//! @param total_xs Resultant total cross section.
|
||||
//! @param abs_xs Resultant absorption cross section.
|
||||
//! @param nu_fiss_xs Resultant nu-fission cross section.
|
||||
//! @param p The particle whose attributes set which MGXS to get.
|
||||
void
|
||||
calculate_xs(int gin, double sqrtkT, Direction u,
|
||||
double& total_xs, double& abs_xs, double& nu_fiss_xs);
|
||||
calculate_xs(Particle& p);
|
||||
|
||||
//! \brief Sets the temperature index in cache given a temperature
|
||||
//!
|
||||
|
|
|
|||
15
src/mgxs.cpp
15
src/mgxs.cpp
|
|
@ -600,8 +600,7 @@ Mgxs::sample_scatter(int gin, int& gout, double& mu, double& wgt)
|
|||
//==============================================================================
|
||||
|
||||
void
|
||||
Mgxs::calculate_xs(int gin, double sqrtkT, Direction u,
|
||||
double& total_xs, double& abs_xs, double& nu_fiss_xs)
|
||||
Mgxs::calculate_xs(Particle& p)
|
||||
{
|
||||
// Set our indices
|
||||
#ifdef _OPENMP
|
||||
|
|
@ -609,13 +608,13 @@ Mgxs::calculate_xs(int gin, double sqrtkT, Direction u,
|
|||
#else
|
||||
int tid = 0;
|
||||
#endif
|
||||
set_temperature_index(sqrtkT);
|
||||
set_angle_index(u);
|
||||
set_temperature_index(p.sqrtkT_);
|
||||
set_angle_index(p.u_local());
|
||||
XsData* xs_t = &xs[cache[tid].t];
|
||||
total_xs = xs_t->total(cache[tid].a, gin);
|
||||
abs_xs = xs_t->absorption(cache[tid].a, gin);
|
||||
|
||||
nu_fiss_xs = fissionable ? xs_t->nu_fission(cache[tid].a, gin) : 0.;
|
||||
p.macro_xs_.total = xs_t->total(cache[tid].a, p.g_);
|
||||
p.macro_xs_.absorption = xs_t->absorption(cache[tid].a, p.g_);
|
||||
p.macro_xs_.nu_fission =
|
||||
fissionable ? xs_t->nu_fission(cache[tid].a, p.g_) : 0.;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -202,12 +202,12 @@ Particle::transport()
|
|||
model::materials[material_]->calculate_xs(*this);
|
||||
}
|
||||
} else {
|
||||
// Get the MG data
|
||||
data::mg.macro_xs_[material_].calculate_xs(g_, sqrtkT_,
|
||||
this->u_local(), macro_xs_.total, macro_xs_.absorption,
|
||||
macro_xs_.nu_fission);
|
||||
// Get the MG data; unlike the CE case above, we have to re-calculate
|
||||
// cross sections for every collision since the cross sections may
|
||||
// be angle-dependent
|
||||
data::mg.macro_xs_[material_].calculate_xs(*this);
|
||||
|
||||
// Finally, update the particle group since we know we are multi-group
|
||||
// Update the particle's group while we know we are multi-group
|
||||
g_last_ = g_;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue