11 if (
method == BackwardEuler) theta = 1.0;
12 else if (
method == CrankNicolson) theta = 0.5;
15 const double eff_dt = theta *
dt_;
18 precursor_new_local_.assign(precursor_new_local_.size(), 0.0);
23 for (
auto& cell : grid_ptr_->local_cells)
25 const auto& fe_values = unit_cell_matrices_[cell.local_id_];
26 const auto& transport_view = cell_transport_views_[cell.local_id_];
27 const double cell_volume = transport_view.Volume();
30 const auto& xs = matid_to_xs_map_.at(cell.material_id_);
31 const auto& precursors = xs->Precursors();
32 const auto& nu_delayed_sigma_f = xs->NuDelayedSigmaF();
35 double delayed_fission = 0.0;
36 for (
int i = 0; i < transport_view.NumNodes(); ++i)
38 const size_t uk_map = transport_view.MapDOF(i, 0, 0);
39 const double node_V_fraction = fe_values.Vi_vectors[i]/cell_volume;
41 for (
int g = 0; g < groups_.size(); ++g)
42 delayed_fission += nu_delayed_sigma_f[g] *
43 phi_new_local_[uk_map + g] *
48 const auto& max_precursors = max_precursors_per_material_;
49 for (
unsigned int j = 0; j < xs->NumPrecursors(); ++j)
51 const size_t dof_map = cell.local_id_ * max_precursors + j;
52 const auto& precursor = precursors[j];
53 const double coeff = 1.0 / (1.0 + eff_dt * precursor.decay_constant);
59 precursor_new_local_[dof_map] +=
60 coeff * eff_dt * precursor.fractional_yield * delayed_fission;
66 auto& Cj = precursor_new_local_;
69 const double inv_theta = 1.0/theta;
70 for (
size_t i = 0; i < Cj.size(); ++i)
71 Cj[i] = inv_theta * (Cj[i] + (theta - 1.0) * Cj_prev[i]);
std::vector< double > precursor_prev_local_
chi_math::SteppingMethod method