mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Rename results.h5 -> depletion_results.h5. Use /materials in HDF5 file
This commit is contained in:
parent
fc6b3bd9d9
commit
730623246f
9 changed files with 11 additions and 16 deletions
|
|
@ -9,7 +9,7 @@ def save_results(op, x, rates, eigvls, seeds, t, step_ind):
|
|||
|
||||
Parameters
|
||||
----------
|
||||
op : Function
|
||||
op : openmc.deplete.Operator
|
||||
The operator used to generate these results.
|
||||
x : list of list of numpy.array
|
||||
The prior x vectors. Indexed [i][cell] using the above equation.
|
||||
|
|
@ -44,4 +44,4 @@ def save_results(op, x, rates, eigvls, seeds, t, step_ind):
|
|||
results.time = t
|
||||
results.rates = rates
|
||||
|
||||
write_results(results, "results.h5", step_ind)
|
||||
write_results(results, "depletion_results.h5", step_ind)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ class Results(object):
|
|||
self.k = None
|
||||
self.seeds = None
|
||||
self.time = None
|
||||
self.p_terms = None
|
||||
self.rates = None
|
||||
self.volume = None
|
||||
|
||||
|
|
@ -192,7 +191,7 @@ class Results(object):
|
|||
n_rxn = len(rxn_list)
|
||||
n_stages = self.n_stages
|
||||
|
||||
mat_group = handle.create_group("cells")
|
||||
mat_group = handle.create_group("materials")
|
||||
|
||||
for mat in mat_list:
|
||||
mat_single_group = mat_group.create_group(mat)
|
||||
|
|
@ -333,24 +332,21 @@ class Results(object):
|
|||
rxn_nuc_to_ind = OrderedDict()
|
||||
rxn_to_ind = OrderedDict()
|
||||
|
||||
for mat in handle["/cells"]:
|
||||
mat_handle = handle["/cells/" + mat]
|
||||
for mat, mat_handle in handle["/materials"].items():
|
||||
vol = mat_handle.attrs["volume"]
|
||||
ind = mat_handle.attrs["index"]
|
||||
|
||||
results.volume[mat] = vol
|
||||
results.mat_to_ind[mat] = ind
|
||||
|
||||
for nuc in handle["/nuclides"]:
|
||||
nuc_handle = handle["/nuclides/" + nuc]
|
||||
for nuc, nuc_handle in handle["/nuclides"].items():
|
||||
ind_atom = nuc_handle.attrs["atom number index"]
|
||||
results.nuc_to_ind[nuc] = ind_atom
|
||||
|
||||
if "reaction rate index" in nuc_handle.attrs:
|
||||
rxn_nuc_to_ind[nuc] = nuc_handle.attrs["reaction rate index"]
|
||||
|
||||
for rxn in handle["/reactions"]:
|
||||
rxn_handle = handle["/reactions/" + rxn]
|
||||
for rxn, rxn_handle in handle["/reactions"].items():
|
||||
rxn_to_ind[rxn] = rxn_handle.attrs["index"]
|
||||
|
||||
results.rates = []
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from openmc.deplete import (read_results, evaluate_single_nuclide,
|
|||
result_folder = "test"
|
||||
|
||||
# Load data
|
||||
results = read_results(result_folder + "/results.h5")
|
||||
results = read_results(result_folder + "/deplete_results.h5")
|
||||
|
||||
cell = "5"
|
||||
nuc = "Gd157"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ settings.particles = 1000
|
|||
settings.batches = 100
|
||||
settings.inactive = 40
|
||||
settings.source = openmc.Source(space=openmc.stats.Box(lower_left, upper_right))
|
||||
settings.verbosity = 3
|
||||
|
||||
op = openmc.deplete.OpenMCOperator(geometry, settings)
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ def test_full(run_in_tmpdir):
|
|||
openmc.deplete.integrator.predictor(op)
|
||||
|
||||
# Load the files
|
||||
res_test = results.read_results(settings.output_dir + "/results.h5")
|
||||
res_test = results.read_results(settings.output_dir + "/depletion_results.h5")
|
||||
|
||||
# Load the reference
|
||||
filename = str(Path(__file__).with_name('test_reference.h5'))
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -24,7 +24,7 @@ def test_cecm(run_in_tmpdir):
|
|||
openmc.deplete.cecm(op, print_out=False)
|
||||
|
||||
# Load the files
|
||||
res = results.read_results(settings.output_dir + "/results.h5")
|
||||
res = results.read_results(settings.output_dir + "/depletion_results.h5")
|
||||
|
||||
_, y1 = utilities.evaluate_single_nuclide(res, "1", "1")
|
||||
_, y2 = utilities.evaluate_single_nuclide(res, "1", "2")
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ def test_save_results(run_in_tmpdir):
|
|||
integrator.save_results(op, x2, rate2, eigvl2, seed2, t2, 1)
|
||||
|
||||
# Load the files
|
||||
res = results.read_results("results.h5")
|
||||
res = results.read_results("depletion_results.h5")
|
||||
|
||||
for i in range(stages):
|
||||
for mat_i, mat in enumerate(burn_list):
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ def test_predictor(run_in_tmpdir):
|
|||
openmc.deplete.predictor(op, print_out=False)
|
||||
|
||||
# Load the files
|
||||
res = results.read_results(settings.output_dir + "/results.h5")
|
||||
res = results.read_results(settings.output_dir + "/depletion_results.h5")
|
||||
|
||||
_, y1 = utilities.evaluate_single_nuclide(res, "1", "1")
|
||||
_, y2 = utilities.evaluate_single_nuclide(res, "1", "2")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue