15#ifndef CARDINAL_ENUM_H
43 const Real pin_diameter,
44 const Real wire_diameter,
45 const Real wire_pitch,
46 const unsigned int n_rings,
47 const unsigned int axis,
48 const Real rotation_around_axis = 0);
56 Real
distanceFromGap(
const Point & pt,
const unsigned int gap_index)
const;
63 unsigned int gapIndex(
const Point & point)
const;
113 unsigned int ringIndex(
const unsigned int pin)
const;
126 unsigned int pins(
const unsigned int n)
const;
133 unsigned int totalPins(
const unsigned int n)
const;
140 unsigned int rings(
const unsigned int n)
const;
540 const std::vector<Point>
557 const std::vector<Point>
572 unsigned int pinIndex(
const Point & point)
const;
605 unsigned int & row_index,
606 unsigned int & within_row_index)
const;
614 unsigned int globalGapIndex(
const std::pair<int, int> & local_gap)
const;
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
const Real _bundle_side_length
Side length of duct.
unsigned int _n_corner_channels
Total number of corner channels.
const Real _pin_area
Pin cross-sectional area.
Real wirePitch() const
Get the wire pitch.
Real wireVolumePerPitch() const
Get the wire volume per pitch.
unsigned int _n_pins
Total number of pins.
Real pinBundleSpacing() const
Get the distance between the outermost pins and the duct walls.
const Real _pin_volume_per_pitch
Single-pin volume per wire pitch.
Real _wire_volume_per_pitch
Single-wire volume per wire pitch.
std::vector< std::vector< unsigned int > > _interior_channel_pin_indices
Pin indices forming the corner of each interior channel.
void gapIndexAndDistance(const Point &point, unsigned int &index, Real &distance) const
Get the gap index and distance to that gap for a given point.
std::vector< Point > _pin_centers
Pin center coordinates.
std::vector< Real > _unit_translation_y
(unitless) y-translations to apply to move from a center point to a side of a hexagon
unsigned int nCornerPins() const
Get the number of corner pins.
Real _wetted_area
Wetted area of entire bundle per wire pitch.
Real hexagonPitch(const Real volume) const
Get the pitch of a hexagonal prism based on its per-wire-pitch volume.
unsigned int rings(const unsigned int n) const
Get the number of rings for a specified number of pins.
Real cornerVolume() const
Get the total volume of an corner channel per wire pitch.
const std::vector< Point > & pinCenters() const
Get the center coordinates of the pins.
void computeWettedAreas()
Compute the wetted areas for each channel type.
unsigned int _n_interior_gaps
Number of gaps that touch an interior channel.
std::vector< Real > _unit_translation_x
(unitless) x-translations to apply to move from a center point to a side of a hexagon
unsigned int closestPinIndex(const Point &point) const
Get the closest pin index given a point outside the lattice.
void computeChannelPinIndices()
Get the pin indices that form the corners of each channel type.
Real _Dh
Bundle-wide hydraulic diameter.
const Real _pin_circumference
Pin circumference.
static const unsigned int NUM_SIDES
Number of sides in a hexagon.
unsigned int nInteriorChannels() const
Get the number of interior channels.
Real _flow_volume
Bundle-wide flow volume per wire pitch.
unsigned int nInteriorPins() const
Get the number of interior pins.
const Real _L_over_D
Wire axial lead length to diameter ratio.
std::vector< std::vector< Real > > _duct_coeffs
Coefficients in the line equations defining each duct wall.
Real _wire_surface_area_per_pitch
Wire surface area per wire pitch.
Real distanceFromGap(const Point &pt, const unsigned int gap_index) const
Distance from a point and a gap.
unsigned int pinIndex(const Point &point) const
Get the pin index given a point.
unsigned int _n_channels
Total number of channels.
Real _edge_wetted_area
Wetted area of an edge channel per wire pitch.
const std::vector< Point > & gapCenters() const
Get the center coordinates of the gaps.
const std::vector< Point > & gapUnitNormals() const
Get the unit normals for all of the gaps.
Real _edge_flow_volume
Flow volume of an edge channel per wire pitch.
Real hydraulicDiameter() const
Get the overall bundle hydraulic diameter.
void computeFlowVolumes()
Compute the flow volumes for each channel type.
Real _corner_volume
Total volume of a corner channel per wire pitch.
Real pinPitch() const
Get the pin pitch.
const Real _wire_pitch
Wire pitch.
Real _interior_Dh
Hydraulic diameter of interior channel.
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...
Real cornerEdgeLength() const
Get half the distance of the duct that a corner channel is in contact with.
Real _edge_Dh
Hydraulic diameter of edge channel.
Real heightToDiameter() const
Get the (wire) axial pitch-to-diameter ratio.
Real triangleArea(const Real side) const
Get the area of an equilateral triangle with given side length.
const std::vector< std::vector< unsigned int > > & interiorChannelPinIndices() const
Get the pin indices forming the corners of all interior channels.
unsigned int nEdgePins() const
Get the number of edge pins.
Real interiorWettedArea() const
Get the wetted area of an interior channel per wire pitch.
const Real _wire_area
Wire cross-sectional area.
Real _corner_wetted_area
Wetted area of a corner channel per wire pitch.
Real hexagonSide(const Real pitch) const
Get the side length of a hexagon with given flat-to-flat distance (pitch)
unsigned int nCornerChannels() const
Get the number of corner channels.
Real triangleVolume(const Real side) const
Get the volume of an equilateral triangle prism per wire pitch.
const std::vector< std::pair< int, int > > & gapIndices() const
Get the pin and side indices on each gap.
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 ...
const Real _pin_diameter
Pin diameter.
Real pinVolumePerPitch() const
Get the pin volume per pitch.
const Real _pin_surface_area_per_pitch
Pin surface area per wire pitch.
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.
const std::vector< std::vector< unsigned int > > & cornerChannelPinIndices() const
Get the pin indices forming one of the corners of all corner channels.
unsigned int nChannels() const
Get the total number of channels.
Real pitchToDiameter() const
Get the (pin) pitch-to-diameter ratio.
void computePinAndDuctCoordinates()
Compute the pin center coordinates and the duct corner coordinates.
unsigned int _iy
Index representing "second" coordinate of 2-D plane.
unsigned int lastPinInRing(const unsigned int ring) const
Get the index of the "last" pin in a ring.
const unsigned int _n_rings
Total number of rings of pins.
Real _corner_flow_volume
Flow volume of a corner channel per wire pitch.
const RealTensorValue _rotation_matrix
Rotation matrix to apply the rotation why.
Real edgeFlowVolume() const
Get the flow volume of an edge channel per wire pitch.
const std::vector< std::vector< int > > & localToGlobalGaps() const
For each subchannel, get the indices of the gaps that touch that subchannel.
unsigned int interiorChannels(const unsigned int ring)
Get the number of interior channels between ring and ring - 1 (0 indexing)
Real _interior_wetted_area
Wetted area of an interior channel per wire pitch.
std::vector< std::vector< int > > _local_to_global_gaps
Local-to-global gap indexing, ordered by channel ID.
Real wettedArea() const
Get the wetted area of entire bundle per wire pitch.
unsigned int nPins() const
Get the total number of pins for the lattice.
Real cornerHydraulicDiameter() const
Get the hydraulic diameter of a corner channel.
const Real _bundle_pitch
Bundle pitch (distance across bundle measured flat-to-flat on the inside of the duct)
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...
Real pinSurfaceAreaPerPitch() const
Get the pin surface area per wire pitch.
Real cornerWettedArea() const
Get the wetted area of a corner channel per wire pitch.
Real pinDiameter() const
Get the pin diameter.
Real _pin_bundle_spacing
Spacing between the duct inner wall and the pin surface.
std::vector< Point > _gap_centers
Center points of all the gaps.
unsigned int _ix
Index representing "first" coordinate of 2-D plane.
Real edgeHydraulicDiameter() const
Get the hydraulic diameter of an edge channel.
const Real _P_over_D
Pitch-to-diameter ratio.
Point channelCentroid(const std::vector< Point > &corners) const
Get the centroid of a channel given the corner coordinates.
void computeHydraulicDiameters()
Compute the hydraulic diameters for each channel type.
std::vector< std::vector< unsigned int > > _corner_channel_pin_indices
Pin indices forming one of the corners of each corner channel.
Real hexagonArea(const Real pitch) const
Get the area of a hexagon with given flat-to-flat distance (pitch)
void computeWireVolumeAndAreaPerPitch()
Compute the volume and surface area const occupied by the wire in one with pitch.
std::vector< std::vector< Point > > _gap_points
Two points on each gap, in order to compute distance-from-gap calculations.
unsigned int _n_edge_channels
Total number of edge channels.
void computePinBundleSpacing()
Compute the spacing between the outer pins and the duct inner walls.
std::vector< Point > _gap_unit_normals
Unit normal vectors for each gap.
unsigned int nGaps() const
Get the number of gaps.
Real flowVolume() const
Get the flow volume of the bundle per wire pitch.
bool lastGapInRing(const unsigned int gap_index) const
Whether this gap is the "last" in the ring, i.e.
std::vector< std::vector< unsigned int > > _edge_channel_pin_indices
Pin indices forming two of the corners of each edge channel.
Real pinRadius() const
Get the pin outer radius.
const Real _wire_diameter
Wire diameter.
Real channelHydraulicDiameter(const channel_type::ChannelTypeEnum &channel) const
Get the hydraulic diameter of a channel.
unsigned int firstPinInRing(const unsigned int ring) const
Get the index of the "first" pin in a ring.
Real cornerFlowVolume() const
Get the flow volume of an corner channel per wire pitch.
const std::vector< std::vector< Point > > & pinCenteredCornerCoordinates() const
Get the corner coordinates of a hexagon surrounding each pin.
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< Point > > _pin_centered_corner_coordinates
Corner coordinates of a hexagon surrounding each pin.
unsigned int channelIndex(const Point &point) const
Get the channel index given a point.
Real _corner_Dh
Hydraulic diameter of corner channel.
Real _interior_flow_volume
Flow volume of an interior channel per wire pitch.
void computeGapIndices()
Determine the global gap indices, sorted first by lower pin ID and next by higher pin ID.
std::vector< Point > _duct_corners
Six corner coordinates for the ducts.
Real bundlePitch() const
Get the bundle pitch.
Real interiorFlowVolume() const
Get the flow volume of an interior channel per wire pitch.
bool insideLattice(const Point &point) const
Whether the point is inside the lattice.
Real sideTranslationX(const unsigned int side) const
Get the unit vector translation to move a center point to a duct wall.
unsigned int axis() const
Get the vertical axis of the bed along which pins are aligned.
Real _edge_volume
Total volume of an edge channel per wire pitch.
const Real _pin_pitch
Pin pitch.
unsigned int _n_gaps
Total number of gaps.
Real channelSpecificSurfaceArea(const channel_type::ChannelTypeEnum &channel) const
Get the specific surface area of a channel.
const std::vector< std::vector< unsigned int > > & edgeChannelPinIndices() const
Get the pin indices forming two of the corners of all edge channels.
Real interiorVolume() const
Get the total volume of an interior channel per wire pitch.
unsigned int globalGapIndex(const std::pair< int, int > &local_gap) const
Get the global gap index from the local gap index.
unsigned int totalPins(const unsigned int n) const
Get the total number of pins for all rings.
const Real _rotation_around_axis
Rotation around the axis to apply to the lattice.
Real interiorHydraulicDiameter() const
Get the hydraulic diameter of an interior channel.
unsigned int _n_interior_pins
Number of interior pins.
Real minDuctWallDistance(const Point &p) const
Get the minimum distance from a point to the duct inner surface.
const unsigned int _axis
Vertical axis of the bundle along which the pins are aligned.
unsigned int _n_edge_pins
Number of edge pins.
Real edgeVolume() const
Get the total 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 triangleHeight(const Real side) const
Get the height of an equilateral triangle with given side length.
channel_type::ChannelTypeEnum channelType(const Point &p) const
Get the channel type (interior, edge, corner) given a point.
unsigned int nInteriorGaps() const
Get the number of gaps that touch an interior channel.
unsigned int _n_corner_pins
Number of corner pins.
const Real _wire_circumference
Wire circumference.
unsigned int gapIndex(const Point &point) const
Get the index for the gap closest to the point.
Real sideTranslationY(const unsigned int side) const
Get the unit vector translation to move a center point to a duct wall.
unsigned int nEdgeChannels() const
Get the number of edge channels.
unsigned int _n_interior_channels
Total number of interior channels.
Real wireDiameter() const
Get the wire diameter.
Real edgeWettedArea() const
Get the wetted area of an edge channel per wire pitch.
Real minDuctCornerDistance(const Point &p) const
Get the minimum distance from a point to the duct corners.
Real triangleSide(const Real height) const
Get the side of an equilateral triangle with given height.
Real _corner_edge_length
Half the distance for which a corner channel is in contact with the duct.
void computePinAndChannelTypes()
Compute the number of pins and channels and their types for the lattice.
unsigned int pins(const unsigned int n) const
Get the number of pins in a given ring.
Real _interior_volume
Total volume of an interior channel per wire pitch.
unsigned int ringIndex(const unsigned int pin) const
Get the index of the ring for a certain pin index.
ChannelTypeEnum
Type of subchannel.
Real distance(const Point &p)