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. ");
55std::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;
143 Real offset_x = (
_nx - 1) *
_pitch / 2.0;
144 Real offset_y = (
_ny - 1) *
_pitch / 2.0;
157 Real offset_x = (
_nx - 1) *
_pitch / 2.0;
158 Real offset_y = (
_ny - 1) *
_pitch / 2.0;
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.");
177 Real offset_x = (
_nx - 2) *
_pitch / 2.0;
178 Real offset_y = (
_ny - 2) *
_pitch / 2.0;
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.");
190 Real offset_x = (
_nx - 2) *
_pitch / 2.0;
191 Real offset_y = (
_ny - 2) *
_pitch / 2.0;
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.");
204 Real offset_x = (nx - 2) * pitch / 2.0;
205 Real offset_y = (ny - 2) * pitch / 2.0;
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));
registerMooseObject("SubChannelApp", QuadSubChannelMesh)
std::unique_ptr< T > copyConstruct(const T &object)
const std::string & name() const
void mooseError(Args &&... args) const
Creates the mesh of subchannels in a quadrilateral lattice.
static InputParameters validParams()
static void generatePinCenters(unsigned int nx, unsigned int ny, Real pitch, Real elev, std::vector< Point > &pin_centers)
Generate pin centers.
unsigned int _ny
number of subchannels in the y direction
unsigned int getPinIndexFromPoint(const Point &p) const override
Return a pin index for a given physical point p
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...
unsigned int pinIndex(const Point &p) const override
Real getSubchannelWettedPerimeter(unsigned int i_chan) const override
Return undeformed wetted perimeter for a subchannel.
unsigned int _n_pins
Number of pins.
unsigned int getSubchannelIndexFromPoint(const Point &p) const override
Return a subchannel index for a given physical point p
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.
unsigned int _nx
number of subchannels in the x direction
EChannelType getSubchannelType(unsigned int index) const override
Return the type of the subchannel for given subchannel index.
void buildMesh() override
unsigned int channelIndex(const Point &point) const override
std::unique_ptr< MooseMesh > safeClone() const override
void computeAssemblyHydraulicParameters()
Compute undeformed bundle-average inlet hydraulic quantities from generated mesh geometry.
unsigned int _n_channels
number of subchannels in total
QuadSubChannelMesh(const InputParameters ¶meters)
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.
Real _pin_diameter
fuel Pin diameter
Real _assembly_hydraulic_diameter
Undeformed bundle-average hydraulic diameter.
Real _pitch
Distance between the neighbor fuel pins, pitch.