https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
HexagonalLatticeUtils Class Reference

Class providing various utility functions related to triangular lattices of pins enclosed in a hexagonal duct. More...

#include <HexagonalLatticeUtils.h>

Public Member Functions

 HexagonalLatticeUtils (const Real bundle_inner_flat_to_flat, const Real pin_pitch, const Real pin_diameter, const Real wire_diameter, const Real wire_pitch, const unsigned int n_rings, const unsigned int axis)
 
Real distanceFromGap (const Point &pt, const unsigned int gap_index) const
 Distance from a point and a gap. More...
 
unsigned int gapIndex (const Point &point) const
 Get the index for the gap closest to the point. More...
 
void gapIndexAndDistance (const Point &point, unsigned int &index, Real &distance) const
 Get the gap index and distance to that gap for a given point. More...
 
Real sideTranslationX (const unsigned int side) const
 Get the unit vector translation to move a center point to a duct wall. More...
 
Real sideTranslationY (const unsigned int side) const
 Get the unit vector translation to move a center point to a duct wall. More...
 
unsigned int firstPinInRing (const unsigned int ring) const
 Get the index of the "first" pin in a ring. More...
 
unsigned int lastPinInRing (const unsigned int ring) const
 Get the index of the "last" pin in a ring. More...
 
bool lastGapInRing (const unsigned int gap_index) const
 Whether this gap is the "last" in the ring, i.e. More...
 
unsigned int ringIndex (const unsigned int pin) const
 Get the index of the ring for a certain pin index. More...
 
const std::vector< Point > & gapUnitNormals () const
 Get the unit normals for all of the gaps. More...
 
unsigned int pins (const unsigned int n) const
 Get the number of pins in a given ring. More...
 
unsigned int totalPins (const unsigned int n) const
 Get the total number of pins for all rings. More...
 
unsigned int rings (const unsigned int n) const
 Get the number of rings for a specified number of pins. More...
 
unsigned int interiorChannels (const unsigned int ring)
 Get the number of interior channels between ring and ring - 1 (0 indexing) More...
 
unsigned int nInteriorGaps () const
 Get the number of gaps that touch an interior channel. More...
 
const std::vector< Point > & gapCenters () const
 Get the center coordinates of the gaps. More...
 
unsigned int nGaps () const
 Get the number of gaps. More...
 
Real pitchToDiameter () const
 Get the (pin) pitch-to-diameter ratio. More...
 
Real heightToDiameter () const
 Get the (wire) axial pitch-to-diameter ratio. More...
 
unsigned int axis () const
 Get the vertical axis of the bed along which pins are aligned. More...
 
Real pinDiameter () const
 Get the pin diameter. More...
 
Real wirePitch () const
 Get the wire pitch. More...
 
Real wireDiameter () const
 Get the wire diameter. More...
 
Real pinPitch () const
 Get the pin pitch. More...
 
Real bundlePitch () const
 Get the bundle pitch. More...
 
Real pinVolumePerPitch () const
 Get the pin volume per pitch. More...
 
Real wireVolumePerPitch () const
 Get the wire volume per pitch. More...
 
unsigned int nInteriorPins () const
 Get the number of interior pins. More...
 
unsigned int nEdgePins () const
 Get the number of edge pins. More...
 
unsigned int nCornerPins () const
 Get the number of corner pins. More...
 
unsigned int nPins () const
 Get the total number of pins for the lattice. More...
 
Real interiorHydraulicDiameter () const
 Get the hydraulic diameter of an interior channel. More...
 
Real edgeHydraulicDiameter () const
 Get the hydraulic diameter of an edge channel. More...
 
Real cornerHydraulicDiameter () const
 Get the hydraulic diameter of a corner channel. More...
 
Real hydraulicDiameter () const
 Get the overall bundle hydraulic diameter. More...
 
Real interiorWettedArea () const
 Get the wetted area of an interior channel per wire pitch. More...
 
Real edgeWettedArea () const
 Get the wetted area of an edge channel per wire pitch. More...
 
Real cornerWettedArea () const
 Get the wetted area of a corner channel per wire pitch. More...
 
Real wettedArea () const
 Get the wetted area of entire bundle per wire pitch. More...
 
Real interiorFlowVolume () const
 Get the flow volume of an interior channel per wire pitch. More...
 
Real edgeFlowVolume () const
 Get the flow volume of an edge channel per wire pitch. More...
 
Real cornerFlowVolume () const
 Get the flow volume of an corner channel per wire pitch. More...
 
Real interiorVolume () const
 Get the total volume of an interior channel per wire pitch. More...
 
Real edgeVolume () const
 Get the total volume of an edge channel per wire pitch. More...
 
Real cornerVolume () const
 Get the total volume of an corner channel per wire pitch. More...
 
Real flowVolume () const
 Get the flow volume of the bundle per wire pitch. More...
 
unsigned int nInteriorChannels () const
 Get the number of interior channels. More...
 
unsigned int nEdgeChannels () const
 Get the number of edge channels. More...
 
unsigned int nCornerChannels () const
 Get the number of corner channels. More...
 
unsigned int nChannels () const
 Get the total number of channels. More...
 
Real pinBundleSpacing () const
 Get the distance between the outermost pins and the duct walls. More...
 
const std::vector< Point > & pinCenters () const
 Get the center coordinates of the pins. More...
 
const std::vector< std::vector< Point > > & pinCenteredCornerCoordinates () const
 Get the corner coordinates of a hexagon surrounding each pin. More...
 
Real pinSurfaceAreaPerPitch () const
 Get the pin surface area per wire pitch. More...
 
Real cornerEdgeLength () const
 Get half the distance of the duct that a corner channel is in contact with. More...
 
Real minDuctWallDistance (const Point &p) const
 Get the minimum distance from a point to the duct inner surface. More...
 
Real minDuctCornerDistance (const Point &p) const
 Get the minimum distance from a point to the duct corners. More...
 
channel_type::ChannelTypeEnum channelType (const Point &p) const
 Get the channel type (interior, edge, corner) given a point. More...
 
Real channelSpecificSurfaceArea (const channel_type::ChannelTypeEnum &channel) const
 Get the specific surface area of a channel. More...
 
Real channelHydraulicDiameter (const channel_type::ChannelTypeEnum &channel) const
 Get the hydraulic diameter of a channel. More...
 
Real pinRadius () const
 Get the pin outer radius. More...
 
Real hexagonArea (const Real pitch) const
 Get the area of a hexagon with given flat-to-flat distance (pitch) More...
 
Real hexagonSide (const Real pitch) const
 Get the side length of a hexagon with given flat-to-flat distance (pitch) More...
 
Real hexagonVolume (const Real side) const
 Get the volume of a hexagonal prism per wire pitch. More...
 
Real hexagonPitch (const Real volume) const
 Get the pitch of a hexagonal prism based on its per-wire-pitch volume. More...
 
Real triangleArea (const Real side) const
 Get the area of an equilateral triangle with given side length. More...
 
Real triangleHeight (const Real side) const
 Get the height of an equilateral triangle with given side length. More...
 
Real triangleSide (const Real height) const
 Get the side of an equilateral triangle with given height. More...
 
Real triangleVolume (const Real side) const
 Get the volume of an equilateral triangle prism per wire pitch. More...
 
const std::vector< std::vector< unsigned int > > & interiorChannelPinIndices () const
 Get the pin indices forming the corners of all interior channels. More...
 
const std::vector< std::vector< unsigned int > > & edgeChannelPinIndices () const
 Get the pin indices forming two of the corners of all edge channels. More...
 
const std::vector< std::vector< unsigned int > > & cornerChannelPinIndices () const
 Get the pin indices forming one of the corners of all corner channels. More...
 
const std::vector< std::pair< int, int > > & gapIndices () const
 Get the pin and side indices on each gap. More...
 
const std::vector< std::vector< int > > & localToGlobalGaps () const
 For each subchannel, get the indices of the gaps that touch that subchannel. More...
 
const std::vector< Point > interiorChannelCornerCoordinates (const unsigned int interior_channel_id) const
 Get the corner coordinates of an interior channel given an ID (relative to the start of the interior channels) More...
 
const std::vector< Point > edgeChannelCornerCoordinates (const unsigned int edge_channel_id) const
 Get the corner coordinates of an edge channel given an ID (relative to the start of the edge channels) More...
 
const std::vector< Point > cornerChannelCornerCoordinates (const unsigned int corner_channel_id) const
 Get the corner coordinates of a corner channel given an ID (relative to the start of the corner channels) More...
 
Point channelCentroid (const std::vector< Point > &corners) const
 Get the centroid of a channel given the corner coordinates. More...
 
unsigned int pinIndex (const Point &point) const
 Get the pin index given a point. More...
 
unsigned int closestPinIndex (const Point &point) const
 Get the closest pin index given a point outside the lattice. More...
 
unsigned int channelIndex (const Point &point) const
 Get the channel index given a point. More...
 
bool insideLattice (const Point &point) const
 Whether the point is inside the lattice. More...
 
void get2DInputPatternIndex (const unsigned int pin_index, unsigned int &row_index, unsigned int &within_row_index) const
 Conversion from lattice pin indexing to the 2D input file index. More...
 

Protected Member Functions

unsigned int globalGapIndex (const std::pair< int, int > &local_gap) const
 Get the global gap index from the local gap index. More...
 

Protected Attributes

const Real _bundle_pitch
 Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct) More...
 
const Real _pin_pitch
 Pin pitch. More...
 
const Real _pin_diameter
 Pin diameter. More...
 
const Real _wire_diameter
 Wire diameter. More...
 
const Real _wire_pitch
 Wire pitch. More...
 
const unsigned int _n_rings
 Total number of rings of pins. More...
 
const unsigned int _axis
 Vertical axis of the bundle along which the pins are aligned. More...
 
const Real _bundle_side_length
 Side length of duct. More...
 
const Real _pin_area
 Pin cross-sectional area. More...
 
const Real _pin_circumference
 Pin circumference. More...
 
const Real _wire_area
 Wire cross-sectional area. More...
 
const Real _wire_circumference
 Wire circumference. More...
 
const Real _pin_surface_area_per_pitch
 Pin surface area per wire pitch. More...
 
const Real _pin_volume_per_pitch
 Single-pin volume per wire pitch. More...
 
const Real _P_over_D
 Pitch-to-diameter ratio. More...
 
const Real _L_over_D
 Wire axial lead length to diameter ratio. More...
 
Real _wire_surface_area_per_pitch
 Wire surface area per wire pitch. More...
 
Real _pin_bundle_spacing
 Spacing between the duct inner wall and the pin surface. More...
 
Real _wire_volume_per_pitch
 Single-wire volume per wire pitch. More...
 
unsigned int _n_pins
 Total number of pins. More...
 
unsigned int _n_interior_pins
 Number of interior pins. More...
 
unsigned int _n_edge_pins
 Number of edge pins. More...
 
unsigned int _n_corner_pins
 Number of corner pins. More...
 
unsigned int _n_channels
 Total number of channels. More...
 
unsigned int _n_interior_channels
 Total number of interior channels. More...
 
unsigned int _n_edge_channels
 Total number of edge channels. More...
 
unsigned int _n_corner_channels
 Total number of corner channels. More...
 
Real _corner_edge_length
 Half the distance for which a corner channel is in contact with the duct. More...
 
Real _interior_Dh
 Hydraulic diameter of interior channel. More...
 
Real _edge_Dh
 Hydraulic diameter of edge channel. More...
 
Real _corner_Dh
 Hydraulic diameter of corner channel. More...
 
Real _Dh
 Bundle-wide hydraulic diameter. More...
 
Real _interior_flow_volume
 Flow volume of an interior channel per wire pitch. More...
 
Real _edge_flow_volume
 Flow volume of an edge channel per wire pitch. More...
 
Real _corner_flow_volume
 Flow volume of a corner channel per wire pitch. More...
 
Real _interior_volume
 Total volume of an interior channel per wire pitch. More...
 
Real _edge_volume
 Total volume of an edge channel per wire pitch. More...
 
Real _corner_volume
 Total volume of a corner channel per wire pitch. More...
 
Real _flow_volume
 Bundle-wide flow volume per wire pitch. More...
 
Real _interior_wetted_area
 Wetted area of an interior channel per wire pitch. More...
 
Real _edge_wetted_area
 Wetted area of an edge channel per wire pitch. More...
 
Real _corner_wetted_area
 Wetted area of a corner channel per wire pitch. More...
 
Real _wetted_area
 Wetted area of entire bundle per wire pitch. More...
 
std::vector< Point > _pin_centers
 Pin center coordinates. More...
 
std::vector< std::vector< Point > > _pin_centered_corner_coordinates
 Corner coordinates of a hexagon surrounding each pin. More...
 
std::vector< Point > _duct_corners
 Six corner coordinates for the ducts. More...
 
std::vector< std::vector< Real > > _duct_coeffs
 Coefficients in the line equations defining each duct wall. More...
 
std::vector< std::vector< unsigned int > > _interior_channel_pin_indices
 Pin indices forming the corner of each interior channel. More...
 
std::vector< std::vector< unsigned int > > _edge_channel_pin_indices
 Pin indices forming two of the corners of each edge channel. More...
 
std::vector< std::vector< unsigned int > > _corner_channel_pin_indices
 Pin indices forming one of the corners of each corner channel. More...
 
std::vector< std::pair< int, int > > _gap_indices
 Gap indices, connecting two pins or one pin and a side, ordered by global gap ID. More...
 
std::vector< std::vector< int > > _local_to_global_gaps
 Local-to-global gap indexing, ordered by channel ID. More...
 
std::vector< std::vector< Point > > _gap_points
 Two points on each gap, in order to compute distance-from-gap calculations. More...
 
std::vector< Point > _gap_unit_normals
 Unit normal vectors for each gap. More...
 
unsigned int _n_interior_gaps
 Number of gaps that touch an interior channel. More...
 
unsigned int _n_gaps
 Total number of gaps. More...
 
std::vector< Real_unit_translation_x
 (unitless) x-translations to apply to move from a center point to a side of a hexagon More...
 
std::vector< Real_unit_translation_y
 (unitless) y-translations to apply to move from a center point to a side of a hexagon More...
 
std::vector< Point > _gap_centers
 Center points of all the gaps. More...
 
unsigned int _ix
 Index representing "first" coordinate of 2-D plane. More...
 
unsigned int _iy
 Index representing "second" coordinate of 2-D plane. More...
 

Static Protected Attributes

static const Real SIN60 = std::sqrt(3.0) / 2.0
 
static const Real COS60 = 0.5
 
static const unsigned int NUM_SIDES = 6
 Number of sides in a hexagon. More...
 

Private Member Functions

void computeGapIndices ()
 Determine the global gap indices, sorted first by lower pin ID and next by higher pin ID. More...
 
void computePinAndChannelTypes ()
 Compute the number of pins and channels and their types for the lattice. More...
 
void computePinBundleSpacing ()
 Compute the spacing between the outer pins and the duct inner walls. More...
 
void computeWireVolumeAndAreaPerPitch ()
 Compute the volume and surface area const occupied by the wire in one with pitch. More...
 
void computeFlowVolumes ()
 Compute the flow volumes for each channel type. More...
 
void computeWettedAreas ()
 Compute the wetted areas for each channel type. More...
 
void computeHydraulicDiameters ()
 Compute the hydraulic diameters for each channel type. More...
 
void computePinAndDuctCoordinates ()
 Compute the pin center coordinates and the duct corner coordinates. More...
 
void computeChannelPinIndices ()
 Get the pin indices that form the corners of each channel type. More...
 

Detailed Description

Class providing various utility functions related to triangular lattices of pins enclosed in a hexagonal duct.

Notes:

Definition at line 38 of file HexagonalLatticeUtils.h.

Constructor & Destructor Documentation

◆ HexagonalLatticeUtils()

HexagonalLatticeUtils::HexagonalLatticeUtils ( const Real  bundle_inner_flat_to_flat,
const Real  pin_pitch,
const Real  pin_diameter,
const Real  wire_diameter,
const Real  wire_pitch,
const unsigned int  n_rings,
const unsigned int  axis 
)

Definition at line 18 of file HexagonalLatticeUtils.C.

25  : _bundle_pitch(bundle_inner_flat_to_flat),
26  _pin_pitch(pin_pitch),
27  _pin_diameter(pin_diameter),
28  _wire_diameter(wire_diameter),
29  _wire_pitch(wire_pitch),
30  _n_rings(n_rings),
31  _axis(axis),
33  _pin_area(M_PI * _pin_diameter * _pin_diameter / 4.0),
41 {
43  _ix = idx.first;
44  _iy = idx.second;
45 
46  // object is not tested and probably won't work if axis != 2
47  if (_axis != 2)
48  mooseError("The HexagonalLatticeUtils is currently limited to 'axis = 2'!");
49 
51  mooseError("Pin pitch of " + std::to_string(_pin_pitch) + " cannot fit pins of diameter " +
52  std::to_string(_pin_diameter) + "!");
53 
55  mooseError("Wire diameter of " + std::to_string(_wire_diameter) +
56  " cannot fit between pin-pin space of " +
57  std::to_string(_pin_pitch - _pin_diameter) + "!");
58 
59  _unit_translation_x = {0.0, -SIN60, -SIN60, 0.0, SIN60, SIN60};
60  _unit_translation_y = {1.0, COS60, -COS60, -1.0, -COS60, COS60};
61 
62  // compute number of each pin and channel and channel type (interior, edge channel)
64 
66 
75 
77  mooseError("Specified bundle pitch " + std::to_string(_bundle_pitch) +
78  " is too small to fit the given pins and wire wrap!");
79 }
const Real _wire_diameter
Wire diameter.
void computeGapIndices()
Determine the global gap indices, sorted first by lower pin ID and next by higher pin ID...
const unsigned int _n_rings
Total number of rings of pins.
void computeHydraulicDiameters()
Compute the hydraulic diameters for each channel type.
const Real _wire_area
Wire cross-sectional area.
const Real _pin_diameter
Pin diameter.
void mooseError(Args &&... args)
Real hexagonSide(const Real pitch) const
Get the side length of a hexagon with given flat-to-flat distance (pitch)
const Real _P_over_D
Pitch-to-diameter ratio.
void computePinAndChannelTypes()
Compute the number of pins and channels and their types for the lattice.
const Real _pin_area
Pin cross-sectional area.
void computePinBundleSpacing()
Compute the spacing between the outer pins and the duct inner walls.
const Real _L_over_D
Wire axial lead length to diameter ratio.
const Real _wire_pitch
Wire pitch.
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
Real _corner_edge_length
Half the distance for which a corner channel is in contact with the duct.
const Real _bundle_pitch
Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct) ...
void computeChannelPinIndices()
Get the pin indices that form the corners of each channel type.
const Real _pin_pitch
Pin pitch.
unsigned int _iy
Index representing "second" coordinate of 2-D plane.
std::pair< unsigned int, unsigned int > projectedIndices(const unsigned int axis)
unsigned int _ix
Index representing "first" coordinate of 2-D plane.
const Real _pin_circumference
Pin circumference.
Real _pin_bundle_spacing
Spacing between the duct inner wall and the pin surface.
const Real _pin_volume_per_pitch
Single-pin volume per wire pitch.
void computePinAndDuctCoordinates()
Compute the pin center coordinates and the duct corner coordinates.
const Real _bundle_side_length
Side length of duct.
void computeWettedAreas()
Compute the wetted areas for each channel type.
void computeWireVolumeAndAreaPerPitch()
Compute the volume and surface area const occupied by the wire in one with pitch. ...
const Real _pin_surface_area_per_pitch
Pin surface area per wire pitch.
std::vector< Real > _unit_translation_y
(unitless) y-translations to apply to move from a center point to a side of a hexagon ...
void computeFlowVolumes()
Compute the flow volumes for each channel type.
unsigned int axis() const
Get the vertical axis of the bed along which pins are aligned.
unsigned int _n_edge_channels
Total number of edge channels.
std::vector< Real > _unit_translation_x
(unitless) x-translations to apply to move from a center point to a side of a hexagon ...
const Real _wire_circumference
Wire circumference.
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

Member Function Documentation

◆ axis()

unsigned int HexagonalLatticeUtils::axis ( ) const
inline

Get the vertical axis of the bed along which pins are aligned.

Returns
vertical axis

Definition at line 182 of file HexagonalLatticeUtils.h.

182 { return _axis; }
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.

◆ bundlePitch()

Real HexagonalLatticeUtils::bundlePitch ( ) const
inline

Get the bundle pitch.

Returns
bundle pitch

Definition at line 212 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

212 { return _bundle_pitch; }
const Real _bundle_pitch
Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct) ...

◆ channelCentroid()

Point HexagonalLatticeUtils::channelCentroid ( const std::vector< Point > &  corners) const

Get the centroid of a channel given the corner coordinates.

Parameters
[in]cornerscorner coordinates
Returns
channel centroid

Definition at line 585 of file HexagonalLatticeUtils.C.

586 {
587  int n_pins = pins.size();
588  Point centroid(0.0, 0.0, 0.0);
589  for (const auto & p : pins)
590  centroid += p / n_pins;
591 
592  return centroid;
593 }
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.

◆ channelHydraulicDiameter()

Real HexagonalLatticeUtils::channelHydraulicDiameter ( const channel_type::ChannelTypeEnum channel) const

Get the hydraulic diameter of a channel.

Parameters
[in]channelchannel type
Returns
hydraulic diameter

Definition at line 215 of file HexagonalLatticeUtils.C.

216 {
217  switch (channel)
218  {
220  return _interior_Dh;
221  case channel_type::edge:
222  return _edge_Dh;
224  return _corner_Dh;
225  default:
226  mooseError("Unhandled ChannelTypeEnum in HexagonalLattice!");
227  }
228 }
void mooseError(Args &&... args)
Real _corner_Dh
Hydraulic diameter of corner channel.
Real _interior_Dh
Hydraulic diameter of interior channel.
Real _edge_Dh
Hydraulic diameter of edge channel.

◆ channelIndex()

unsigned int HexagonalLatticeUtils::channelIndex ( const Point &  point) const

Get the channel index given a point.

Parameters
[in]pointpoint, must already be translated to lattice frame
Returns
channel index

Definition at line 650 of file HexagonalLatticeUtils.C.

Referenced by gapIndex(), gapIndexAndDistance(), and TEST_F().

