Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

CellTally cannot have multiple targets #109

Open
RemDelaporteMathurin opened this issue Feb 15, 2022 · 2 comments
Open

CellTally cannot have multiple targets #109

RemDelaporteMathurin opened this issue Feb 15, 2022 · 2 comments

Comments

@RemDelaporteMathurin
Copy link
Member

A user would want to have multiple targets on a CellTally. For instance, to compute the TBR on volumes 1, 2 and 3:

my_tally = odw.CellTally(tally_type='TBR', target=[1, 2, 3])

This is not possible currently. We would have to modify CellTally.set_filters...

Or it might be easier to just let the users do

my_tally = openmc.Tally()
my_tally.scores = ['(n,Xt)']  # yes it's not TBR
my_tally.filters = [openmc.MaterialFilter(i) for i in [1, 2, 3]]

Version 1: abstraction (loss of flexibility) + maintainance/development to make it better
Version 2: 2 additional lines 😄

@shimwell
Copy link
Member

We use to have odwCellTallies for such things which was perhaps also not a good solution.

Up to you, I am happy with both options

@RemDelaporteMathurin
Copy link
Member Author

No CellTallies is not the same thing

CellTallies doesn't inherit from openmc.Tally but is a collection of several CellTally

my_tally = odw.CellTallies(tally_types=['TBR'], targets=[1, 2, 3])
my_tallies = my_tally.tallies

This will create a list of 3 CellTally objects

This is equivalent to

my_tallies = [ odw.CellTally(tally_type='TBR', target=i)  for i in [1, 2, 3] ]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants