Chi-Tech
single_state_mgxs.h
Go to the documentation of this file.
1#ifndef CHI_PHYSICS_SINGLE_STATE_MGXS_H
2#define CHI_PHYSICS_SINGLE_STATE_MGXS_H
3
4#include "multigroup_xs.h"
5
6namespace chi_physics
7{
8
9
10//######################################################################
11/**
12 * A class for handling multi-group cross sections.
13 */
15{
16protected:
17 typedef std::vector<std::pair<double,double>> AnglePairs;
18
19protected:
20 unsigned int num_groups_ = 0; ///< Total number of groups
21 unsigned int scattering_order_ = 0; ///< Legendre scattering order
22 unsigned int num_precursors_ = 0; ///< Number of precursors
23
24 bool is_fissionable_ = false;
25
26 std::vector<std::vector<double>> e_bounds_; ///< Energy bin boundaries in MeV
27
28 std::vector<double> sigma_t_; ///< Total cross section
29 std::vector<double> sigma_a_; ///< Absorption cross section
30 std::vector<double> sigma_f_; ///< Fission cross section
31
32 std::vector<double> nu_sigma_f_;
33 std::vector<double> nu_prompt_sigma_f_;
34 std::vector<double> nu_delayed_sigma_f_;
35
36 std::vector<double> inv_velocity_;
37
38 std::vector<chi_math::SparseMatrix> transfer_matrices_;
39 std::vector<std::vector<double>> production_matrix_;
40
41 std::vector<Precursor> precursors_;
42
43 //Diffusion quantities
45 std::vector<double> diffusion_coeff_; ///< Transport corrected diffusion coeff
46 std::vector<double> sigma_removal_; ///< Removal cross section
47 std::vector<double> sigma_s_gtog_; ///< Within-group scattering xs
48
49 //Monte-Carlo quantities
50protected:
52private:
53 std::vector<std::vector<double>> cdf_gprime_g_;
54 std::vector<std::vector<AnglePairs>> scat_angles_gprime_g_;
55
56public:
57 //00
62 {}
63
64 //00
65 void MakeSimple0(unsigned int num_groups, double sigma_t);
66 void MakeSimple1(unsigned int num_groups, double sigma_t, double c);
67 void MakeCombined(std::vector<std::pair<int,double>>& combinations);
68
69private:
70 void Clear();
71
72public:
73 //01
74 void MakeFromChiXSFile(const std::string &file_name);
75
76private:
77 //02
78 void ComputeAbsorption();
80
81public:
82 //Accessors
83 const unsigned int NumGroups() const override { return num_groups_; }
84
85 const unsigned int ScatteringOrder() const override
86 { return scattering_order_; }
87
88 const unsigned int NumPrecursors() const override { return num_precursors_; }
89
90 const bool IsFissionable() const override { return is_fissionable_; }
91
92 const bool DiffusionInitialized() const override
93 { return diffusion_initialized_; }
94
95 const bool ScatteringInitialized() const override
96 { return scattering_initialized_; }
97
98 const std::vector<double>& SigmaTotal() const override { return sigma_t_; }
99 const std::vector<double>& SigmaAbsorption() const override { return sigma_a_; }
100 const std::vector<double>& SigmaFission() const override { return sigma_f_; }
101
102 const std::vector<double>& NuSigmaF() const override { return nu_sigma_f_; }
103
104 const std::vector<double>& NuPromptSigmaF() const override
105 { return nu_prompt_sigma_f_; }
106
107 const std::vector<double>& NuDelayedSigmaF() const override
108 { return nu_delayed_sigma_f_; }
109
110 const std::vector<double>& InverseVelocity() const override
111 { return inv_velocity_; }
112
113 const std::vector<chi_math::SparseMatrix>& TransferMatrices() const override
114 { return transfer_matrices_; }
115
116 const chi_math::SparseMatrix& TransferMatrix(unsigned int ell) const override
117 { return transfer_matrices_.at(ell); }
118
119 const std::vector<std::vector<double>> ProductionMatrix() const override
120 { return production_matrix_; }
121
122 const std::vector<Precursor>& Precursors() const override
123 { return precursors_; }
124
125 const std::vector<double>& DiffusionCoefficient() const override
126 { return diffusion_coeff_; }
127
128 std::vector<double> SigmaTransport() const override
129 {
130 std::vector<double> sigma_tr(num_groups_, 0.0);
131 for (size_t g = 0; g < num_groups_; ++g)
132 sigma_tr[g] = (1.0/diffusion_coeff_[g])/3.0;
133
134 return sigma_tr;
135 }
136
137 const std::vector<double>& SigmaRemoval() const override
138 { return sigma_removal_; }
139
140 const std::vector<double>& SigmaSGtoG() const override
141 { return sigma_s_gtog_; }
142};
143
144}//namespace chi_physics
145
146
147#endif //CHI_PHYSICS_SINGLE_STATE_MGXS_H
const std::vector< double > & SigmaRemoval() const override
std::vector< double > diffusion_coeff_
Transport corrected diffusion coeff.
unsigned int scattering_order_
Legendre scattering order.
const bool ScatteringInitialized() const override
std::vector< double > sigma_f_
Fission cross section.
std::vector< double > sigma_removal_
Removal cross section.
std::vector< std::vector< double > > production_matrix_
const std::vector< double > & NuPromptSigmaF() const override
const std::vector< double > & SigmaFission() const override
std::vector< double > nu_prompt_sigma_f_
const std::vector< std::vector< double > > ProductionMatrix() const override
unsigned int num_groups_
Total number of groups.
std::vector< std::vector< double > > e_bounds_
Energy bin boundaries in MeV.
const bool IsFissionable() const override
unsigned int num_precursors_
Number of precursors.
std::vector< double > sigma_t_
Total cross section.
std::vector< std::vector< AnglePairs > > scat_angles_gprime_g_
std::vector< chi_math::SparseMatrix > transfer_matrices_
std::vector< double > inv_velocity_
const std::vector< chi_math::SparseMatrix > & TransferMatrices() const override
std::vector< double > sigma_s_gtog_
Within-group scattering xs.
const unsigned int NumGroups() const override
std::vector< std::vector< double > > cdf_gprime_g_
void MakeCombined(std::vector< std::pair< int, double > > &combinations)
std::vector< Precursor > precursors_
const unsigned int ScatteringOrder() const override
const std::vector< double > & NuSigmaF() const override
const bool DiffusionInitialized() const override
const std::vector< double > & NuDelayedSigmaF() const override
const chi_math::SparseMatrix & TransferMatrix(unsigned int ell) const override
const unsigned int NumPrecursors() const override
std::vector< double > SigmaTransport() const override
const std::vector< double > & SigmaTotal() const override
const std::vector< Precursor > & Precursors() const override
const std::vector< double > & SigmaSGtoG() const override
void MakeSimple0(unsigned int num_groups, double sigma_t)
std::vector< double > nu_sigma_f_
const std::vector< double > & DiffusionCoefficient() const override
const std::vector< double > & SigmaAbsorption() const override
const std::vector< double > & InverseVelocity() const override
std::vector< std::pair< double, double > > AnglePairs
std::vector< double > nu_delayed_sigma_f_
void MakeSimple1(unsigned int num_groups, double sigma_t, double c)
void MakeFromChiXSFile(const std::string &file_name)
std::vector< double > sigma_a_
Absorption cross section.