mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Convert all photon physics except bremsstrahlung (not done yet)
This commit is contained in:
parent
6c3f35d019
commit
2e6ac03433
9 changed files with 717 additions and 872 deletions
|
|
@ -78,6 +78,10 @@ public:
|
|||
//! \param[in] x independent variable
|
||||
//! \return Function evaluated at x
|
||||
double operator()(double x) const;
|
||||
|
||||
// Accessors
|
||||
const std::vector<double>& x() const { return x_; }
|
||||
const std::vector<double>& y() const { return y_; }
|
||||
private:
|
||||
std::size_t n_regions_ {0}; //!< number of interpolation regions
|
||||
std::vector<int> nbt_; //!< values separating interpolation regions
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ extern "C" void calc_zn_rad(int n, double rho, double zn_rad[]);
|
|||
//! is passed
|
||||
//==============================================================================
|
||||
|
||||
extern "C" void rotate_angle_c(double uvw[3], double mu, double* phi);
|
||||
extern "C" void rotate_angle_c(double uvw[3], double mu, const double* phi);
|
||||
|
||||
Direction rotate_angle(Direction u, double mu, double* phi);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@
|
|||
#define OPENMC_PHOTON_H
|
||||
|
||||
#include "openmc/endf.h"
|
||||
#include "openmc/particle.h"
|
||||
|
||||
#include <hdf5.h>
|
||||
#include "xtensor/xtensor.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility> // for pair
|
||||
#include <vector>
|
||||
|
||||
namespace openmc {
|
||||
|
|
@ -39,6 +41,17 @@ public:
|
|||
// Constructors
|
||||
PhotonInteraction(hid_t group);
|
||||
|
||||
// Methods
|
||||
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
|
||||
|
|
@ -76,6 +89,9 @@ public:
|
|||
|
||||
// Bremsstrahlung scaled DCS
|
||||
xt::xtensor<double, 2> dcs_;
|
||||
|
||||
private:
|
||||
void compton_doppler(double alpha, double mu, double* E_out, int* i_shell) const;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -94,6 +110,14 @@ struct ElementMicroXS {
|
|||
double pair_production; //!< microscopic pair production xs
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Non-member functions
|
||||
//==============================================================================
|
||||
|
||||
std::pair<double, double> klein_nishina(double alpha);
|
||||
|
||||
void thick_target_bremsstrahlung(Particle& p, double* E_lost);
|
||||
|
||||
//==============================================================================
|
||||
// Global variables
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ void sample_neutron_reaction(Particle* p);
|
|||
//! Samples an element based on the macroscopic cross sections for each nuclide
|
||||
//! within a material and then samples a reaction for that element and calls the
|
||||
//! appropriate routine to process the physics.
|
||||
extern "C" void sample_photon_reaction(Particle* p);
|
||||
void sample_photon_reaction(Particle* p);
|
||||
|
||||
//! Terminates the particle and either deposits all energy locally
|
||||
//! (electron_treatment = ELECTRON_LED) or creates secondary bremsstrahlung
|
||||
|
|
@ -44,7 +44,7 @@ void sample_nuclide(const Particle* p, int mt, int* i_nuclide, int* i_nuc_mat);
|
|||
void create_fission_sites(Particle* p, int i_nuclide, const Reaction* rx,
|
||||
Bank* bank_array, int64_t* bank_size, int64_t bank_capacity);
|
||||
|
||||
// void sample_element(Particle* p);
|
||||
extern "C" int sample_element(Particle* p);
|
||||
|
||||
Reaction* sample_fission(int i_nuclide, double E);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue