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

Upgrade reactor data model to fully support an arbitrarily-deep composite design pattern #1008

Open ntouran opened 1 year ago

ntouran commented 1 year ago

Right now we have a sort-of hybrid Composite design pattern for the reactor data model, with the following players:

Things that could be improved:

But for this ticket, let's just focus on the 2nd bullet: Allow deeper nesting of components and composites within composites.

This will support #477.

john-science commented 1 year ago

@drewj-usnctech Just FYI.

jakehader commented 1 year ago

@ntouran, I think there is a challenge associated with parameter definitions and assignments of a composite tree like this, at least in the context of how we are doing things. I think that every Assemblies and Blocks aren't really all that special, just that we have associates them in a certain way and then applied methods on those classes to make them special. If anything, the assembly and blocks are just short cuts that we take to associate the composites within together for fuel management and some axial "mesh" for Neutronics related calculations.

It would be interesting to me if we were to look at what it would mean to get rid of blocks and move to a mesh-based system for parameter storage.

I have a hard time knowing what we mean by an arbitrarily deep tree if we don't consider also rethinking assemblies and blocks. Also, will number density calculations start taking a very long time if we have like 4+ layers of composites? We might need to get a bit fancier with caching again?

drewj-usnctech commented 1 year ago

😍

I put a lot of my thoughts on some possible extension classes in https://github.com/terrapower/armi/discussions/960

I think there is merit to having the Composites be semi-physically grounded (e.g., an Assembly contains Blocks axially stacked together) because Monte Carlo codes modeling the full Reactor state need to know where things are. Another way of putting this, I don't think adding a free Component to an Assembly is a good move: where does that Component live in the reactor?

Blocks are kind of a mix of 0-D to 2-D collections of components already depending on how you view the geometry

will number density calculations start taking a very long time if we have like 4+ layers of composites?

probably? This could be an opportunity to look at distributing the composite tree navigation in parallel with threading, multiprocesing, or something extra. The number density of one component in a block doesn't depend on it's neighbor so they could be done in parallel

john-science commented 2 weeks ago

Bump. This is still super important.

Perhaps I need to pin this as High Priority for the next release.