651 {
652  auto channel = channelType(point);
653 
654  switch (channel)
655  {
657  {
658  for (const auto i : make_range(_n_interior_channels))
659  {
660  auto corners = interiorChannelCornerCoordinates(i);
661  if (geom_utils::pointInPolygon(point, corners, _axis))
662  return i;
663  }
664  break;
665  }
666  case channel_type::edge:
667  {
668  for (const auto i : make_range(_n_edge_channels))
669  {
670  auto corners = edgeChannelCornerCoordinates(i);
671  if (geom_utils::pointInPolygon(point, corners, _axis))
672  return i + _n_interior_channels;
673  }
674  break;
675  }
677  {
678  for (const auto i : make_range(_n_corner_channels))
679  {
680  auto corners = cornerChannelCornerCoordinates(i);
681  if (geom_utils::pointInPolygon(point, corners, _axis))
683  }
684  break;
685  }
686  default:
687  mooseError("Unhandled ChannelTypeEnum!");
688  }
689 
690  mooseError(
691  "Point (" + std::to_string(point(0)) + ", " + std::to_string(point(1)) + ", " +
692  std::to_string(point(2)) +
693  ") is not in any channel! This can sometimes happen "
694  "due to:\n\n a) Points in the mesh actually being outside the domain specified with the "
695  "HexagonalLatticeUtils.\n b) Small floating point errors - we recommend using a CONSTANT "
696  "MONOMIAL variable with all related objects.\nYou can also try slightly decreasing the pin "
697  "diameter and/or "
698  "increasing the bundle pitch.");
699 }
void mooseError(Args &&... args)
channel_type::ChannelTypeEnum channelType(const Point &p) const
Get the channel type (interior, edge, corner) given a point.
const std::vector< Point > cornerChannelCornerCoordinates(const unsigned int corner_channel_id) const
Get the corner coordinates of a corner channel given an ID (relative to the start of the corner chann...
unsigned int _n_interior_channels
Total number of interior channels.
const std::vector< Point > edgeChannelCornerCoordinates(const unsigned int edge_channel_id) const
Get the corner coordinates of an edge channel given an ID (relative to the start of the edge channels...
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
bool pointInPolygon(const libMesh::Point &point, const std::vector< libMesh::Point > &corners, const unsigned int axis)
const std::vector< Point > interiorChannelCornerCoordinates(const unsigned int interior_channel_id) const
Get the corner coordinates of an interior channel given an ID (relative to the start of the interior ...
IntRange< T > make_range(T beg, T end)
unsigned int _n_corner_channels
Total number of corner channels.
unsigned int _n_edge_channels
Total number of edge channels.

◆ channelSpecificSurfaceArea()

Real HexagonalLatticeUtils::channelSpecificSurfaceArea ( const channel_type::ChannelTypeEnum channel) const

Get the specific surface area of a channel.

Parameters
[in]channelchannel type
Returns
flow volume per wire pitch

Definition at line 198 of file HexagonalLatticeUtils.C.

200 {
201  switch (channel)
202  {
205  case channel_type::edge:
209  default:
210  mooseError("Unhandled ChannelTypeEnum in HexagonalLattice!");
211  }
212 }
void mooseError(Args &&... args)
Real _corner_volume
Total volume of a corner channel per wire pitch.
Real _interior_wetted_area
Wetted area of an interior channel per wire pitch.
Real _interior_volume
Total volume of an interior channel per wire pitch.
Real _edge_wetted_area
Wetted area of an edge channel per wire pitch.
Real _corner_wetted_area
Wetted area of a corner channel per wire pitch.
Real _edge_volume
Total volume of an edge channel per wire pitch.

◆ channelType()

channel_type::ChannelTypeEnum HexagonalLatticeUtils::channelType ( const Point &  p) const

Get the channel type (interior, edge, corner) given a point.

Parameters
[in]ppoint, must already be translated to lattice frame
Returns
channel type

Definition at line 178 of file HexagonalLatticeUtils.C.

Referenced by channelIndex(), and TEST_F().

179 {
180  const Real distance_to_wall = minDuctWallDistance(p);
181 
182  if (distance_to_wall > _pin_bundle_spacing + pinRadius())
183  return channel_type::interior;
184 
185  // the point is in a corner channel if the right triangle formed by the point,
186  // the corner, and the duct wall has a wall length less than the wall length
187  // of a corner channel
188  const Real distance_to_corner = minDuctCornerDistance(p);
189  Real l = std::sqrt(distance_to_corner * distance_to_corner - distance_to_wall * distance_to_wall);
190 
191  if (l < _corner_edge_length)
192  return channel_type::corner;
193  else
194  return channel_type::edge;
195 }
Real minDuctWallDistance(const Point &p) const
Get the minimum distance from a point to the duct inner surface.
Real _corner_edge_length
Half the distance for which a corner channel is in contact with the duct.
Real _pin_bundle_spacing
Spacing between the duct inner wall and the pin surface.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real pinRadius() const
Get the pin outer radius.
Real minDuctCornerDistance(const Point &p) const
Get the minimum distance from a point to the duct corners.

◆ closestPinIndex()

unsigned int HexagonalLatticeUtils::closestPinIndex ( const Point &  point) const

Get the closest pin index given a point outside the lattice.

Parameters
[in]pointpoint, must already be translated to lattice frame
Returns
pin index

Definition at line 621 of file HexagonalLatticeUtils.C.

622 {
623  // If within the lattice, you must consider all pins. If outside, outer ring suffices
624  unsigned int start_index = 0;
625  if (!insideLattice(point))
626  start_index = firstPinInRing(_n_rings);
627 
628  // Classic minimum search. If more performance is required for a large lattice we may consider
629  // using a KD-Tree instead or checking which ring the point is part of before examining each pin
630  auto min_distance = std::numeric_limits<Real>::max();
631  unsigned int index_min = 0;
632  for (unsigned int i = start_index; i < _n_pins; ++i)
633  {
634  const auto & center = _pin_centers[i];
635  Real dx = center(_ix) - point(_ix);
636  Real dy = center(_iy) - point(_iy);
637  Real distance_from_pin = std::sqrt(dx * dx + dy * dy);
638 
639  if (distance_from_pin < min_distance)
640  {
641  min_distance = distance_from_pin;
642  index_min = i;
643  }
644  }
645 
646  return index_min;
647 }
const unsigned int _n_rings
Total number of rings of pins.
std::vector< Point > _pin_centers
Pin center coordinates.
unsigned int _iy
Index representing "second" coordinate of 2-D plane.
unsigned int _ix
Index representing "first" coordinate of 2-D plane.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int _n_pins
Total number of pins.
unsigned int firstPinInRing(const unsigned int ring) const
Get the index of the "first" pin in a ring.
static const std::string center
Definition: NS.h:28
bool insideLattice(const Point &point) const
Whether the point is inside the lattice.

◆ computeChannelPinIndices()

void HexagonalLatticeUtils::computeChannelPinIndices ( )
private

Get the pin indices that form the corners of each channel type.

Definition at line 436 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

437 {
441 
442  // 3 pins per interior channel
443  for (auto & i : _interior_channel_pin_indices)
444  i.resize(3);
445 
446  // 2 pins per edge channel
447  for (auto & i : _edge_channel_pin_indices)
448  i.resize(2);
449 
450  // 1 pin per corner channel
451  for (auto & i : _corner_channel_pin_indices)
452  i.resize(1);
453 
454  // for each ring of pins, and for each sector, get the "first" pin index in that ring
455  std::vector<std::vector<unsigned int>> starts;
456  starts.resize(_n_rings);
457  for (const auto i : make_range(_n_rings))
458  {
459  starts[i].resize(NUM_SIDES);
460  starts[i][0] = (i == 0) ? 0 : totalPins(i);
461 
462  for (unsigned int j = 1; j < NUM_SIDES; ++j)
463  starts[i][j] = starts[i][j - 1] + i;
464  }
465 
466  unsigned int c = 0;
467  for (const auto i : make_range(_n_rings - 1))
468  {
469  auto channels = interiorChannels(i + 1);
470  unsigned int channels_per_sector = channels / NUM_SIDES;
471 
472  for (const auto j : make_range(NUM_SIDES))
473  {
474  auto prev_inner = starts[i][j];
475  auto prev_outer = starts[i + 1][j];
476 
477  for (const auto k : make_range(channels_per_sector))
478  {
479  bool downward = k % 2 == 0;
480 
481  if (downward)
482  {
483  _interior_channel_pin_indices[c][0] = prev_inner;
484  _interior_channel_pin_indices[c][1] = prev_outer;
485  _interior_channel_pin_indices[c][2] = ++prev_outer;
486  }
487  else
488  {
489  _interior_channel_pin_indices[c][0] = prev_outer;
490  _interior_channel_pin_indices[c][1] = ++prev_inner;
491  _interior_channel_pin_indices[c][2] = prev_inner - 1;
492  }
493 
494  if (j == 5) // last sector
495  {
496  if (k == channels_per_sector - 1)
497  {
498  _interior_channel_pin_indices[c][2] = starts[i + 1][0];
499  _interior_channel_pin_indices[c][0] = starts[i][0];
500  }
501 
502  if (k == channels_per_sector - 2 && i > 0)
503  _interior_channel_pin_indices[c][1] = starts[i][0];
504  }
505 
506  c++;
507  }
508  }
509  }
510 
511  for (const auto i : make_range(_n_edge_channels))
512  {
513  _edge_channel_pin_indices[i][0] = starts[_n_rings - 1][0] + i;
515 
516  if (i == _n_edge_channels - 1)
518  }
519 
520  for (const auto i : make_range(_n_corner_channels))
523 }
const unsigned int _n_rings
Total number of rings of pins.
unsigned int totalPins(const unsigned int n) const
Get the total number of pins for all rings.
unsigned int _n_interior_channels
Total number of interior channels.
std::vector< std::vector< unsigned int > > _edge_channel_pin_indices
Pin indices forming two of the corners of each edge channel.
unsigned int interiorChannels(const unsigned int ring)
Get the number of interior channels between ring and ring - 1 (0 indexing)
std::vector< std::vector< unsigned int > > _corner_channel_pin_indices
Pin indices forming one of the corners of each corner channel.
std::vector< std::vector< unsigned int > > _interior_channel_pin_indices
Pin indices forming the corner of each interior channel.
IntRange< T > make_range(T beg, T end)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
unsigned int _n_corner_channels
Total number of corner channels.
static const std::string k
Definition: NS.h:130
unsigned int _n_edge_channels
Total number of edge channels.
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ computeFlowVolumes()

void HexagonalLatticeUtils::computeFlowVolumes ( )
private

Compute the flow volumes for each channel type.

Definition at line 357 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

358 {
359  // It is assumed that in the interior and edge channels, that a wire is present half
360  // of the time (because those channels contain half a pin), while in the corner channels
361  // that a wire is present one sixth of the time (because those channels contain one sixth
362  // of a pin).
363  Real rod_volume_per_pitch = _pin_volume_per_pitch + _wire_volume_per_pitch;
364 
366 
370 
371  _interior_flow_volume = _interior_volume - 0.5 * rod_volume_per_pitch;
372  _edge_flow_volume = _edge_volume - 0.5 * rod_volume_per_pitch;
373  _corner_flow_volume = _corner_volume - rod_volume_per_pitch / 6.0;
374 
375  _flow_volume = hexagonVolume(_bundle_pitch) - _n_pins * rod_volume_per_pitch;
376 }
Real _corner_flow_volume
Flow volume of a corner channel per wire pitch.
Real _wire_volume_per_pitch
Single-wire volume per wire pitch.
Real _flow_volume
Bundle-wide flow volume per wire pitch.
Real _corner_volume
Total volume of a corner channel per wire pitch.
const Real _wire_pitch
Wire pitch.
Real triangleVolume(const Real side) const
Get the volume of an equilateral triangle prism per wire pitch.
Real _corner_edge_length
Half the distance for which a corner channel is in contact with the duct.
const Real _bundle_pitch
Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct) ...
const Real _pin_pitch
Pin pitch.
Real _interior_volume
Total volume of an interior channel per wire pitch.
Real _interior_flow_volume
Flow volume of an interior channel per wire pitch.
Real _pin_bundle_spacing
Spacing between the duct inner wall and the pin surface.
const Real _pin_volume_per_pitch
Single-pin volume per wire pitch.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real pinRadius() const
Get the pin outer radius.
unsigned int _n_pins
Total number of pins.
Real _edge_flow_volume
Flow volume of an edge channel per wire pitch.
Real hexagonVolume(const Real side) const
Get the volume of a hexagonal prism per wire pitch.
Real _edge_volume
Total volume of an edge channel per wire pitch.

◆ computeGapIndices()

void HexagonalLatticeUtils::computeGapIndices ( )
private

Determine the global gap indices, sorted first by lower pin ID and next by higher pin ID.

Definition at line 756 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

757 {
758  std::set<std::pair<int, int>> indices;
759  for (const auto & pins : _interior_channel_pin_indices)
760  {
761  std::pair<int, int> gap0 = {std::min(pins[0], pins[1]), std::max(pins[0], pins[1])};
762  std::pair<int, int> gap1 = {std::min(pins[0], pins[2]), std::max(pins[0], pins[2])};
763  std::pair<int, int> gap2 = {std::min(pins[2], pins[1]), std::max(pins[2], pins[1])};
764 
765  indices.insert(gap0);
766  indices.insert(gap1);
767  indices.insert(gap2);
768  }
769 
770  for (const auto & it : indices)
771  _gap_indices.push_back({it.first, it.second});
772 
774 
775  // add the gaps along the peripheral channels; -1 indicates side 1, -2 indicates side 2,
776  // and so on
777  int n_edge_gaps = _n_rings;
778  int pin = totalPins(_n_rings - 1);
779  for (const auto i : make_range(NUM_SIDES))
780  {
781  for (const auto j : make_range(_n_rings))
782  _gap_indices.push_back({pin + j, -(i + 1)});
783 
784  pin += n_edge_gaps - 1;
785  }
786 
787  // fix the last gap to use the first pin
788  _gap_indices.back() = {totalPins(_n_rings - 1), -int(NUM_SIDES)};
789  _n_gaps = _gap_indices.size();
790 
791  // for each channel, determine which gaps are on that channel to find the local-to-global
792  // indexing
793  for (const auto & pins : _interior_channel_pin_indices)
794  {
795  std::pair<int, int> gap0 = {std::min(pins[0], pins[1]), std::max(pins[0], pins[1])};
796  std::pair<int, int> gap1 = {std::min(pins[1], pins[2]), std::max(pins[1], pins[2])};
797  std::pair<int, int> gap2 = {std::min(pins[2], pins[0]), std::max(pins[2], pins[0])};
798 
799  int loc_gap0 = globalGapIndex(gap0);
800  int loc_gap1 = globalGapIndex(gap1);
801  int loc_gap2 = globalGapIndex(gap2);
802  _local_to_global_gaps.push_back({loc_gap0, loc_gap1, loc_gap2});
803  }
804 
805  int gap = _gap_indices.size() - _n_rings * NUM_SIDES;
806  for (const auto i : make_range(_n_edge_channels))
807  {
808  const auto & pins = _edge_channel_pin_indices[i];
809  std::pair<int, int> gap0 = {std::min(pins[0], pins[1]), std::max(pins[0], pins[1])};
810  int loc_gap0 = globalGapIndex(gap0);
811  _local_to_global_gaps.push_back({loc_gap0, gap + 1, gap});
812 
813  if ((i + 1) % (_n_rings - 1) == 0)
814  gap += 2;
815  else
816  gap += 1;
817  }
818 
819  int n_interior_gaps = _gap_indices.size() - _n_rings * NUM_SIDES - 1;
820  n_edge_gaps = _n_rings * NUM_SIDES;
821  _local_to_global_gaps.push_back({n_interior_gaps + n_edge_gaps, n_interior_gaps + 1});
822  gap = n_interior_gaps + _n_rings;
823  for (unsigned int i = 1; i < _n_corner_channels; ++i)
824  {
825  _local_to_global_gaps.push_back({gap, gap + 1});
826  gap += _n_rings;
827  }
828 
829  _gap_points.resize(_n_gaps);
830 
831  // For each gap, get two points on the gap
832  for (const auto i : make_range(_n_interior_gaps))
833  {
834  const auto & pins = _gap_indices[i];
835  Point pt1(_pin_centers[pins.first]);
836  Point pt2(_pin_centers[pins.second]);
837  _gap_centers.push_back(0.5 * (pt2 + pt1));
838 
839  _gap_points[i] = {pt1, pt2};
840 
841  // for the last gap in the ring, we need to swap the ordering of pins
842  if (lastGapInRing(i))
843  {
844  Point tmp = pt1;
845  pt1 = pt2;
846  pt2 = tmp;
847  }
848 
850  }
851 
853  for (unsigned int i = _n_interior_gaps; i < _n_gaps; ++i)
854  {
855  const auto & pins = _gap_indices[i];
856  int side = std::abs(pins.second) - 1;
857 
858  const auto & pt1 = _pin_centers[pins.first];
859  const Point pt2 =
860  pt1 + Point(d * _unit_translation_x[side], d * _unit_translation_y[side], 0.0);
861  _gap_centers.push_back(0.5 * (pt2 + pt1));
862 
863  _gap_points[i] = {pt1, pt2};
864 
866  }
867 }
std::vector< Point > _gap_unit_normals
Unit normal vectors for each gap.
unsigned int _n_interior_gaps
Number of gaps that touch an interior channel.
const unsigned int _n_rings
Total number of rings of pins.
unsigned int totalPins(const unsigned int n) const
Get the total number of pins for all rings.
libMesh::Point projectedUnitNormal(libMesh::Point pt1, libMesh::Point pt2, const unsigned int axis)
std::vector< Point > _gap_centers
Center points of all the gaps.
std::vector< std::vector< unsigned int > > _edge_channel_pin_indices
Pin indices forming two of the corners of each edge channel.
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
std::vector< Point > _pin_centers
Pin center coordinates.
unsigned int globalGapIndex(const std::pair< int, int > &local_gap) const
Get the global gap index from the local gap index.
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.
Real _pin_bundle_spacing
Spacing between the duct inner wall and the pin surface.
std::vector< std::pair< int, int > > _gap_indices
Gap indices, connecting two pins or one pin and a side, ordered by global gap ID. ...
std::vector< std::vector< unsigned int > > _interior_channel_pin_indices
Pin indices forming the corner of each interior channel.
std::vector< std::vector< int > > _local_to_global_gaps
Local-to-global gap indexing, ordered by channel ID.
bool lastGapInRing(const unsigned int gap_index) const
Whether this gap is the "last" in the ring, i.e.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real pinRadius() const
Get the pin outer radius.
unsigned int _n_gaps
Total number of gaps.
std::vector< std::vector< Point > > _gap_points
Two points on each gap, in order to compute distance-from-gap calculations.
IntRange< T > make_range(T beg, T end)
std::vector< Real > _unit_translation_y
(unitless) y-translations to apply to move from a center point to a side of a hexagon ...
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
unsigned int _n_corner_channels
Total number of corner channels.
unsigned int _n_edge_channels
Total number of edge channels.
void ErrorVector unsigned int
std::vector< Real > _unit_translation_x
(unitless) x-translations to apply to move from a center point to a side of a hexagon ...
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ computeHydraulicDiameters()

void HexagonalLatticeUtils::computeHydraulicDiameters ( )
private

Compute the hydraulic diameters for each channel type.

Definition at line 345 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

346 {
347  // Because the hydraulic diameter should be different for a bundle with an
348  // infinite wire pitch vs. a finite wire pitch (because finite = more wire spooled in),
349  // we compute hydraulic diameters based on volumes and areas.
353  _Dh = 4 * _flow_volume / _wetted_area;
354 }
Real _corner_flow_volume
Flow volume of a corner channel per wire pitch.
Real _flow_volume
Bundle-wide flow volume per wire pitch.
Real _interior_wetted_area
Wetted area of an interior channel per wire pitch.
Real _corner_Dh
Hydraulic diameter of corner channel.
Real _interior_Dh
Hydraulic diameter of interior channel.
Real _interior_flow_volume
Flow volume of an interior channel per wire pitch.
Real _wetted_area
Wetted area of entire bundle per wire pitch.
Real _edge_Dh
Hydraulic diameter of edge channel.
Real _edge_wetted_area
Wetted area of an edge channel per wire pitch.
Real _Dh
Bundle-wide hydraulic diameter.
Real _corner_wetted_area
Wetted area of a corner channel per wire pitch.
Real _edge_flow_volume
Flow volume of an edge channel per wire pitch.

◆ computePinAndChannelTypes()

void HexagonalLatticeUtils::computePinAndChannelTypes ( )
private

Compute the number of pins and channels and their types for the lattice.

Definition at line 385 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

386 {
387  _n_pins = 0;
388  for (unsigned int i = _n_rings; i > 0; --i)
389  _n_pins += pins(i);
390 
391  // the one-ring case
393  _n_edge_pins = 0;
394  _n_corner_pins = 0;
395 
397  _n_edge_channels = 0;
399 
400  if (_n_rings > 1)
401  {
403  _n_edge_pins = (_n_rings - 2) * NUM_SIDES;
405 
407 
408  for (unsigned int i = 1; i < _n_rings; ++i)
410  }
411 
413 }
unsigned int _n_interior_pins
Number of interior pins.
const unsigned int _n_rings
Total number of rings of pins.
unsigned int _n_interior_channels
Total number of interior channels.
unsigned int interiorChannels(const unsigned int ring)
Get the number of interior channels between ring and ring - 1 (0 indexing)
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.
unsigned int _n_corner_pins
Number of corner pins.
unsigned int _n_edge_pins
Number of edge pins.
unsigned int _n_channels
Total number of channels.
unsigned int _n_corner_channels
Total number of corner channels.
unsigned int _n_pins
Total number of pins.
unsigned int _n_edge_channels
Total number of edge channels.
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ computePinAndDuctCoordinates()

void HexagonalLatticeUtils::computePinAndDuctCoordinates ( )
private

Compute the pin center coordinates and the duct corner coordinates.

Compute the x, y, z coordinates of the pincells based on a bundle centered on (0, 0, 0) and with pins aligned in the z direction. Also compute the corner coordinates of the ducts

Definition at line 254 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

255 {
256  Real corner_shiftx[] = {COS60, -COS60, -1, -COS60, COS60, 1};
257  Real corner_shifty[] = {SIN60, SIN60, 0, -SIN60, -SIN60, 0};
258 
259  Real edge_shiftx[] = {-1, -COS60, COS60, 1, COS60, -COS60};
260  Real edge_shifty[] = {0, -SIN60, -SIN60, 0, SIN60, SIN60};
261 
262  // compute coordinates of the pin centers relative to the bundle's center
263  Point center(0, 0, 0);
264  _pin_centers.push_back(center);
265 
266  for (unsigned int i = 2; i <= _n_rings; ++i)
267  {
268  auto n_total_in_ring = pins(i);
269  auto increment = i - 1;
270 
271  unsigned int d = 0;
272 
273  for (const auto j : make_range(n_total_in_ring))
274  {
275  unsigned int side = j / increment;
276 
277  if (d == increment)
278  d = 0;
279 
280  Point center = geom_utils::projectPoint(corner_shiftx[side] * _pin_pitch * (i - 1),
281  corner_shifty[side] * _pin_pitch * (i - 1),
282  _axis);
283 
284  // additional shift for the edge sides
285  if (d != 0)
286  {
287  center(_ix) += edge_shiftx[side] * _pin_pitch * d;
288  center(_iy) += edge_shifty[side] * _pin_pitch * d;
289  }
290 
291  _pin_centers.push_back(center);
292 
293  d += 1;
294  }
295  }
296 
297  // compute corners of the hexagonal prisms that enclose each pin
299  auto side = hexagonSide(_pin_pitch);
300  for (const auto pin : make_range(_n_pins))
301  {
302  for (const auto i : make_range(NUM_SIDES))
303  {
304  Point translation = geom_utils::projectPoint(
305  _unit_translation_x[i] * side, _unit_translation_y[i] * side, _axis);
306 
307  _pin_centered_corner_coordinates[pin].push_back(translation + _pin_centers[pin]);
308  }
309  }
310 
311  // compute coordinates of duct corners relative to the bundle's center
313  for (const auto i : make_range(NUM_SIDES))
314  {
315  Point corner = geom_utils::projectPoint(corner_shiftx[i] * l, corner_shifty[i] * l, _axis);
316  _duct_corners.push_back(corner);
317  }
318 
319  // compute the equations (a*x + b*y + c) defining each duct wall
320  for (const auto i : make_range(NUM_SIDES))
321  {
322  auto c = i;
323  unsigned int n = i == 5 ? 0 : i + 1;
324  Real slope = (_duct_corners[n](_iy) - _duct_corners[c](_iy)) /
325  (_duct_corners[n](_ix) - _duct_corners[c](_ix));
326  std::vector<Real> coeffs = {-slope, 1.0, slope * _duct_corners[c](_ix) - _duct_corners[c](_iy)};
327  _duct_coeffs.push_back(coeffs);
328  }
329 }
const unsigned int _n_rings
Total number of rings of pins.
constexpr auto increment(std::index_sequence< first, tail... >)
std::vector< std::vector< Point > > _pin_centered_corner_coordinates
Corner coordinates of a hexagon surrounding each pin.
libMesh::Point projectPoint(const libMesh::Real x0, const libMesh::Real x1, const unsigned int axis)
Real hexagonSide(const Real pitch) const
Get the side length of a hexagon with given flat-to-flat distance (pitch)
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
std::vector< Point > _pin_centers
Pin center coordinates.
const Real _pin_pitch
Pin pitch.
unsigned int _iy
Index representing "second" coordinate of 2-D plane.
unsigned int _ix
Index representing "first" coordinate of 2-D plane.
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.
const Real _bundle_side_length
Side length of duct.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
std::vector< Real > _unit_translation_y
(unitless) y-translations to apply to move from a center point to a side of a hexagon ...
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
unsigned int _n_pins
Total number of pins.
std::vector< std::vector< Real > > _duct_coeffs
Coefficients in the line equations defining each duct wall.
std::vector< Point > _duct_corners
Six corner coordinates for the ducts.
std::vector< Real > _unit_translation_x
(unitless) x-translations to apply to move from a center point to a side of a hexagon ...
static const std::string center
Definition: NS.h:28
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ computePinBundleSpacing()

void HexagonalLatticeUtils::computePinBundleSpacing ( )
private

Compute the spacing between the outer pins and the duct inner walls.

Definition at line 416 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

417 {
418  // hexagonal flat-to-flat that *just* encloses the pins (NOT including the wire)
419  Real pin_h = 2.0 * (_n_rings - 1) * triangleHeight(_pin_pitch) + _pin_diameter;
420 
421  _pin_bundle_spacing = (_bundle_pitch - pin_h) / 2.0;
422 }
const unsigned int _n_rings
Total number of rings of pins.
const Real _pin_diameter
Pin diameter.
const Real _bundle_pitch
Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct) ...
const Real _pin_pitch
Pin pitch.
Real _pin_bundle_spacing
Spacing between the duct inner wall and the pin surface.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real triangleHeight(const Real side) const
Get the height of an equilateral triangle with given side length.

◆ computeWettedAreas()

void HexagonalLatticeUtils::computeWettedAreas ( )
private

Compute the wetted areas for each channel type.

Definition at line 332 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

333 {
335 
336  _interior_wetted_area = 0.5 * rod_area_per_pitch;
337  _edge_wetted_area = 0.5 * rod_area_per_pitch + _pin_pitch * _wire_pitch;
338 
340  _corner_wetted_area = rod_area_per_pitch / 6.0 + 2 * h * _wire_pitch;
341  _wetted_area = _n_pins * rod_area_per_pitch + 6.0 * _bundle_side_length * _wire_pitch;
342 }
const Real _wire_pitch
Wire pitch.
Real _interior_wetted_area
Wetted area of an interior channel per wire pitch.
const Real _pin_pitch
Pin pitch.
Real _wetted_area
Wetted area of entire bundle per wire pitch.
const Real _bundle_side_length
Side length of duct.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _edge_wetted_area
Wetted area of an edge channel per wire pitch.
const Real _pin_surface_area_per_pitch
Pin surface area per wire pitch.
Real _corner_wetted_area
Wetted area of a corner channel per wire pitch.
unsigned int _n_pins
Total number of pins.
unsigned int _n_edge_channels
Total number of edge channels.
static const unsigned int NUM_SIDES
Number of sides in a hexagon.
Real _wire_surface_area_per_pitch
Wire surface area per wire pitch.

◆ computeWireVolumeAndAreaPerPitch()

void HexagonalLatticeUtils::computeWireVolumeAndAreaPerPitch ( )
private

Compute the volume and surface area const occupied by the wire in one with pitch.

Definition at line 425 of file HexagonalLatticeUtils.C.

Referenced by HexagonalLatticeUtils().

426 {
427  unsigned int n_wire_coils = 1;
428  Real wire_length_per_coil =
429  std::sqrt(_wire_pitch * _wire_pitch + std::pow(M_PI * (_pin_diameter + _wire_diameter), 2.0));
430  Real wire_length = wire_length_per_coil * n_wire_coils;
431  _wire_volume_per_pitch = _wire_area * wire_length;
433 }
const Real _wire_diameter
Wire diameter.
Real _wire_volume_per_pitch
Single-wire volume per wire pitch.
const Real _wire_area
Wire cross-sectional area.
const Real _pin_diameter
Pin diameter.
const Real _wire_pitch
Wire pitch.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseUnits pow(const MooseUnits &, int)
const Real _wire_circumference
Wire circumference.
Real _wire_surface_area_per_pitch
Wire surface area per wire pitch.

◆ cornerChannelCornerCoordinates()

const std::vector< Point > HexagonalLatticeUtils::cornerChannelCornerCoordinates ( const unsigned int  corner_channel_id) const

Get the corner coordinates of a corner channel given an ID (relative to the start of the corner channels)

Parameters
[in]corner_channel_idID of corner channel
Returns
corner coordinates of channel

Definition at line 562 of file HexagonalLatticeUtils.C.

Referenced by channelIndex().

563 {
564  std::vector<Point> corners;
565 
566  auto pin_indices = _corner_channel_pin_indices[corner_channel_id];
567  const Point & pin = _pin_centers[pin_indices[0]];
568  corners.push_back(pin);
569 
571 
572  unsigned int side1 = corner_channel_id == 0 ? NUM_SIDES - 1 : corner_channel_id - 1;
573  unsigned int side2 = corner_channel_id;
574 
575  corners.push_back(pin +
576  Point(d * _unit_translation_x[side1], d * _unit_translation_y[side1], 0.0));
577  corners.push_back(_duct_corners[corner_channel_id]);
578  corners.push_back(pin +
579  Point(d * _unit_translation_x[side2], d * _unit_translation_y[side2], 0.0));
580 
581  return corners;
582 }
Real pinBundleSpacing() const
Get the distance between the outermost pins and the duct walls.
std::vector< Point > _pin_centers
Pin center coordinates.
std::vector< std::vector< unsigned int > > _corner_channel_pin_indices
Pin indices forming one of the corners of each corner channel.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real pinRadius() const
Get the pin outer radius.
std::vector< Real > _unit_translation_y
(unitless) y-translations to apply to move from a center point to a side of a hexagon ...
std::vector< Point > _duct_corners
Six corner coordinates for the ducts.
std::vector< Real > _unit_translation_x
(unitless) x-translations to apply to move from a center point to a side of a hexagon ...
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ cornerChannelPinIndices()

const std::vector<std::vector<unsigned int> >& HexagonalLatticeUtils::cornerChannelPinIndices ( ) const
inline

Get the pin indices forming one of the corners of all corner channels.

Returns
pin indices forming one of the corners of all corner channels

Definition at line 516 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

517  {
519  }
std::vector< std::vector< unsigned int > > _corner_channel_pin_indices
Pin indices forming one of the corners of each corner channel.

◆ cornerEdgeLength()

Real HexagonalLatticeUtils::cornerEdgeLength ( ) const
inline

Get half the distance of the duct that a corner channel is in contact with.

Returns
half the duct length that a corner channel is in contact with

Definition at line 395 of file HexagonalLatticeUtils.h.

395 { return _corner_edge_length; }
Real _corner_edge_length
Half the distance for which a corner channel is in contact with the duct.

◆ cornerFlowVolume()

Real HexagonalLatticeUtils::cornerFlowVolume ( ) const
inline

Get the flow volume of an corner channel per wire pitch.

Returns
flow volume of corner channel

Definition at line 314 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

314 { return _corner_flow_volume; }
Real _corner_flow_volume
Flow volume of a corner channel per wire pitch.

◆ cornerHydraulicDiameter()

Real HexagonalLatticeUtils::cornerHydraulicDiameter ( ) const
inline

Get the hydraulic diameter of a corner channel.

Returns
hydraulic diameter of a corner channel

Definition at line 266 of file HexagonalLatticeUtils.h.

266 { return _corner_Dh; }
Real _corner_Dh
Hydraulic diameter of corner channel.

◆ cornerVolume()

Real HexagonalLatticeUtils::cornerVolume ( ) const
inline

Get the total volume of an corner channel per wire pitch.

Returns
total volume of corner channel

Definition at line 332 of file HexagonalLatticeUtils.h.

332 { return _corner_volume; }
Real _corner_volume
Total volume of a corner channel per wire pitch.

◆ cornerWettedArea()

Real HexagonalLatticeUtils::cornerWettedArea ( ) const
inline

Get the wetted area of a corner channel per wire pitch.

Returns
wetted area of corner channel

Definition at line 290 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

290 { return _corner_wetted_area; }
Real _corner_wetted_area
Wetted area of a corner channel per wire pitch.

◆ distanceFromGap()

Real HexagonalLatticeUtils::distanceFromGap ( const Point &  pt,
const unsigned int  gap_index 
) const

Distance from a point and a gap.

Parameters
[in]ptpoint, must already be translated to lattice frame
[in]gap_indexgap index @ return distance from gap

Definition at line 883 of file HexagonalLatticeUtils.C.

Referenced by gapIndex(), and gapIndexAndDistance().

884 {
885  auto p = _gap_points[gap_index];
886  return geom_utils::projectedDistanceFromLine(pt, p[0], p[1], _axis);
887 }
libMesh::Real projectedDistanceFromLine(libMesh::Point pt, libMesh::Point line0, libMesh::Point line1, const unsigned int axis)
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
std::vector< std::vector< Point > > _gap_points
Two points on each gap, in order to compute distance-from-gap calculations.

◆ edgeChannelCornerCoordinates()

const std::vector< Point > HexagonalLatticeUtils::edgeChannelCornerCoordinates ( const unsigned int  edge_channel_id) const

Get the corner coordinates of an edge channel given an ID (relative to the start of the edge channels)

Parameters
[in]edge_channel_idID of edge channel
Returns
corner coordinates of channel

Definition at line 538 of file HexagonalLatticeUtils.C.

Referenced by channelIndex().

539 {
540  std::vector<Point> corners;
541 
542  auto pin_indices = _edge_channel_pin_indices[edge_channel_id];
543 
544  const Point & pin1 = _pin_centers[pin_indices[0]];
545  const Point & pin2 = _pin_centers[pin_indices[1]];
546 
548 
549  corners.push_back(pin1);
550  corners.push_back(pin2);
551 
552  unsigned int sector = edge_channel_id / (_n_rings - 1);
553  corners.push_back(pin2 +
554  Point(d * _unit_translation_x[sector], d * _unit_translation_y[sector], 0.0));
555  corners.push_back(pin1 +
556  Point(d * _unit_translation_x[sector], d * _unit_translation_y[sector], 0.0));
557 
558  return corners;
559 }
const unsigned int _n_rings
Total number of rings of pins.
Real pinBundleSpacing() const
Get the distance between the outermost pins and the duct walls.
std::vector< std::vector< unsigned int > > _edge_channel_pin_indices
Pin indices forming two of the corners of each edge channel.
std::vector< Point > _pin_centers
Pin center coordinates.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real pinRadius() const
Get the pin outer radius.
std::vector< Real > _unit_translation_y
(unitless) y-translations to apply to move from a center point to a side of a hexagon ...
std::vector< Real > _unit_translation_x
(unitless) x-translations to apply to move from a center point to a side of a hexagon ...

◆ edgeChannelPinIndices()

const std::vector<std::vector<unsigned int> >& HexagonalLatticeUtils::edgeChannelPinIndices ( ) const
inline

Get the pin indices forming two of the corners of all edge channels.

Returns
pin indices forming two of the corners of all edge channels

Definition at line 507 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

508  {
510  }
std::vector< std::vector< unsigned int > > _edge_channel_pin_indices
Pin indices forming two of the corners of each edge channel.

◆ edgeFlowVolume()

Real HexagonalLatticeUtils::edgeFlowVolume ( ) const
inline

Get the flow volume of an edge channel per wire pitch.

Returns
flow volume of edge channel

Definition at line 308 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

308 { return _edge_flow_volume; }
Real _edge_flow_volume
Flow volume of an edge channel per wire pitch.

◆ edgeHydraulicDiameter()

Real HexagonalLatticeUtils::edgeHydraulicDiameter ( ) const
inline

Get the hydraulic diameter of an edge channel.

Returns
hydraulic diameter of an edge channel

Definition at line 260 of file HexagonalLatticeUtils.h.

260 { return _edge_Dh; }
Real _edge_Dh
Hydraulic diameter of edge channel.

◆ edgeVolume()

Real HexagonalLatticeUtils::edgeVolume ( ) const
inline

Get the total volume of an edge channel per wire pitch.

Returns
total volume of edge channel

Definition at line 326 of file HexagonalLatticeUtils.h.

326 { return _edge_volume; }
Real _edge_volume
Total volume of an edge channel per wire pitch.

◆ edgeWettedArea()

Real HexagonalLatticeUtils::edgeWettedArea ( ) const
inline

Get the wetted area of an edge channel per wire pitch.

Returns
wetted area of edge channel

Definition at line 284 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

284 { return _edge_wetted_area; }
Real _edge_wetted_area
Wetted area of an edge channel per wire pitch.

◆ firstPinInRing()

unsigned int HexagonalLatticeUtils::firstPinInRing ( const unsigned int  ring) const

Get the index of the "first" pin in a ring.

Parameters
[in]ringring index
Returns
first pin

Definition at line 933 of file HexagonalLatticeUtils.C.

Referenced by closestPinIndex(), get2DInputPatternIndex(), lastGapInRing(), and TEST_F().

934 {
935  mooseAssert(ring > 0, "Ring indexing starts at 1");
936  if (ring == 1)
937  return 0;
938  else
939  return totalPins(ring - 1);
940 }
unsigned int totalPins(const unsigned int n) const
Get the total number of pins for all rings.

◆ flowVolume()

Real HexagonalLatticeUtils::flowVolume ( ) const
inline

Get the flow volume of the bundle per wire pitch.

Returns
flow volume of bundle

Definition at line 338 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

338 { return _flow_volume; }
Real _flow_volume
Bundle-wide flow volume per wire pitch.

◆ gapCenters()

const std::vector<Point>& HexagonalLatticeUtils::gapCenters ( ) const
inline

Get the center coordinates of the gaps.

Returns
gap center coordinates

Definition at line 158 of file HexagonalLatticeUtils.h.

158 { return _gap_centers; }
std::vector< Point > _gap_centers
Center points of all the gaps.

◆ gapIndex()

unsigned int HexagonalLatticeUtils::gapIndex ( const Point &  point) const

Get the index for the gap closest to the point.

Parameters
[in]pointpoint, must already be translated to lattice frame
Returns
index of closest gap

Definition at line 890 of file HexagonalLatticeUtils.C.

Referenced by TEST_F().

891 {
892  const auto & channel_index = channelIndex(point);
893  const auto & gap_indices = _local_to_global_gaps[channel_index];
894 
895  Real distance = std::numeric_limits<Real>::max();
896  unsigned int index = 0;
897  for (const auto i : index_range(gap_indices))
898  {
899  Real distance_from_gap = distanceFromGap(point, gap_indices[i]);
900 
901  if (distance_from_gap < distance)
902  {
903  distance = distance_from_gap;
904  index = gap_indices[i];
905  }
906  }
907 
908  return index;
909 }
Real distanceFromGap(const Point &pt, const unsigned int gap_index) const
Distance from a point and a gap.
unsigned int channelIndex(const Point &point) const
Get the channel index given a point.
Real distance(const Point &p)
std::vector< std::vector< int > > _local_to_global_gaps
Local-to-global gap indexing, ordered by channel ID.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
auto index_range(const T &sizable)

◆ gapIndexAndDistance()

void HexagonalLatticeUtils::gapIndexAndDistance ( const Point &  point,
unsigned int index,
Real distance 
) const

Get the gap index and distance to that gap for a given point.

Parameters
[in]pointpoint, must already be translated to lattice frame
[out]indexindex of closest gap
[out]distancedistance to closest gap

Definition at line 912 of file HexagonalLatticeUtils.C.

915 {
916  const auto & channel_index = channelIndex(point);
917  const auto & gap_indices = _local_to_global_gaps[channel_index];
918 
919  distance = std::numeric_limits<Real>::max();
920  for (const auto i : index_range(gap_indices))
921  {
922  Real distance_from_gap = distanceFromGap(point, gap_indices[i]);
923 
924  if (distance_from_gap < distance)
925  {
926  distance = distance_from_gap;
927  index = gap_indices[i];
928  }
929  }
930 }
Real distanceFromGap(const Point &pt, const unsigned int gap_index) const
Distance from a point and a gap.
unsigned int channelIndex(const Point &point) const
Get the channel index given a point.
Real distance(const Point &p)
std::vector< std::vector< int > > _local_to_global_gaps
Local-to-global gap indexing, ordered by channel ID.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
auto index_range(const T &sizable)

◆ gapIndices()

const std::vector<std::pair<int, int> >& HexagonalLatticeUtils::gapIndices ( ) const
inline

Get the pin and side indices on each gap.

Returns
pin and side indices on each gap

Definition at line 525 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

525 { return _gap_indices; }
std::vector< std::pair< int, int > > _gap_indices
Gap indices, connecting two pins or one pin and a side, ordered by global gap ID. ...

◆ gapUnitNormals()

const std::vector<Point>& HexagonalLatticeUtils::gapUnitNormals ( ) const
inline

Get the unit normals for all of the gaps.

Returns
gap unit normals

Definition at line 118 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

118 { return _gap_unit_normals; }
std::vector< Point > _gap_unit_normals
Unit normal vectors for each gap.

◆ get2DInputPatternIndex()

void HexagonalLatticeUtils::get2DInputPatternIndex ( const unsigned int  pin_index,
unsigned int row_index,
unsigned int within_row_index 
) const

Conversion from lattice pin indexing to the 2D input file index.

The indexing matches like this. Note that you have a 30 degree rotation between the 2D input and the positions output 2 1 3 0 6 4 5

Parameters
pin_indexindex of the pin in the utility ring-wise indexing
row_indexrow index (from the top) in the 2D input
within_row_indexindex within the row

Definition at line 716 of file HexagonalLatticeUtils.C.

719 {
720 
721  // First compute the ring on which the pin is
722  const auto ring_index = ringIndex(pin_index);
723  row_index = _n_rings - ring_index;
724  within_row_index = _n_rings - 1;
725 
726  const auto n_pin_sectors = pins(ring_index) / 6;
727  // Loop around the center until we reach the pin_index
728  // We start on the diagonal at the top
729 
730  for (const auto local_i : make_range(pin_index - firstPinInRing(ring_index)))
731  {
732  if (local_i < n_pin_sectors)
733  within_row_index--;
734  else if (local_i < 3 * n_pin_sectors)
735  row_index++;
736  else if (local_i < 4 * n_pin_sectors)
737  within_row_index++;
738  else if (local_i < 5 * n_pin_sectors)
739  {
740  row_index--;
741  within_row_index++;
742  }
743  else
744  {
745  row_index--;
746  within_row_index--;
747  }
748  }
749 
750  // Underflow (row_index is invalid_uint) will also fail this assert
751  mooseAssert(row_index < 2 * _n_rings - 1, "Inverse indexing failed");
752  mooseAssert(within_row_index < 2 * _n_rings - 1, "Inverse indexing failed");
753 }
const unsigned int _n_rings
Total number of rings of pins.
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.
IntRange< T > make_range(T beg, T end)
unsigned int ringIndex(const unsigned int pin) const
Get the index of the ring for a certain pin index.
unsigned int firstPinInRing(const unsigned int ring) const
Get the index of the "first" pin in a ring.

◆ globalGapIndex()

unsigned int HexagonalLatticeUtils::globalGapIndex ( const std::pair< int, int > &  local_gap) const
protected

Get the global gap index from the local gap index.

Parameters
[in]local_gaplocal gap for a channel
Returns
global gap index

Definition at line 870 of file HexagonalLatticeUtils.C.

Referenced by computeGapIndices().

871 {
872  for (const auto i : index_range(_gap_indices))
873  {
874  const auto gap = _gap_indices[i];
875  if (gap.first == local_gap.first && gap.second == local_gap.second)
876  return i;
877  }
878 
879  mooseError("Failed to find local gap in global gap array!");
880 }
void mooseError(Args &&... args)
std::vector< std::pair< int, int > > _gap_indices
Gap indices, connecting two pins or one pin and a side, ordered by global gap ID. ...
auto index_range(const T &sizable)

◆ heightToDiameter()

Real HexagonalLatticeUtils::heightToDiameter ( ) const
inline

Get the (wire) axial pitch-to-diameter ratio.

Returns
wire axial pitch-to-diameter ratio

Definition at line 176 of file HexagonalLatticeUtils.h.

176 { return _L_over_D; }
const Real _L_over_D
Wire axial lead length to diameter ratio.

◆ hexagonArea()

Real HexagonalLatticeUtils::hexagonArea ( const Real  pitch) const

Get the area of a hexagon with given flat-to-flat distance (pitch)

Parameters
[in]pitchflat-to-flat distance
Returns
hexagon area

Definition at line 128 of file HexagonalLatticeUtils.C.

Referenced by hexagonVolume().

129 {
130  Real side = hexagonSide(pitch);
131  return 3 * SIN60 * side * side;
132 }
Real hexagonSide(const Real pitch) const
Get the side length of a hexagon with given flat-to-flat distance (pitch)
static const std::string pitch
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ hexagonPitch()

Real HexagonalLatticeUtils::hexagonPitch ( const Real  volume) const

Get the pitch of a hexagonal prism based on its per-wire-pitch volume.

Parameters
[in]volumevolume
Returns
pitch

Definition at line 141 of file HexagonalLatticeUtils.C.

142 {
143  Real area = volume / _wire_pitch;
144  return std::sqrt(area / SIN60);
145 }
const Real _wire_pitch
Wire pitch.
Real volume(const MeshBase &mesh, unsigned int dim=libMesh::invalid_uint)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ hexagonSide()

Real HexagonalLatticeUtils::hexagonSide ( const Real  pitch) const

Get the side length of a hexagon with given flat-to-flat distance (pitch)

Parameters
[in]pitchhexagon flat-to-flat distance, or pitch
Returns
side length of hexagon, to give 1/6 of the hexagon's perimeter

Definition at line 122 of file HexagonalLatticeUtils.C.

Referenced by computePinAndDuctCoordinates(), hexagonArea(), insideLattice(), and pinIndex().

123 {
124  return pitch / std::sqrt(3.0);
125 }
static const std::string pitch

◆ hexagonVolume()

Real HexagonalLatticeUtils::hexagonVolume ( const Real  side) const

Get the volume of a hexagonal prism per wire pitch.

Parameters
[in]sideside length
Returns
hexagonal prism volume

Definition at line 135 of file HexagonalLatticeUtils.C.

Referenced by computeFlowVolumes().

136 {
137  return hexagonArea(pitch) * _wire_pitch;
138 }
Real hexagonArea(const Real pitch) const
Get the area of a hexagon with given flat-to-flat distance (pitch)
const Real _wire_pitch
Wire pitch.
static const std::string pitch

◆ hydraulicDiameter()

Real HexagonalLatticeUtils::hydraulicDiameter ( ) const
inline

Get the overall bundle hydraulic diameter.

Returns
hydraulic diameter

Definition at line 272 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

272 { return _Dh; }
Real _Dh
Bundle-wide hydraulic diameter.

◆ insideLattice()

bool HexagonalLatticeUtils::insideLattice ( const Point &  point) const

Whether the point is inside the lattice.

Parameters
pointpoint being examined, must already be translated to lattice frame

Definition at line 702 of file HexagonalLatticeUtils.C.

Referenced by closestPinIndex().

703 {
704  std::vector<Point> lattice_corners(6);
705  auto side = hexagonSide(_bundle_pitch);
706  for (const auto i : make_range(NUM_SIDES))
707  {
708  Point translation = geom_utils::projectPoint(
709  _unit_translation_x[i] * side, _unit_translation_y[i] * side, _axis);
710  lattice_corners[i] = translation;
711  }
712  return geom_utils::pointInPolygon(point, lattice_corners, _axis);
713 }
libMesh::Point projectPoint(const libMesh::Real x0, const libMesh::Real x1, const unsigned int axis)
Real hexagonSide(const Real pitch) const
Get the side length of a hexagon with given flat-to-flat distance (pitch)
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
const Real _bundle_pitch
Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct) ...
bool pointInPolygon(const libMesh::Point &point, const std::vector< libMesh::Point > &corners, const unsigned int axis)
IntRange< T > make_range(T beg, T end)
std::vector< Real > _unit_translation_y
(unitless) y-translations to apply to move from a center point to a side of a hexagon ...
std::vector< Real > _unit_translation_x
(unitless) x-translations to apply to move from a center point to a side of a hexagon ...
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ interiorChannelCornerCoordinates()

