12 #include "libmesh/node.h" 21 "lattice subchannel arrangement");
31 _n_rings(other_mesh._n_rings),
32 _n_channels(other_mesh._n_channels),
33 _flat_to_flat(other_mesh._flat_to_flat),
34 _duct_to_pin_gap(other_mesh._duct_to_pin_gap),
35 _nodes(other_mesh._nodes),
36 _duct_nodes(other_mesh._duct_nodes),
37 _chan_to_duct_node_map(other_mesh._chan_to_duct_node_map),
38 _duct_node_to_chan_map(other_mesh._duct_node_to_chan_map),
39 _gap_to_chan_map(other_mesh._gap_to_chan_map),
40 _gap_to_pin_map(other_mesh._gap_to_pin_map),
41 _chan_to_gap_map(other_mesh._chan_to_gap_map),
42 _sign_id_crossflow_map(other_mesh._sign_id_crossflow_map),
43 _gij_map(other_mesh._gij_map),
44 _subchannel_position(other_mesh._subchannel_position),
45 _pin_position(other_mesh._pin_position),
46 _pins_in_rings(other_mesh._pins_in_rings),
47 _chan_to_pin_map(other_mesh._chan_to_pin_map),
48 _n_assemblies(other_mesh._n_assemblies),
49 _n_gaps(other_mesh._n_gaps),
50 _subch_type(other_mesh._subch_type),
51 _gap_type(other_mesh._gap_type),
52 _gap_pairs_sf(other_mesh._gap_pairs_sf),
53 _chan_pairs_sf(other_mesh._chan_pairs_sf),
54 _pin_to_chan_map(other_mesh._pin_to_chan_map),
55 _tight_side_bypass(other_mesh._tight_side_bypass)
59 std::unique_ptr<MooseMesh>
68 Real distance0 = 1.0e+8;
77 if (distance1 < distance0)
80 distance0 = distance1;
89 mooseAssert(
false,
"This is not implemented");
101 mooseAssert(
false,
"This is not implemented");
108 mooseAssert(
false,
"This is not implemented");
125 Real theta_corrected = 0.0;
128 positions.emplace_back(0.0, 0.0);
129 for (
unsigned int i = 1; i < nrings; i++)
131 dtheta = 2.0 *
pi / (i * 6);
133 for (
unsigned int j = 0;
j < i * 6;
j++)
136 theta1 = fmod(theta + 1.0e-10,
pi / 3.0);
145 theta_corrected = theta;
149 if (theta >
pi / 3.0 && theta <= 2.0 / 3.0 *
pi)
150 theta_corrected = theta_corrected +
pi / 3.0;
151 else if (theta > 2.0 / 3.0 *
pi && theta <=
pi)
152 theta_corrected = theta_corrected + 2.0 / 3.0 *
pi;
153 else if (theta >
pi && theta <= 4.0 / 3.0 *
pi)
154 theta_corrected = theta_corrected +
pi;
155 else if (theta > 4.0 / 3.0 *
pi && theta <= 5.0 / 3.0 *
pi)
156 theta_corrected = theta_corrected + 4.0 / 3.0 *
pi;
157 else if (theta > 5.0 / 3.0 *
pi && theta <= 2.0 *
pi)
158 theta_corrected = theta_corrected + 5.0 / 3.0 *
pi;
160 positions.emplace_back(
center(0) +
distance * std::cos(theta_corrected),
162 theta = theta + dtheta;
171 for (
size_t i = 0; i < duct_nodes.size(); i++)
174 Real min_dist = std::numeric_limits<double>::max();
175 Point ductpos((*duct_nodes[i])(0), (*duct_nodes[i])(1), 0);
179 auto dist = (chanpos - ductpos).
norm();
187 Node * chan_node =
nullptr;
188 for (
auto cn :
_nodes[min_chan])
190 if (std::abs((*cn)(2) - (*duct_nodes[i])(2)) <
tol)
197 if (chan_node ==
nullptr)
198 mooseError(
"failed to find matching channel node for duct node");
static InputParameters validParams()
TriInterWrapperMesh(const InputParameters ¶meters)
std::vector< Node * > _duct_nodes
A list of all mesh nodes that form the (elements of) the hexagonal duct mesh that surrounds the pins/...
Base class for inter-wrapper meshes.
static InputParameters validParams()
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the interstice
static const std::string assembly_pitch
Real distance(const Point &p)
std::unique_ptr< T > copyConstruct(const T &object)
static void rodPositions(std::vector< Point > &positions, unsigned int nrings, Real assembly_pitch, Point center)
Calculates and stores the Pin positions/centers for a hexagonal assembly containing the given number ...
std::map< Node *, Node * > _duct_node_to_chan_map
A map for providing the closest/corresponding interstice node associated with each duct node...
registerMooseObject("SubChannelApp", TriInterWrapperMesh)
void setChannelToDuctMaps(const std::vector< Node *> &duct_nodes)
Setup the internal maps when there is a outside duct present.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int getSubchannelIndexFromPoint(const Point &p) const override
Return a inter-wrapper index for a given physical point p
unsigned int _n_channels
number of subchannels
virtual unsigned int getPinIndexFromPoint(const Point &p) const override
Return a pin index for a given physical point p
void mooseError(Args &&... args) const
virtual unsigned int pinIndex(const Point &p) const override
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< std::vector< Node * > > _nodes
nodes
virtual unsigned int channelIndex(const Point &point) const override
std::map< Node *, Node * > _chan_to_duct_node_map
A map for providing the closest/corresponding duct node associated with each interstice node...
Mesh class for triangular, edge and corner inter_wrappers for hexagonal lattice fuel assemblies...
MooseUnits pow(const MooseUnits &, int)
static const std::string k
static const std::string center
virtual void buildMesh() override
virtual std::unique_ptr< MooseMesh > safeClone() const override