LCOV - code coverage report
Current view: top level - src/ics - SCMTriWettedPerimIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31405 (292dce) with base fef103 Lines: 26 27 96.3 %
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 "SCMTriWettedPerimIC.h"
      11             : #include "TriSubChannelMesh.h"
      12             : 
      13             : registerMooseObject("SubChannelApp", SCMTriWettedPerimIC);
      14             : registerMooseObjectRenamed("SubChannelApp",
      15             :                            TriWettedPerimIC,
      16             :                            "06/30/2025 24:00",
      17             :                            SCMTriWettedPerimIC);
      18             : 
      19             : InputParameters
      20         274 : SCMTriWettedPerimIC::validParams()
      21             : 
      22             : {
      23         274 :   InputParameters params = TriSubChannelBaseIC::validParams();
      24         274 :   params.addClassDescription(
      25             :       "Computes wetted perimeter of subchannels in a triangular lattice arrangement");
      26         274 :   return params;
      27           0 : }
      28             : 
      29         154 : SCMTriWettedPerimIC::SCMTriWettedPerimIC(const InputParameters & params)
      30         154 :   : TriSubChannelBaseIC(params)
      31             : {
      32         154 : }
      33             : 
      34             : Real
      35      372240 : SCMTriWettedPerimIC::value(const Point & p)
      36             : {
      37             :   // Define geometry parameters.
      38      372240 :   auto pitch = _mesh.getPitch();
      39      372240 :   auto pin_diameter = _mesh.getPinDiameter();
      40      372240 :   auto wire_diameter = _mesh.getWireDiameter();
      41      372240 :   auto wire_lead_length = _mesh.getWireLeadLength();
      42      372240 :   auto rod_circumference = libMesh::pi * pin_diameter;
      43      372240 :   auto wire_circumference = libMesh::pi * wire_diameter;
      44      372240 :   auto gap = _mesh.getDuctToPinGap();
      45      372240 :   auto theta = std::acos(wire_lead_length /
      46      372240 :                          std::sqrt(std::pow(wire_lead_length, 2) +
      47      372240 :                                    std::pow(libMesh::pi * (pin_diameter + wire_diameter), 2)));
      48             :   // given the channel number, i, it computes the wetted perimeter of
      49             :   // the subchannel based on the subchannel type: CENTER, EDGE or CORNER.
      50      372240 :   auto i = _mesh.getSubchannelIndexFromPoint(p);
      51      372240 :   auto subch_type = _mesh.getSubchannelType(i);
      52             : 
      53      372240 :   if (subch_type == EChannelType::CENTER)
      54             :   {
      55      244080 :     return 0.5 * rod_circumference + 0.5 * wire_circumference / std::cos(theta);
      56             :   }
      57      128160 :   else if (subch_type == EChannelType::EDGE)
      58             :   {
      59       90000 :     return 0.5 * rod_circumference + 0.5 * wire_circumference / std::cos(theta) + pitch;
      60             :   }
      61             :   else
      62             :   {
      63       38160 :     return (rod_circumference + wire_circumference / std::cos(theta)) / 6.0 +
      64       38160 :            2.0 / std::sqrt(3.0) * (pin_diameter / 2.0 + gap);
      65             :   }
      66             : }

Generated by: LCOV version 1.14