Closed lewisgross1296 closed 2 months ago
Tagging @GiudGiud
I just tried the MWE with $nr=2$ and I think that confirms my understanding of ring counting
*** ERROR ***
The following error occurred in the object "hex_grid", of type "HexagonalGridPositions".
Number of rows in pattern 5 should be equal to twice the number of hexagonal rings minus one
AKA the above code snippet should be considered 3 rings and the error checking condition is off-by-one.
First picture is 5.5 rings Yes it possible this check is off by 1
Ah gotcha, 5.5 also makes sense. I only call it 6 rings because I made the image using a HexLattice in OpenMC and there it is defined as 6. The hexagonal prism I filled it into clips the last ring to "a half." I think this kind of reflective boundary (only really done in simulations only) is the limit of what should be allowed for a minimum flat to flat.
Happy to review a patch if you feel comfortable making it
Sure! This seems very doable, so I'll give it a try.
Note: all this math above is for a half-ring situation. I should redo this when the number of rings is only an integer and there isn't a smooth boundary
Bug Description
Recently, #26935 added the capability to generate various positions within a Hexagonal Lattice (which I am very grateful for). I went to try it out today and encountered
but I think either I am misunderstanding
nr
or there is an off-by-one error.When counting rings, does the central ring count or not? For example, I would say this hexagaonal lattice has 6 rings
I would say that the flat-to-flat here is $5pitch\sqrt{3}$. Currently, https://github.com/idaholab/moose/blob/659e12791ceaa627c75956d97d009b3f9f8963c0/modules/reactor/src/positions/HexagonalGridPositions.C#L61 would throw an error because $6pitch\sqrt{3} > 5pitch\sqrt{3}$. I believe the correct condition to throw an error should be $(nr-1)p\sqrt{3} > lattice$ $flat$ $to$ $flat$
I've attached some diagrams for a hexagon of arbitrary number of rings
nr
. Here a hexagon is shown where the edge length is $(nr-1)p$ Here is the 30-60-90 triangle created that relates the side length to the flat to flat distance. Note the base of this triangle is half the flat to flat distance.Here the math tells us $$\big( \frac{1}{2} dftf \big)^2 + \big( \frac{1}{2} (nr-1)p \big)^2 = \big((nr-1)p \big)^2$$ $$\big(\frac{1}{2} dftf \big)^2 = \big((nr-1)p \big)^2 - \big( \frac{1}{2} (nr-1)p \big)^2$$ $$\frac{1}{2} dftf = (nr-1)p \frac{\sqrt{3}}{2}$$ Thus, the minimum flat to flat distance is given by $$dftf = (nr-1)p \sqrt{3}$$
Steps to Reproduce
Run this file
coolant_channel_generator.i
Impact
This would be a very small PR and I could likely get around it by using a different
lattice_flat_to_flat
, but I think it should be resolved.[Optional] Diagnostics
No response