#ifndef OPENMC_PHOTON_H #define OPENMC_PHOTON_H #include "openmc/endf.h" #include "openmc/particle.h" #include #include "xtensor/xtensor.hpp" #include #include #include // for pair #include namespace openmc { //============================================================================== //! Photon interaction data for a single element //============================================================================== class ElectronSubshell { public: // Constructors ElectronSubshell() { }; int index_subshell; //!< index in SUBSHELLS int threshold; double n_electrons; double binding_energy; xt::xtensor cross_section; // Transition data int n_transitions; xt::xtensor transition_subshells; xt::xtensor transition_energy; xt::xtensor transition_probability; }; class PhotonInteraction { public: // Constructors PhotonInteraction(hid_t group, int i_element); // Methods void calculate_xs(Particle& p) const; void compton_scatter(double alpha, bool doppler, double* alpha_out, double* mu, int* i_shell) const; double rayleigh_scatter(double alpha) const; void pair_production(double alpha, double* E_electron, double* E_positron, double* mu_electron, double* mu_positron) const; void atomic_relaxation(const ElectronSubshell& shell, Particle& p) const; // Data members std::string name_; //!< Name of element, e.g. "Zr" int Z_; //!< Atomic number int i_element_; //!< Index in global elements vector // Microscopic cross sections xt::xtensor energy_; xt::xtensor coherent_; xt::xtensor incoherent_; xt::xtensor photoelectric_total_; xt::xtensor pair_production_total_; xt::xtensor pair_production_electron_; xt::xtensor pair_production_nuclear_; xt::xtensor heating_; // Form factors Tabulated1D incoherent_form_factor_; Tabulated1D coherent_int_form_factor_; Tabulated1D coherent_anomalous_real_; Tabulated1D coherent_anomalous_imag_; // Photoionization and atomic relaxation data std::unordered_map shell_map_; //!< Given a shell designator, e.g. 3, this //!< dictionary gives an index in shells_ std::vector shells_; // Compton profile data xt::xtensor profile_pdf_; xt::xtensor profile_cdf_; xt::xtensor binding_energy_; xt::xtensor electron_pdf_; // Stopping power data double I_; // mean excitation energy xt::xtensor n_electrons_; xt::xtensor ionization_energy_; xt::xtensor stopping_power_radiative_; // Bremsstrahlung scaled DCS xt::xtensor dcs_; private: void compton_doppler(double alpha, double mu, double* E_out, int* i_shell) const; }; //============================================================================== // Non-member functions //============================================================================== std::pair klein_nishina(double alpha); void free_memory_photon(); //============================================================================== // Global variables //============================================================================== namespace data { extern xt::xtensor compton_profile_pz; //! Compton profile momentum grid //! Photon interaction data for each element extern std::vector elements; extern std::unordered_map element_map; } // namespace data } // namespace openmc #endif // OPENMC_PHOTON_H