const std::vector< Point > HexagonalLatticeUtils::interiorChannelCornerCoordinates ( const unsigned int  interior_channel_id) const

Get the corner coordinates of an interior channel given an ID (relative to the start of the interior channels)

Parameters
[in]interior_channel_idID of interior channel
Returns
corner coordinates of channel

Definition at line 526 of file HexagonalLatticeUtils.C.

Referenced by channelIndex().

528 {
529  std::vector<Point> corners;
530  auto pin_indices = _interior_channel_pin_indices[interior_channel_id];
531  for (const auto & pin : pin_indices)
532  corners.push_back(_pin_centers[pin]);
533 
534  return corners;
535 }
std::vector< Point > _pin_centers
Pin center coordinates.
std::vector< std::vector< unsigned int > > _interior_channel_pin_indices
Pin indices forming the corner of each interior channel.

◆ interiorChannelPinIndices()

const std::vector<std::vector<unsigned int> >& HexagonalLatticeUtils::interiorChannelPinIndices ( ) const
inline

Get the pin indices forming the corners of all interior channels.

Returns
pin indices forming the corners of all interior channels

Definition at line 498 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

499  {
501  }
std::vector< std::vector< unsigned int > > _interior_channel_pin_indices
Pin indices forming the corner of each interior channel.

