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)
55 std::unique_ptr<MooseMesh>
77 Real distance0 = 1.0e+8;
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;
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);
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);
289 2.0 * i *
pitch * (theta1 / dtheta *
pitch) * std::cos(
pi / 3.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;
std::vector< EChannelType > _subch_type
subchannel type
static InputParameters validParams()
std::vector< Real > _z_grid
axial location of nodes
Real getSubchannelWettedPerimeter(unsigned int i_chan) const override
Return undeformed wetted perimeter for a subchannel.
std::unique_ptr< MooseMesh > safeClone() const override
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 getSubchannelIndexFromPoint(const Point &p) const override
Return a subchannel index for a given physical point p
TriSubChannelMesh(const InputParameters ¶meters)
void computeAssemblyHydraulicParameters()
Compute undeformed bundle-average inlet hydraulic quantities from generated mesh geometry.
Real _hwire
wire lead length
Real _duct_to_pin_gap
the gap thickness between the duct and peripheral fuel pins
Real distance(const Point &p)
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the subchannel centroids
std::unique_ptr< T > copyConstruct(const T &object)
registerMooseObject("SubChannelApp", TriSubChannelMesh)
void buildMesh() override
unsigned int _n_rings
number of fuel-pin rings, counting the center pin as the first ring
const std::string & name() const
unsigned int channelIndex(const Point &point) const override
static const std::string pitch
Real _flat_to_flat
the distance between flat surfaces of the duct facing each other
Real _assembly_wetted_perimeter
Undeformed bundle inlet wetted perimeter.
std::vector< Real > _z_blockage
axial location of blockage (inlet, outlet) [m]
unsigned int _npins
number of fuel pins
Real _pin_diameter
fuel Pin diameter
std::vector< Real > _reduction_blockage
area reduction of subchannels affected by blockage
unsigned int getPinIndexFromPoint(const Point &p) const override
Return a pin index for a given physical point p
Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies...
Real _pitch
Distance between the neighbor fuel pins, pitch.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real _assembly_flow_area
Undeformed bundle inlet flow area.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int pinIndex(const Point &p) const override
void mooseError(Args &&... args) const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Base class for subchannel meshes.
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...
EChannelType getSubchannelType(unsigned int index) const override
Return the type of the subchannel for given subchannel index.
MooseUnits pow(const MooseUnits &, int)
unsigned int _n_channels
number of subchannels
static const std::string k
static InputParameters validParams()
Real _assembly_hydraulic_diameter
Undeformed bundle-average hydraulic diameter.
static const std::string center
std::vector< unsigned int > _index_blockage
index of subchannels affected by blockage