13 #include "libmesh/edge_edge2.h" 14 #include "libmesh/unstructured_mesh.h" 23 "lattice arrangement");
33 _n_channels(other_mesh._n_channels),
34 _n_gaps(other_mesh._n_gaps),
35 _n_pins(other_mesh._n_pins),
36 _side_gap(other_mesh._side_gap),
37 _nodes(other_mesh._nodes),
38 _pin_nodes(other_mesh._pin_nodes),
39 _gapnodes(other_mesh._gapnodes),
40 _gap_to_chan_map(other_mesh._gap_to_chan_map),
41 _gap_to_pin_map(other_mesh._gap_to_pin_map),
42 _chan_to_gap_map(other_mesh._chan_to_gap_map),
43 _chan_to_pin_map(other_mesh._chan_to_pin_map),
44 _pin_to_chan_map(other_mesh._pin_to_chan_map),
45 _sign_id_crossflow_map(other_mesh._sign_id_crossflow_map),
46 _gij_map(other_mesh._gij_map),
47 _subch_type(other_mesh._subch_type)
51 ": The number of subchannels cannot be less than 2 in both directions (x and y). " 52 "Smallest assembly allowed is either 2X1 or 1X2. ");
55 std::unique_ptr<MooseMesh>
75 for (
unsigned int i_ch = 0; i_ch <
_n_channels; i_ch++)
82 mooseError(
name(),
": Assembly wetted perimeter is zero; cannot compute hydraulic diameter.");
90 Real standard_area = 0.0;
92 Real additional_area = 0.0;
113 Real flow_area = standard_area + additional_area - rod_area;
115 unsigned int blockage_index = 0;
135 return 0.5 * rod_circumference +
_pitch;
137 return rod_circumference;
163 i = std::min(i, (
int)(
_nx - 1));
166 j = std::min(
j, (
int)(
_ny - 1));
175 mooseError(
name(),
": Cannot compute a pin index because this mesh has no pins.");
179 unsigned int i = (
p(0) + offset_x) /
_pitch;
180 unsigned int j = (
p(1) + offset_y) /
_pitch;
181 return j * (
_nx - 1) + i;
188 mooseError(
name(),
": Cannot compute a pin index because this mesh has no pins.");
192 unsigned int i = (
p(0) + offset_x) /
_pitch;
193 unsigned int j = (
p(1) + offset_y) /
_pitch;
194 return j * (
_nx - 1) + i;
199 unsigned int nx,
unsigned int ny, Real
pitch, Real elev, std::vector<Point> & pin_centers)
201 mooseAssert(nx >= 2,
"Number of channels in x-direction must be 2 or more.");
202 mooseAssert(ny >= 2,
"Number of channels in y-direction must be 2 or more.");
206 for (
unsigned int iy = 0; iy < ny - 1; iy++)
207 for (
unsigned int ix = 0; ix < nx - 1; ix++)
208 pin_centers.push_back(Point(
pitch * ix - offset_x,
pitch * iy - offset_y, elev));
static InputParameters validParams()
registerMooseObject("SubChannelApp", QuadSubChannelMesh)
EChannelType getSubchannelType(unsigned int index) const override
Return the type of the subchannel for given subchannel index.
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...
std::vector< Real > _z_grid
axial location of nodes
unsigned int pinIndex(const Point &p) const override
std::unique_ptr< MooseMesh > safeClone() const override
unsigned int _ny
number of subchannels in the y direction
Creates the mesh of subchannels in a quadrilateral lattice.
unsigned int channelIndex(const Point &point) const override
std::unique_ptr< T > copyConstruct(const T &object)
unsigned int _n_pins
Number of pins.
Real _side_gap
The side gap, not to be confused with the gap between pins, this refers to the gap next to the duct o...
const std::string & name() const
void buildMesh() override
unsigned int getSubchannelIndexFromPoint(const Point &p) const override
Return a subchannel index for a given physical point p
static const std::string pitch
void computeAssemblyHydraulicParameters()
Compute undeformed bundle-average inlet hydraulic quantities from generated mesh geometry.
Real _assembly_wetted_perimeter
Undeformed bundle inlet wetted perimeter.
std::vector< Real > _z_blockage
axial location of blockage (inlet, outlet) [m]
Real _pin_diameter
fuel Pin diameter
std::vector< Real > _reduction_blockage
area reduction of subchannels affected by blockage
Real _pitch
Distance between the neighbor fuel pins, pitch.
Real _assembly_flow_area
Undeformed bundle inlet flow area.
static void generatePinCenters(unsigned int nx, unsigned int ny, Real pitch, Real elev, std::vector< Point > &pin_centers)
Generate pin centers.
unsigned int _n_channels
number of subchannels in total
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
QuadSubChannelMesh(const InputParameters ¶meters)
void mooseError(Args &&... args) const
unsigned int getPinIndexFromPoint(const Point &p) const override
Return a pin index for a given physical point p
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Base class for subchannel meshes.
unsigned int _nx
number of subchannels in the x direction
Real getSubchannelWettedPerimeter(unsigned int i_chan) const override
Return undeformed wetted perimeter for a subchannel.
Real _assembly_hydraulic_diameter
Undeformed bundle-average hydraulic diameter.
std::vector< unsigned int > _index_blockage
index of subchannels affected by blockage