◆ interiorChannels()

unsigned int HexagonalLatticeUtils::interiorChannels ( const unsigned int  ring)

Get the number of interior channels between ring and ring - 1 (0 indexing)

Parameters
[in]ringring number (relative to 0 indexing)
Returns
number of interior channels

Definition at line 379 of file HexagonalLatticeUtils.C.

Referenced by computeChannelPinIndices(), and computePinAndChannelTypes().

380 {
381  return (ring * 2 - 1) * NUM_SIDES;
382 }
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ interiorFlowVolume()

Real HexagonalLatticeUtils::interiorFlowVolume ( ) const
inline

Get the flow volume of an interior channel per wire pitch.

Returns
flow volume of interior channel

Definition at line 302 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

302 { return _interior_flow_volume; }
Real _interior_flow_volume
Flow volume of an interior channel per wire pitch.

◆ interiorHydraulicDiameter()

Real HexagonalLatticeUtils::interiorHydraulicDiameter ( ) const
inline

Get the hydraulic diameter of an interior channel.

Returns
hydraulic diameter of an interior channel

Definition at line 254 of file HexagonalLatticeUtils.h.

254 { return _interior_Dh; }
Real _interior_Dh
Hydraulic diameter of interior channel.

◆ interiorVolume()

Real HexagonalLatticeUtils::interiorVolume ( ) const
inline

