LCOV - code coverage report
Current view: top level - src/postprocessors - SCMPinPowerPostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #32971 (54bef8) with base c6cf66 Lines: 20 22 90.9 %
Date: 2026-05-29 20:40:47 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "SCMPinPowerPostprocessor.h"
      11             : #include "FEProblemBase.h"
      12             : #include "MooseMesh.h"
      13             : #include "SCM.h"
      14             : #include "SubChannel1PhaseProblem.h"
      15             : 
      16             : registerMooseObject("SubChannelApp", SCMPinPowerPostprocessor);
      17             : 
      18             : InputParameters
      19         112 : SCMPinPowerPostprocessor::validParams()
      20             : {
      21         112 :   InputParameters params = GeneralPostprocessor::validParams();
      22         112 :   params.addClassDescription(
      23             :       "Calculates the total heat rate that goes into the coolant from all the heated fuel-pins "
      24             :       "based on aux variable q_prime");
      25         112 :   return params;
      26           0 : }
      27             : 
      28          56 : SCMPinPowerPostprocessor::SCMPinPowerPostprocessor(const InputParameters & parameters)
      29             :   : GeneralPostprocessor(parameters),
      30          56 :     _mesh(SCM::getConstMesh<SubChannelMesh>(_fe_problem.mesh())),
      31          56 :     _value(0)
      32             : {
      33          56 : }
      34             : 
      35             : void
      36          56 : SCMPinPowerPostprocessor::execute()
      37             : {
      38          56 :   const auto scm_problem = dynamic_cast<SubChannel1PhaseProblem *>(&_fe_problem);
      39          56 :   const auto nz = _mesh.getNumOfAxialCells();
      40          56 :   const auto n_channels = _mesh.getNumOfChannels();
      41          56 :   if (!scm_problem)
      42           0 :     mooseError("SCMPinPowerPostprocessor can only be used within a subchannel 1phase problem.");
      43             :   auto power = 0.0;
      44        1026 :   for (unsigned int iz = 1; iz < nz + 1; iz++)
      45       33130 :     for (unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
      46       32160 :       power += scm_problem->getAddedHeatPin(i_ch, iz);
      47          56 :   _value = power;
      48          56 : }
      49             : 
      50             : Real
      51          56 : SCMPinPowerPostprocessor::getValue() const
      52             : {
      53          56 :   return _value;
      54             : }

Generated by: LCOV version 1.14