LCOV - code coverage report
Current view: top level - src/ics - SCMQuadFlowAreaIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31405 (292dce) with base fef103 Lines: 32 33 97.0 %
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 "SCMQuadFlowAreaIC.h"
      11             : 
      12             : #include "SubChannelMesh.h"
      13             : #include "QuadSubChannelMesh.h"
      14             : #include "SCM.h"
      15             : 
      16             : registerMooseObject("SubChannelApp", SCMQuadFlowAreaIC);
      17             : registerMooseObjectRenamed("SubChannelApp", QuadFlowAreaIC, "06/30/2025 24:00", SCMQuadFlowAreaIC);
      18             : 
      19             : InputParameters
      20         303 : SCMQuadFlowAreaIC::validParams()
      21             : {
      22         303 :   InputParameters params = QuadSubChannelBaseIC::validParams();
      23         303 :   params.addClassDescription(
      24             :       "Computes subchannel flow area in the square lattice subchannel arrangement");
      25         303 :   return params;
      26           0 : }
      27             : 
      28         161 : SCMQuadFlowAreaIC::SCMQuadFlowAreaIC(const InputParameters & params)
      29         161 :   : QuadSubChannelBaseIC(params), _subchannel_mesh(SCM::getConstMesh<SubChannelMesh>(_mesh))
      30             : {
      31         161 : }
      32             : 
      33             : Real
      34       99512 : SCMQuadFlowAreaIC::value(const Point & p)
      35             : {
      36             :   Real standard_area, rod_area, additional_area;
      37       99512 :   auto pitch = _mesh.getPitch();
      38       99512 :   auto pin_diameter = _mesh.getPinDiameter();
      39       99512 :   auto side_gap = _mesh.getSideGap();
      40       99512 :   auto z_blockage = _mesh.getZBlockage();
      41       99512 :   auto index_blockage = _mesh.getIndexBlockage();
      42       99512 :   auto reduction_blockage = _mesh.getReductionBlockage();
      43       99512 :   auto i = _mesh.getSubchannelIndexFromPoint(p);
      44       99512 :   auto subch_type = _mesh.getSubchannelType(i);
      45             : 
      46       99512 :   if (subch_type == EChannelType::CORNER)
      47             :   {
      48       16040 :     standard_area = 0.25 * pitch * pitch;
      49       16040 :     rod_area = 0.25 * 0.25 * M_PI * pin_diameter * pin_diameter;
      50       16040 :     additional_area = pitch * side_gap + side_gap * side_gap;
      51             :   }
      52       83472 :   else if (subch_type == EChannelType::EDGE)
      53             :   {
      54       44928 :     standard_area = 0.5 * pitch * pitch;
      55       44928 :     rod_area = 0.5 * 0.25 * M_PI * pin_diameter * pin_diameter;
      56       44928 :     additional_area = pitch * side_gap;
      57             :   }
      58             :   else
      59             :   {
      60       38544 :     standard_area = pitch * pitch;
      61       38544 :     rod_area = 0.25 * M_PI * pin_diameter * pin_diameter;
      62             :     additional_area = 0.0;
      63             :   }
      64             : 
      65             :   /// Calculate subchannel area
      66       99512 :   auto subchannel_area = standard_area + additional_area - rod_area;
      67             : 
      68             :   /// Apply area reduction on subchannels affected by blockage
      69             :   auto index = 0;
      70      198906 :   for (const auto & i_blockage : index_blockage)
      71             :   {
      72       99512 :     if (i == i_blockage && (p(2) >= z_blockage.front() && p(2) <= z_blockage.back()))
      73             :     {
      74         118 :       return reduction_blockage[index] * subchannel_area;
      75             :     }
      76       99394 :     index++;
      77             :   }
      78             : 
      79             :   return subchannel_area;
      80       99512 : }

Generated by: LCOV version 1.14