• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Open-Sn / opensn / 18380674863

09 Oct 2025 02:45PM UTC coverage: 75.202% (+0.3%) from 74.862%
18380674863

push

github

web-flow
Merge pull request #793 from wdhawkins/remove_cmake_debug_flags

Removing forced use of -O0 for Debug config

18014 of 23954 relevant lines covered (75.2%)

56527302.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/modules/linear_boltzmann_solvers/lbs_problem/source_functions/transient_source_function.cc
1
// SPDX-FileCopyrightText: 2024 The OpenSn Authors <https://open-sn.github.io/opensn/>
2
// SPDX-License-Identifier: MIT
3

4
#include "modules/linear_boltzmann_solvers/lbs_problem/source_functions/transient_source_function.h"
5

6
namespace opensn
7
{
8

9
TransientSourceFunction::TransientSourceFunction(const LBSProblem& lbs_problem,
×
10
                                                 double& ref_dt,
11
                                                 SteppingMethod& method)
×
12
  : SourceFunction(lbs_problem), dt_(ref_dt), method_(method)
×
13
{
14
}
×
15

16
double
17
TransientSourceFunction::DelayedFission(const PrecursorList& precursors,
×
18
                                        const double& rho,
19
                                        const std::vector<double>& nu_delayed_sigma_f,
20
                                        const double* phi) const
21
{
22
  const auto& BackwardEuler = SteppingMethod::IMPLICIT_EULER;
×
23
  const auto& CrankNicolson = SteppingMethod::CRANK_NICOLSON;
×
24

25
  double theta;
×
26
  if (method_ == BackwardEuler)
×
27
    theta = 1.0;
28
  else if (method_ == CrankNicolson)
×
29
    theta = 0.5;
30
  else
31
    theta = 0.7;
×
32

33
  const double eff_dt = theta * dt_;
×
34

35
  double value = 0.0;
×
36
  if (apply_ags_fission_src_)
×
37
    for (size_t gp = first_grp_; gp <= last_grp_; ++gp)
×
38
      if (gp < gs_i_ or gp > gs_f_)
×
39
        for (const auto& precursor : precursors)
×
40
        {
41
          const double coeff = precursor.emission_spectrum[g_] * precursor.decay_constant /
×
42
                               (1.0 + eff_dt * precursor.decay_constant);
×
43

44
          value += coeff * eff_dt * precursor.fractional_yield * rho * nu_delayed_sigma_f[gp] *
×
45
                   phi[gp] / cell_volume_;
×
46
        }
47

48
  if (apply_wgs_fission_src_)
×
49
    for (size_t gp = gs_i_; gp <= gs_f_; ++gp)
×
50
      for (const auto& precursor : precursors)
×
51
      {
52
        const double coeff = precursor.emission_spectrum[g_] * precursor.decay_constant /
×
53
                             (1.0 + eff_dt * precursor.decay_constant);
×
54

55
        value += coeff * eff_dt * precursor.fractional_yield * rho * nu_delayed_sigma_f[gp] *
×
56
                 phi[gp] / cell_volume_;
×
57
      }
58

59
  return value;
×
60
}
61

62
} // namespace opensn
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc