2018-08-08 07:00:48 -05:00
|
|
|
//! \file reaction_product.h
|
|
|
|
|
//! Data for a reaction product
|
|
|
|
|
|
2018-07-10 22:49:37 -05:00
|
|
|
#ifndef OPENMC_REACTION_PRODUCT_H
|
|
|
|
|
#define OPENMC_REACTION_PRODUCT_H
|
|
|
|
|
|
|
|
|
|
#include "hdf5.h"
|
2018-08-20 14:40:32 -05:00
|
|
|
|
|
|
|
|
#include "openmc/angle_energy.h"
|
2025-02-21 11:47:38 -06:00
|
|
|
#include "openmc/chain.h"
|
2018-08-20 14:40:32 -05:00
|
|
|
#include "openmc/endf.h"
|
2021-04-22 16:46:23 -04:00
|
|
|
#include "openmc/memory.h" // for unique_ptr
|
2026-02-03 01:23:24 -06:00
|
|
|
#include "openmc/particle_type.h"
|
2021-04-22 16:46:23 -04:00
|
|
|
#include "openmc/vector.h" // for vector
|
2018-07-10 22:49:37 -05:00
|
|
|
|
|
|
|
|
namespace openmc {
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
//==============================================================================
|
|
|
|
|
//! Data for a reaction product including its yield and angle-energy
|
|
|
|
|
//! distributions, each of which has a given probability of occurring for a
|
|
|
|
|
//! given incoming energy. In general, most products only have one angle-energy
|
|
|
|
|
//! distribution, but for some cases (e.g., (n,2n) in certain nuclides) multiple
|
|
|
|
|
//! distinct distributions exist.
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
2018-07-10 22:49:37 -05:00
|
|
|
class ReactionProduct {
|
|
|
|
|
public:
|
2018-08-08 07:00:48 -05:00
|
|
|
//! Emission mode for product
|
2018-07-10 22:49:37 -05:00
|
|
|
enum class EmissionMode {
|
|
|
|
|
prompt, // Prompt emission of secondary particle
|
2018-12-28 08:06:35 -06:00
|
|
|
delayed, // Yield represents total emission (prompt + delayed)
|
|
|
|
|
total // Delayed emission of secondary particle
|
2018-07-10 22:49:37 -05:00
|
|
|
};
|
|
|
|
|
|
2021-04-22 16:46:23 -04:00
|
|
|
using Secondary = unique_ptr<AngleEnergy>;
|
2018-07-10 22:49:37 -05:00
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
//! Construct reaction product from HDF5 data
|
|
|
|
|
//! \param[in] group HDF5 group containing data
|
|
|
|
|
explicit ReactionProduct(hid_t group);
|
|
|
|
|
|
2025-02-21 11:47:38 -06:00
|
|
|
//! Construct reaction product for decay photon from chain nuclide product
|
|
|
|
|
//! \param[in] product Chain nuclide product
|
|
|
|
|
explicit ReactionProduct(const ChainNuclide::Product& product);
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
//! Sample an outgoing angle and energy
|
|
|
|
|
//! \param[in] E_in Incoming energy in [eV]
|
|
|
|
|
//! \param[out] E_out Outgoing energy in [eV]
|
|
|
|
|
//! \param[out] mu Outgoing cosine with respect to current direction
|
2019-12-05 19:50:31 +00:00
|
|
|
//! \param[inout] seed Pseudorandom seed pointer
|
|
|
|
|
void sample(double E_in, double& E_out, double& mu, uint64_t* seed) const;
|
2018-08-08 07:00:48 -05:00
|
|
|
|
2026-03-14 23:58:17 +02:00
|
|
|
//! Select which angle-energy distribution to sample
|
|
|
|
|
//! \param[in] E_in Incoming energy in [eV]
|
|
|
|
|
//! \param[inout] seed Pseudorandom seed pointer
|
|
|
|
|
//! \return Reference to the selected angle-energy distribution
|
|
|
|
|
AngleEnergy& sample_dist(double E_in, uint64_t* seed) const;
|
|
|
|
|
|
|
|
|
|
//! Sample an outgoing energy and evaluate the angular PDF
|
|
|
|
|
//! \param[in] E_in Incoming energy in [eV]
|
|
|
|
|
//! \param[in] mu Scattering cosine with respect to current direction
|
|
|
|
|
//! \param[out] E_out Outgoing energy in [eV]
|
|
|
|
|
//! \param[inout] seed Pseudorandom seed pointer
|
|
|
|
|
//! \return Probability density for the scattering cosine
|
|
|
|
|
double sample_energy_and_pdf(
|
|
|
|
|
double E_in, double mu, double& E_out, uint64_t* seed) const;
|
|
|
|
|
|
2021-04-16 15:35:33 -04:00
|
|
|
ParticleType particle_; //!< Particle type
|
2018-08-08 07:00:48 -05:00
|
|
|
EmissionMode emission_mode_; //!< Emission mode
|
|
|
|
|
double decay_rate_; //!< Decay rate (for delayed neutron precursors) in [1/s]
|
2021-04-22 16:46:23 -04:00
|
|
|
unique_ptr<Function1D> yield_; //!< Yield as a function of energy
|
|
|
|
|
vector<Tabulated1D> applicability_; //!< Applicability of distribution
|
|
|
|
|
vector<Secondary> distribution_; //!< Secondary angle-energy distribution
|
2025-02-21 11:47:38 -06:00
|
|
|
int parent_nuclide_ = -1; //!< Index of chain nuclide that is parent
|
2018-07-10 22:49:37 -05:00
|
|
|
};
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
} // namespace openmc
|
2018-07-10 22:49:37 -05:00
|
|
|
|
|
|
|
|
#endif // OPENMC_REACTION_PRODUCT_H
|