23 "Places triangular-lattice subchannel assembly meshes on a hexagonal core lattice. Each "
24 "assembly keeps its own subdomains and boundaries; assemblies are not connected.");
27 "The SCMTriAssemblyMeshGenerator, SCMTriDuctMeshGenerator, or "
28 "SCMTriVisualizationAssemblyMeshGenerator meshes that can be placed in the core");
31 "Hexagonal core pattern of indices into 'inputs', using the row syntax of "
32 "PatternedHexMeshGenerator; -1 marks an empty position. Row i is placed as the i-th column "
33 "from -x, and the entries of a row are placed from -y to +y.");
42 paramError(
"pattern",
"The pattern must contain at least one row.");
44 paramError(
"pattern",
"A hexagonal pattern must have an odd number of rows.");
47 const auto n_side = (n_rows + 1) / 2;
48 for (
const auto i : index_range(
_pattern))
50 const auto row_length = n_side + std::min(i, n_rows - 1 - i);
51 if (
_pattern[i].size() != row_length)
57 " entries; a hexagonal pattern with ",
63 for (
const auto j : index_range(
_pattern[i]))
68 const Real
x = (Real(i) - Real(n_side - 1)) *
_assembly_pitch * std::sqrt(3.0) / 2.0;
75 paramError(
"pattern",
"The pattern must contain at least one assembly.");
83 if (!hasMeshProperty<Real>(
"flat_to_flat", input_name))
87 "' does not provide 'flat_to_flat' metadata. Inputs must be "
88 "SCMTriAssemblyMeshGenerator, SCMTriDuctMeshGenerator, or "
89 "SCMTriVisualizationAssemblyMeshGenerator objects.");
90 _flat_to_flat.push_back(getMeshProperty<Real>(
"flat_to_flat", input_name));
96 const unsigned int input_b,
97 const Point & offset)
const
103 const std::array<Point, 3> flat_normals = {Point(std::sqrt(3.0) / 2.0, 0.5, 0.0),
104 Point(0.0, 1.0, 0.0),
105 Point(-std::sqrt(3.0) / 2.0, 0.5, 0.0)};
110 for (
const auto & normal : flat_normals)
111 if (!MooseUtils::absoluteFuzzyLessThan(std::abs(offset * normal), sum_apothems,
tol))
const std::vector< double > y
const std::vector< double > x
registerMooseObject("SubChannelApp", SCMTriCoreMeshGenerator)
void paramError(const std::string ¶m, Args... args) const
Base class for mesh generators that place SCM assembly meshes on a core lattice and merge them into o...
const Real _assembly_pitch
Center-to-center distance between neighboring assembly positions [m].
static InputParameters validParams()
const std::vector< std::vector< int > > & _pattern
Core pattern of indices into the inputs; -1 marks an empty position.
std::vector< std::pair< unsigned int, Point > > _assemblies
Placed assemblies in pattern order: (index into the inputs, x-y center of the assembly)
void addAssembly(int entry, const Point ¢er)
Check that a pattern entry is -1 or a valid input index and, if it is an index, place that input at c...
const std::vector< MeshGeneratorName > & _input_names
Names of the input SCM 1D assembly, duct, or 3D visualization assembly mesh generators.
Places triangular-lattice SCM assembly meshes on a hexagonal core lattice and merges them into one me...
SCMTriCoreMeshGenerator(const InputParameters ¶meters)
static InputParameters validParams()
std::vector< Real > _flat_to_flat
Flat-to-flat duct size of each input [m].
bool overlap(unsigned int input_a, unsigned int input_b, const Point &offset) const override
Whether the ducts of two inputs overlap when their centers are offset apart.
void readAssemblySizes() override
Read the duct size metadata of every input.
static constexpr Real TOLERANCE