Get the total volume of an interior channel per wire pitch.

Returns
total volume of interior channel

Definition at line 320 of file HexagonalLatticeUtils.h.

320 { return _interior_volume; }
Real _interior_volume
Total volume of an interior channel per wire pitch.

◆ interiorWettedArea()

Real HexagonalLatticeUtils::interiorWettedArea ( ) const
inline

Get the wetted area of an interior channel per wire pitch.

Returns
wetted area of interior channel

Definition at line 278 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

278 { return _interior_wetted_area; }
Real _interior_wetted_area
Wetted area of an interior channel per wire pitch.

◆ lastGapInRing()

bool HexagonalLatticeUtils::lastGapInRing ( const unsigned int  gap_index) const

Whether this gap is the "last" in the ring, i.e.

connecting the first and last pins of the ring

Parameters
[in]gap_indexgap index
Returns
whether this gap is the last in the ring

Definition at line 964 of file HexagonalLatticeUtils.C.

Referenced by computeGapIndices(), and TEST_F().

965 {
966  if (gap_index >= _n_interior_gaps)
967  return false;
968 
969  const auto & pins = _gap_indices[gap_index];
970 
971  for (unsigned int i = 2; i <= _n_rings; ++i)
972  {
973  bool one_is_first_pin = false;
974  bool one_is_last_pin = false;
975 
976  int first_pin = firstPinInRing(i);
977  int last_pin = lastPinInRing(i);
978 
979  if (pins.first == first_pin || pins.second == first_pin)
980  one_is_first_pin = true;
981 
982  if (pins.first == last_pin || pins.second == last_pin)
983  one_is_last_pin = true;
984 
985  if (one_is_first_pin && one_is_last_pin)
986  return true;
987  }
988 
989  return false;
990 }
unsigned int _n_interior_gaps
Number of gaps that touch an interior channel.
const unsigned int _n_rings
Total number of rings of pins.
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.
std::vector< std::pair< int, int > > _gap_indices
Gap indices, connecting two pins or one pin and a side, ordered by global gap ID. ...
unsigned int firstPinInRing(const unsigned int ring) const
Get the index of the "first" pin in a ring.
unsigned int lastPinInRing(const unsigned int ring) const
Get the index of the "last" pin in a ring.

◆ lastPinInRing()

unsigned int HexagonalLatticeUtils::lastPinInRing ( const unsigned int  ring) const

Get the index of the "last" pin in a ring.

Parameters
[in]ringring index
Returns
last pin

Definition at line 943 of file HexagonalLatticeUtils.C.

Referenced by lastGapInRing(), ringIndex(), and TEST_F().

944 {
945  mooseAssert(ring > 0, "Ring indexing starts at 1");
946  if (ring == 1)
947  return 0;
948  else
949  return totalPins(ring) - 1;
950 }
unsigned int totalPins(const unsigned int n) const
Get the total number of pins for all rings.

◆ localToGlobalGaps()

const std::vector<std::vector<int> >& HexagonalLatticeUtils::localToGlobalGaps ( ) const
inline

For each subchannel, get the indices of the gaps that touch that subchannel.

Returns
indices of gaps touch each channel

Definition at line 531 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

531 { return _local_to_global_gaps; }
std::vector< std::vector< int > > _local_to_global_gaps
Local-to-global gap indexing, ordered by channel ID.

◆ minDuctCornerDistance()

Real HexagonalLatticeUtils::minDuctCornerDistance ( const Point &  p) const

Get the minimum distance from a point to the duct corners.

Parameters
[in]ppoint, must already be translated to lattice frame
Returns
distance to duct corner

Definition at line 248 of file HexagonalLatticeUtils.C.

Referenced by channelType().

249 {
251 }
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
libMesh::Real minDistanceToPoints(const libMesh::Point &pt, const std::vector< libMesh::Point > &candidates, const unsigned int axis)
std::vector< Point > _duct_corners
Six corner coordinates for the ducts.

◆ minDuctWallDistance()

Real HexagonalLatticeUtils::minDuctWallDistance ( const Point &  p) const

Get the minimum distance from a point to the duct inner surface.

Parameters
[in]ppoint, must already be translated to lattice frame
Returns
distance to duct

Definition at line 231 of file HexagonalLatticeUtils.C.

Referenced by channelType().

232 {
233  Real distance = std::numeric_limits<Real>::max();
234  for (const auto i : make_range(NUM_SIDES))
235  {
236  Real a = _duct_coeffs[i][0];
237  Real b = _duct_coeffs[i][1];
238  Real c = _duct_coeffs[i][2];
239 
240  Real d = std::abs(a * p(_ix) + b * p(_iy) + c) / std::sqrt(a * a + b * b);
241  distance = std::min(d, distance);
242  }
243 
244  return distance;
245 }
Real distance(const Point &p)
unsigned int _iy
Index representing "second" coordinate of 2-D plane.
unsigned int _ix
Index representing "first" coordinate of 2-D plane.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
std::vector< std::vector< Real > > _duct_coeffs
Coefficients in the line equations defining each duct wall.
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ nChannels()

unsigned int HexagonalLatticeUtils::nChannels ( ) const
inline

Get the total number of channels.

Returns
number of channels

Definition at line 362 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

362 { return _n_channels; }
unsigned int _n_channels
Total number of channels.

◆ nCornerChannels()

unsigned int HexagonalLatticeUtils::nCornerChannels ( ) const
inline

Get the number of corner channels.

Returns
number of corner channels

Definition at line 356 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

356 { return _n_corner_channels; }
unsigned int _n_corner_channels
Total number of corner channels.

◆ nCornerPins()

unsigned int HexagonalLatticeUtils::nCornerPins ( ) const
inline

Get the number of corner pins.

Returns
number of corner pins

Definition at line 242 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

242 { return _n_corner_pins; }
unsigned int _n_corner_pins
Number of corner pins.

◆ nEdgeChannels()

unsigned int HexagonalLatticeUtils::nEdgeChannels ( ) const
inline

Get the number of edge channels.

Returns
number of edge channels

Definition at line 350 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

350 { return _n_edge_channels; }
unsigned int _n_edge_channels
Total number of edge channels.

◆ nEdgePins()

unsigned int HexagonalLatticeUtils::nEdgePins ( ) const
inline

Get the number of edge pins.

Returns
number of edge pins

Definition at line 236 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

236 { return _n_edge_pins; }
unsigned int _n_edge_pins
Number of edge pins.

◆ nGaps()

unsigned int HexagonalLatticeUtils::nGaps ( ) const
inline

Get the number of gaps.

Returns
number of gaps

Definition at line 164 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

164 { return _n_gaps; }
unsigned int _n_gaps
Total number of gaps.

◆ nInteriorChannels()

unsigned int HexagonalLatticeUtils::nInteriorChannels ( ) const
inline

Get the number of interior channels.

Returns
number of interior channels

Definition at line 344 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

344 { return _n_interior_channels; }
unsigned int _n_interior_channels
Total number of interior channels.

◆ nInteriorGaps()

unsigned int HexagonalLatticeUtils::nInteriorGaps ( ) const
inline

Get the number of gaps that touch an interior channel.

Returns
number of gaps touching an interior channel

Definition at line 152 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

152 { return _n_interior_gaps; }
unsigned int _n_interior_gaps
Number of gaps that touch an interior channel.

◆ nInteriorPins()

unsigned int HexagonalLatticeUtils::nInteriorPins ( ) const
inline

Get the number of interior pins.

Returns
number of interior pins

Definition at line 230 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

230 { return _n_interior_pins; }
unsigned int _n_interior_pins
Number of interior pins.

◆ nPins()

unsigned int HexagonalLatticeUtils::nPins ( ) const
inline

Get the total number of pins for the lattice.

Returns
total number of pins

Definition at line 248 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

248 { return _n_pins; }
unsigned int _n_pins
Total number of pins.

◆ pinBundleSpacing()

Real HexagonalLatticeUtils::pinBundleSpacing ( ) const
inline

Get the distance between the outermost pins and the duct walls.

Returns
pin-bundle spacing

Definition at line 368 of file HexagonalLatticeUtils.h.

Referenced by cornerChannelCornerCoordinates(), edgeChannelCornerCoordinates(), and TEST_F().

368 { return _pin_bundle_spacing; }
Real _pin_bundle_spacing
Spacing between the duct inner wall and the pin surface.

◆ pinCenteredCornerCoordinates()

const std::vector<std::vector<Point> >& HexagonalLatticeUtils::pinCenteredCornerCoordinates ( ) const
inline

Get the corner coordinates of a hexagon surrounding each pin.

Returns
pin center coordinates

Definition at line 380 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

381  {
383  }
std::vector< std::vector< Point > > _pin_centered_corner_coordinates
Corner coordinates of a hexagon surrounding each pin.

◆ pinCenters()

const std::vector<Point>& HexagonalLatticeUtils::pinCenters ( ) const
inline

Get the center coordinates of the pins.

Returns
pin center coordinates

Definition at line 374 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

374 { return _pin_centers; }
std::vector< Point > _pin_centers
Pin center coordinates.

◆ pinDiameter()

