12#include "libmesh/node.h"
21 "lattice arrangement");
29 _n_rings(other_mesh._n_rings),
30 _n_channels(other_mesh._n_channels),
31 _flat_to_flat(other_mesh._flat_to_flat),
32 _dwire(other_mesh._dwire),
33 _hwire(other_mesh._hwire),
34 _duct_to_pin_gap(other_mesh._duct_to_pin_gap),
35 _nodes(other_mesh._nodes),
36 _pin_nodes(other_mesh._pin_nodes),
37 _gap_to_chan_map(other_mesh._gap_to_chan_map),
38 _gap_to_pin_map(other_mesh._gap_to_pin_map),
39 _chan_to_gap_map(other_mesh._chan_to_gap_map),
40 _sign_id_crossflow_map(other_mesh._sign_id_crossflow_map),
41 _gij_map(other_mesh._gij_map),
42 _pin_position(other_mesh._pin_position),
43 _pins_in_rings(other_mesh._pins_in_rings),
44 _chan_to_pin_map(other_mesh._chan_to_pin_map),
45 _npins(other_mesh._npins),
46 _n_gaps(other_mesh._n_gaps),
47 _subch_type(other_mesh._subch_type),
48 _gap_type(other_mesh._gap_type),
49 _gap_pairs_sf(other_mesh._gap_pairs_sf),
50 _chan_pairs_sf(other_mesh._chan_pairs_sf),
51 _pin_to_chan_map(other_mesh._pin_to_chan_map)
55std::unique_ptr<MooseMesh>
77 Real distance0 = 1.0e+8;
84 Real channel_distance = std::sqrt(std::pow(
p(0), 2) + std::pow(
p(1), 2));
85 Real angle = std::abs(std::atan2(
p(1),
p(0)));
86 Real projection_angle =
88 channel_distance = channel_distance * std::cos(projection_angle);
92 Real loc_angle = std::atan2(
p(1),
p(0));
96 Real x_coord_new = (std::cos(-rem_ang) *
p(0) - std::sin(-rem_ang) *
p(1));
107 if (channel_distance < distance_outer_ring)
112 distance0 = distance1;
118 if ((distance1 < distance0) &&
121 if (((x_coord_new > x_lim) || (x_coord_new < -x_lim)) &&
125 distance0 = distance1;
127 else if ((x_coord_new <= x_lim && x_coord_new >= -x_lim) &&
131 distance0 = distance1;
153 for (
unsigned int i_ch = 0; i_ch <
_n_channels; i_ch++)
160 mooseError(
name(),
": Assembly wetted perimeter is zero; cannot compute hydraulic diameter.");
168 Real standard_area = 0.0;
170 Real wire_area = 0.0;
178 standard_area = std::pow(
_pitch, 2) * std::sqrt(3.0) / 4.0;
195 Real flow_area = standard_area - rod_area - wire_area;
197 unsigned int blockage_index = 0;
219 return 0.5 * rod_circumference + 0.5 * wire_circumference / std::cos(theta);
221 return 0.5 * rod_circumference + 0.5 * wire_circumference / std::cos(theta) +
_pitch;
223 return (rod_circumference + wire_circumference / std::cos(theta)) / 6.0 +
243 unsigned int current_rod = 0;
245 std::vector<Point> positions;
248 for (
unsigned int i = 0; i <
_npins; i++)
250 Real x_dist = positions[i](0) -
p(0);
251 Real y_dist = positions[i](1) -
p(1);
252 distance_rod = std::sqrt(std::pow(x_dist, 2) + std::pow(y_dist, 2));
253 if (distance_rod < d0)
276 Real theta_corrected = 0.0;
280 for (
unsigned int i = 1; i < nrings; i++)
282 dtheta = 2.0 * pi / (i * 6);
284 for (
unsigned int j = 0; j < i * 6; j++)
287 theta1 = fmod(theta + 1.0e-10, pi / 3.0);
288 distance = std::sqrt((
pow(i * pitch, 2) +
pow(theta1 / dtheta * pitch, 2) -
289 2.0 * i * pitch * (theta1 / dtheta * pitch) * std::cos(pi / 3.0)));
290 double argument = 1.0 / (i * pitch) /
distance / 2.0 *
291 (std::pow(i * pitch, 2.0) + std::pow(
distance, 2.0) -
292 std::pow(theta1 / dtheta * pitch, 2.0));
294 if (argument >= -1.0 && argument <= 1.0)
296 theta_corrected = std::acos(argument);
298 else if (argument > 1.0)
300 theta_corrected = 0.0;
304 theta_corrected = pi;
308 theta_corrected = theta;
312 if (theta > pi / 3.0 && theta <= 2.0 / 3.0 * pi)
313 theta_corrected = theta_corrected + pi / 3.0;
314 else if (theta > 2.0 / 3.0 * pi && theta <= pi)
315 theta_corrected = theta_corrected + 2.0 / 3.0 * pi;
316 else if (theta > pi && theta <= 4.0 / 3.0 * pi)
317 theta_corrected = theta_corrected + pi;
318 else if (theta > 4.0 / 3.0 * pi && theta <= 5.0 / 3.0 * pi)
319 theta_corrected = theta_corrected + 4.0 / 3.0 * pi;
320 else if (theta > 5.0 / 3.0 * pi && theta <= 2.0 * pi)
321 theta_corrected = theta_corrected + 5.0 / 3.0 * pi;
323 positions.emplace_back(
center(0) +
distance * std::cos(theta_corrected),
325 theta = theta + dtheta;
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
registerMooseObject("SubChannelApp", TriSubChannelMesh)
std::unique_ptr< T > copyConstruct(const T &object)
const std::string & name() const
void mooseError(Args &&... args) const
Base class for subchannel meshes.
std::vector< unsigned int > _index_blockage
index of subchannels affected by blockage
std::vector< Real > _z_grid
axial location of nodes
Real _assembly_wetted_perimeter
Undeformed bundle inlet wetted perimeter.
std::vector< Real > _reduction_blockage
area reduction of subchannels affected by blockage
static InputParameters validParams()
std::vector< Real > _z_blockage
axial location of blockage (inlet, outlet) [m]
Real _assembly_flow_area
Undeformed bundle inlet flow area.
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the subchannel centroids
Real _pin_diameter
fuel Pin diameter
Real _assembly_hydraulic_diameter
Undeformed bundle-average hydraulic diameter.
Real _pitch
Distance between the neighbor fuel pins, pitch.
Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies.
unsigned int _npins
number of fuel pins
unsigned int getPinIndexFromPoint(const Point &p) const override
Return a pin index for a given physical point p
Real _duct_to_pin_gap
the gap thickness between the duct and peripheral fuel pins
Real _flat_to_flat
the distance between flat surfaces of the duct facing each other
void buildMesh() override
void computeAssemblyHydraulicParameters()
Compute undeformed bundle-average inlet hydraulic quantities from generated mesh geometry.
unsigned int getSubchannelIndexFromPoint(const Point &p) const override
Return a subchannel index for a given physical point p
TriSubChannelMesh(const InputParameters ¶meters)
unsigned int pinIndex(const Point &p) const override
unsigned int channelIndex(const Point &point) const override
Real _hwire
wire lead length
std::unique_ptr< MooseMesh > safeClone() const override
Real getSubchannelWettedPerimeter(unsigned int i_chan) const override
Return undeformed wetted perimeter for a subchannel.
static InputParameters validParams()
std::vector< EChannelType > _subch_type
subchannel type
EChannelType getSubchannelType(unsigned int index) const override
Return the type of the subchannel for given subchannel index.
static void pinPositions(std::vector< Point > &positions, unsigned int nrings, Real pitch, Point center)
Calculates and stores the pin positions/centers for a hexagonal assembly containing the given number ...
unsigned int _n_channels
number of subchannels
unsigned int _n_rings
number of fuel-pin rings, counting the center pin as the first ring
Real getSubchannelFlowArea(unsigned int i_chan, Real z) const override
Return undeformed flow area for a subchannel at an axial location, including any blockage reduction.
Real distance(const Point &p)