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