Real HexagonalLatticeUtils::pinDiameter ( ) const
inline

Get the pin diameter.

Returns
pin diameter

Definition at line 188 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

188 { return _pin_diameter; }
const Real _pin_diameter
Pin diameter.

◆ pinIndex()

unsigned int HexagonalLatticeUtils::pinIndex ( const Point &  point) const

Get the pin index given a point.

The pin index is for the entire hexagon around the pin

Parameters
[in]pointpoint, must already be translated to lattice frame
Returns
pin index

Definition at line 596 of file HexagonalLatticeUtils.C.

Referenced by TEST_F().

597 {
598  auto side = hexagonSide(_pin_pitch);
599 
600  for (const auto i : make_range(_n_pins))
601  {
602  const auto & center = _pin_centers[i];
603  Real dx = center(_ix) - point(_ix);
604  Real dy = center(_iy) - point(_iy);
605  Real distance_from_pin = std::sqrt(dx * dx + dy * dy);
606 
607  // if we're outside the circumference of the hexagon, we're certain not
608  // within the hexagon for this pin
609  if (distance_from_pin > side)
610  continue;
611 
612  auto corners = _pin_centered_corner_coordinates[i];
613  if (geom_utils::pointInPolygon(point, corners, _axis))
614  return i;
615  }
616 
617  return _n_pins;
618 }
std::vector< std::vector< Point > > _pin_centered_corner_coordinates
Corner coordinates of a hexagon surrounding each pin.
Real hexagonSide(const Real pitch) const
Get the side length of a hexagon with given flat-to-flat distance (pitch)
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
std::vector< Point > _pin_centers
Pin center coordinates.
const Real _pin_pitch
Pin pitch.
unsigned int _iy
Index representing "second" coordinate of 2-D plane.
unsigned int _ix
Index representing "first" coordinate of 2-D plane.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool pointInPolygon(const libMesh::Point &point, const std::vector< libMesh::Point > &corners, const unsigned int axis)
IntRange< T > make_range(T beg, T end)
unsigned int _n_pins
Total number of pins.
static const std::string center
Definition: NS.h:28

◆ pinPitch()

Real HexagonalLatticeUtils::pinPitch ( ) const
inline

Get the pin pitch.

Returns
pin pitch

Definition at line 206 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

206 { return _pin_pitch; }
const Real _pin_pitch
Pin pitch.

◆ pinRadius()

Real HexagonalLatticeUtils::pinRadius ( ) const

Get the pin outer radius.

Returns
pin outer radius

Definition at line 172 of file HexagonalLatticeUtils.C.

Referenced by channelType(), computeFlowVolumes(), computeGapIndices(), cornerChannelCornerCoordinates(), edgeChannelCornerCoordinates(), and TEST_F().

173 {
174  return _pin_diameter / 2.0;
175 }
const Real _pin_diameter
Pin diameter.

◆ pins()

unsigned int HexagonalLatticeUtils::pins ( const unsigned int  n) const

Get the number of pins in a given ring.

Parameters
[in]nring number, beginning from 1
Returns
number of pins in the specified ring

Definition at line 82 of file HexagonalLatticeUtils.C.

Referenced by channelCentroid(), computeGapIndices(), computePinAndChannelTypes(), computePinAndDuctCoordinates(), get2DInputPatternIndex(), lastGapInRing(), rings(), TEST_F(), and totalPins().

83 {
84  if (n <= 0)
85  return 0;
86  else if (n == 1)
87  return 1;
88  else
89  return NUM_SIDES * (n - 1);
90 }
static const unsigned int NUM_SIDES
Number of sides in a hexagon.

◆ pinSurfaceAreaPerPitch()

Real HexagonalLatticeUtils::pinSurfaceAreaPerPitch ( ) const
inline

Get the pin surface area per wire pitch.

Returns
pin surface area per wire pitch

Definition at line 389 of file HexagonalLatticeUtils.h.

389 { return _pin_surface_area_per_pitch; }
const Real _pin_surface_area_per_pitch
Pin surface area per wire pitch.

◆ pinVolumePerPitch()

Real HexagonalLatticeUtils::pinVolumePerPitch ( ) const
inline

Get the pin volume per pitch.

Returns
pin volume per pitch

Definition at line 218 of file HexagonalLatticeUtils.h.

218 { return _pin_volume_per_pitch; }
const Real _pin_volume_per_pitch
Single-pin volume per wire pitch.

◆ pitchToDiameter()

Real HexagonalLatticeUtils::pitchToDiameter ( ) const
inline

Get the (pin) pitch-to-diameter ratio.

Returns
pin pitch-to-diameter ratio

Definition at line 170 of file HexagonalLatticeUtils.h.

170 { return _P_over_D; }
const Real _P_over_D
Pitch-to-diameter ratio.

◆ ringIndex()

unsigned int HexagonalLatticeUtils::ringIndex ( const unsigned int  pin) const

Get the index of the ring for a certain pin index.

Parameters
[in]pinpin index
Returns
ring index

Definition at line 953 of file HexagonalLatticeUtils.C.

Referenced by get2DInputPatternIndex().

954 {
955  for (const auto i : make_range(_n_rings))
956  {
957  if (pin <= lastPinInRing(i + 1))
958  return i + 1;
959  }
960  mooseError("Should not reach here. Pin index: ", pin, " for ", _n_rings, " rings.");
961 }
const unsigned int _n_rings
Total number of rings of pins.
void mooseError(Args &&... args)
IntRange< T > make_range(T beg, T end)
unsigned int lastPinInRing(const unsigned int ring) const
Get the index of the "last" pin in a ring.

◆ rings()

unsigned int HexagonalLatticeUtils::rings ( const unsigned int  n) const

Get the number of rings for a specified number of pins.

Parameters
[in]nnumber of pins
Returns
number of hexagonal rings

Definition at line 103 of file HexagonalLatticeUtils.C.

Referenced by TEST_F().

104 {
105  auto remaining = n;
106  unsigned int i = 0;
107 
108  while (remaining > 0)
109  {
110  i += 1;
111  remaining -= pins(i);
112  }
113 
114  if (n != totalPins(i))
115  mooseError("Number of pins " + std::to_string(n) +
116  " not evenly divisible in a hexagonal lattice!");
117 
118  return i;
119 }
void mooseError(Args &&... args)
unsigned int totalPins(const unsigned int n) const
Get the total number of pins for all rings.
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.

◆ sideTranslationX()

Real HexagonalLatticeUtils::sideTranslationX ( const unsigned int  side) const
inline

Get the unit vector translation to move a center point to a duct wall.

Parameters
[in]sideduct side
Returns
x-component translation

Definition at line 77 of file HexagonalLatticeUtils.h.

77 { return _unit_translation_x[side]; }
std::vector< Real > _unit_translation_x
(unitless) x-translations to apply to move from a center point to a side of a hexagon ...

◆ sideTranslationY()

Real HexagonalLatticeUtils::sideTranslationY ( const unsigned int  side) const
inline

Get the unit vector translation to move a center point to a duct wall.

Parameters
[in]sideduct side
Returns
y-component translation

Definition at line 84 of file HexagonalLatticeUtils.h.

84 { return _unit_translation_y[side]; }
std::vector< Real > _unit_translation_y
(unitless) y-translations to apply to move from a center point to a side of a hexagon ...

◆ totalPins()

unsigned int HexagonalLatticeUtils::totalPins ( const unsigned int  n) const

Get the total number of pins for all rings.

Parameters
[in]nnumber of total rings, beginning from 1
Returns
total number of pins

Definition at line 93 of file HexagonalLatticeUtils.C.

Referenced by computeChannelPinIndices(), computeGapIndices(), firstPinInRing(), lastPinInRing(), and rings().

94 {
95  unsigned int total = 0;
96  for (unsigned int i = 1; i <= n; ++i)
97  total += pins(i);
98 
99  return total;
100 }
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.

◆ triangleArea()

Real HexagonalLatticeUtils::triangleArea ( const Real  side) const

Get the area of an equilateral triangle with given side length.

Parameters
[in]sideside length
Returns
triangle area

Definition at line 148 of file HexagonalLatticeUtils.C.

Referenced by triangleVolume().

149 {
150  return 0.5 * triangleHeight(side) * side;
151 }
Real triangleHeight(const Real side) const
Get the height of an equilateral triangle with given side length.

◆ triangleHeight()

Real HexagonalLatticeUtils::triangleHeight ( const Real  side) const

Get the height of an equilateral triangle with given side length.

Parameters
[in]sideside length
Returns
triangle height

Definition at line 154 of file HexagonalLatticeUtils.C.

Referenced by computePinBundleSpacing(), and triangleArea().

155 {
156  return SIN60 * side;
157 }

◆ triangleSide()

Real HexagonalLatticeUtils::triangleSide ( const Real  height) const

Get the side of an equilateral triangle with given height.

Parameters
[in]heighttriangle height
Returns
triangle side

Definition at line 160 of file HexagonalLatticeUtils.C.

161 {
162  return height / SIN60;
163 }

◆ triangleVolume()

Real HexagonalLatticeUtils::triangleVolume ( const Real  side) const

Get the volume of an equilateral triangle prism per wire pitch.

Parameters
[in]sideside length
Returns
triangle prism volume

Definition at line 166 of file HexagonalLatticeUtils.C.

Referenced by computeFlowVolumes().

167 {
168  return triangleArea(side) * _wire_pitch;
169 }
const Real _wire_pitch
Wire pitch.
Real triangleArea(const Real side) const
Get the area of an equilateral triangle with given side length.

◆ wettedArea()

Real HexagonalLatticeUtils::wettedArea ( ) const
inline

Get the wetted area of entire bundle per wire pitch.

Returns
wetted area of bundle

Definition at line 296 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

296 { return _wetted_area; }
Real _wetted_area
Wetted area of entire bundle per wire pitch.

◆ wireDiameter()

Real HexagonalLatticeUtils::wireDiameter ( ) const
inline

Get the wire diameter.

Returns
wire diameter

Definition at line 200 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

200 { return _wire_diameter; }
const Real _wire_diameter
Wire diameter.

◆ wirePitch()

Real HexagonalLatticeUtils::wirePitch ( ) const
inline

Get the wire pitch.

Returns
wire pitch

Definition at line 194 of file HexagonalLatticeUtils.h.

Referenced by TEST_F().

194 { return _wire_pitch; }
const Real _wire_pitch
Wire pitch.

◆ wireVolumePerPitch()

Real HexagonalLatticeUtils::wireVolumePerPitch ( ) const
inline

Get the wire volume per pitch.

Returns
wire volume per pitch

Definition at line 224 of file HexagonalLatticeUtils.h.

224 { return _wire_volume_per_pitch; }
Real _wire_volume_per_pitch
Single-wire volume per wire pitch.

Member Data Documentation

◆ _axis

const unsigned int HexagonalLatticeUtils::_axis
protected

Vertical axis of the bundle along which the pins are aligned.

Definition at line 634 of file HexagonalLatticeUtils.h.

Referenced by axis(), channelIndex(), computeGapIndices(), computePinAndDuctCoordinates(), distanceFromGap(), HexagonalLatticeUtils(), insideLattice(), minDuctCornerDistance(), and pinIndex().

◆ _bundle_pitch

const Real HexagonalLatticeUtils::_bundle_pitch
protected

Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct)

Definition at line 616 of file HexagonalLatticeUtils.h.

Referenced by bundlePitch(), computeFlowVolumes(), computePinBundleSpacing(), HexagonalLatticeUtils(), and insideLattice().

◆ _bundle_side_length

const Real HexagonalLatticeUtils::_bundle_side_length
protected

Side length of duct.

Definition at line 637 of file HexagonalLatticeUtils.h.

Referenced by computePinAndDuctCoordinates(), computeWettedAreas(), and HexagonalLatticeUtils().

◆ _corner_channel_pin_indices

std::vector<std::vector<unsigned int> > HexagonalLatticeUtils::_corner_channel_pin_indices
protected

Pin indices forming one of the corners of each corner channel.

Definition at line 768 of file HexagonalLatticeUtils.h.

Referenced by computeChannelPinIndices(), cornerChannelCornerCoordinates(), and cornerChannelPinIndices().

◆ _corner_Dh

Real HexagonalLatticeUtils::_corner_Dh
protected

Hydraulic diameter of corner channel.

Definition at line 706 of file HexagonalLatticeUtils.h.

Referenced by channelHydraulicDiameter(), computeHydraulicDiameters(), and cornerHydraulicDiameter().

◆ _corner_edge_length

Real HexagonalLatticeUtils::_corner_edge_length
protected

Half the distance for which a corner channel is in contact with the duct.

Definition at line 697 of file HexagonalLatticeUtils.h.

Referenced by channelType(), computeFlowVolumes(), cornerEdgeLength(), and HexagonalLatticeUtils().

◆ _corner_flow_volume

Real HexagonalLatticeUtils::_corner_flow_volume
protected

Flow volume of a corner channel per wire pitch.

Definition at line 718 of file HexagonalLatticeUtils.h.

Referenced by computeFlowVolumes(), computeHydraulicDiameters(), and cornerFlowVolume().

◆ _corner_volume

Real HexagonalLatticeUtils::_corner_volume
protected

Total volume of a corner channel per wire pitch.

Definition at line 727 of file HexagonalLatticeUtils.h.

Referenced by channelSpecificSurfaceArea(), computeFlowVolumes(), and cornerVolume().

◆ _corner_wetted_area

Real HexagonalLatticeUtils::_corner_wetted_area
protected

Wetted area of a corner channel per wire pitch.

Definition at line 739 of file HexagonalLatticeUtils.h.

Referenced by channelSpecificSurfaceArea(), computeHydraulicDiameters(), computeWettedAreas(), and cornerWettedArea().

◆ _Dh

Real HexagonalLatticeUtils::_Dh
protected

Bundle-wide hydraulic diameter.

Definition at line 709 of file HexagonalLatticeUtils.h.

Referenced by computeHydraulicDiameters(), and hydraulicDiameter().

◆ _duct_coeffs

std::vector<std::vector<Real> > HexagonalLatticeUtils::_duct_coeffs
protected

