LCOV - code coverage report
Current view: top level - src/postprocessors - SCMDuctHeatRatePostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31730 (e8b711) with base e0c998 Lines: 20 22 90.9 %
Date: 2025-10-29 16:55:46 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 "SCMDuctHeatRatePostprocessor.h"
      11             : #include "FEProblemBase.h"
      12             : #include "MooseMesh.h"
      13             : #include "SCM.h"
      14             : #include "SubChannel1PhaseProblem.h"
      15             : 
      16             : registerMooseObject("SubChannelApp", SCMDuctHeatRatePostprocessor);
      17             : 
      18             : InputParameters
      19          18 : SCMDuctHeatRatePostprocessor::validParams()
      20             : {
      21          18 :   InputParameters params = GeneralPostprocessor::validParams();
      22          18 :   params.addClassDescription("Calculates the heat flow that goes into the coolant through the duct "
      23             :                              "based on aux variable duct_heat_flux");
      24          18 :   return params;
      25           0 : }
      26             : 
      27           9 : SCMDuctHeatRatePostprocessor::SCMDuctHeatRatePostprocessor(const InputParameters & parameters)
      28             :   : GeneralPostprocessor(parameters),
      29           9 :     _mesh(SCM::getConstMesh<SubChannelMesh>(_fe_problem.mesh())),
      30           9 :     _value(0)
      31             : {
      32           9 : }
      33             : 
      34             : void
      35           9 : SCMDuctHeatRatePostprocessor::execute()
      36             : {
      37           9 :   const auto scm_problem = dynamic_cast<SubChannel1PhaseProblem *>(&_fe_problem);
      38           9 :   const auto nz = _mesh.getNumOfAxialCells();
      39           9 :   const auto n_channels = _mesh.getNumOfChannels();
      40           9 :   if (!scm_problem)
      41           0 :     mooseError("SCMDuctHeatRatePostprocessor can only be used within a subchannel 1phase problem.");
      42             :   auto power = 0.0;
      43          39 :   for (unsigned int iz = 1; iz < nz + 1; iz++)
      44        1290 :     for (unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
      45        1260 :       power += scm_problem->computeAddedHeatDuct(i_ch, iz);
      46           9 :   _value = power;
      47           9 : }
      48             : 
      49             : Real
      50           9 : SCMDuctHeatRatePostprocessor::getValue() const
      51             : {
      52           9 :   return _value;
      53             : }

Generated by: LCOV version 1.14