Skip to content

Commit 54a9631

Browse files
committed
Fix merged subchannel mesh fallout in tests, docs, and gold files Refs idaholab#32847
1 parent 54e18e2 commit 54a9631

9 files changed

Lines changed: 43 additions & 34 deletions

File tree

modules/combined/test/tests/subchannel_thm_coupling/3D.i

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,14 @@ heated_length = 1.0
1010
###################################################
1111
[TriSubChannelMesh]
1212
[subchannel]
13-
type = SCMDetailedTriSubChannelMeshGenerator
13+
type = SCMDetailedTriAssemblyMeshGenerator
1414
nrings = ${n_rings}
1515
n_cells = ${n_cells}
1616
flat_to_flat = ${inner_duct_in}
1717
heated_length = ${heated_length}
1818
pin_diameter = ${fuel_pin_diameter}
1919
pitch = ${fuel_pin_pitch}
2020
[]
21-
22-
[fuel_pins]
23-
type = SCMDetailedTriPinMeshGenerator
24-
input = subchannel
25-
nrings = ${n_rings}
26-
n_cells = ${n_cells}
27-
pin_diameter = ${fuel_pin_diameter}
28-
heated_length = ${heated_length}
29-
pitch = ${fuel_pin_pitch}
30-
[]
3121
[]
3222

3323
[AuxVariables]

modules/combined/test/tests/subchannel_thm_coupling/subchannel.i

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ heated_length = 1.0
1717
###################################################
1818
[TriSubChannelMesh]
1919
[subchannel]
20-
type = SCMTriSubChannelMeshGenerator
20+
type = SCMTriAssemblyMeshGenerator
2121
nrings = ${n_rings}
2222
n_cells = ${n_cells}
2323
flat_to_flat = ${inner_duct_in}
@@ -29,15 +29,6 @@ heated_length = 1.0
2929
spacer_z = '0.0'
3030
spacer_k = '0.0'
3131
[]
32-
33-
[fuel_pins]
34-
type = SCMTriPinMeshGenerator
35-
input = subchannel
36-
nrings = ${n_rings}
37-
n_cells = ${n_cells}
38-
heated_length = ${heated_length}
39-
pitch = ${fuel_pin_pitch}
40-
[]
4132
[]
4233

4334
[AuxVariables]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SCMQuadAssemblyMeshGenerator
2+
3+
!syntax description /Mesh/SCMQuadAssemblyMeshGenerator
4+
5+
## Overview
6+
7+
!! Intentional comment to provide extra spacing
8+
9+
This mesh generator creates the 1D subchannel and pin meshes for a square lattice arrangement.
10+
The generated subdomains are named `subchannel` and `fuel_pins`.
11+
The center of the mesh is the origin.
12+
13+
## Example Input File Syntax
14+
15+
!listing /test/tests/problems/psbt/psbt_explicit.i block=QuadSubChannelMesh language=moose
16+
17+
!syntax parameters /Mesh/SCMQuadAssemblyMeshGenerator
18+
19+
!syntax inputs /Mesh/SCMQuadAssemblyMeshGenerator
20+
21+
!syntax children /Mesh/SCMQuadAssemblyMeshGenerator