Coefficients in the line equations defining each duct wall.

Coefficients \(a\), \(b\), and \(c\) in equation \(ax+by+c=0\) that defines each wall of the duct.

Definition at line 759 of file HexagonalLatticeUtils.h.

Referenced by computePinAndDuctCoordinates(), and minDuctWallDistance().

◆ _duct_corners

std::vector<Point> HexagonalLatticeUtils::_duct_corners
protected

Six corner coordinates for the ducts.

Definition at line 751 of file HexagonalLatticeUtils.h.

Referenced by computePinAndDuctCoordinates(), cornerChannelCornerCoordinates(), and minDuctCornerDistance().

◆ _edge_channel_pin_indices

std::vector<std::vector<unsigned int> > HexagonalLatticeUtils::_edge_channel_pin_indices
protected

Pin indices forming two of the corners of each edge channel.

Definition at line 765 of file HexagonalLatticeUtils.h.

Referenced by computeChannelPinIndices(), computeGapIndices(), edgeChannelCornerCoordinates(), and edgeChannelPinIndices().

◆ _edge_Dh

Real HexagonalLatticeUtils::_edge_Dh
protected

Hydraulic diameter of edge channel.

Definition at line 703 of file HexagonalLatticeUtils.h.

Referenced by channelHydraulicDiameter(), computeHydraulicDiameters(), and edgeHydraulicDiameter().

◆ _edge_flow_volume

Real HexagonalLatticeUtils::_edge_flow_volume
protected

Flow volume of an edge channel per wire pitch.

Definition at line 715 of file HexagonalLatticeUtils.h.

Referenced by computeFlowVolumes(), computeHydraulicDiameters(), and edgeFlowVolume().

◆ _edge_volume

Real HexagonalLatticeUtils::_edge_volume
protected

Total volume of an edge channel per wire pitch.

Definition at line 724 of file HexagonalLatticeUtils.h.

Referenced by channelSpecificSurfaceArea(), computeFlowVolumes(), and edgeVolume().

◆ _edge_wetted_area

Real HexagonalLatticeUtils::_edge_wetted_area
protected

Wetted area of an edge channel per wire pitch.

Definition at line 736 of file HexagonalLatticeUtils.h.

Referenced by channelSpecificSurfaceArea(), computeHydraulicDiameters(), computeWettedAreas(), and edgeWettedArea().

◆ _flow_volume

Real HexagonalLatticeUtils::_flow_volume
protected

Bundle-wide flow volume per wire pitch.

Definition at line 730 of file HexagonalLatticeUtils.h.

Referenced by computeFlowVolumes(), computeHydraulicDiameters(), and flowVolume().

◆ _gap_centers

std::vector<Point> HexagonalLatticeUtils::_gap_centers
protected

Center points of all the gaps.

Definition at line 802 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), and gapCenters().

◆ _gap_indices

std::vector<std::pair<int, int> > HexagonalLatticeUtils::_gap_indices
protected

Gap indices, connecting two pins or one pin and a side, ordered by global gap ID.

Definition at line 771 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), gapIndices(), globalGapIndex(), and lastGapInRing().

◆ _gap_points

std::vector<std::vector<Point> > HexagonalLatticeUtils::_gap_points
protected

Two points on each gap, in order to compute distance-from-gap calculations.

Definition at line 777 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), and distanceFromGap().

◆ _gap_unit_normals

std::vector<Point> HexagonalLatticeUtils::_gap_unit_normals
protected

Unit normal vectors for each gap.

Definition at line 780 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), and gapUnitNormals().

◆ _interior_channel_pin_indices

std::vector<std::vector<unsigned int> > HexagonalLatticeUtils::_interior_channel_pin_indices
protected

Pin indices forming the corner of each interior channel.

Definition at line 762 of file HexagonalLatticeUtils.h.

Referenced by computeChannelPinIndices(), computeGapIndices(), interiorChannelCornerCoordinates(), and interiorChannelPinIndices().

◆ _interior_Dh

Real HexagonalLatticeUtils::_interior_Dh
protected

Hydraulic diameter of interior channel.

Definition at line 700 of file HexagonalLatticeUtils.h.

Referenced by channelHydraulicDiameter(), computeHydraulicDiameters(), and interiorHydraulicDiameter().

◆ _interior_flow_volume

Real HexagonalLatticeUtils::_interior_flow_volume
protected

Flow volume of an interior channel per wire pitch.

Definition at line 712 of file HexagonalLatticeUtils.h.

Referenced by computeFlowVolumes(), computeHydraulicDiameters(), and interiorFlowVolume().

◆ _interior_volume

Real HexagonalLatticeUtils::_interior_volume
protected

Total volume of an interior channel per wire pitch.

Definition at line 721 of file HexagonalLatticeUtils.h.

Referenced by channelSpecificSurfaceArea(), computeFlowVolumes(), and interiorVolume().

◆ _interior_wetted_area

Real HexagonalLatticeUtils::_interior_wetted_area
protected

Wetted area of an interior channel per wire pitch.

Definition at line 733 of file HexagonalLatticeUtils.h.

Referenced by channelSpecificSurfaceArea(), computeHydraulicDiameters(), computeWettedAreas(), and interiorWettedArea().

◆ _ix

unsigned int HexagonalLatticeUtils::_ix
protected

Index representing "first" coordinate of 2-D plane.

Definition at line 805 of file HexagonalLatticeUtils.h.

Referenced by closestPinIndex(), computePinAndDuctCoordinates(), HexagonalLatticeUtils(), minDuctWallDistance(), and pinIndex().

◆ _iy

unsigned int HexagonalLatticeUtils::_iy
protected

Index representing "second" coordinate of 2-D plane.

Definition at line 808 of file HexagonalLatticeUtils.h.

Referenced by closestPinIndex(), computePinAndDuctCoordinates(), HexagonalLatticeUtils(), minDuctWallDistance(), and pinIndex().

◆ _L_over_D

const Real HexagonalLatticeUtils::_L_over_D
protected

Wire axial lead length to diameter ratio.

Definition at line 661 of file HexagonalLatticeUtils.h.

Referenced by heightToDiameter().

◆ _local_to_global_gaps

std::vector<std::vector<int> > HexagonalLatticeUtils::_local_to_global_gaps
protected

Local-to-global gap indexing, ordered by channel ID.

Definition at line 774 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), gapIndex(), gapIndexAndDistance(), and localToGlobalGaps().

◆ _n_channels

unsigned int HexagonalLatticeUtils::_n_channels
protected

Total number of channels.

Definition at line 685 of file HexagonalLatticeUtils.h.

Referenced by computePinAndChannelTypes(), and nChannels().

◆ _n_corner_channels

unsigned int HexagonalLatticeUtils::_n_corner_channels
protected

Total number of corner channels.

Definition at line 694 of file HexagonalLatticeUtils.h.

Referenced by channelIndex(), computeChannelPinIndices(), computeGapIndices(), computePinAndChannelTypes(), and nCornerChannels().

◆ _n_corner_pins

unsigned int HexagonalLatticeUtils::_n_corner_pins
protected

Number of corner pins.

Definition at line 682 of file HexagonalLatticeUtils.h.

Referenced by computePinAndChannelTypes(), and nCornerPins().

◆ _n_edge_channels

unsigned int HexagonalLatticeUtils::_n_edge_channels
protected

◆ _n_edge_pins

unsigned int HexagonalLatticeUtils::_n_edge_pins
protected

Number of edge pins.

Definition at line 679 of file HexagonalLatticeUtils.h.

Referenced by computePinAndChannelTypes(), and nEdgePins().

◆ _n_gaps

unsigned int HexagonalLatticeUtils::_n_gaps
protected

Total number of gaps.

Definition at line 786 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), and nGaps().

◆ _n_interior_channels

unsigned int HexagonalLatticeUtils::_n_interior_channels
protected

Total number of interior channels.

Definition at line 688 of file HexagonalLatticeUtils.h.

Referenced by channelIndex(), computeChannelPinIndices(), computePinAndChannelTypes(), and nInteriorChannels().

◆ _n_interior_gaps

unsigned int HexagonalLatticeUtils::_n_interior_gaps
protected

Number of gaps that touch an interior channel.

Definition at line 783 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), lastGapInRing(), and nInteriorGaps().

◆ _n_interior_pins

unsigned int HexagonalLatticeUtils::_n_interior_pins
protected

Number of interior pins.

Definition at line 676 of file HexagonalLatticeUtils.h.

Referenced by computePinAndChannelTypes(), and nInteriorPins().

◆ _n_pins

unsigned int HexagonalLatticeUtils::_n_pins
protected

◆ _n_rings

const unsigned int HexagonalLatticeUtils::_n_rings
protected

◆ _P_over_D

const Real HexagonalLatticeUtils::_P_over_D
protected

Pitch-to-diameter ratio.

Definition at line 658 of file HexagonalLatticeUtils.h.

Referenced by pitchToDiameter().

◆ _pin_area

const Real HexagonalLatticeUtils::_pin_area
protected

Pin cross-sectional area.

Definition at line 640 of file HexagonalLatticeUtils.h.

◆ _pin_bundle_spacing

Real HexagonalLatticeUtils::_pin_bundle_spacing
protected

Spacing between the duct inner wall and the pin surface.

Definition at line 667 of file HexagonalLatticeUtils.h.

Referenced by channelType(), computeFlowVolumes(), computeGapIndices(), computePinBundleSpacing(), HexagonalLatticeUtils(), and pinBundleSpacing().

◆ _pin_centered_corner_coordinates

std::vector<std::vector<Point> > HexagonalLatticeUtils::_pin_centered_corner_coordinates
protected

Corner coordinates of a hexagon surrounding each pin.

Definition at line 748 of file HexagonalLatticeUtils.h.

Referenced by computePinAndDuctCoordinates(), pinCenteredCornerCoordinates(), and pinIndex().

◆ _pin_centers

std::vector<Point> HexagonalLatticeUtils::_pin_centers
protected

◆ _pin_circumference

const Real HexagonalLatticeUtils::_pin_circumference
protected

Pin circumference.

Definition at line 643 of file HexagonalLatticeUtils.h.

◆ _pin_diameter

const Real HexagonalLatticeUtils::_pin_diameter
protected

◆ _pin_pitch

const Real HexagonalLatticeUtils::_pin_pitch
protected

◆ _pin_surface_area_per_pitch

const Real HexagonalLatticeUtils::_pin_surface_area_per_pitch
protected

Pin surface area per wire pitch.

Definition at line 652 of file HexagonalLatticeUtils.h.

Referenced by computeWettedAreas(), and pinSurfaceAreaPerPitch().

◆ _pin_volume_per_pitch

const Real HexagonalLatticeUtils::_pin_volume_per_pitch
protected

Single-pin volume per wire pitch.

Definition at line 655 of file HexagonalLatticeUtils.h.

Referenced by computeFlowVolumes(), and pinVolumePerPitch().

◆ _unit_translation_x

std::vector<Real> HexagonalLatticeUtils::_unit_translation_x
protected

(unitless) x-translations to apply to move from a center point to a side of a hexagon

Definition at line 796 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), computePinAndDuctCoordinates(), cornerChannelCornerCoordinates(), edgeChannelCornerCoordinates(), HexagonalLatticeUtils(), insideLattice(), and sideTranslationX().

◆ _unit_translation_y

std::vector<Real> HexagonalLatticeUtils::_unit_translation_y
protected

(unitless) y-translations to apply to move from a center point to a side of a hexagon

Definition at line 799 of file HexagonalLatticeUtils.h.

Referenced by computeGapIndices(), computePinAndDuctCoordinates(), cornerChannelCornerCoordinates(), edgeChannelCornerCoordinates(), HexagonalLatticeUtils(), insideLattice(), and sideTranslationY().

◆ _wetted_area

Real HexagonalLatticeUtils::_wetted_area
protected

Wetted area of entire bundle per wire pitch.

Definition at line 742 of file HexagonalLatticeUtils.h.

Referenced by computeHydraulicDiameters(), computeWettedAreas(), and wettedArea().

◆ _wire_area

const Real HexagonalLatticeUtils::_wire_area
protected

Wire cross-sectional area.

Definition at line 646 of file HexagonalLatticeUtils.h.

Referenced by computeWireVolumeAndAreaPerPitch().

◆ _wire_circumference

const Real HexagonalLatticeUtils::_wire_circumference
protected

Wire circumference.

Definition at line 649 of file HexagonalLatticeUtils.h.

Referenced by computeWireVolumeAndAreaPerPitch().

◆ _wire_diameter

const Real HexagonalLatticeUtils::_wire_diameter
protected

Wire diameter.

Definition at line 625 of file HexagonalLatticeUtils.h.

Referenced by computeWireVolumeAndAreaPerPitch(), HexagonalLatticeUtils(), and wireDiameter().

◆ _wire_pitch

const Real HexagonalLatticeUtils::_wire_pitch
protected

◆ _wire_surface_area_per_pitch

Real HexagonalLatticeUtils::_wire_surface_area_per_pitch
protected

Wire surface area per wire pitch.

Definition at line 664 of file HexagonalLatticeUtils.h.

Referenced by computeWettedAreas(), and computeWireVolumeAndAreaPerPitch().

◆ _wire_volume_per_pitch

Real HexagonalLatticeUtils::_wire_volume_per_pitch
protected

Single-wire volume per wire pitch.

Definition at line 670 of file HexagonalLatticeUtils.h.

Referenced by computeFlowVolumes(), computeWireVolumeAndAreaPerPitch(), and wireVolumePerPitch().

◆ COS60

const Real HexagonalLatticeUtils::COS60 = 0.5
staticprotected

Definition at line 790 of file HexagonalLatticeUtils.h.

Referenced by computePinAndDuctCoordinates(), and HexagonalLatticeUtils().

◆ NUM_SIDES

const unsigned int HexagonalLatticeUtils::NUM_SIDES = 6
staticprotected

◆ SIN60

const Real HexagonalLatticeUtils::SIN60 = std::sqrt(3.0) / 2.0
staticprotected

The documentation for this class was generated from the following files: