LCOV - code coverage report
Current view: top level - src/ics - SCMQuadFlowAreaIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31730 (e8b711) with base e0c998 Lines: 32 33 97.0 %
Date: 2025-10-29 16:55:46 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         479 : SCMQuadFlowAreaIC::validParams()
      21             : {
      22         479 :   InputParameters params = QuadSubChannelBaseIC::validParams();
      23         479 :   params.addClassDescription(
      24             :       "Computes subchannel flow area in the square lattice subchannel arrangement");
      25         479 :   return params;
      26           0 : }
      27             : 
      28         256 : SCMQuadFlowAreaIC::SCMQuadFlowAreaIC(const InputParameters & params)
      29         256 :   : QuadSubChannelBaseIC(params), _subchannel_mesh(SCM::getConstMesh<SubChannelMesh>(_mesh))
      30             : {
      31         256 : }
      32             : 
      33             : Real
      34      103112 : SCMQuadFlowAreaIC::value(const Point & p)
      35             : {
      36             :   Real standard_area, rod_area, additional_area;
      37      103112 :   auto pitch = _mesh.getPitch();
      38      103112 :   auto pin_diameter = _mesh.getPinDiameter();
      39      103112 :   auto side_gap = _mesh.getSideGap();
      40      103112 :   auto z_blockage = _mesh.getZBlockage();
      41      103112 :   auto index_blockage = _mesh.getIndexBlockage();
      42      103112 :   auto reduction_blockage = _mesh.getReductionBlockage();
      43      103112 :   auto i = _mesh.getSubchannelIndexFromPoint(p);
      44      103112 :   auto subch_type = _mesh.getSubchannelType(i);
      45             : 
      46      103112 :   if (subch_type == EChannelType::CORNER)
      47             :   {
      48       19640 :     standard_area = 0.25 * pitch * pitch;
      49       19640 :     rod_area = 0.25 * 0.25 * M_PI * pin_diameter * pin_diameter;
      50       19640 :     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      103112 :   auto subchannel_area = standard_area + additional_area - rod_area;
      67             : 
      68             :   /// Apply area reduction on subchannels affected by blockage
      69             :   auto index = 0;
      70      206088 :   for (const auto & i_blockage : index_blockage)
      71             :   {
      72      103112 :     if (i == i_blockage && (p(2) >= z_blockage.front() && p(2) <= z_blockage.back()))
      73             :     {
      74         136 :       return reduction_blockage[index] * subchannel_area;
      75             :     }
      76      102976 :     index++;
      77             :   }
      78             : 
      79             :   return subchannel_area;
      80      103112 : }

Generated by: LCOV version 1.14