Is the armi reactor loaded already when sweeping with an input modifier? #2188
-
|
Hi ARMI devs. I'm a nuclear engineer at Antares. We're working on some modeling tools built on the ARMI framework for a couple months now and finally came crawling out of the woodwork. I have a question on the order of operations in a parameter sweep. Suppose I have a block in the blueprint with a few linked components, something like this: blocks:
block_1:
shape: Circle
id: 0
od: 1
block_2:
shape: Circle
id: block_1.od
od: 2.5
block_3:
shape: Circle
id: block_2.od
od: 3I want to create a modifier that would preserve the thicknesses or dimensions of the other components. So I could create a modifier like this: class thicknessOfBlockTwoModifier(inputModifiers.InputModifier):
"""Modifier that adjusts the thickness of block 2 diameter."""
def __call__(self, cs, bp):
for blockDesign in bp.blockDesigns:
for componentDesign in blockDesign:
if componentDesign.name == "block_1":
thickness_block_1 = componentDesign.od - componentDesign.id
if componentDesign.name == "block_2":
componentDesign.od = componentDesign.id + self.independentVariable["cladThickness"]
if componentDesign.name == "block_3":
thickness_block_3 = componentDesign.od - componentDesign.id
blockDesign["block_1"].od = blockDesign["block_1"].id + thickness_block_1
blockDesign["block_3"].id = blockDesign["block_2"].od
blockDesign["block_3"].od = blockDesign["block_3"].id + thickness_block_3
return cs, bpbasically manually march down the components in the block and mimic the linked components to preserve their original dimension. As far as I can tell, the class thicknessOfBlockTwoModifier(inputModifiers.InputModifier):
"""Modifier that adjusts the thickness of block 2 diameter."""
def __call__(self, cs, bp):
for block in core.getBlocks():
for component in block.getComponents():
<Update the dimensions of the target component and linked components programmatically>
return cs, bpand not need to update the modifiers themselves if something minor in the blueprints changed, like adding or removing a component. Alternatively if there's a different way I should be thinking about input modifiers and parameter sweeps, please let me know! Happy to solicit advice or recommendations if you guys have some lessons learned or best practices on input modifiers and parameter sweeping. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
I do not believe that any reactor objects are created during the course of using input modifiers by default. That being said, you can really do whatever you want to within the The input modifiers are a bit of create-your-own-adventure situation. Typically they are used to create a case suite, though there isn't much magic to them until you implement whatever you want in the |
Beta Was this translation helpful? Give feedback.
Sorry for being so late to the part @azshe . I've been busy and such. Sorry about that.
Nope. This is just before the
Reactorgets created.Chris is correct. No
Reactorobjects are created during input modifier execution. But, of course, the__call__method is a blank slate where you can inject any code you want.