LCOV - code coverage report
Current view: top level - src/auxkernels - SCMBlockedMassFlowRateAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31405 (292dce) with base fef103 Lines: 21 22 95.5 %
Date: 2025-09-04 07:58:06 Functions: 3 3 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 "SCMBlockedMassFlowRateAux.h"
      11             : #include "SCM.h"
      12             : 
      13             : registerMooseObject("SubChannelApp", SCMBlockedMassFlowRateAux);
      14             : registerMooseObjectRenamed("SubChannelApp",
      15             :                            BlockedMassFlowRateAux,
      16             :                            "06/30/2025 24:00",
      17             :                            SCMBlockedMassFlowRateAux);
      18             : 
      19             : InputParameters
      20          21 : SCMBlockedMassFlowRateAux::validParams()
      21             : {
      22          21 :   InputParameters params = AuxKernel::validParams();
      23          21 :   params.addClassDescription("Computes inlet mass flow rate BCs, from specified mass flux and "
      24             :                              "cross-sectional area and applies blocked inlet conditions");
      25          42 :   params.addRequiredCoupledVar("area", "Cross sectional area [m^2]");
      26          42 :   params.addRequiredParam<PostprocessorName>(
      27             :       "unblocked_mass_flux", "Specified mass flux for unblocked subchannels [kg/s-m^2]");
      28          42 :   params.addRequiredParam<PostprocessorName>(
      29             :       "blocked_mass_flux", "Specified mass flux for blocked subchannels [kg/s-m^2]]");
      30          42 :   params.addRequiredParam<std::vector<unsigned int>>("index_blockage",
      31             :                                                      "index of subchannels affected by blockage");
      32          21 :   return params;
      33           0 : }
      34             : 
      35          12 : SCMBlockedMassFlowRateAux::SCMBlockedMassFlowRateAux(const InputParameters & parameters)
      36             :   : AuxKernel(parameters),
      37          24 :     _subchannel_mesh(SCM::getConstMesh<SubChannelMesh>(_mesh)),
      38          12 :     _unblocked_mass_flux(getPostprocessorValue("unblocked_mass_flux")),
      39          12 :     _blocked_mass_flux(getPostprocessorValue("blocked_mass_flux")),
      40          12 :     _area(coupledValue("area")),
      41          36 :     _index_blockage(getParam<std::vector<unsigned int>>("index_blockage"))
      42             : {
      43          12 : }
      44             : 
      45             : Real
      46         864 : SCMBlockedMassFlowRateAux::computeValue()
      47             : {
      48         864 :   auto i = _subchannel_mesh.getSubchannelIndexFromPoint(*_current_node);
      49             : 
      50        1704 :   for (const auto & index : _index_blockage)
      51             :   {
      52         864 :     if (i == index)
      53          24 :       return _blocked_mass_flux * _area[_qp];
      54             :   }
      55             : 
      56         840 :   return _unblocked_mass_flux * _area[_qp];
      57             : }

Generated by: LCOV version 1.14