modules/subchannel/doc/content/source/postprocessors/SCMPinPowerPostprocessor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ The user needs to specify a subchannel problem. Either a [QuadSubChannel1PhasePr
1010

1111
## Example Input File Syntax
1212

13-
!listing /test/tests/SCMQuadPower/test.i block=Postprocessors language=moose
14-
!listing /test/tests/SCMTriPower/test.i block=Postprocessors language=moose
13+
!listing /test/tests/SCMQuadPower/test_with_pins.i block=Postprocessors language=moose
14+
!listing /test/tests/SCMTriPower/test_with_pins.i block=Postprocessors language=moose
1515

1616
!syntax parameters /Postprocessors/SCMPinPowerPostprocessor
1717

modules/subchannel/include/mesh/TriSubChannelMesh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TriSubChannelMesh : public SubChannelMesh
4141
const Real & getDuctToPinGap() const { return _duct_to_pin_gap; }
4242

4343
/**
44-
* Return the number of rings
44+
* Return the number of fuel-pin rings, counting the center pin as the first ring
4545
*/
4646
const unsigned int & getNumOfRings() const { return _n_rings; }
4747

@@ -131,7 +131,7 @@ class TriSubChannelMesh : public SubChannelMesh
131131
unsigned int pinIndex(const Point & p) const override;
132132

133133
protected:
134-
/// number of rings of fuel pins
134+
/// number of fuel-pin rings, counting the center pin as the first ring
135135
unsigned int _n_rings;
136136
/// number of subchannels
137137
unsigned int _n_channels;

modules/subchannel/src/mesh/TriSubChannelMesh.C

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,15 @@ TriSubChannelMesh::channelIndex(const Point & p) const
8282
// subchannel
8383
Real distance_outer_ring = _flat_to_flat / 2 - _duct_to_pin_gap - _pin_diameter / 2;
8484
Real channel_distance = std::sqrt(std::pow(p(0), 2) + std::pow(p(1), 2));
85-
Real angle = std::abs(std::atan(p(1) / p(0)));
85+
Real angle = std::abs(std::atan2(p(1), p(0)));
8686
Real projection_angle =
8787
angle - libMesh::pi / 6 - std::trunc(angle / (libMesh::pi / 3)) * (libMesh::pi / 3);
8888
channel_distance = channel_distance * std::cos(projection_angle);
8989

9090
// Projecting point on top edge to determine if the point is a corner or edge subchannel by x
9191
// coordinate
92-
Real loc_angle = std::atan(p(1) / p(0));
93-
if (p(0) <= 0)
94-
loc_angle += libMesh::pi;
95-
else if (p(0) >= 0 && p(1) <= 0)
92+
Real loc_angle = std::atan2(p(1), p(0));
93+
if (loc_angle < 0.0)
9694
loc_angle += 2 * libMesh::pi;
9795
Real rem_ang = std::trunc(loc_angle / (libMesh::pi / 3)) * (libMesh::pi / 3) - libMesh::pi / 3;
9896
Real x_coord_new = (std::cos(-rem_ang) * p(0) - std::sin(-rem_ang) * p(1));
@@ -104,7 +102,9 @@ TriSubChannelMesh::channelIndex(const Point & p) const
104102

105103
if (_n_rings == 1)
106104
{
107-
Real angle = std::atan(p(1) / p(0));
105+
Real angle = std::atan2(p(1), p(0));
106+
if (angle < 0.0)
107+
angle += 2.0 * libMesh::pi;
108108
if ((i * libMesh::pi / 6.0 < angle) && (angle <= (i + 1) * libMesh::pi / 6.0))
109109
return i;
110110
}
@@ -129,13 +129,13 @@ TriSubChannelMesh::channelIndex(const Point & p) const
129129
if ((distance1 < distance0) &&
130130
(_subch_type[i] == EChannelType::EDGE || _subch_type[i] == EChannelType::CORNER))
131131
{
132-
if (((x_coord_new > x_lim) || (x_coord_new < -x_lim)) &&
132+
if ((x_coord_new > x_lim || x_coord_new < -x_lim) &&
133133
_subch_type[i] == EChannelType::CORNER)
134134
{
135135
j = i;
136136
distance0 = distance1;
137137
} // if
138-
else if (((x_coord_new > x_lim) || (x_coord_new > -x_lim)) &&
138+
else if ((x_coord_new <= x_lim && x_coord_new >= -x_lim) &&
139139
_subch_type[i] == EChannelType::EDGE)
140140
{
141141
j = i;

modules/subchannel/src/meshgenerators/SCMTriAssemblyMeshGenerator.C

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ SCMTriAssemblyMeshGenerator::validParams()
2727
params.addParam<Real>("unheated_length_entry", 0.0, "Unheated length at entry [m]");
2828
params.addRequiredParam<Real>("heated_length", "Heated length [m]");
2929
params.addParam<Real>("unheated_length_exit", 0.0, "Unheated length at exit [m]");
30-
params.addRequiredParam<unsigned int>("nrings", "Number of fuel Pin rings per assembly [-]");
30+
params.addRequiredParam<unsigned int>(
31+
"nrings",
32+
"Number of fuel-pin rings per assembly, counting the center pin as the first ring [-]");
3133
params.addRequiredParam<Real>("flat_to_flat",
3234
"Flat to flat distance for the hexagonal assembly [m]");
3335
params.addRequiredParam<Real>("dwire", "Wire diameter [m]");
@@ -86,6 +88,11 @@ SCMTriAssemblyMeshGenerator::SCMTriAssemblyMeshGenerator(const InputParameters &
8688
_n_gaps(0),
8789
_elem_id(0)
8890
{
91+
if (_n_rings < 2)
92+
mooseError(name(),
93+
": 'nrings' must be at least 2. In this mesh generator, the center pin counts as "
94+
"the first ring, so a 7-pin bundle uses nrings = 2.");
95+
8996
if (_spacer_z.size() != _spacer_k.size())
9097
mooseError(name(), ": Size of vector spacer_z should be equal to size of vector spacer_k");
9198

0 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)