From 6fc6e44c5bd80ba18887ea87959add948d5c45ed Mon Sep 17 00:00:00 2001 From: lewisgross1296 Date: Mon, 11 Mar 2024 18:11:50 -0500 Subject: [PATCH 1/4] corrected error condition and print message when given a lattice flat to flat below the min. closes #27051 --- modules/reactor/src/positions/HexagonalGridPositions.C | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/reactor/src/positions/HexagonalGridPositions.C b/modules/reactor/src/positions/HexagonalGridPositions.C index 4603ce20c49a..840c44f08df1 100644 --- a/modules/reactor/src/positions/HexagonalGridPositions.C +++ b/modules/reactor/src/positions/HexagonalGridPositions.C @@ -58,9 +58,10 @@ HexagonalGridPositions::HexagonalGridPositions(const InputParameters & parameter std::set(getParam>("include_in_pattern").begin(), getParam>("include_in_pattern").end())) { - if (MooseUtils::absoluteFuzzyGreaterThan(_nr * _pin_pitch * sqrt(3), _lattice_flat_to_flat)) + if (MooseUtils::absoluteFuzzyGreaterThan((_nr - 1) * _pin_pitch * sqrt(3), _lattice_flat_to_flat)) paramError("lattice_flat_to_flat", - "Bundle pitch is too small to fit this many rings at that pin pitch"); + "Lattice flat to flat distance is less than the minimum, (nr - 1) * pin_pitch * " + "sqrt(3), given nr rings with a pitch of pin_pitch"); if ((_include_in_pattern.empty() && _pattern.size()) || (_include_in_pattern.size() && _pattern.empty())) paramError( From 9914b1a51463156e9c2ee1d0d9c38fd1c007b2b1 Mon Sep 17 00:00:00 2001 From: lewisgross1296 Date: Tue, 12 Mar 2024 15:29:40 -0500 Subject: [PATCH 2/4] added logic to seperate nr whether it is 1 or more. this caused an error on a local script I am using for testing (I will add it to the PR) --- .../src/positions/HexagonalGridPositions.C | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/reactor/src/positions/HexagonalGridPositions.C b/modules/reactor/src/positions/HexagonalGridPositions.C index 840c44f08df1..6f09221d90ad 100644 --- a/modules/reactor/src/positions/HexagonalGridPositions.C +++ b/modules/reactor/src/positions/HexagonalGridPositions.C @@ -58,10 +58,20 @@ HexagonalGridPositions::HexagonalGridPositions(const InputParameters & parameter std::set(getParam>("include_in_pattern").begin(), getParam>("include_in_pattern").end())) { - if (MooseUtils::absoluteFuzzyGreaterThan((_nr - 1) * _pin_pitch * sqrt(3), _lattice_flat_to_flat)) - paramError("lattice_flat_to_flat", - "Lattice flat to flat distance is less than the minimum, (nr - 1) * pin_pitch * " - "sqrt(3), given nr rings with a pitch of pin_pitch"); + if (_nr == 1) + { + if (MooseUtils::absoluteFuzzyGreaterThan(_pin_pitch, _lattice_flat_to_flat)) + paramError("lattice_flat_to_flat", + "For one ring, the lattice flat to flat must be at least the pin pitch"); + } + else + { + if (MooseUtils::absoluteFuzzyGreaterThan((_nr - 1) * _pin_pitch * sqrt(3), + _lattice_flat_to_flat)) + paramError("lattice_flat_to_flat", + "Lattice flat to flat distance is less than the minimum, (nr - 1) * pin_pitch * " + "sqrt(3), given nr rings with a pitch of pin_pitch"); + } if ((_include_in_pattern.empty() && _pattern.size()) || (_include_in_pattern.size() && _pattern.empty())) paramError( From 416a355d4442ea03d73767007e44266b62740c83 Mon Sep 17 00:00:00 2001 From: lewisgross1296 Date: Wed, 17 Apr 2024 15:03:30 -0500 Subject: [PATCH 3/4] updated formula for minimum flat to flat --- modules/reactor/src/positions/HexagonalGridPositions.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/reactor/src/positions/HexagonalGridPositions.C b/modules/reactor/src/positions/HexagonalGridPositions.C index 6f09221d90ad..1dd903d846c3 100644 --- a/modules/reactor/src/positions/HexagonalGridPositions.C +++ b/modules/reactor/src/positions/HexagonalGridPositions.C @@ -66,11 +66,11 @@ HexagonalGridPositions::HexagonalGridPositions(const InputParameters & parameter } else { - if (MooseUtils::absoluteFuzzyGreaterThan((_nr - 1) * _pin_pitch * sqrt(3), + if (MooseUtils::absoluteFuzzyGreaterThan((3 * _nr - 1) * _pin_pitch / sqrt(3), _lattice_flat_to_flat)) paramError("lattice_flat_to_flat", - "Lattice flat to flat distance is less than the minimum, (nr - 1) * pin_pitch * " - "sqrt(3), given nr rings with a pitch of pin_pitch"); + "Lattice flat to flat distance is less than the minimum (3 * nr - 1) * pin_pitch " + "/ sqrt(3) given nr rings with a pitch of pin_pitch"); } if ((_include_in_pattern.empty() && _pattern.size()) || (_include_in_pattern.size() && _pattern.empty())) From 36ea7dd5f4f7e11a216874743bfe30a1bb2cf7ab Mon Sep 17 00:00:00 2001 From: Guillaume Giudicelli Date: Fri, 9 Aug 2024 14:30:33 -0600 Subject: [PATCH 4/4] Add exception-checking for hexagonal grid lattice-flat-to-flat size checkes --- modules/reactor/test/tests/positions/tests | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/reactor/test/tests/positions/tests b/modules/reactor/test/tests/positions/tests index 531144095eea..b3383c895a73 100644 --- a/modules/reactor/test/tests/positions/tests +++ b/modules/reactor/test/tests/positions/tests @@ -45,4 +45,22 @@ detail = 'a three-dimensional cartesian grid with some positions excluded.' [] [] + + [errors] + requirement = "The system shall error" + [1ring_too_big] + type = RunException + input = 'hexagonal_grid_positions.i' + cli_args = "Positions/hex_grid/nr=1 Positions/hex_grid/lattice_flat_to_flat=0.49" + expect_err = "For one ring, the lattice flat to flat must be at least the pin pitch" + detail = 'if the hexagonal lattice flat-to-flat specified is too small for a single pin to fit,' + [] + [more_rings_too_big] + type = RunException + input = 'hexagonal_grid_positions.i' + cli_args = "Positions/hex_grid/lattice_flat_to_flat=1.43" + expect_err = "Lattice flat to flat distance is less than the minimum" + detail = 'and if the hexagonal lattice flat-to-flat specified is too small for the rings of pins to fit.' + [] + [] []