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
234 stars 89 forks source link

`coupledIteration` stored on data model is different than that used during the run #1962

Open keckler opened 1 month ago

keckler commented 1 month ago

In the code chunk below, we store coupledIteration as n+1, whereas we send n into interactAllCOupled(): https://github.com/terrapower/armi/blob/eef58ddcd797c7acc542a4941b95dcb84dda2670/armi/operators/operator.py#L456-L458

This also means that the iteration number that is printed in the STDOUT is not aligned with the value used during interactCoupled() calls. In the screenshot below, the circled value comes from the DB. image https://github.com/terrapower/armi/blob/eef58ddcd797c7acc542a4941b95dcb84dda2670/armi/operators/operator.py#L568-L573

So basically, if anyone is trying to do something within an interactCoupled() call that is dependent on the iteration number, they are possibly using the wrong iteration number if they are using the STDOUT as their guide.

keckler commented 1 month ago

Looks like the CrossSectionGroupManager is assuming zero-indexing: https://github.com/terrapower/armi/blob/eef58ddcd797c7acc542a4941b95dcb84dda2670/armi/physics/neutronics/crossSectionGroupManager.py#L938-L972

keckler commented 1 month ago

The LatticePhysicsInterface also assumes zero-indexing: https://github.com/terrapower/armi/blob/eef58ddcd797c7acc542a4941b95dcb84dda2670/armi/physics/neutronics/latticePhysics/latticePhysicsInterface.py#L224-L257

keckler commented 1 month ago

I'm not sure that anything important is actually broken here, so I removed the "bug" label. But I'd say this is confusing and I would advocate that the value used and the value printed are aligned with each other.

keckler commented 1 month ago

The "Tight Coupling Convergence Summary" table is also zero-indexed: image

So it really seems like everything except for the interaction hook header is zero-indexed. Seems like an easy fix to just change the headers.