meshes.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:pwr 作者: tjlaboss 项目源码 文件源码
def get_radial_power_by_tally(self, state, tally_id, index=None, eps=0):
        """Get the radial power of a specific tally with a known ID

        Parameters:
        -----------
        state:          openmc.StatePoint with this Mesh_Group's tally results
        tally_id:       int; id of the desired openmc.Tally
        index:          int; index of the z-layer within the Tally's mesh.
                        If the index is None, the sum of all the Tally's
                        layers will be returned.
                        [Default: None]

        Returns:
        --------
        xyarray:        numpy.array of the radial power profile
        """
        tally = state.tallies[tally_id]
        talvals = tally.get_values()
        nz = len(talvals)//(self._nx*self._ny)
        talvals.shape = (nz, self._ny, self._nx)
        talvals = np.flip(talvals, 1)
        if index:
            xyarray = talvals[index, :, :]
        else:
            xyarray = np.zeros((self._ny, self._nx))
            for i in range(nz):
                xyarray += talvals[i, :, :]
        xyarray[xyarray <= eps] = np.NaN
        return xyarray
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号