terrapower / armi

An open-source nuclear reactor analysis automation framework that helps design teams increase efficiency and quality
https://terrapower.github.io/armi/
Apache License 2.0
216 stars 87 forks source link

Assembly Rotation Cleanup #1533

Open albeanth opened 7 months ago

albeanth commented 7 months ago

There several rotation methods:

  1. https://github.com/terrapower/armi/blob/7e1e16736b7082c2ce4892bb36243fb080c63a48/armi/reactor/assemblies.py#L1215
  2. https://github.com/terrapower/armi/blob/7e1e16736b7082c2ce4892bb36243fb080c63a48/armi/reactor/assemblies.py#L312
  3. https://github.com/terrapower/armi/blob/7e1e16736b7082c2ce4892bb36243fb080c63a48/armi/reactor/blocks.py#L1827
  4. https://github.com/terrapower/armi/blob/7e1e16736b7082c2ce4892bb36243fb080c63a48/armi/reactor/blocks.py#L1902
  5. https://github.com/terrapower/armi/blob/7e1e16736b7082c2ce4892bb36243fb080c63a48/armi/physics/fuelCycle/assemblyRotationAlgorithms.py#L76

It looks like they all boil down to the two methods on blocks.py, rotate and rotatePins. The docstring for rotatePins suggests that calling it on it's own does not constitute rotation. https://github.com/terrapower/armi/blob/7e1e16736b7082c2ce4892bb36243fb080c63a48/armi/reactor/blocks.py#L1928-L1932

That said, I think we should consider making rotatePins private and/or putting warnings in docstrings (on that method, assembly.rotatePins, and assemblyRotationAlgorithms.py::simpleAssemblyRotation) saying that it's an incomplete rotation.

albeanth commented 7 months ago

Additionally, rotatePins is fixed to increments of 60 degree rotations, while rotate is expected to be a flexible rotation. However, once assembly.rotate boils down to blocks.rotate, that flexible rotation angle needs to be in 60 degree increments https://github.com/terrapower/armi/blob/7e1e16736b7082c2ce4892bb36243fb080c63a48/armi/reactor/blocks.py#L1839-L1844