Chi-Tech
transient_source_function.cc
Go to the documentation of this file.
2
3//###################################################################
4/**Constructor for the transient source function. The only difference
5 * as compared to a steady source function is the treatment of delayed fission.*/
7TransientSourceFunction(const LBSSolver& lbs_solver,
8 double &ref_dt, chi_math::SteppingMethod &method) :
9 SourceFunction(lbs_solver),
10 dt_(ref_dt),
11 method_(method)
12{}
13
14//###################################################################
15/**Customized delayed fission source..*/
17AddDelayedFission(const PrecursorList &precursors,
18 const std::vector<double> &nu_delayed_sigma_f,
19 const double *phi) const
20{
21 const auto& BackwardEuler = chi_math::SteppingMethod::IMPLICIT_EULER;
22 const auto& CrankNicolson = chi_math::SteppingMethod::CRANK_NICOLSON;
23
24 double theta;
25 if (method_ == BackwardEuler) theta = 1.0;
26 else if (method_ == CrankNicolson) theta = 0.5;
27 else theta = 0.7;
28
29 const double eff_dt = theta * dt_;
30
31 double value = 0.0;
32 if (apply_ags_fission_src_)
33 for (size_t gp = first_grp_; gp <= last_grp_; ++gp)
34 if (gp < gs_i_ or gp > gs_f_)
35 for (const auto& precursor : precursors)
36 {
37 const double coeff =
38 precursor.emission_spectrum[g_] *
39 precursor.decay_constant /
40 (1.0 + eff_dt * precursor.decay_constant);
41
42 value += coeff * eff_dt *
43 precursor.fractional_yield *
44 nu_delayed_sigma_f[gp] *
45 phi[gp] /
46 cell_volume_;
47 }
48
49 if (apply_wgs_fission_src_)
50 for (size_t gp = gs_i_; gp <= gs_f_; ++gp)
51 for (const auto& precursor : precursors)
52 {
53 const double coeff =
54 precursor.emission_spectrum[g_] *
55 precursor.decay_constant /
56 (1.0 + eff_dt * precursor.decay_constant);
57
58 value += coeff * eff_dt *
59 precursor.fractional_yield *
60 nu_delayed_sigma_f[gp] *
61 phi[gp] /
62 cell_volume_;
63 }
64
65 return value;
66}
std::vector< chi_physics::MultiGroupXS::Precursor > PrecursorList
double AddDelayedFission(const PrecursorList &precursors, const std::vector< double > &nu_delayed_sigma_f, const double *phi) const override
TransientSourceFunction(const LBSSolver &lbs_solver, double &ref_dt, chi_math::SteppingMethod &method)