Repository navigation
Expand file tree
/
Copy pathreaction_product.h
More file actions
78 lines (63 loc) · 3.06 KB
/
Copy pathreaction_product.h
File metadata and controls
78 lines (63 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! \file reaction_product.h
//! Data for a reaction product
#ifndef OPENMC_REACTION_PRODUCT_H
#define OPENMC_REACTION_PRODUCT_H
#include "hdf5.h"
#include "openmc/angle_energy.h"
#include "openmc/chain.h"
#include "openmc/endf.h"
#include "openmc/memory.h" // for unique_ptr
#include "openmc/particle_type.h"
#include "openmc/vector.h" // for vector
namespace openmc {
//==============================================================================
//! 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.
//==============================================================================
class ReactionProduct {
public:
//! Emission mode for product
enum class EmissionMode {
prompt, // Prompt emission of secondary particle
delayed, // Yield represents total emission (prompt + delayed)
total // Delayed emission of secondary particle
};
using Secondary = unique_ptr<AngleEnergy>;
//! Construct reaction product from HDF5 data
//! \param[in] group HDF5 group containing data
explicit ReactionProduct(hid_t group);
//! Construct reaction product for decay photon from chain nuclide product
//! \param[in] product Chain nuclide product
explicit ReactionProduct(const ChainNuclide::Product& product);
//! 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
//! \param[inout] seed Pseudorandom seed pointer
void sample(double E_in, double& E_out, double& mu, uint64_t* seed) const;
//! 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;
ParticleType particle_; //!< Particle type
EmissionMode emission_mode_; //!< Emission mode
double decay_rate_; //!< Decay rate (for delayed neutron precursors) in [1/s]
unique_ptr<Function1D> yield_; //!< Yield as a function of energy
vector<Tabulated1D> applicability_; //!< Applicability of distribution
vector<Secondary> distribution_; //!< Secondary angle-energy distribution
int parent_nuclide_ = -1; //!< Index of chain nuclide that is parent
};
} // namespace openmc
#endif // OPENMC_REACTION_PRODUCT_H