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

Generated by: LCOV version 1.14