13 #include "libmesh/edge_edge2.h" 14 #include "libmesh/unstructured_mesh.h" 18 TriInterWrapperMeshGenerator,
27 "Creates a mesh for the inter-wrapper around triangular subassemblies");
28 params.
addRequiredParam<
unsigned int>(
"n_cells",
"The number of cells in the axial direction");
30 params.
addParam<
Real>(
"unheated_length_entry", 0.0,
"Unheated length at entry [m]");
32 params.
addParam<
Real>(
"unheated_length_exit", 0.0,
"Unheated length at exit [m]");
33 params.
addRequiredParam<
unsigned int>(
"nrings",
"Number of fuel Pin rings per assembly [-]");
35 "Flat to flat distance for the hexagonal assembly [m]");
36 params.
addParam<
Real>(
"Kij", 0.5,
"Lateral form loss coefficient [-]");
38 "Extra size of the bypass for the side assemblies [m]");
42 "Whether the side bypass shape follows the hexagonal shape of the assemblies");
48 _unheated_length_entry(getParam<
Real>(
"unheated_length_entry")),
49 _heated_length(getParam<
Real>(
"heated_length")),
50 _unheated_length_exit(getParam<
Real>(
"unheated_length_exit")),
51 _kij(getParam<
Real>(
"Kij")),
52 _assembly_pitch(getParam<
Real>(
"assembly_pitch")),
53 _n_cells(getParam<unsigned
int>(
"n_cells")),
54 _n_rings(getParam<unsigned
int>(
"nrings")),
55 _flat_to_flat(getParam<
Real>(
"flat_to_flat")),
56 _duct_to_pin_gap(getParam<
Real>(
"side_bypass")),
57 _tight_side_bypass(getParam<bool>(
"tight_side_bypass"))
79 Real avg_coor_x = 0.0;
81 Real avg_coor_y = 0.0;
87 unsigned int kgap = 0;
89 unsigned int icorner = 0;
91 const Real positive_flow = 1.0;
93 const Real negative_flow = -1.0;
95 std::vector<std::pair<unsigned int, unsigned int>> gap_fill;
103 for (
unsigned int i = 1; i <
_n_rings; i++)
104 for (
unsigned int j = 0;
j < i * 6;
j++)
108 unsigned int chancount = 0.0;
137 for (
unsigned int j = 0;
j < 3;
j++)
149 for (
unsigned int i = 1; i <
_n_rings; i++)
386 gap_fill[
j].first = 1;
391 gap_fill[
j].second = 1;
405 gap_fill[
j].first = 1;
410 gap_fill[
j].second = 1;
491 for (
unsigned int k = 0;
k < 3;
k++)
522 for (
unsigned int k = 0;
k < 2;
k++)
606 a2 = std::sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) + a1;
618 a2 = std::sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) + a1;
630 std::unique_ptr<MeshBase>
635 BoundaryInfo & boundary_info = mesh_base->get_boundary_info();
636 mesh_base->set_spatial_dimension(3);
644 unsigned int node_id = 0;
648 for (
unsigned int iz = 0; iz <
_n_cells + 1; iz++)
650 _nodes[i].push_back(mesh_base->add_point(
657 unsigned int elem_id = 0;
660 for (
unsigned int iz = 0; iz <
_n_cells; iz++)
662 Elem * elem =
new Edge2;
663 elem->set_id(elem_id++);
664 elem = mesh_base->add_elem(elem);
665 const int indx1 = (
_n_cells + 1) * i + iz;
666 const int indx2 = (
_n_cells + 1) * i + (iz + 1);
667 elem->set_node(0, mesh_base->node_ptr(indx1));
668 elem->set_node(1, mesh_base->node_ptr(indx2));
671 boundary_info.add_side(elem, 0, 0);
673 boundary_info.add_side(elem, 1, 1);
676 boundary_info.sideset_name(0) =
"inlet";
677 boundary_info.sideset_name(1) =
"outlet";
678 boundary_info.nodeset_name(0) =
"inlet";
679 boundary_info.nodeset_name(1) =
"outlet";
681 mesh_base->prepare_for_use();
690 sch_mesh._kij =
_kij;
Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies...
std::vector< std::pair< unsigned int, unsigned int > > _chan_pairs_sf
sweeping flow model channel pairs to specify directional edge flow
unsigned int _n_assemblies
number of assemblies
Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
const Real & _kij
Lateral form loss coefficient.
const Real _flat_to_flat
the distance between flat surfaces of the duct facing each other
const Real _unheated_length_exit
unheated length of the fuel Pin at the exit of the assembly
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_chan_map
stores the channel pairs for each gap
std::vector< Real > _z_grid
axial location of nodes
std::vector< std::vector< Node * > > _nodes
nodes
const Real _assembly_pitch
Distance between the neighbor fuel pins, assembly_pitch.
static InputParameters validParams()
std::vector< std::pair< unsigned int, unsigned int > > _gap_pairs_sf
sweeping flow model gap pairs per channel to specify directional edge flow
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::vector< std::vector< Real > > _pins_in_rings
fuel pins that are belonging to each ring
const unsigned int _n_rings
number of rings of fuel pins
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_pin_map
stores the fuel pin pairs for each gap each gap
unsigned int _n_channels
number of subchannels
SCMTriInterWrapperMeshGenerator(const InputParameters ¶meters)
const Real _duct_to_pin_gap
the gap thickness between the duct and peripheral fuel pins
std::vector< Real > _gij_map
gap size
const Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
registerMooseObjectRenamed("SubChannelApp", TriInterWrapperMeshGenerator, "06/30/2025 24:00", SCMTriInterWrapperMeshGenerator)
static void generateZGrid(Real unheated_length_entry, Real heated_length, Real unheated_length_exit, unsigned int n_cells, std::vector< Real > &z_grid)
Generate the spacing in z-direction using heated and unheated lengths.
static InputParameters validParams()
std::vector< std::vector< Real > > _sign_id_crossflow_map
Defines the global cross-flow direction -1 or 1 for each interstice and for all gaps that are belongi...
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const unsigned int _n_cells
number of axial cells
const bool _tight_side_bypass
whether the side bypass shape follows the hexagonal shape of the assemblies TODO: add a picture in th...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int _n_gaps
number of gaps
std::vector< Point > _pin_position
x,y coordinates of the fuel pins
std::vector< std::vector< unsigned int > > _chan_to_gap_map
stores the gaps that forms each interstice
std::unique_ptr< MeshBase > generate() override
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
registerMooseObject("SubChannelApp", SCMTriInterWrapperMeshGenerator)
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the interstices
std::vector< std::vector< Real > > _k_grid
axial form loss coefficient per computational cell
std::vector< EChannelType > _subch_type
interstice type
std::vector< EChannelType > _gap_type
gap type
Mesh class for triangular, edge and corner inter_wrappers for hexagonal lattice fuel assemblies...
static const std::string k
void ErrorVector unsigned int
std::vector< std::vector< unsigned int > > _chan_to_pin_map
stores the fuel pins belonging to each interstice
const Real _heated_length
heated length of the fuel Pin