Merge pull request #1212 from pshriwise/plot_mesh_tally_fix

Various Fixes
This commit is contained in:
Paul Romano 2019-04-04 07:25:01 -05:00 committed by GitHub
commit f97aaf1fa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 349 additions and 552 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -16,7 +16,6 @@ particles = 1000
time_step = 1*24*60*60 # s
final_time = 5*24*60*60 # s
time_steps = np.full(final_time // time_step, time_step)
chain_file = './chain_simple.xml'
power = 174 # W/cm, for 2D simulations only (use W for 3D)
@ -100,7 +99,7 @@ geometry = openmc.Geometry(root)
# Compute cell areas
area = {}
area[fuel] = np.pi * fuel_or.coefficients['R'] ** 2
area[fuel] = np.pi * fuel_or.coefficients['r'] ** 2
# Set materials volume for depletion. Set to an area for 2D simulations
uo2.volume = area[fuel]

View file

@ -216,24 +216,40 @@ class MeshPlotter(tk.Frame):
index = self.filterBoxes[f.short_name].current()
spec_list.append((type(f), (index,)))
dims = (self.nx, self.ny, self.nz)
text = self.basisBox.get()
if text == 'xy':
dims = (self.nx, self.ny)
h_ind = 0
v_ind = 1
elif text == 'yz':
dims = (self.ny, self.nz)
h_ind = 1
v_ind = 2
else:
dims = (self.nx, self.nz)
h_ind = 0
v_ind = 2
axial_ind = 3 - (h_ind + v_ind)
dims = (dims[h_ind], dims[v_ind])
mesh_dim = len(self.mesh.dimension)
if mesh_dim == 3:
mesh_indices = [0,0,0]
else:
mesh_indices = [0,0]
matrix = np.zeros(dims)
for i in range(dims[0]):
for j in range(dims[1]):
if text == 'xy':
meshtuple = (i + 1, j + 1, axial_level)
elif text == 'yz':
meshtuple = (axial_level, i + 1, j + 1)
if mesh_dim == 3:
mesh_indices[h_ind] = i + 1
mesh_indices[v_ind] = j + 1
mesh_indices[axial_ind] = axial_level
else:
meshtuple = (i + 1, axial_level, j + 1)
mesh_indices[0] = i + 1
mesh_indices[1] = j + 1
filters, filter_bins = zip(*spec_list + [
(type(mesh_filter), (meshtuple,))])
(type(mesh_filter), (tuple(mesh_indices),))])
mean = selectedTally.get_values(
[self.scoreBox.get()], filters, filter_bins)
stdev = selectedTally.get_values(

View file

@ -259,12 +259,13 @@ score_fission_eout(const Particle* p, int i_tally, int i_score, int score_bin)
} else if (score_bin == SCORE_DELAYED_NU_FISSION && g != 0) {
// Get the index of the delayed group filter
auto i_dg_filt = tally.filters()[tally.delayedgroup_filter_];
// If the delayed group filter is present, tally to corresponding delayed
// group bin if it exists
if (i_dg_filt >= 0) {
if (tally.delayedgroup_filter_ >= 0) {
// Get the index of the delayed group filter
auto i_dg_filt = tally.filters()[tally.delayedgroup_filter_];
const DelayedGroupFilter& dg_filt {*dynamic_cast<DelayedGroupFilter*>(
model::tally_filters[i_dg_filt].get())};