Hello All,
How would I get a discretized scattering kernel from OpenMC? What I need is a 2d array gridded by energy and energyout. From the documentation it seems like the following would word:
scatter
But in fact this seems to produce two 1-d array. Any ideas? Thanks!
Be Well
Anthony
Hi Anthony,
You have it right. That tally should produce what you want; what do you mean by two 1-d arrays?
That tally you showed should produce a flattened array with dimensions of NxNyNzNginNgout where Nx, Ny, and Nz are the mesh dimensions and Ngin and Ngout are the number of bins in the energy and energyout filters, respectively. The second array you mention could be the uncertainties of those values, but that depends how you are defining the array (and if you are looking at tallies.out or the statepoint file).
Hi Adam,
Thanks for pointing me in the right direction. To simplify things I removed the mesh filter. I am looking at the statepoint.h5 file and the /tallies/tally1/results dataset. This has a length of 4, which is correct given two bins in energy and energyout. I didn’t expect the data to be flattened, but expected a hypercube whose dimensionality was the number of filters. This flattened structure has ‘sum’ and ‘sum_sq’ columns that appear to be the data & uncertainties you mentioned. Is this true?
Also, how do I know how the data was flattened? Are the bins for filter1 or filter2 the ones that are most nested. Apologies, I couldn’t find documentation on this either in the tally section or the data analysis section of the user’s guide. Thanks!
Be Well
Anthony
You are right about sum and sum_sq; they are the mean and uncertainties, respectively.
How are you to know that? Well, the best we have right now is here: http://mit-crpg.github.io/openmc/usersguide/processing.html#data-extraction
Thats not satisfactory of course, but thats what we have. I learned myself by messing around with the data structures spit out by statepoint.py.
The flattening is done based on the order in which you specify the filters. The last filter you specify has a stride of 1 in the array, the second to last filter has a stride of N where N is the number of bins of the last filter, etc. So, if you reverse the order of the filters in your input, the strides will switch as well.
https://github.com/mit-crpg/openmc/blob/develop/src/tally_initialize.F90#L52-56
Paul
Thanks Paul!
I know that OpenMC isn’t at 1.0 yet, but it would be great to have comprehensive documentation on the output format. It would prevent folks like me from asking a million little questions on the mailing list.
Be Well
Anthony