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

Generated by: LCOV version 1.14