1D Mesh Tally post processing issue

Hello,

I have recently reinstalled openMC (‘0.13.3’), and was going through some old notebooks to see what needs fixing. I got into some problem which I don’t manage to resolve, when trying to run this notebook: RFP/6-openMCIntro.ipynb at 02c9db30d0aee3533fbe657d2148068f1c34b5fc · ezsolti/RFP · GitHub

Namely, this bit

    tallydf3=sp.tallies[3].get_pandas_dataframe()
    tallydf3.head()

seems to give me a typeError even after I change the Mesh() to a RegularMesh(): “TypeError: can only concatenate tuple (not “int”) to tuple”.

Looking at this openmc example: openmc-notebooks/pandas-dataframes.ipynb at main · openmc-dev/openmc-notebooks · GitHub I am not sure I understand why the get_pandas_dataframe() doesn’t work for my case.

I managed to get the results with np.reshape(sp.tallies[3].get_reshaped_data()[:,0,:,:],(100)), but I would really appreciate if someone could guide me how to use the dataframe here, what am I missing?

Thanks!

zsolti

I think here is the issue:

in case only one dimension is defined ´nx = self.mesh.dimension´ will result in nx being a tuple.

That said, at the input level the solution to overcome this seems to be to define a 2D mesh:

    myMesh=openmc.RegularMesh(name='xmesh')
    myMesh.dimension=[100,1] #number of spatial bins along x axis
    myMesh.lower_left=[-pitch/2,-pitch/2]
    myMesh.upper_right=[pitch/2,pitch/2]