Chi-Tech
lbs_06c_compute_precursors.cc
Go to the documentation of this file.
2
4
5#include "chi_runtime.h"
6
7
8//###################################################################
9/**Compute the steady state delayed neutron precursor concentrations.*/
11{
12 const size_t J = max_precursors_per_material_;
13
15
16 //================================================== Loop over cells
17 for (const auto& cell : grid_ptr_->local_cells)
18 {
19 const auto& fe_values = unit_cell_matrices_[cell.local_id_];
20 const auto& transport_view = cell_transport_views_[cell.local_id_];
21 const double cell_volume = transport_view.Volume();
22
23 //==================== Obtain xs
24 const auto& xs = transport_view.XS();
25 const auto& precursors = xs.Precursors();
26 const auto& nu_delayed_sigma_f = xs.NuDelayedSigmaF();
27
28 //======================================== Loop over precursors
29 for (unsigned int j = 0; j < xs.NumPrecursors(); ++j)
30 {
31 size_t dof = cell.local_id_ * J + j;
32 const auto& precursor = precursors[j];
33 const double coeff = precursor.fractional_yield /
34 precursor.decay_constant;
35
36 //=================================== Loop over nodes
37 for (int i = 0; i < transport_view.NumNodes(); ++i)
38 {
39 const size_t uk_map = transport_view.MapDOF(i, 0, 0);
40 const double node_V_fraction = fe_values.Vi_vectors[i]/cell_volume;
41
42 //============================== Loop over groups
43 for (unsigned int g = 0; g < groups_.size(); ++g)
44 precursor_new_local_[dof] += coeff *
45 nu_delayed_sigma_f[g] *
46 phi_new_local_[uk_map + g] *
47 node_V_fraction;
48 }//for node i
49 }//for precursor j
50
51 }//for cell
52}
std::vector< double > precursor_new_local_
Definition: lbs_solver.h:97
chi_mesh::MeshContinuumPtr grid_ptr_
Definition: lbs_solver.h:75
std::vector< lbs::CellLBSView > cell_transport_views_
Definition: lbs_solver.h:83
std::vector< UnitCellMatrices > unit_cell_matrices_
Definition: lbs_solver.h:81
std::vector< double > phi_new_local_
Definition: lbs_solver.h:95
std::vector< LBSGroup > groups_
Definition: lbs_solver.h:67
size_t max_precursors_per_material_
Definition: lbs_solver.h:65