LCOV - code coverage report
Current view: top level - src/ics - TriInterWrapperFlowAreaIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31405 (292dce) with base fef103 Lines: 27 28 96.4 %
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 "TriInterWrapperFlowAreaIC.h"
      11             : #include "TriInterWrapperMesh.h"
      12             : 
      13             : registerMooseObject("SubChannelApp", TriInterWrapperFlowAreaIC);
      14             : 
      15             : InputParameters
      16          80 : TriInterWrapperFlowAreaIC::validParams()
      17             : {
      18          80 :   InputParameters params = TriInterWrapperBaseIC::validParams();
      19          80 :   params.addClassDescription(
      20             :       "Computes flow area of inter-wrapper cells in a triangualar subchannel lattice");
      21          80 :   return params;
      22           0 : }
      23             : 
      24          41 : TriInterWrapperFlowAreaIC::TriInterWrapperFlowAreaIC(const InputParameters & params)
      25          41 :   : TriInterWrapperBaseIC(params)
      26             : {
      27          41 : }
      28             : 
      29             : Real
      30       25200 : TriInterWrapperFlowAreaIC::value(const Point & p)
      31             : {
      32       25200 :   auto pitch = _mesh.getPitch();
      33       25200 :   auto flat_to_flat = _mesh.getSideX();
      34       25200 :   auto gap = _mesh.getDuctToPinGap();
      35       25200 :   auto element_side = flat_to_flat * std::tan(libMesh::pi / 6.0);
      36       25200 :   auto tight_side_bypass = _mesh.getIsTightSide();
      37       25200 :   auto i = _mesh.getSubchannelIndexFromPoint(p);
      38             :   // given the channel number, i, it computes the flow area of the subchannel
      39             :   // based on the subchannel type: CENTER, EDGE or CORNER.
      40       25200 :   auto subch_type = _mesh.getSubchannelType(i);
      41       25200 :   if (subch_type == EChannelType::CENTER)
      42             :   {
      43       14400 :     return (pitch - flat_to_flat) * element_side * 3.0 / 2.0 +
      44       14400 :            std::sin(libMesh::pi / 3.) * (pitch - flat_to_flat) * (pitch - flat_to_flat) / 2.0;
      45             :   }
      46       10800 :   else if (subch_type == EChannelType::EDGE)
      47             :   {
      48        7200 :     if (tight_side_bypass)
      49        1440 :       return (pitch - flat_to_flat) * element_side * 0.5 + gap * element_side * 2 +
      50        1440 :              gap * gap * std::tan(libMesh::pi / 6.0);
      51             :     else
      52        5760 :       return (pitch - flat_to_flat) * element_side * 1.0 / 2.0 +
      53        5760 :              (element_side + gap * std::tan(libMesh::pi / 6.0) / 2.0) * gap;
      54             :   }
      55             :   else
      56             :   {
      57        3600 :     if (tight_side_bypass)
      58         720 :       return (element_side + gap * std::tan(libMesh::pi / 6.0)) * gap;
      59             :     else
      60        2880 :       return (element_side + gap * std::tan(libMesh::pi / 6.0) / 2.0) * gap;
      61             :   }
      62             : }

Generated by: LCOV version 1.14