Replies: 5 comments 12 replies
-
I like the above. I would like to add some classic software clues that we don't have enough abstraction in our codebase. Let me focus on the data object model (at time of writing):
Perhaps there should be a simple Such distinctions would make reading, understanding, and testing the code easier. But it would also allow for ARMI to better support a wider range of rectors. |
Beta Was this translation helpful? Give feedback.
-
A comment from @john-science in #1894 is worth pulling here
An |
Beta Was this translation helpful? Give feedback.
-
From @jakehader in #303 (comment) |
Beta Was this translation helpful? Give feedback.
-
Bringing in another thought - #1030 Provide a A PBR or MSR would not have an assembly but could still benefit from a |
Beta Was this translation helpful? Give feedback.
-
Okay, some thoughts. (SFR below is a stand-in for the pin-type hexagonal assembly fast spectrum sodium cooled reactor concepts that has informed a lot of ARMI's design decisions)
With these questions in place, we have the abstract (or semi-abstract) building blocks (pun intended) for the composite tree. Could these be a submodule, e.g., from armi.reactor.bases import BaseComponent, BaseBlock, BaseAssembly
class MyNewShape(Component):
...
class MyNewBlock(BaseBlock):
...
class MyNewAssembly(BaseAssembly):
... Then, we could move a lot of the existing (SFR-influenced) classes in |
Beta Was this translation helpful? Give feedback.
-
This might be my hottest take on ARMI from someone who has worked on the outside of ARMI using ARMI for a few years before starting to work on the inside of ARMI:
ARMI defaults to doing too much.
This is great but it can also be frustrating. Great because you have a lot of functionality on block and assembly and core objects for free. There are a lot of parameters that someone assumes you're going to want and sometimes you do and you don't have to re-define them.
Frustrating if you want to make an ARMI application purpose built for something that isn't
getRingPos
for 2d location when something likegetXY
orgetIJ
would be more intuitive.- doing traditional two-stage neutronics (lattice physics multi-group xs generation followed by deterministic global flux solve)
I know this is where ARMI originated and that drove the design and a lot of the defaults. I have put some thoughts in a discussion on supporting more reactor types but I want to go a bit deeper.
What if ARMI provided pure abstract classes that only did the absolute bare minimum?
Case study
The block as a concept is a thing with child components and a height and lives in an assembly. Yet, the default
armi.reactor.blocks.Block
has functionality forHexBlock
inherits fromBlock
and brings in a lot of its own assumptions. One of which is your pin pitch is based on a wire component which makes sense for SFRs but not for prismatic HTGRs that are hexagonal but don't have wire wraps.These are useful but I would say they are not universally useful all the time. The API for a
Block
and its associated documentation is extensive.What if ARMI shipped an
AbstractBlock
that provided very little functionality if at all but provided the interface, throughabstractmethod
s for how the most basic block should be expected to behave?Then, the
AbstractHexBlock
could provide a little more of the interface.The current ARMI blocks could have a name more tied to their use case and engineering domain, like
FastReactorHexBlock
andSFRHexBlock
.Benefits
The composite tree structure is great. The plugin and hub-and-spoke model is powerful. This could be a way to further remove some of the modeling assumptions and allow applications to build their own plugins specific to their needs.
Applications don't have to spend time or see warnings because their blocks inherit from something that has different goals.
Users and plugins are more likely to use more of the API afforded to them. Methods that are not used still show up in docs and when people do tab completion in ipython looking for the method they can't quite remember.
Drawbacks
Lots.
This is a huge architectural change. It's going to be hard and take time and need to be well thought out and advertised and get lots of stakeholders on board. Internal and external.
Where do you put parameters? What parameters matter for a
SFRHexBlock
and should be defined there and not on aHTGRHexBlock
orLWRCartesianBlock
?Determining what the bare functionality to be on an abstract block or component or assembly would be a community effort. If you're trying to make a (semi) general purpose Monte Carlo interface, like the
openmc plugin
, does this distinction make your life easier or harder?I'm not convinced the reactor-specific block inheritance tree of
AbstractBlock
->AbstractHexBlock
->FastReactorHexBlock
->SFRHexBlock
is great.Conclusion
I am a big fan of ARMI and its goal and design. I think this could unlock a lot of potential for people building with ARMI by reducing some friction and modeling assumptions. More on the modeling assumptions in #1894
Beta Was this translation helpful? Give feedback.
All reactions