OpenMC/include/openmc/physics.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
3.8 KiB
C
Raw Permalink Normal View History

2018-11-17 09:24:31 -06:00
#ifndef OPENMC_PHYSICS_H
#define OPENMC_PHYSICS_H
#include "openmc/bank.h"
2018-11-21 11:13:55 -06:00
#include "openmc/nuclide.h"
2018-11-17 09:24:31 -06:00
#include "openmc/particle.h"
#include "openmc/position.h"
#include "openmc/reaction.h"
#include "openmc/vector.h"
2018-11-17 09:24:31 -06:00
namespace openmc {
//==============================================================================
// Non-member functions
//==============================================================================
//! Sample a nuclide and reaction and then calls the appropriate routine
void collision(Particle& p);
2018-11-17 09:24:31 -06:00
//! Samples an incident neutron reaction
void sample_neutron_reaction(Particle& p);
2018-11-17 09:24:31 -06:00
//! 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.
void sample_photon_reaction(Particle& p);
2018-11-17 09:24:31 -06:00
//! Terminates the particle and either deposits all energy locally
//! (electron_treatment = ElectronTreatment::LED) or creates secondary
2018-11-17 09:24:31 -06:00
//! bremsstrahlung photons from electron deflections with charged particles
//! (electron_treatment = ElectronTreatment::TTB).
void sample_electron_reaction(Particle& p);
2018-11-17 09:24:31 -06:00
//! Terminates the particle and either deposits all energy locally
//! (electron_treatment = ElectronTreatment::LED) or creates secondary
2018-11-17 09:24:31 -06:00
//! bremsstrahlung photons from electron deflections with charged particles
//! (electron_treatment = ElectronTreatment::TTB). Two annihilation photons of
2018-11-17 09:24:31 -06:00
//! energy MASS_ELECTRON_EV (0.511 MeV) are created and travel in opposite
//! directions.
void sample_positron_reaction(Particle& p);
2018-11-17 09:24:31 -06:00
//! Sample a nuclide based on their total cross sections and densities within
//! the current material
//!
//! \param[in] p Particle
//! \return Index in the data::nuclides vector
int sample_nuclide(Particle& p);
//! Determine the average total, prompt, and delayed neutrons produced from
//! fission and creates appropriate bank sites.
void create_fission_sites(Particle& p, int i_nuclide, const Reaction& rx);
2018-11-17 09:24:31 -06:00
int sample_element(Particle& p);
2018-11-17 09:24:31 -06:00
Reaction& sample_fission(int i_nuclide, Particle& p);
2018-11-17 09:24:31 -06:00
void sample_photon_product(
int i_nuclide, Particle& p, int* i_rx, int* i_product);
2018-11-17 09:24:31 -06:00
void absorption(Particle& p, int i_nuclide);
2018-11-17 09:24:31 -06:00
void scatter(Particle& p, int i_nuclide);
2018-11-17 09:24:31 -06:00
2018-11-21 11:13:55 -06:00
//! Treats the elastic scattering of a neutron with a target.
void elastic_scatter(int i_nuclide, const Reaction& rx, double kT, Particle& p);
2018-11-17 09:24:31 -06:00
void sab_scatter(int i_nuclide, int i_sab, Particle& p);
2018-11-17 09:24:31 -06:00
2018-11-21 11:13:55 -06:00
//! samples the target velocity. The constant cross section free gas model is
//! the default method. Methods for correctly accounting for the energy
//! dependence of cross sections in treating resonance elastic scattering such
//! as the DBRC and a new, accelerated scheme are also implemented here.
Direction sample_target_velocity(const Nuclide& nuc, double E, Direction u,
Direction v_neut, double xs_eff, double kT, uint64_t* seed);
2018-11-17 09:24:31 -06:00
2018-11-21 11:13:55 -06:00
//! samples a target velocity based on the free gas scattering formulation, used
//! by most Monte Carlo codes, in which cross section is assumed to be constant
//! in energy. Excellent documentation for this method can be found in
//! FRA-TM-123.
2019-11-21 22:19:15 +00:00
Direction sample_cxs_target_velocity(
double awr, double E, Direction u, double kT, uint64_t* seed);
2018-11-17 09:24:31 -06:00
void sample_fission_neutron(
int i_nuclide, const Reaction& rx, SourceSite* site, Particle& p);
2018-11-17 09:24:31 -06:00
2018-11-21 11:13:55 -06:00
//! handles all reactions with a single secondary neutron (other than fission),
//! i.e. level scattering, (n,np), (n,na), etc.
void inelastic_scatter(const Nuclide& nuc, const Reaction& rx, Particle& p);
2018-11-17 09:24:31 -06:00
void sample_secondary_photons(Particle& p, int i_nuclide);
2018-11-17 09:24:31 -06:00
2023-01-10 10:39:22 +07:00
//! Split or Roulette particles based their weight and the lower weight window
//! bound.
//
//! \param[in] p, particle to be split or rouletted with the weight window.
void split_particle(Particle& p);
2018-11-17 09:24:31 -06:00
} // namespace openmc
#endif // OPENMC_PHYSICS_H