LCOV - code coverage report
Current view: top level - include/utils - HexagonalLatticeUtils.h (source / functions) Hit Total Coverage
Test: idaholab/moose reactor: #31405 (292dce) with base fef103 Lines: 25 25 100.0 %
Date: 2025-09-04 07:56:24 Functions: 0 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             : #pragma once
      11             : 
      12             : #include "Moose.h"
      13             : #include "MooseTypes.h"
      14             : 
      15             : #ifndef CARDINAL_ENUM_H
      16             : namespace channel_type
      17             : {
      18             : /// Type of subchannel
      19             : enum ChannelTypeEnum
      20             : {
      21             :   interior,
      22             :   edge,
      23             :   corner
      24             : };
      25             : } // namespace channel_type
      26             : #endif
      27             : 
      28             : /**
      29             :  * Class providing various utility functions related to triangular lattices of pins
      30             :  * enclosed in a hexagonal duct.
      31             :  * Notes:
      32             :  * - the lattice is centered around an axis (X, Y, Z) going through the origin
      33             :  *   If calling the utility for a lattice that is not centered around the origin
      34             :  *   Then the point arguments must first be translated: p -= lattice_center
      35             :  * - You should never have to rotate the point to place it in the lattice frame
      36             :  *   before calling a routine with a point argument.
      37             :  */
      38             : class HexagonalLatticeUtils
      39             : {
      40             : public:
      41             :   HexagonalLatticeUtils(const Real bundle_inner_flat_to_flat,
      42             :                         const Real pin_pitch,
      43             :                         const Real pin_diameter,
      44             :                         const Real wire_diameter,
      45             :                         const Real wire_pitch,
      46             :                         const unsigned int n_rings,
      47             :                         const unsigned int axis,
      48             :                         const Real rotation_around_axis = 0);
      49             : 
      50             :   /**
      51             :    * Distance from a point and a gap
      52             :    * @param[in] pt point, must already be translated to lattice frame
      53             :    * @param[in] gap_index gap index
      54             :    * @ return distance from gap
      55             :    */
      56             :   Real distanceFromGap(const Point & pt, const unsigned int gap_index) const;
      57             : 
      58             :   /**
      59             :    * Get the index for the gap closest to the point
      60             :    * @param[in] point point, must already be translated to lattice frame
      61             :    * @return index of closest gap
      62             :    */
      63             :   unsigned int gapIndex(const Point & point) const;
      64             : 
      65             :   /**
      66             :    * Get the gap index and distance to that gap for a given point
      67             :    * @param[in] point point, must already be translated to lattice frame
      68             :    * @param[out] index index of closest gap
      69             :    * @param[out] distance distance to closest gap
      70             :    */
      71             :   void gapIndexAndDistance(const Point & point, unsigned int & index, Real & distance) const;
      72             : 
      73             :   /**
      74             :    * Get the unit vector translation to move a center point to a duct wall
      75             :    * @param[in] side duct side
      76             :    * @return x-component translation
      77             :    */
      78             :   Real sideTranslationX(const unsigned int side) const { return _unit_translation_x[side]; }
      79             : 
      80             :   /**
      81             :    * Get the unit vector translation to move a center point to a duct wall
      82             :    * @param[in] side duct side
      83             :    * @return y-component translation
      84             :    */
      85             :   Real sideTranslationY(const unsigned int side) const { return _unit_translation_y[side]; }
      86             : 
      87             :   /**
      88             :    * Get the index of the "first" pin in a ring
      89             :    * @param[in] ring ring index
      90             :    * @return first pin
      91             :    */
      92             :   unsigned int firstPinInRing(const unsigned int ring) const;
      93             : 
      94             :   /**
      95             :    * Get the index of the "last" pin in a ring
      96             :    * @param[in] ring ring index
      97             :    * @return last pin
      98             :    */
      99             :   unsigned int lastPinInRing(const unsigned int ring) const;
     100             : 
     101             :   /**
     102             :    * Whether this gap is the "last" in the ring, i.e. connecting the first and last pins of the ring
     103             :    * @param[in] gap_index gap index
     104             :    * @return whether this gap is the last in the ring
     105             :    */
     106             :   bool lastGapInRing(const unsigned int gap_index) const;
     107             : 
     108             :   /**
     109             :    * Get the index of the ring for a certain pin index
     110             :    * @param[in] pin pin index
     111             :    * @return ring index
     112             :    */
     113             :   unsigned int ringIndex(const unsigned int pin) const;
     114             : 
     115             :   /**
     116             :    * Get the unit normals for all of the gaps
     117             :    * @return gap unit normals
     118             :    */
     119             :   const std::vector<Point> & gapUnitNormals() const { return _gap_unit_normals; }
     120             : 
     121             :   /**
     122             :    * Get the number of pins in a given ring
     123             :    * @param[in] n ring number, beginning from 1
     124             :    * @return number of pins in the specified ring
     125             :    */
     126             :   unsigned int pins(const unsigned int n) const;
     127             : 
     128             :   /**
     129             :    * Get the total number of pins for all rings
     130             :    * @param[in] n number of total rings, beginning from 1
     131             :    * @return total number of pins
     132             :    */
     133             :   unsigned int totalPins(const unsigned int n) const;
     134             : 
     135             :   /**
     136             :    * Get the number of rings for a specified number of pins
     137             :    * @param[in] n number of pins
     138             :    * @return number of hexagonal rings
     139             :    */
     140             :   unsigned int rings(const unsigned int n) const;
     141             : 
     142             :   /**
     143             :    * Get the number of interior channels between ring and ring - 1 (0 indexing)
     144             :    * @param[in] ring ring number (relative to 0 indexing)
     145             :    * @return number of interior channels
     146             :    */
     147             :   unsigned int interiorChannels(const unsigned int ring);
     148             : 
     149             :   /**
     150             :    * Get the number of gaps that touch an interior channel
     151             :    * @return number of gaps touching an interior channel
     152             :    */
     153           3 :   unsigned int nInteriorGaps() const { return _n_interior_gaps; }
     154             : 
     155             :   /**
     156             :    * Get the center coordinates of the gaps
     157             :    * @return gap center coordinates
     158             :    */
     159             :   const std::vector<Point> & gapCenters() const { return _gap_centers; }
     160             : 
     161             :   /**
     162             :    * Get the number of gaps
     163             :    * @return number of gaps
     164             :    */
     165          93 :   unsigned int nGaps() const { return _n_gaps; }
     166             : 
     167             :   /**
     168             :    * Get the (pin) pitch-to-diameter ratio
     169             :    * @return pin pitch-to-diameter ratio
     170             :    */
     171             :   Real pitchToDiameter() const { return _P_over_D; }
     172             : 
     173             :   /**
     174             :    * Get the (wire) axial pitch-to-diameter ratio
     175             :    * @return wire axial pitch-to-diameter ratio
     176             :    */
     177             :   Real heightToDiameter() const { return _L_over_D; }
     178             : 
     179             :   /**
     180             :    * Get the vertical axis of the bed along which pins are aligned
     181             :    * @return vertical axis
     182             :    */
     183             :   unsigned int axis() const { return _axis; }
     184             : 
     185             :   /**
     186             :    * Get the pin diameter
     187             :    * @return pin diameter
     188             :    */
     189           1 :   Real pinDiameter() const { return _pin_diameter; }
     190             : 
     191             :   /**
     192             :    * Get the wire pitch
     193             :    * @return wire pitch
     194             :    */
     195           1 :   Real wirePitch() const { return _wire_pitch; }
     196             : 
     197             :   /**
     198             :    * Get the wire diameter
     199             :    * @return wire diameter
     200             :    */
     201           1 :   Real wireDiameter() const { return _wire_diameter; }
     202             : 
     203             :   /**
     204             :    * Get the pin pitch
     205             :    * @return pin pitch
     206             :    */
     207           1 :   Real pinPitch() const { return _pin_pitch; }
     208             : 
     209             :   /**
     210             :    * Get the bundle pitch
     211             :    * @return bundle pitch
     212             :    */
     213           1 :   Real bundlePitch() const { return _bundle_pitch; }
     214             : 
     215             :   /**
     216             :    * Get the pin volume per pitch
     217             :    * @return pin volume per pitch
     218             :    */
     219             :   Real pinVolumePerPitch() const { return _pin_volume_per_pitch; }
     220             : 
     221             :   /**
     222             :    * Get the wire volume per pitch
     223             :    * @return wire volume per pitch
     224             :    */
     225             :   Real wireVolumePerPitch() const { return _wire_volume_per_pitch; }
     226             : 
     227             :   /**
     228             :    * Get the number of interior pins
     229             :    * @return number of interior pins
     230             :    */
     231           4 :   unsigned int nInteriorPins() const { return _n_interior_pins; }
     232             : 
     233             :   /**
     234             :    * Get the number of edge pins
     235             :    * @return number of edge pins
     236             :    */
     237           4 :   unsigned int nEdgePins() const { return _n_edge_pins; }
     238             : 
     239             :   /**
     240             :    * Get the number of corner pins
     241             :    * @return number of corner pins
     242             :    */
     243           4 :   unsigned int nCornerPins() const { return _n_corner_pins; }
     244             : 
     245             :   /**
     246             :    * Get the total number of pins for the lattice
     247             :    * @return total number of pins
     248             :    */
     249       28026 :   unsigned int nPins() const { return _n_pins; }
     250             : 
     251             :   /**
     252             :    * Get the hydraulic diameter of an interior channel
     253             :    * @return hydraulic diameter of an interior channel
     254             :    */
     255             :   Real interiorHydraulicDiameter() const { return _interior_Dh; }
     256             : 
     257             :   /**
     258             :    * Get the hydraulic diameter of an edge channel
     259             :    * @return hydraulic diameter of an edge channel
     260             :    */
     261             :   Real edgeHydraulicDiameter() const { return _edge_Dh; }
     262             : 
     263             :   /**
     264             :    * Get the hydraulic diameter of a corner channel
     265             :    * @return hydraulic diameter of a corner channel
     266             :    */
     267             :   Real cornerHydraulicDiameter() const { return _corner_Dh; }
     268             : 
     269             :   /**
     270             :    * Get the overall bundle hydraulic diameter
     271             :    * @return hydraulic diameter
     272             :    */
     273           6 :   Real hydraulicDiameter() const { return _Dh; }
     274             : 
     275             :   /**
     276             :    * Get the wetted area of an interior channel per wire pitch
     277             :    * @return wetted area of interior channel
     278             :    */
     279           6 :   Real interiorWettedArea() const { return _interior_wetted_area; }
     280             : 
     281             :   /**
     282             :    * Get the wetted area of an edge channel per wire pitch
     283             :    * @return wetted area of edge channel
     284             :    */
     285           6 :   Real edgeWettedArea() const { return _edge_wetted_area; }
     286             : 
     287             :   /**
     288             :    * Get the wetted area of a corner channel per wire pitch
     289             :    * @return wetted area of corner channel
     290             :    */
     291           6 :   Real cornerWettedArea() const { return _corner_wetted_area; }
     292             : 
     293             :   /**
     294             :    * Get the wetted area of entire bundle per wire pitch
     295             :    * @return wetted area of bundle
     296             :    */
     297           6 :   Real wettedArea() const { return _wetted_area; }
     298             : 
     299             :   /**
     300             :    * Get the flow volume of an interior channel per wire pitch
     301             :    * @return flow volume of interior channel
     302             :    */
     303           6 :   Real interiorFlowVolume() const { return _interior_flow_volume; }
     304             : 
     305             :   /**
     306             :    * Get the flow volume of an edge channel per wire pitch
     307             :    * @return flow volume of edge channel
     308             :    */
     309           6 :   Real edgeFlowVolume() const { return _edge_flow_volume; }
     310             : 
     311             :   /**
     312             :    * Get the flow volume of an corner channel per wire pitch
     313             :    * @return flow volume of corner channel
     314             :    */
     315           6 :   Real cornerFlowVolume() const { return _corner_flow_volume; }
     316             : 
     317             :   /**
     318             :    * Get the total volume of an interior channel per wire pitch
     319             :    * @return total volume of interior channel
     320             :    */
     321             :   Real interiorVolume() const { return _interior_volume; }
     322             : 
     323             :   /**
     324             :    * Get the total volume of an edge channel per wire pitch
     325             :    * @return total volume of edge channel
     326             :    */
     327             :   Real edgeVolume() const { return _edge_volume; }
     328             : 
     329             :   /**
     330             :    * Get the total volume of an corner channel per wire pitch
     331             :    * @return total volume of corner channel
     332             :    */
     333             :   Real cornerVolume() const { return _corner_volume; }
     334             : 
     335             :   /**
     336             :    * Get the flow volume of the bundle per wire pitch
     337             :    * @return flow volume of bundle
     338             :    */
     339           6 :   Real flowVolume() const { return _flow_volume; }
     340             : 
     341             :   /**
     342             :    * Get the number of interior channels
     343             :    * @return number of interior channels
     344             :    */
     345          10 :   unsigned int nInteriorChannels() const { return _n_interior_channels; }
     346             : 
     347             :   /**
     348             :    * Get the number of edge channels
     349             :    * @return number of edge channels
     350             :    */
     351          10 :   unsigned int nEdgeChannels() const { return _n_edge_channels; }
     352             : 
     353             :   /**
     354             :    * Get the number of corner channels
     355             :    * @return number of corner channels
     356             :    */
     357          10 :   unsigned int nCornerChannels() const { return _n_corner_channels; }
     358             : 
     359             :   /**
     360             :    * Get the total number of channels
     361             :    * @return number of channels
     362             :    */
     363           4 :   unsigned int nChannels() const { return _n_channels; }
     364             : 
     365             :   /**
     366             :    * Get the distance between the outermost pins and the duct walls
     367             :    * @return pin-bundle spacing
     368             :    */
     369         220 :   Real pinBundleSpacing() const { return _pin_bundle_spacing; }
     370             : 
     371             :   /**
     372             :    * Get the center coordinates of the pins
     373             :    * @return pin center coordinates
     374             :    */
     375             :   const std::vector<Point> & pinCenters() const { return _pin_centers; }
     376             : 
     377             :   /**
     378             :    * Get the corner coordinates of a hexagon surrounding each pin
     379             :    * @return pin center coordinates
     380             :    */
     381             :   const std::vector<std::vector<Point>> & pinCenteredCornerCoordinates() const
     382             :   {
     383             :     return _pin_centered_corner_coordinates;
     384             :   }
     385             : 
     386             :   /**
     387             :    * Get the pin surface area per wire pitch
     388             :    * @return pin surface area per wire pitch
     389             :    */
     390             :   Real pinSurfaceAreaPerPitch() const { return _pin_surface_area_per_pitch; }
     391             : 
     392             :   /**
     393             :    * Get half the distance of the duct that a corner channel is in contact with
     394             :    * @return half the duct length that a corner channel is in contact with
     395             :    */
     396             :   Real cornerEdgeLength() const { return _corner_edge_length; }
     397             : 
     398             :   /**
     399             :    * Get the minimum distance from a point to the duct inner surface
     400             :    * @param[in] p point, must already be translated to lattice frame
     401             :    * @return distance to duct
     402             :    */
     403             :   Real minDuctWallDistance(const Point & p) const;
     404             : 
     405             :   /**
     406             :    * Get the minimum distance from a point to the duct corners
     407             :    * @param[in] p point, must already be translated to lattice frame
     408             :    * @return distance to duct corner
     409             :    */
     410             :   Real minDuctCornerDistance(const Point & p) const;
     411             : 
     412             :   /**
     413             :    * Get the channel type (interior, edge, corner) given a point
     414             :    * @param[in] p point, must already be translated to lattice frame
     415             :    * @return channel type
     416             :    */
     417             :   channel_type::ChannelTypeEnum channelType(const Point & p) const;
     418             : 
     419             :   /**
     420             :    * Get the specific surface area of a channel
     421             :    * @param[in] channel channel type
     422             :    * @return flow volume per wire pitch
     423             :    */
     424             :   Real channelSpecificSurfaceArea(const channel_type::ChannelTypeEnum & channel) const;
     425             : 
     426             :   /**
     427             :    * Get the hydraulic diameter of a channel
     428             :    * @param[in] channel channel type
     429             :    * @return hydraulic diameter
     430             :    */
     431             :   Real channelHydraulicDiameter(const channel_type::ChannelTypeEnum & channel) const;
     432             : 
     433             :   /**
     434             :    * Get the pin outer radius
     435             :    * @return pin outer radius
     436             :    */
     437             :   Real pinRadius() const;
     438             : 
     439             :   /**
     440             :    * Get the area of a hexagon with given flat-to-flat distance (pitch)
     441             :    * @param[in] pitch flat-to-flat distance
     442             :    * @return hexagon area
     443             :    */
     444             :   Real hexagonArea(const Real pitch) const;
     445             : 
     446             :   /**
     447             :    * Get the side length of a hexagon with given flat-to-flat distance (pitch)
     448             :    * @param[in] pitch hexagon flat-to-flat distance, or pitch
     449             :    * @return side length of hexagon, to give 1/6 of the hexagon's perimeter
     450             :    */
     451             :   Real hexagonSide(const Real pitch) const;
     452             : 
     453             :   /**
     454             :    * Get the volume of a hexagonal prism per wire pitch
     455             :    * @param[in] side side length
     456             :    * @return hexagonal prism volume
     457             :    */
     458             :   Real hexagonVolume(const Real side) const;
     459             : 
     460             :   /**
     461             :    * Get the pitch of a hexagonal prism based on its per-wire-pitch volume
     462             :    * @param[in] volume volume
     463             :    * @return pitch
     464             :    */
     465             :   Real hexagonPitch(const Real volume) const;
     466             : 
     467             :   /**
     468             :    * Get the area of an equilateral triangle with given side length
     469             :    * @param[in] side side length
     470             :    * @return triangle area
     471             :    */
     472             :   Real triangleArea(const Real side) const;
     473             : 
     474             :   /**
     475             :    * Get the height of an equilateral triangle with given side length
     476             :    * @param[in] side side length
     477             :    * @return triangle height
     478             :    */
     479             :   Real triangleHeight(const Real side) const;
     480             : 
     481             :   /**
     482             :    * Get the side of an equilateral triangle with given height
     483             :    * @param[in] height triangle height
     484             :    * @return triangle side
     485             :    */
     486             :   Real triangleSide(const Real height) const;
     487             : 
     488             :   /**
     489             :    * Get the volume of an equilateral triangle prism per wire pitch
     490             :    * @param[in] side side length
     491             :    * @return triangle prism volume
     492             :    */
     493             :   Real triangleVolume(const Real side) const;
     494             : 
     495             :   /**
     496             :    * Get the pin indices forming the corners of all interior channels
     497             :    * @return pin indices forming the corners of all interior channels
     498             :    */
     499             :   const std::vector<std::vector<unsigned int>> & interiorChannelPinIndices() const
     500             :   {
     501             :     return _interior_channel_pin_indices;
     502             :   }
     503             : 
     504             :   /**
     505             :    * Get the pin indices forming two of the corners of all edge channels
     506             :    * @return pin indices forming two of the corners of all edge channels
     507             :    */
     508             :   const std::vector<std::vector<unsigned int>> & edgeChannelPinIndices() const
     509             :   {
     510             :     return _edge_channel_pin_indices;
     511             :   }
     512             : 
     513             :   /**
     514             :    * Get the pin indices forming one of the corners of all corner channels
     515             :    * @return pin indices forming one of the corners of all corner channels
     516             :    */
     517             :   const std::vector<std::vector<unsigned int>> & cornerChannelPinIndices() const
     518             :   {
     519             :     return _corner_channel_pin_indices;
     520             :   }
     521             : 
     522             :   /**
     523             :    * Get the pin and side indices on each gap
     524             :    * @return pin and side indices on each gap
     525             :    */
     526             :   const std::vector<std::pair<int, int>> & gapIndices() const { return _gap_indices; }
     527             : 
     528             :   /**
     529             :    * For each subchannel, get the indices of the gaps that touch that subchannel
     530             :    * @return indices of gaps touch each channel
     531             :    */
     532             :   const std::vector<std::vector<int>> & localToGlobalGaps() const { return _local_to_global_gaps; }
     533             : 
     534             :   /**
     535             :    * Get the corner coordinates of an interior channel given an ID
     536             :    * (relative to the start of the interior channels)
     537             :    * @param[in] interior_channel_id ID of interior channel
     538             :    * @return corner coordinates of channel
     539             :    */
     540             :   const std::vector<Point>
     541             :   interiorChannelCornerCoordinates(const unsigned int interior_channel_id) const;
     542             : 
     543             :   /**
     544             :    * Get the corner coordinates of an edge channel given an ID
     545             :    * (relative to the start of the edge channels)
     546             :    * @param[in] edge_channel_id ID of edge channel
     547             :    * @return corner coordinates of channel
     548             :    */
     549             :   const std::vector<Point> edgeChannelCornerCoordinates(const unsigned int edge_channel_id) const;
     550             : 
     551             :   /**
     552             :    * Get the corner coordinates of a corner channel given an ID
     553             :    * (relative to the start of the corner channels)
     554             :    * @param[in] corner_channel_id ID of corner channel
     555             :    * @return corner coordinates of channel
     556             :    */
     557             :   const std::vector<Point>
     558             :   cornerChannelCornerCoordinates(const unsigned int corner_channel_id) const;
     559             : 
     560             :   /**
     561             :    * Get the centroid of a channel given the corner coordinates
     562             :    * @param[in] corners corner coordinates
     563             :    * @return channel centroid
     564             :    */
     565             :   Point channelCentroid(const std::vector<Point> & corners) const;
     566             : 
     567             :   /**
     568             :    * Get the pin index given a point. The pin index is for the entire hexagon around the pin
     569             :    * @param[in] point point, must already be translated to lattice frame
     570             :    * @return pin index
     571             :    */
     572             :   unsigned int pinIndex(const Point & point) const;
     573             : 
     574             :   /**
     575             :    * Get the closest pin index given a point outside the lattice
     576             :    * @param[in] point point, must already be translated to lattice frame
     577             :    * @return pin index
     578             :    */
     579             :   unsigned int closestPinIndex(const Point & point) const;
     580             : 
     581             :   /**
     582             :    * Get the channel index given a point
     583             :    * @param[in] point point, must already be translated to lattice frame
     584             :    * @return channel index
     585             :    */
     586             :   unsigned int channelIndex(const Point & point) const;
     587             : 
     588             :   /**
     589             :    * Whether the point is inside the lattice
     590             :    * @param point point being examined, must already be translated to lattice frame
     591             :    */
     592             :   bool insideLattice(const Point & point) const;
     593             : 
     594             :   /**
     595             :    * Conversion from lattice pin indexing to the 2D input file index. The indexing matches like
     596             :    * this. Note that you have a 30 degree rotation between the 2D input and the positions output
     597             :    *  2 1
     598             :    * 3 0 6
     599             :    *  4 5
     600             :    * @param pin_index index of the pin in the utility ring-wise indexing
     601             :    * @param row_index row index (from the top) in the 2D input
     602             :    * @param within_row_index index within the row
     603             :    */
     604             :   void get2DInputPatternIndex(const unsigned int pin_index,
     605             :                               unsigned int & row_index,
     606             :                               unsigned int & within_row_index) const;
     607             : 
     608             : protected:
     609             :   /**
     610             :    * Get the global gap index from the local gap index
     611             :    * @param[in] local_gap local gap for a channel
     612             :    * @return global gap index
     613             :    */
     614             :   unsigned int globalGapIndex(const std::pair<int, int> & local_gap) const;
     615             : 
     616             :   /// Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct)
     617             :   const Real _bundle_pitch;
     618             : 
     619             :   /// Pin pitch
     620             :   const Real _pin_pitch;
     621             : 
     622             :   /// Pin diameter
     623             :   const Real _pin_diameter;
     624             : 
     625             :   /// Wire diameter
     626             :   const Real _wire_diameter;
     627             : 
     628             :   /// Wire pitch
     629             :   const Real _wire_pitch;
     630             : 
     631             :   /// Total number of rings of pins
     632             :   const unsigned int _n_rings;
     633             : 
     634             :   /// Vertical axis of the bundle along which the pins are aligned
     635             :   const unsigned int _axis;
     636             : 
     637             :   /// Rotation around the axis to apply to the lattice
     638             :   const Real _rotation_around_axis;
     639             : 
     640             :   /// Rotation matrix to apply the rotation why
     641             :   const RealTensorValue _rotation_matrix;
     642             : 
     643             :   /// Side length of duct
     644             :   const Real _bundle_side_length;
     645             : 
     646             :   /// Pin cross-sectional area
     647             :   const Real _pin_area;
     648             : 
     649             :   /// Pin circumference
     650             :   const Real _pin_circumference;
     651             : 
     652             :   /// Wire cross-sectional area
     653             :   const Real _wire_area;
     654             : 
     655             :   /// Wire circumference
     656             :   const Real _wire_circumference;
     657             : 
     658             :   /// Pin surface area per wire pitch
     659             :   const Real _pin_surface_area_per_pitch;
     660             : 
     661             :   /// Single-pin volume per wire pitch
     662             :   const Real _pin_volume_per_pitch;
     663             : 
     664             :   /// Pitch-to-diameter ratio
     665             :   const Real _P_over_D;
     666             : 
     667             :   /// Wire axial lead length to diameter ratio
     668             :   const Real _L_over_D;
     669             : 
     670             :   /// Wire surface area per wire pitch
     671             :   Real _wire_surface_area_per_pitch;
     672             : 
     673             :   /// Spacing between the duct inner wall and the pin surface
     674             :   Real _pin_bundle_spacing;
     675             : 
     676             :   /// Single-wire volume per wire pitch
     677             :   Real _wire_volume_per_pitch;
     678             : 
     679             :   /// Total number of pins
     680             :   unsigned int _n_pins;
     681             : 
     682             :   /// Number of interior pins
     683             :   unsigned int _n_interior_pins;
     684             : 
     685             :   /// Number of edge pins
     686             :   unsigned int _n_edge_pins;
     687             : 
     688             :   /// Number of corner pins
     689             :   unsigned int _n_corner_pins;
     690             : 
     691             :   /// Total number of channels
     692             :   unsigned int _n_channels;
     693             : 
     694             :   /// Total number of interior channels
     695             :   unsigned int _n_interior_channels;
     696             : 
     697             :   /// Total number of edge channels
     698             :   unsigned int _n_edge_channels;
     699             : 
     700             :   /// Total number of corner channels
     701             :   unsigned int _n_corner_channels;
     702             : 
     703             :   /// Half the distance for which a corner channel is in contact with the duct
     704             :   Real _corner_edge_length;
     705             : 
     706             :   /// Hydraulic diameter of interior channel
     707             :   Real _interior_Dh;
     708             : 
     709             :   /// Hydraulic diameter of edge channel
     710             :   Real _edge_Dh;
     711             : 
     712             :   /// Hydraulic diameter of corner channel
     713             :   Real _corner_Dh;
     714             : 
     715             :   /// Bundle-wide hydraulic diameter
     716             :   Real _Dh;
     717             : 
     718             :   /// Flow volume of an interior channel per wire pitch
     719             :   Real _interior_flow_volume;
     720             : 
     721             :   /// Flow volume of an edge channel per wire pitch
     722             :   Real _edge_flow_volume;
     723             : 
     724             :   /// Flow volume of a corner channel per wire pitch
     725             :   Real _corner_flow_volume;
     726             : 
     727             :   /// Total volume of an interior channel per wire pitch
     728             :   Real _interior_volume;
     729             : 
     730             :   /// Total volume of an edge channel per wire pitch
     731             :   Real _edge_volume;
     732             : 
     733             :   /// Total volume of a corner channel per wire pitch
     734             :   Real _corner_volume;
     735             : 
     736             :   /// Bundle-wide flow volume per wire pitch
     737             :   Real _flow_volume;
     738             : 
     739             :   /// Wetted area of an interior channel per wire pitch
     740             :   Real _interior_wetted_area;
     741             : 
     742             :   /// Wetted area of an edge channel per wire pitch
     743             :   Real _edge_wetted_area;
     744             : 
     745             :   /// Wetted area of a corner channel per wire pitch
     746             :   Real _corner_wetted_area;
     747             : 
     748             :   /// Wetted area of entire bundle per wire pitch
     749             :   Real _wetted_area;
     750             : 
     751             :   /// Pin center coordinates
     752             :   std::vector<Point> _pin_centers;
     753             : 
     754             :   /// Corner coordinates of a hexagon surrounding each pin
     755             :   std::vector<std::vector<Point>> _pin_centered_corner_coordinates;
     756             : 
     757             :   /// Six corner coordinates for the ducts
     758             :   std::vector<Point> _duct_corners;
     759             : 
     760             :   /**
     761             :    * Coefficients in the line equations defining each duct wall
     762             :    *
     763             :    * Coefficients \f$a\f$, \f$b\f$, and \f$c\f$ in equation \f$ax+by+c=0\f$ that
     764             :    * defines each wall of the duct.
     765             :    */
     766             :   std::vector<std::vector<Real>> _duct_coeffs;
     767             : 
     768             :   /// Pin indices forming the corner of each interior channel
     769             :   std::vector<std::vector<unsigned int>> _interior_channel_pin_indices;
     770             : 
     771             :   /// Pin indices forming two of the corners of each edge channel
     772             :   std::vector<std::vector<unsigned int>> _edge_channel_pin_indices;
     773             : 
     774             :   /// Pin indices forming one of the corners of each corner channel
     775             :   std::vector<std::vector<unsigned int>> _corner_channel_pin_indices;
     776             : 
     777             :   /// Gap indices, connecting two pins or one pin and a side, ordered by global gap ID
     778             :   std::vector<std::pair<int, int>> _gap_indices;
     779             : 
     780             :   /// Local-to-global gap indexing, ordered by channel ID
     781             :   std::vector<std::vector<int>> _local_to_global_gaps;
     782             : 
     783             :   /// Two points on each gap, in order to compute distance-from-gap calculations
     784             :   std::vector<std::vector<Point>> _gap_points;
     785             : 
     786             :   /// Unit normal vectors for each gap
     787             :   std::vector<Point> _gap_unit_normals;
     788             : 
     789             :   /// Number of gaps that touch an interior channel
     790             :   unsigned int _n_interior_gaps;
     791             : 
     792             :   /// Total number of gaps
     793             :   unsigned int _n_gaps;
     794             : 
     795             :   static const Real SIN60;
     796             : 
     797             :   static const Real COS60;
     798             : 
     799             :   /// Number of sides in a hexagon
     800             :   static const unsigned int NUM_SIDES;
     801             : 
     802             :   /// (unitless) x-translations to apply to move from a center point to a side of a hexagon
     803             :   std::vector<Real> _unit_translation_x;
     804             : 
     805             :   /// (unitless) y-translations to apply to move from a center point to a side of a hexagon
     806             :   std::vector<Real> _unit_translation_y;
     807             : 
     808             :   /// Center points of all the gaps
     809             :   std::vector<Point> _gap_centers;
     810             : 
     811             :   /// Index representing "first" coordinate of 2-D plane
     812             :   unsigned int _ix;
     813             : 
     814             :   /// Index representing "second" coordinate of 2-D plane
     815             :   unsigned int _iy;
     816             : 
     817             : private:
     818             :   /// Determine the global gap indices, sorted first by lower pin ID and next by higher pin ID
     819             :   void computeGapIndices();
     820             : 
     821             :   /// Compute the number of pins and channels and their types for the lattice
     822             :   void computePinAndChannelTypes();
     823             : 
     824             :   /// Compute the spacing between the outer pins and the duct inner walls
     825             :   void computePinBundleSpacing();
     826             : 
     827             :   /// Compute the volume and surface area const occupied by the wire in one with pitch
     828             :   void computeWireVolumeAndAreaPerPitch();
     829             : 
     830             :   /// Compute the flow volumes for each channel type
     831             :   void computeFlowVolumes();
     832             : 
     833             :   /// Compute the wetted areas for each channel type
     834             :   void computeWettedAreas();
     835             : 
     836             :   /// Compute the hydraulic diameters for each channel type
     837             :   void computeHydraulicDiameters();
     838             : 
     839             :   /**
     840             :    * \brief Compute the pin center coordinates and the duct corner coordinates
     841             :    *
     842             :    * Compute the x, y, z coordinates of the pincells based on a bundle centered on (0, 0, 0)
     843             :    * and with pins aligned in the z direction. Also compute the corner coordinates of the ducts
     844             :    */
     845             :   void computePinAndDuctCoordinates();
     846             : 
     847             :   /// Get the pin indices that form the corners of each channel type
     848             :   void computeChannelPinIndices();
     849             : };

Generated by: LCOV version 1.14