Angle-Energy Distributions¶
AngleEnergyPacket¶
-
struct AngleEnergyPacket¶
A struct to hold a sampled angle and energy.
AngleEnergy¶
-
class AngleEnergy : public std::enable_shared_from_this<AngleEnergy>¶
Interface to represent any secondary angle-energy distribution.
Subclassed by pndl::Absorption, pndl::CMDistribution, pndl::ContinuousEnergyDiscreteCosines, pndl::DiscreteCosinesEnergies, pndl::Elastic, pndl::Kalbach, pndl::MultipleDistribution, pndl::NBody, pndl::STTSLReaction, pndl::SummedFissionSpectrum, pndl::TabularEnergyAngle, pndl::Uncorrelated
Public Functions
-
virtual ~AngleEnergy() = default¶
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const = 0¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const = 0¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const = 0¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
virtual ~AngleEnergy() = default¶
MultipleDistribution¶
-
class MultipleDistribution : public pndl::AngleEnergy¶
A dsitribution which is composed of mutliple possible distributions, each with a tabulated probability.
Public Functions
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline std::size_t size() const¶
Returns the number of distributions for the reaction.
-
inline const AngleEnergy &distribution(std::size_t i) const¶
Returns the ith distribution for the reaction.
- Parameters
i – Index of distribution to fetch.
-
inline const Tabulated1D &probability(std::size_t i) const¶
Returns the ith distribution’s probability function.
- Parameters
i – Index of distribution to fetch.
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
SummedFissionSpectrum¶
-
class SummedFissionSpectrum : public pndl::AngleEnergy¶
In nuclear data evaluations, MT 18 is the reaction which is designated for fission, and contains the prompt neutron fission spectrum. MT 18 is actually the sum of four other reactions however: MT 19, MT 20, MT 21, and MT 38. These stand for first chance, second chance, third chance, and fourth chance fission respectively. If these four are provided insteadd of MT 18, then the prompt fission spectrum is the average of these four different spectra. This class handles this niche case.
Public Functions
- Parameters
mt19 – Pointer to STReaction for first chance fission.
mt20 – Pointer to STReaction for second chance fission.
mt21 – Pointer to STReaction for third chance fission.
mt38 – Pointer to STReaction for fourth chance fission.
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
CMDistribution¶
-
class CMDistribution : public pndl::AngleEnergy¶
A dsitribution for which the data is provided in the center of mass frame.
Public Functions
- Parameters
A – Atomic weight ratio of the nuclide.
Q – The Q-value of the reaction.
distribution – Pointer to the distribution object in the center of mass frame.
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline const AngleEnergy &distribution() const¶
Returns the distribution in the Center of Mass frame.
-
inline double awr() const¶
Returns the nuclide Atomic Weight Ratio.
-
inline double q() const¶
Returns the Q-value of the reaction.
NBody¶
-
class NBody : public pndl::AngleEnergy¶
Implements product Angle-Energy law which follows an N-body phase space distribution.
Public Functions
-
NBody(const ACE &ace, std::size_t i, double iQ)¶
- Parameters
ace – ACE file to take data from.
i – Starting index of distribution in the XSS array.
iQ – Q-value for the reaction.
-
NBody(uint16_t n, double Ap, double AWR, double Q)¶
- Parameters
n – Number of particles (3, 4, or 5).
Ap – Total mass ratio for the n particles.
AWR – Atomic Weight Ratio of the nuclide.
Q – Q-value for the reaction.
-
~NBody() = default¶
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline uint32_t n() const¶
Returns the number of bodies.
-
inline double Ap() const¶
Returns the total AWR for all of the particles.
-
inline double A() const¶
Returns the AWR of the nuclide in question.
-
inline double Q() const¶
Returns the Q-value for the reaction in MeV.
-
NBody(const ACE &ace, std::size_t i, double iQ)¶
EnergyAngleTable¶
-
class EnergyAngleTable¶
Contains the product Angle-Energy distribution for a single incident energy.
Public Functions
-
EnergyAngleTable(const ACE &ace, std::size_t i, std::size_t JED)¶
- Parameters
ace – ACE file to take data from.
i – Starting index of distribution in the XSS array.
JED – Relative index for finding angular distributions.
-
EnergyAngleTable(const std::vector<double> &outgoing_energy, const std::vector<double> &pdf, const std::vector<double> &cdf, const std::vector<PCTable> &angle_tables, Interpolation interp)¶
- Parameters
outgoing_energy – Outgoing energy grid.
pdf – Probability Density Function for outgoing energy.
cdf – Cumulative Density Function for outgoing energy.
angle_tables – A vector a PCTable, one for each outgoing energy, each describing the cosine of the scattering angle.
interp – Interpolation used for the PDF (Histogram or LinLin).
-
~EnergyAngleTable() = default¶
-
inline AngleEnergyPacket sample_angle_energy(const std::function<double()> &rng) const¶
-
inline double angle_pdf(double mu) const¶
@breif Evaluates the PDF of scattering with angle mu, and any exit energy.
- Parameters
mu – Cosine of scattering angle.
-
inline double pdf(double mu, double E_out) const¶
@breif Evaluates the PDF of scattering with angle mu, and exit energy E_out.
- Parameters
mu – Cosine of scattering angle.
E_out – Exit energy.
-
inline double min_energy() const¶
Returns the lowest possible outgoing energy in MeV.
-
inline double max_energy() const¶
Returns the highest possible outgoing energy in MeV.
-
inline Interpolation interpolation() const¶
Returns the method of interpolation used for the energy PDF and CDF.
-
inline const std::vector<double> &energy() const¶
Returns a vector of the outgoing energy points.
-
inline const std::vector<double> &pdf() const¶
Returns a vector for the PDF points corresponding to the outgoing energy grid.
-
inline const std::vector<double> &cdf() const¶
Returns a vector for the CDF points corresponding to the outgoing energy grid.
-
inline const PCTable &angle_table(std::size_t i) const¶
Returns the ith AngleTable which contains the angular distribution for the ith outgoing energy.
- Parameters
i – Index to the outgoing energy grid.
-
inline std::size_t size() const¶
Returns the number of outgoing energy points / AngleTables.
-
EnergyAngleTable(const ACE &ace, std::size_t i, std::size_t JED)¶
TabularEnergyAngle¶
-
class TabularEnergyAngle : public pndl::AngleEnergy¶
A product Angle-Energy distribution where the angle and energy PDFs and CDFs are tabulated for different incoming energies.
Public Functions
-
TabularEnergyAngle(const ACE &ace, std::size_t i, std::size_t JED)¶
- Parameters
ace – ACE file to take data from.
i – Starting index of distribution in the XSS array.
JED – Relative index for finding energy and angle distributions.
-
TabularEnergyAngle(const std::vector<double> &incoming_energy, const std::vector<EnergyAngleTable> &tables)¶
- Parameters
incoming_energy – Incoming energy grid.
tables – vector of EnergyAngleTable for each point in the incoming energy grid.
-
~TabularEnergyAngle() = default¶
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline const std::vector<double> &incoming_energy() const¶
Returns a vector to the grid of incoming energies.
-
inline double incoming_energy(std::size_t i) const¶
Returns the ith incoming energy in MeV.
- Parameters
i – Index to the incoming energy grid.
-
inline const EnergyAngleTable &table(std::size_t i) const¶
Returns an EnergyAngleTable which contains the distributions for the ith incoming energy.
- Parameters
i – Index to the incoming energy.
-
inline std::size_t size() const¶
Returns the number of incoming energy points.
-
TabularEnergyAngle(const ACE &ace, std::size_t i, std::size_t JED)¶
KalbachTable¶
-
class KalbachTable¶
Contains the product Angle-Energy distribution for a single incident energy, using the Kalbach-Mann representation.
Public Functions
-
KalbachTable(const ACE &ace, std::size_t i)¶
- Parameters
ace – ACE file to take data from.
i – Starting index of distribution in the XSS array.
-
KalbachTable(const std::vector<double> &energy, const std::vector<double> &pdf, const std::vector<double> &cdf, const std::vector<double> &R, const std::vector<double> &A, Interpolation interp)¶
- Parameters
energy – Outgoing energy grid.
pdf – Probability Density Function for outgoing energy grid.
cdf – Cumulative Density Function for outgoing energy grid.
R – R values as a function of outgoing energy.
A – A values as a function of outgoing energy.
interp – Interpolation method (Histogram or LinLin).
-
~KalbachTable() = default¶
-
inline double sample_energy(double xi) const¶
-
inline double min_energy() const¶
Returns the lowest possible outgoing energy in MeV.
-
inline double max_energy() const¶
Returns the highest possible outgoing energy in MeV.
-
inline double R(double E) const¶
Evaluates R for a given outgoing energy.
- Parameters
E – Outgoing energy in MeV.
-
inline double A(double E) const¶
Evaluates A for a given outgoing energy.
- Parameters
E – Outgoing energy in MeV.
-
inline double angle_pdf(double mu) const¶
@breif Evaluates the PDF of scattering with angle mu, and any exit energy.
- Parameters
mu – Cosine of scattering angle.
-
inline double pdf(double mu, double E_out) const¶
@breif Evaluates the PDF of scattering with angle mu, and exit energy E_out.
- Parameters
mu – Cosine of scattering angle.
E_out – Exit energy.
-
inline const std::vector<double> &energy() const¶
Returns a vector of the outgoing energy points.
-
inline const std::vector<double> &pdf() const¶
Returns a vector for the PDF points corresponding to the outgoing energy grid.
-
inline const std::vector<double> &cdf() const¶
Returns a vector for the CDF points corresponding to the outgoing energy grid.
-
inline const std::vector<double> &R() const¶
Returns a vector for the values of R corresponding to the energy grid points.
-
inline const std::vector<double> &A() const¶
Returns a vector for the values of A corresponding to the energy grid points.
-
inline Interpolation interpolation() const¶
Returns the method of interpolation used for the energy PDF and CDF, R, and A.
-
inline std::size_t size() const¶
Returns the number of outgoing energy points / AngleTables.
-
KalbachTable(const ACE &ace, std::size_t i)¶
Kalbach¶
-
class Kalbach : public pndl::AngleEnergy¶
A product Angle-Energy distribution which follows a Kalbach-Mann semantic. This distribution is simillar to the TabularEnergyAngle distribution.
Public Functions
-
Kalbach(const ACE &ace, std::size_t i)¶
- Parameters
ace – ACE file to take data from.
i – Starting index of distribution in the XSS array.
-
Kalbach(const std::vector<double> &incoming_energy, const std::vector<KalbachTable> &tables)¶
- Parameters
incoming_energy – Incoming energy grid.
tables – vector of KalbachTable for each point in the incoming energy grid.
-
~Kalbach() = default¶
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline const std::vector<double> &incoming_energy() const¶
Returns a vector to the grid of incoming energies.
-
inline double incoming_energy(std::size_t i) const¶
Returns the ith incoming energy in MeV.
- Parameters
i – Index to the incoming energy grid.
-
inline const KalbachTable &table(std::size_t i) const¶
Returns a KalbachTable which contains the distributions for the ith incoming energy.
- Parameters
i – Index to the incoming energy.
-
inline std::size_t size() const¶
Returns the number of incoming energy points.
-
Kalbach(const ACE &ace, std::size_t i)¶
DiscreteCosinesEnergies¶
-
class DiscreteCosinesEnergies : public pndl::AngleEnergy¶
Class which represents equiprobably and skewed discrete energy and discrete cosine distributions for incoherent inelastic scattering.
Public Functions
-
DiscreteCosinesEnergies(const ACE &ace)¶
- Parameters
ace – ACE file which contains thermal scattering law.
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline bool skewed() const¶
Returns true if the outgoing energies are skewed.
-
inline const std::vector<double> &incoming_energy() const¶
Returns vector to the incoming energy grid.
-
inline const std::vector<std::vector<DiscreteEnergy>> &outgoing_energies() const¶
Returns the vector of outgoing energies for all incoming energies.
-
struct DiscreteEnergy¶
Struct to contain a discrete outgoing energy, with its associated discrete cosines.
-
DiscreteCosinesEnergies(const ACE &ace)¶
ContinuousEnergyDiscreteCosines¶
-
class ContinuousEnergyDiscreteCosines : public pndl::AngleEnergy¶
Class which represents continuous energy distributions with discrete cosines for incoherent inelastic scattering.
Public Functions
-
ContinuousEnergyDiscreteCosines(const ACE &ace, bool unit_based_interpolation = false)¶
- Parameters
ace – ACE file which contains thermal scattering law.
unit_based_interpolation – If false (default value), the distribution will be sampled without using unit-based interpolation, which is the method used by MCNP, Serpent, and OpenMC. If set to true, unit based interpolation will be applied to the sampling of the energy.
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
virtual std::optional<double> angle_pdf(double E_in, double mu) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
virtual std::optional<double> pdf(double E_in, double mu, double E_out) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline const std::vector<double> &incoming_energy() const¶
Returns vector to the incoming energy grid.
-
inline std::size_t size() const¶
Returns the number of incoming energy points.
-
inline const CEDCTable &table(std::size_t i) const¶
Returns a CEDCTable which contains the distributions for the ith incoming energy.
- Parameters
i – Index to the incoming energy.
-
inline bool unit_based_interpolation() const¶
Returns true if the distribution used unit-based interpolation in sampling the scattering energy and angle, and false otherwise.
-
struct CEDCTable¶
Struct which contains the outgoing energy distribution and the discrete scattering cosiens for a single incident energy.
Public Functions
-
double sample_energy(double xi, std::size_t &j) const¶
Samples and outgoing energy from the distributions while also setting the value j to be the lower bound index for sampling the scattering cosine latter on.
- Parameters
xi – Random variable on the unit interval [0,1).
j – Index which will be set to latter locate the proper distribution for the scattering cosine.
-
double sample_energy(double xi, std::size_t &j) const¶
-
ContinuousEnergyDiscreteCosines(const ACE &ace, bool unit_based_interpolation = false)¶
Absorption¶
-
class Absorption : public pndl::AngleEnergy¶
A distribution to represent absorption. When you try to sample from it, a PNDLException is thrown.
Public Functions
-
inline Absorption(uint32_t mt)¶
-
inline virtual AngleEnergyPacket sample_angle_energy(double, const std::function<double()>&) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
inline virtual std::optional<double> angle_pdf(double, double) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
inline virtual std::optional<double> pdf(double, double, double) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline Absorption(uint32_t mt)¶
Elastic¶
-
class Elastic : public pndl::AngleEnergy¶
This class is used to sample elastic scattering of neutrons off of a nuclide. At certain energies, it becomes reasonable to make the approximation that the target nuclide is at rest, and has no thermal motion. The threshold for applying this approximation is set with the tar_threshold parameter. If the incident energy of the neutron (Ein) is larger than tar_threshold * temperature * k (where k is the Boltzmann constant), then the target is taken to be stationary. One exception to this rule is for nuclides with an AWR < 1 (only H1). Since H1 is actually has a slightly smaller mass than a neutron, the target at rest approximation is generally inadequate.
Public Functions
- Parameters
broadener – Shared pointer to the broadening method for sampling the target velocity.
angle – The AngleDistribution for elastic scattering. This distribution must be given in the center of mass frame.
awr – Atomic weight ratio of the nuclide.
temperature – Temperature in Kelvin of the nuclide.
use_tar – Flag for using the Target At Rest approximation. Default value is true.
tar_threshold – The threshold for applying the Target At Rest approximation. Default value is 400.
-
virtual AngleEnergyPacket sample_angle_energy(double E_in, const std::function<double()> &rng) const final override¶
Samples an angle and energy from the distribution.
- Parameters
E_in – Incident energy in MeV.
rng – Randum number generation function.
- Returns
Sampled cosine of the scattering angle and energy in an AngleEnergyPacket.
-
inline virtual std::optional<double> angle_pdf(double, double) const final override¶
Evaluates the marginal PDF for having a scattering cosine of mu at incoming energy E_in. Returns an std::optional<double>, as it may not always be possible to obtain the marginal PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
inline virtual std::optional<double> pdf(double, double, double) const final override¶
Evaluates the joint PDF for having a scattering cosine of mu at incoming energy E_in, and exit energy E_out. Returns an std::optional<double>, as it may not always be possible to calculate the joint PDF.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
E_out – Exit energy.
-
inline const AngleDistribution &angle_distribution() const¶
Returns the AngleDistribution which describes the distribution for the cosine of the scattering angle in the center-of-mass frame.
-
inline const ElasticDopplerBroadener &elastic_doppler_broadener() const¶
Returns a reference to the ElasticDopplerBroadener for sampling the target velocity.
Sets a new elastic scattering broadening method, for sampling the velocity of target.
broadener Shared pointer to the new broadening method.
-
inline double awr() const¶
@breif Returns the Atomic Weight Ratio for the nuclide.
-
double temperature() const¶
@breif Returns the temperature for the nuclide in Kelvin.
-
void set_temperature(double temperature)¶
@breif Sets a new target nuclide temperature.
- Parameters
temperature – New temperature in Kelvin.
-
inline bool use_tar() const¶
If true, the Target At Rest approximation is used for incident energies which are larger than tar_threshold * kT. If false, the Target At Rest approximation is never used.
-
inline void set_use_tar(bool use_tar)¶
Sets a new value for use_tar. If true, the Target At Rest approximation will be used, with the tar_threshold. If false, a target velocity will always be sampled.
- Parameters
use_tar – New value for using TAR.
-
inline double tar_threshold() const¶
Returns the threshold for the application of the Target At Rest approximation.
-
void set_tar_threshold(double tar_threshold)¶
Sets a new value for the Target At Rest threshold. When the incident energy is larger than tar_threshold * k * T, it will be assumed that the target nuclide is at rest.
- Parameters
tar_threshold – New value for the TAR threshold.
ElasticDopplerBroadener¶
-
class ElasticDopplerBroadener : public std::enable_shared_from_this<ElasticDopplerBroadener>¶
Subclassed by pndl::ElasticDBRC, pndl::ElasticSVT
Public Functions
-
ElasticDopplerBroadener() = default¶
-
virtual ~ElasticDopplerBroadener() = default¶
-
virtual std::array<double, 3> sample_target_velocity(const double &Ein, const double &kT, const double &awr, const std::function<double()> &rng) const = 0¶
Samples the velocity of a target nuclide for using in sampling an elastic scattering. It is assumed that the target isotope is a free-gas whose velocity is distributed as a Maxwellian spectrum, at temperature kT. It is assumed that the direction of the incident neutron is always along the positive z-axis (0,0,1).
- Parameters
Ein – Incident energy of the neutron in MeV.
kT – Temperature of the “free-gas” in MeV.
awr – Atomic weight ratio of the nuclide.
rng – Random number generator function.
-
virtual std::string algorithm() const = 0¶
Returns a string with the abbreviation of the elastic kernel broadening method.
-
ElasticDopplerBroadener() = default¶
ElasticSVT¶
-
class ElasticSVT : public pndl::ElasticDopplerBroadener¶
This class uses the Sampling of Velocity of Target (SVT) algorithm. This approach is also sometimes refered to as the Constant Cross Section (CXS) approximation. It assumes that the microscopic scattering cross section is approximately constant over the range of reletive energies which could be observed by the incident neutron (due to the direction of the target nuclides velcity being random and isotropically distributed). This method is standard in many Monte Carlo codes. Despite its ubiquity, it is known to yield inaccurate results for heavy nuclides which have scattering resonances at low energies. For these heavy nuclide, the Doppler Broadened Rejection Correction (DBRC) algorithm is better, as it is an exact treatment.
Public Functions
-
ElasticSVT() = default¶
- Parameters
angle – The AngleDistribution for elastic scattering. This distribution must be given in the center of mass frame.
awr – Atomic weight ratio of the nuclide.
temperature – Temperature in Kelvin of the nuclide.
use_tar – Flag for using the Target At Rest approximation. Default value is true.
tar_threshold – The threshold for applying the Target At Rest approximation. Default value is 400.
-
virtual std::array<double, 3> sample_target_velocity(const double &Ein, const double &kT, const double &awr, const std::function<double()> &rng) const final override¶
Samples the velocity of a target nuclide for using in sampling an elastic scattering. It is assumed that the target isotope is a free-gas whose velocity is distributed as a Maxwellian spectrum, at temperature kT. It is assumed that the direction of the incident neutron is always along the positive z-axis (0,0,1).
- Parameters
Ein – Incident energy of the neutron in MeV.
kT – Temperature of the “free-gas” in MeV.
awr – Atomic weight ratio of the nuclide.
rng – Random number generator function.
-
virtual std::string algorithm() const final override¶
Returns a string with the abbreviation of the elastic kernel broadening method.
-
ElasticSVT() = default¶
ElasticDBRC¶
-
class ElasticDBRC : public pndl::ElasticDopplerBroadener¶
This class uses the Doppler Broadening Resonance Correcction algorithm. It is an improvement on the constant cross section (CXS) approximation, and provides an exact treatment for the elastic scattering of neutrons off of nuclides which exhibit strong resonance behavior at low energies.
Public Functions
-
inline ElasticDBRC(const CrossSection &xs)¶
- Parameters
xs – The 0 Kelvin elastic scattering cross section for the nuclide.
-
virtual std::array<double, 3> sample_target_velocity(const double &Ein, const double &kT, const double &awr, const std::function<double()> &rng) const final override¶
Samples the velocity of a target nuclide for using in sampling an elastic scattering. It is assumed that the target isotope is a free-gas whose velocity is distributed as a Maxwellian spectrum, at temperature kT. It is assumed that the direction of the incident neutron is always along the positive z-axis (0,0,1).
- Parameters
Ein – Incident energy of the neutron in MeV.
kT – Temperature of the “free-gas” in MeV.
awr – Atomic weight ratio of the nuclide.
rng – Random number generator function.
-
virtual std::string algorithm() const final override¶
Returns a string with the abbreviation of the elastic kernel broadening method.
-
inline const CrossSection &elastic_0K_xs() const¶
Returns the 0 Kelvin elastic scattering cross section for the nuclide.
-
inline ElasticDBRC(const CrossSection &xs)¶