2018-08-08 07:00:48 -05:00
|
|
|
//! \file secondary_kalbach.h
|
|
|
|
|
//! Kalbach-Mann angle-energy distribution
|
|
|
|
|
|
2018-07-10 07:36:46 -05:00
|
|
|
#ifndef OPENMC_SECONDARY_KALBACH_H
|
|
|
|
|
#define OPENMC_SECONDARY_KALBACH_H
|
|
|
|
|
|
|
|
|
|
#include "hdf5.h"
|
2026-02-17 09:50:38 -06:00
|
|
|
#include "openmc/tensor.h"
|
2018-08-20 14:40:32 -05:00
|
|
|
|
|
|
|
|
#include "openmc/angle_energy.h"
|
|
|
|
|
#include "openmc/constants.h"
|
|
|
|
|
#include "openmc/endf.h"
|
2021-04-22 16:46:23 -04:00
|
|
|
#include "openmc/vector.h"
|
2018-07-10 07:36:46 -05:00
|
|
|
|
|
|
|
|
namespace openmc {
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
//==============================================================================
|
|
|
|
|
//! Correlated angle-energy distribution with the angular distribution
|
|
|
|
|
//! represented using Kalbach-Mann systematics. This corresponds to ACE law 44
|
|
|
|
|
//! and ENDF File 6, LAW=1, LANG=2.
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
2018-07-10 07:36:46 -05:00
|
|
|
class KalbachMann : public AngleEnergy {
|
|
|
|
|
public:
|
|
|
|
|
explicit KalbachMann(hid_t group);
|
2018-08-08 07:00:48 -05:00
|
|
|
|
|
|
|
|
//! Sample distribution for an 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
|
2019-12-04 16:35:01 +00:00
|
|
|
void sample(
|
|
|
|
|
double E_in, double& E_out, double& mu, uint64_t* seed) const override;
|
2026-03-14 23:58:17 +02:00
|
|
|
|
|
|
|
|
//! Sample outgoing energy and Kalbach-Mann parameters
|
|
|
|
|
//! \param[in] E_in Incoming energy in [eV]
|
|
|
|
|
//! \param[out] E_out Outgoing energy in [eV]
|
|
|
|
|
//! \param[out] km_a Kalbach-Mann 'a' parameter
|
|
|
|
|
//! \param[out] km_r Kalbach-Mann pre-compound fraction 'r'
|
|
|
|
|
//! \param[inout] seed Pseudorandom seed pointer
|
|
|
|
|
void sample_params(double E_in, double& E_out, double& km_a, double& km_r,
|
|
|
|
|
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 override;
|
2021-08-11 11:41:49 -05:00
|
|
|
|
2018-07-10 07:36:46 -05:00
|
|
|
private:
|
2018-08-08 07:00:48 -05:00
|
|
|
//! Outgoing energy/angle at a single incoming energy
|
2018-07-10 07:36:46 -05:00
|
|
|
struct KMTable {
|
2018-08-08 07:00:48 -05:00
|
|
|
int n_discrete; //!< Number of discrete lines
|
|
|
|
|
Interpolation interpolation; //!< Interpolation law
|
2026-02-17 09:50:38 -06:00
|
|
|
tensor::Tensor<double> e_out; //!< Outgoing energies [eV]
|
|
|
|
|
tensor::Tensor<double> p; //!< Probability density
|
|
|
|
|
tensor::Tensor<double> c; //!< Cumulative distribution
|
|
|
|
|
tensor::Tensor<double> r; //!< Pre-compound fraction
|
|
|
|
|
tensor::Tensor<double> a; //!< Parameterized function
|
2018-07-10 07:36:46 -05:00
|
|
|
};
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
int n_region_; //!< Number of interpolation regions
|
2021-04-22 16:46:23 -04:00
|
|
|
vector<int> breakpoints_; //!< Breakpoints between regions
|
|
|
|
|
vector<Interpolation> interpolation_; //!< Interpolation laws
|
|
|
|
|
vector<double> energy_; //!< Energies [eV] at which distributions
|
|
|
|
|
//!< are tabulated
|
|
|
|
|
vector<KMTable> distribution_; //!< Distribution at each energy
|
2018-07-10 07:36:46 -05:00
|
|
|
};
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
} // namespace openmc
|
2018-07-10 07:36:46 -05:00
|
|
|
|
|
|
|
|
#endif // OPENMC_SECONDARY_KALBACH_H
|