diff --git a/2x2-periodic/build-fresh.py b/2x2-periodic/build-fresh.py index 4666dca..0c26889 100644 --- a/2x2-periodic/build-fresh.py +++ b/2x2-periodic/build-fresh.py @@ -2,6 +2,7 @@ import os import shutil +import copy import numpy as np import openmc @@ -9,8 +10,54 @@ import openmc from geometry import beavrs, openmc_geometry +#### Query the user for options + +# Query the user on whether to use multipole cross sections +multipole = input('Use multipole cross sections? (y/n): ').lower() +multipole = (multipole == 'y') + +# Query the user on whether to use distribmats or distribcells +# If using distribmats, the geometry must be "differentiated" with unique +# material instances for each instance of a fuel cell +distrib = input('Use distribmat or distribcells? [mat/cell]: ').lower() + +if distrib not in ['cell', 'mat']: + raise InputError('Distrib type "{}" is unsupported'.format(distrib)) + + +#### "Differentiate" the geometry if using distribmats +if distrib == 'mat': + + # Count the number of instances for each cell and material + openmc_geometry.determine_paths() + + # Determine the maximum material ID + max_material_id = 0 + for material in openmc_geometry.get_all_materials().values(): + max_material_id = max(max_material_id, material.id) + + # Extract all cells filled by a fuel material + fuel_cells = openmc_geometry.get_cells_by_name( + name='enr radial 0: Fuel', case_sensitive=True) + + # Assign distribmats for each material + for cell in fuel_cells: + new_materials = [] + + for i in range(cell.num_instances): + new_material = copy.deepcopy(cell.fill) + new_material.id = max_material_id + 1 + max_material_id += 1 + new_materials.append(new_material) + + # Fill cell with list of "differentiated" materials + cell.fill = new_materials + + #### Create OpenMC "materials.xml" file -beavrs.write_openmc_materials() +all_materials = openmc_geometry.get_all_materials() +materials = openmc.Materials(all_materials.values()) +materials.export_to_xml() #### Create OpenMC "geometry.xml" file @@ -19,10 +66,6 @@ openmc_geometry.export_to_xml() #### Create OpenMC "settings.xml" file -# Query the user on whether to use multipole cross sections -multipole = input('Use multipole cross sections? (y/n): ').lower() -multipole = (multipole == 'y') - # Construct uniform initial source distribution over fissionable zones lower_left = [-21.41728, -21.41728, +192.5] upper_right = [+21.41728, +21.41728, +197.5] @@ -54,80 +97,41 @@ plot.width = [21.41728*2, 21.41728*2] plot.origin = [0., 0., 195.] plot.color_by = 'material' plot.filename = '2x2-periodic' -plot.colors = beavrs.plots.colors_mat plot.pixels = [1000, 1000] plot_file = openmc.Plots([plot]) plot_file.export_to_xml() -#### Create OpenMC MGXS libraries - -# Get all cells filled with a "fuel" material -fuel_cells = [] -for cell in openmc_geometry.get_all_material_cells().values(): - if 'fuel' in cell.fill.name.lower(): - fuel_cells.append(cell) - -# CASMO 70-group structure -energy_groups = openmc.mgxs.EnergyGroups() -energy_groups.group_edges = np.array([ - 0, 0.005, 0.01, 0.015, 0.02, 0.025, 0.03, 0.035, 0.042, 0.05, 0.058, 0.067, - 0.08, 0.1, 0.14, 0.18, 0.22, 0.25, 0.28, 0.3, 0.32, 0.35, 0.4, 0.5, 0.625, - 0.78, 0.85, 0.91, 0.95, 0.972, 0.996, 1.02, 1.045, 1.071, 1.097, 1.123, - 1.15, 1.3, 1.5, 1.855, 2.1, 2.6, 3.3, 4., 9.877, 15.968, 27.7, 48.052, - 75.501, 148.73, 367.26001, 906.90002, 1.4251e3, 2.2395e3, 3.5191e3, 5.53e3, - 9.118e3, 15.03e3, 24.78e3, 40.85e3, 67.34e3, 111.e3, 183e3, 302.5e3, 500e3, - 821e3, 1.353e6, 2.231e6, 3.679e6, 6.0655e6, 2e7]) - -# Initialize a 70-group "distribcell" MGXS library -cell_mgxs_lib = openmc.mgxs.Library(openmc_geometry, by_nuclide=True) -cell_mgxs_lib.energy_groups = energy_groups -cell_mgxs_lib.mgxs_types = ['total', 'nu-fission', 'nu-scatter matrix', 'chi'] -cell_mgxs_lib.domain_type = 'distribcell' -cell_mgxs_lib.domains = fuel_cells -cell_mgxs_lib.correction = None -cell_mgxs_lib.build_library() - -# Initialize a 70-group "material" MGXS library -mat_mgxs_lib = openmc.mgxs.Library(openmc_geometry, by_nuclide=True) -mat_mgxs_lib.energy_groups = energy_groups -mat_mgxs_lib.mgxs_types = ['total', 'nu-fission', 'nu-scatter matrix', 'chi'] -mat_mgxs_lib.domain_type = 'material' -mat_mgxs_lib.correction = None -mat_mgxs_lib.build_library() - - -#### Create mesh tallies for verification of pin-wise reaction rates - -# Instantiate a tally Mesh -mesh = openmc.Mesh(name='assembly mesh') -mesh.type = 'regular' -mesh.dimension = [34, 34, 1] -mesh.lower_left = lower_left -mesh.width = (np.array(upper_right) - np.array(lower_left)) -mesh.width /= mesh.dimension -mesh_filter = openmc.MeshFilter(mesh) - -# Instantiate energy-integrated fission rate mesh Tally -fission_rates = openmc.Tally(name='fission rates') -fission_rates.filters = [mesh_filter] -fission_rates.scores = ['fission'] - -# Instantiate energy-wise U-238 capture rate mesh Tally -capture_rates = openmc.Tally(name='u-238 capture') -capture_rates.filters = [mesh_filter] -capture_rates.nuclides = ['U238'] -capture_rates.scores = ['absorption', 'fission'] - - #### Create OpenMC "tallies.xml" file +tallies = openmc.Tallies() -# Create a "tallies.xml" file for the mesh tallies -tallies_file = openmc.Tallies([fission_rates, capture_rates]) -cell_mgxs_lib.add_to_tallies_file(tallies_file, merge=True) -mat_mgxs_lib.add_to_tallies_file(tallies_file, merge=True) -tallies_file.export_to_xml() +# Extract all fuel materials +materials = openmc_geometry.get_materials_by_name(name='Fuel', matching=False) + +# If using distribcells, create distribcell tally needed for depletion +if distrib == 'cell': + fuel_cells = openmc_geometry.get_cells_by_name( + name='enr radial 0: Fuel', case_sensitive=True, matching=False) + for cell in fuel_cells: + tally = openmc.Tally(name='depletion tally') + tally.scores = ['(n,p)', '(n,a)', '(n,gamma)', + 'fission', '(n,2n)', '(n,3n)', '(n,4n)'] + tally.nuclides = cell.fill.get_nuclides() + tally.filters.append(openmc.DistribcellFilter([cell.id])) + tallies.append(tally) + +# If using distribmats, create material tally needed for depletion +elif distrib == 'mat': + tally = openmc.Tally(name='depletion tally') + tally.scores = ['(n,p)', '(n,a)', '(n,gamma)', + 'fission', '(n,2n)', '(n,3n)', '(n,4n)'] + tally.nuclides = materials[0].get_nuclides() + material_ids = [material.id for material in materials] + tally.filters.append(openmc.MaterialFilter(material_ids)) + tallies.append(tally) + +tallies.export_to_xml() #### Move all XML files to 'fresh' directory diff --git a/2x2-periodic/fresh/materials.xml b/2x2-periodic/fresh/materials.xml index 791db71..a66ccf5 100644 --- a/2x2-periodic/fresh/materials.xml +++ b/2x2-periodic/fresh/materials.xml @@ -33,29 +33,6 @@ - - 300 - - - - - - - - - - - - - - - - 300 - - - - - 300 @@ -112,59 +89,6 @@ - - 300 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 300 @@ -174,15 +98,6 @@ - - 300 - - - - - - - 300 @@ -192,24 +107,6 @@ - - 300 - - - - - - - - - 300 - - - - - - - 300 diff --git a/2x2-periodic/fresh/plots.xml b/2x2-periodic/fresh/plots.xml index c9f477a..9076a35 100644 --- a/2x2-periodic/fresh/plots.xml +++ b/2x2-periodic/fresh/plots.xml @@ -4,20 +4,5 @@ 0.0 0.0 195.0 42.83456 42.83456 1000 1000 - - - - - - - - - - - - - - - diff --git a/2x2-periodic/fresh/tallies.xml b/2x2-periodic/fresh/tallies.xml index 004f370..5668ac2 100644 --- a/2x2-periodic/fresh/tallies.xml +++ b/2x2-periodic/fresh/tallies.xml @@ -1,335 +1,13 @@ - - - 34 34 1 - -21.41728 -21.41728 192.5 - 1.25984 1.25984 5.0 - - - - fission - - - - U238 - absorption fission - - + - - total - flux - tracklength - - - - O16 O17 U234 U235 U238 - total nu-fission - tracklength + (n,p) (n,a) (n,gamma) fission (n,2n) (n,3n) (n,4n) - - - - total - flux - analog - - - - - - O16 O17 U234 U235 U238 - nu-scatter-0 - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - + - - total - flux - tracklength - - - - O16 O17 U234 U235 U238 - total nu-fission - tracklength - - - - - total - flux - analog - - - - - - O16 O17 U234 U235 U238 - nu-scatter-0 - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - total - flux - tracklength - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 He3 He4 - total nu-fission - tracklength - - - - - total - flux - analog - - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 He3 He4 - nu-scatter-0 - analog - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 He3 He4 - nu-fission - analog - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 He3 He4 - nu-fission - analog - - - - - Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 O16 O17 U234 U235 U238 He3 He4 - nu-fission total - tracklength - - - - - O16 O17 Cr50 Cr52 Cr53 Cr54 Fe54 Fe56 Fe57 Fe58 Zr90 Zr91 Zr92 Zr94 Zr96 Sn112 Sn114 Sn115 Sn116 Sn117 Sn118 Sn119 Sn120 Sn122 Sn124 - total nu-fission - tracklength - - - - - - O16 O17 Cr50 Cr52 Cr53 Cr54 Fe54 Fe56 Fe57 Fe58 Zr90 Zr91 Zr92 Zr94 Zr96 Sn112 Sn114 Sn115 Sn116 Sn117 Sn118 Sn119 Sn120 Sn122 Sn124 - nu-scatter-0 - analog - - - - - O16 O17 Cr50 Cr52 Cr53 Cr54 Fe54 Fe56 Fe57 Fe58 Zr90 Zr91 Zr92 Zr94 Zr96 Sn112 Sn114 Sn115 Sn116 Sn117 Sn118 Sn119 Sn120 Sn122 Sn124 - nu-fission - analog - - - - - O16 O17 Cr50 Cr52 Cr53 Cr54 Fe54 Fe56 Fe57 Fe58 Zr90 Zr91 Zr92 Zr94 Zr96 Sn112 Sn114 Sn115 Sn116 Sn117 Sn118 Sn119 Sn120 Sn122 Sn124 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission total - tracklength - - - - - - O16 O17 U234 U235 U238 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-scatter-0 - analog - - - - - O16 O17 U234 U235 U238 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission - analog - - - - - Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 B10 B11 H1 H2 O16 O17 - nu-fission total - tracklength - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission total - tracklength - - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-scatter-0 - analog - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission - analog - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission - analog - - - - - O16 O17 N14 N15 Ar36 Ar38 Ar40 C0 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - total nu-fission - tracklength - - - - - - O16 O17 N14 N15 Ar36 Ar38 Ar40 C0 - nu-scatter-0 - analog - - - - - O16 O17 N14 N15 Ar36 Ar38 Ar40 C0 - nu-fission - analog - - - - - O16 O17 N14 N15 Ar36 Ar38 Ar40 C0 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 - total nu-fission - tracklength - - - - - - O16 O17 U234 U235 U238 - nu-scatter-0 - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - B10 B11 O16 O17 Si28 Si29 Si30 Al27 - total nu-fission - tracklength - - - - - - B10 B11 O16 O17 Si28 Si29 Si30 Al27 - nu-scatter-0 - analog - - - - - B10 B11 O16 O17 Si28 Si29 Si30 Al27 - nu-fission - analog - - - - - B10 B11 O16 O17 Si28 Si29 Si30 Al27 - nu-fission - analog + (n,p) (n,a) (n,gamma) fission (n,2n) (n,3n) (n,4n) diff --git a/2x2-reflector/build-fresh.py b/2x2-reflector/build-fresh.py index 3a2cb84..73c150b 100644 --- a/2x2-reflector/build-fresh.py +++ b/2x2-reflector/build-fresh.py @@ -2,6 +2,7 @@ import os import shutil +import copy import numpy as np import openmc @@ -9,8 +10,54 @@ import openmc from geometry import beavrs, openmc_geometry +#### Query the user for options + +# Query the user on whether to use multipole cross sections +multipole = input('Use multipole cross sections? (y/n): ').lower() +multipole = (multipole == 'y') + +# Query the user on whether to use distribmats or distribcells +# If using distribmats, the geometry must be "differentiated" with unique +# material instances for each instance of a fuel cell +distrib = input('Use distribmat or distribcells? [mat/cell]: ').lower() + +if distrib not in ['cell', 'mat']: + raise InputError('Distrib type "{}" is unsupported'.format(distrib)) + + +#### "Differentiate" the geometry if using distribmats +if distrib == 'mat': + + # Count the number of instances for each cell and material + openmc_geometry.determine_paths() + + # Determine the maximum material ID + max_material_id = 0 + for material in openmc_geometry.get_all_materials().values(): + max_material_id = max(max_material_id, material.id) + + # Extract all cells filled by a fuel material + fuel_cells = openmc_geometry.get_cells_by_name( + name='enr radial 0: Fuel', case_sensitive=True) + + # Assign distribmats for each material + for cell in fuel_cells: + new_materials = [] + + for i in range(cell.num_instances): + new_material = copy.deepcopy(cell.fill) + new_material.id = max_material_id + 1 + max_material_id += 1 + new_materials.append(new_material) + + # Fill cell with list of "differentiated" materials + cell.fill = new_materials + + #### Create OpenMC "materials.xml" file -beavrs.write_openmc_materials() +all_materials = openmc_geometry.get_all_materials() +materials = openmc.Materials(all_materials.values()) +materials.export_to_xml() #### Create OpenMC "geometry.xml" file @@ -19,10 +66,6 @@ openmc_geometry.export_to_xml() #### Create OpenMC "settings.xml" file -# Query the user on whether to use multipole cross sections -multipole = input('Use multipole cross sections? (y/n): ').lower() -multipole = (multipole == 'y') - # Construct uniform initial source distribution over fissionable zones lower_left = [-32.12592, -32.12592, 192.5] upper_right = [32.12592, 32.12592, 197.5] @@ -57,80 +100,41 @@ plot.width = [64.25184, 64.25184] plot.origin = [0., 0., 195.] plot.color_by = 'material' plot.filename = '2x2-reflector' -plot.colors = beavrs.plots.colors_mat plot.pixels = [1000, 1000] plot_file = openmc.Plots([plot]) plot_file.export_to_xml() -#### Create OpenMC MGXS libraries - -# Get all cells filled with a "fuel" material -fuel_cells = [] -for cell in openmc_geometry.get_all_material_cells().values(): - if 'fuel' in cell.fill.name.lower(): - fuel_cells.append(cell) - -# CASMO 70-group structure -energy_groups = openmc.mgxs.EnergyGroups() -energy_groups.group_edges = np.array([ - 0, 0.005, 0.01, 0.015, 0.02, 0.025, 0.03, 0.035, 0.042, 0.05, 0.058, 0.067, - 0.08, 0.1, 0.14, 0.18, 0.22, 0.25, 0.28, 0.3, 0.32, 0.35, 0.4, 0.5, 0.625, - 0.78, 0.85, 0.91, 0.95, 0.972, 0.996, 1.02, 1.045, 1.071, 1.097, 1.123, - 1.15, 1.3, 1.5, 1.855, 2.1, 2.6, 3.3, 4., 9.877, 15.968, 27.7, 48.052, - 75.501, 148.73, 367.26001, 906.90002, 1.4251e3, 2.2395e3, 3.5191e3, 5.53e3, - 9.118e3, 15.03e3, 24.78e3, 40.85e3, 67.34e3, 111.e3, 183e3, 302.5e3, 500e3, - 821e3, 1.353e6, 2.231e6, 3.679e6, 6.0655e6, 2e7]) - -# Initialize a 70-group "distribcell" MGXS library -cell_mgxs_lib = openmc.mgxs.Library(openmc_geometry, by_nuclide=True) -cell_mgxs_lib.energy_groups = energy_groups -cell_mgxs_lib.mgxs_types = ['total', 'nu-fission', 'nu-scatter matrix', 'chi'] -cell_mgxs_lib.domain_type = 'distribcell' -cell_mgxs_lib.domains = fuel_cells -cell_mgxs_lib.correction = None -cell_mgxs_lib.build_library() - -# Initialize a 70-group "material" MGXS library -mat_mgxs_lib = openmc.mgxs.Library(openmc_geometry, by_nuclide=True) -mat_mgxs_lib.energy_groups = energy_groups -mat_mgxs_lib.mgxs_types = ['total', 'nu-fission', 'nu-scatter matrix', 'chi'] -mat_mgxs_lib.domain_type = 'material' -mat_mgxs_lib.correction = None -mat_mgxs_lib.build_library() - - -#### Create mesh tallies for verification of pin-wise reaction rates - -# Instantiate a tally Mesh -mesh = openmc.Mesh(name='assembly mesh') -mesh.type = 'regular' -mesh.dimension = [34, 34, 1] -mesh.lower_left = [lower_left[0], lower_left[1] + lat_width[1], lower_left[2]] -mesh.width = np.array(lat_width) -mesh.width /= mesh.dimension -mesh_filter = openmc.MeshFilter(mesh) - -# Instantiate energy-integrated fission rate mesh Tally -fission_rates = openmc.Tally(name='fission rates') -fission_rates.filters = [mesh_filter] -fission_rates.scores = ['fission'] - -# Instantiate energy-wise U-238 capture rate mesh Tally -capture_rates = openmc.Tally(name='u-238 capture') -capture_rates.filters = [mesh_filter] -capture_rates.nuclides = ['U238'] -capture_rates.scores = ['absorption', 'fission'] - - #### Create OpenMC "tallies.xml" file +tallies = openmc.Tallies() -# Create a "tallies.xml" file for the mesh tallies -tallies_file = openmc.Tallies([fission_rates, capture_rates]) -cell_mgxs_lib.add_to_tallies_file(tallies_file, merge=True) -mat_mgxs_lib.add_to_tallies_file(tallies_file, merge=True) -tallies_file.export_to_xml() +# Extract all fuel materials +materials = openmc_geometry.get_materials_by_name(name='Fuel', matching=False) + +# If using distribcells, create distribcell tally needed for depletion +if distrib == 'cell': + fuel_cells = openmc_geometry.get_cells_by_name( + name='enr radial 0: Fuel', case_sensitive=True, matching=False) + for cell in fuel_cells: + tally = openmc.Tally(name='depletion tally') + tally.scores = ['(n,p)', '(n,a)', '(n,gamma)', + 'fission', '(n,2n)', '(n,3n)', '(n,4n)'] + tally.nuclides = cell.fill.get_nuclides() + tally.filters.append(openmc.DistribcellFilter([cell.id])) + tallies.append(tally) + +# If using distribmats, create material tally needed for depletion +elif distrib == 'mat': + tally = openmc.Tally(name='depletion tally') + tally.scores = ['(n,p)', '(n,a)', '(n,gamma)', + 'fission', '(n,2n)', '(n,3n)', '(n,4n)'] + tally.nuclides = materials[0].get_nuclides() + material_ids = [material.id for material in materials] + tally.filters.append(openmc.MaterialFilter(material_ids)) + tallies.append(tally) + +tallies.export_to_xml() #### Move all XML files to 'fresh' directory diff --git a/2x2-reflector/fresh/materials.xml b/2x2-reflector/fresh/materials.xml index 791db71..a66ccf5 100644 --- a/2x2-reflector/fresh/materials.xml +++ b/2x2-reflector/fresh/materials.xml @@ -33,29 +33,6 @@ - - 300 - - - - - - - - - - - - - - - - 300 - - - - - 300 @@ -112,59 +89,6 @@ - - 300 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 300 @@ -174,15 +98,6 @@ - - 300 - - - - - - - 300 @@ -192,24 +107,6 @@ - - 300 - - - - - - - - - 300 - - - - - - - 300 diff --git a/2x2-reflector/fresh/plots.xml b/2x2-reflector/fresh/plots.xml index 178a1ba..8b18ae9 100644 --- a/2x2-reflector/fresh/plots.xml +++ b/2x2-reflector/fresh/plots.xml @@ -4,20 +4,5 @@ 0.0 0.0 195.0 64.25184 64.25184 1000 1000 - - - - - - - - - - - - - - - diff --git a/2x2-reflector/fresh/tallies.xml b/2x2-reflector/fresh/tallies.xml index fe9f8f8..5668ac2 100644 --- a/2x2-reflector/fresh/tallies.xml +++ b/2x2-reflector/fresh/tallies.xml @@ -1,335 +1,13 @@ - - - 34 34 1 - -32.12592 -10.70864 192.5 - 0.62992 0.62992 5.0 - - - - fission - - - - U238 - absorption fission - - + - - total - flux - tracklength - - - - O16 O17 U234 U235 U238 - total nu-fission - tracklength + (n,p) (n,a) (n,gamma) fission (n,2n) (n,3n) (n,4n) - - - - total - flux - analog - - - - - - O16 O17 U234 U235 U238 - nu-scatter-0 - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - + - - total - flux - tracklength - - - - O16 O17 U234 U235 U238 - total nu-fission - tracklength - - - - - total - flux - analog - - - - - - O16 O17 U234 U235 U238 - nu-scatter-0 - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - total - flux - tracklength - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 He3 He4 - total nu-fission - tracklength - - - - - total - flux - analog - - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 He3 He4 - nu-scatter-0 - analog - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 He3 He4 - nu-fission - analog - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 He3 He4 - nu-fission - analog - - - - - Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 O16 O17 U234 U235 U238 He3 He4 - nu-fission total - tracklength - - - - - O16 O17 Cr50 Cr52 Cr53 Cr54 Fe54 Fe56 Fe57 Fe58 Zr90 Zr91 Zr92 Zr94 Zr96 Sn112 Sn114 Sn115 Sn116 Sn117 Sn118 Sn119 Sn120 Sn122 Sn124 - total nu-fission - tracklength - - - - - - O16 O17 Cr50 Cr52 Cr53 Cr54 Fe54 Fe56 Fe57 Fe58 Zr90 Zr91 Zr92 Zr94 Zr96 Sn112 Sn114 Sn115 Sn116 Sn117 Sn118 Sn119 Sn120 Sn122 Sn124 - nu-scatter-0 - analog - - - - - O16 O17 Cr50 Cr52 Cr53 Cr54 Fe54 Fe56 Fe57 Fe58 Zr90 Zr91 Zr92 Zr94 Zr96 Sn112 Sn114 Sn115 Sn116 Sn117 Sn118 Sn119 Sn120 Sn122 Sn124 - nu-fission - analog - - - - - O16 O17 Cr50 Cr52 Cr53 Cr54 Fe54 Fe56 Fe57 Fe58 Zr90 Zr91 Zr92 Zr94 Zr96 Sn112 Sn114 Sn115 Sn116 Sn117 Sn118 Sn119 Sn120 Sn122 Sn124 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission total - tracklength - - - - - - O16 O17 U234 U235 U238 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-scatter-0 - analog - - - - - O16 O17 U234 U235 U238 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission - analog - - - - - Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 B10 B11 H1 H2 O16 O17 - nu-fission total - tracklength - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission total - tracklength - - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-scatter-0 - analog - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission - analog - - - - - B10 B11 H1 H2 O16 O17 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - nu-fission - analog - - - - - O16 O17 N14 N15 Ar36 Ar38 Ar40 C0 Si28 Si29 Si30 Cr50 Cr52 Cr53 Cr54 Mn55 Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Ni61 Ni62 Ni64 - total nu-fission - tracklength - - - - - - O16 O17 N14 N15 Ar36 Ar38 Ar40 C0 - nu-scatter-0 - analog - - - - - O16 O17 N14 N15 Ar36 Ar38 Ar40 C0 - nu-fission - analog - - - - - O16 O17 N14 N15 Ar36 Ar38 Ar40 C0 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 - total nu-fission - tracklength - - - - - - O16 O17 U234 U235 U238 - nu-scatter-0 - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - O16 O17 U234 U235 U238 - nu-fission - analog - - - - - B10 B11 O16 O17 Si28 Si29 Si30 Al27 - total nu-fission - tracklength - - - - - - B10 B11 O16 O17 Si28 Si29 Si30 Al27 - nu-scatter-0 - analog - - - - - B10 B11 O16 O17 Si28 Si29 Si30 Al27 - nu-fission - analog - - - - - B10 B11 O16 O17 Si28 Si29 Si30 Al27 - nu-fission - analog + (n,p) (n,a) (n,gamma) fission (n,2n) (n,3n) (n,4n) diff --git a/assembly/build-fresh.py b/assembly/build-fresh.py index 719299d..f026f8b 100644 --- a/assembly/build-fresh.py +++ b/assembly/build-fresh.py @@ -97,7 +97,6 @@ plot.width = [10.70864*2, 10.70864*2] plot.origin = [0., 0., 195.] plot.color_by = 'material' plot.filename = 'assembly' -plot.colors = beavrs.plots.colors_mat plot.pixels = [1000, 1000] plot_file = openmc.Plots([plot]) @@ -105,30 +104,33 @@ plot_file.export_to_xml() #### Create OpenMC "tallies.xml" file - tallies = openmc.Tallies() # Extract all fuel materials -materials = openmc_geometry.get_materials_by_name(name='Fuel 1.6%') - -# Create a single tally akin to that used by OpenDeplete -tally = openmc.Tally(name='depletion tally') -tally.scores = \ - ['(n,p)', '(n,a)', '(n,gamma)', 'fission', '(n,2n)', '(n,3n)', '(n,4)'] -tally.nuclides = materials[0].get_nuclides() +materials = openmc_geometry.get_materials_by_name(name='Fuel', matching=False) # If using distribcells, create distribcell tally needed for depletion -if distrib == 'cell': +if distrib == 'cell': fuel_cells = openmc_geometry.get_cells_by_name( - name='enr radial 0: Fuel', case_sensitive=True) - tally.filters.append(openmc.DistribcellFilter([fuel_cells[0].id])) + name='enr radial 0: Fuel', case_sensitive=True, matching=False) + for cell in fuel_cells: + tally = openmc.Tally(name='depletion tally') + tally.scores = ['(n,p)', '(n,a)', '(n,gamma)', + 'fission', '(n,2n)', '(n,3n)', '(n,4n)'] + tally.nuclides = cell.fill.get_nuclides() + tally.filters.append(openmc.DistribcellFilter([cell.id])) + tallies.append(tally) # If using distribmats, create material tally needed for depletion elif distrib == 'mat': + tally = openmc.Tally(name='depletion tally') + tally.scores = ['(n,p)', '(n,a)', '(n,gamma)', + 'fission', '(n,2n)', '(n,3n)', '(n,4n)'] + tally.nuclides = materials[0].get_nuclides() material_ids = [material.id for material in materials] tally.filters.append(openmc.MaterialFilter(material_ids)) + tallies.append(tally) -tallies.append(tally) tallies.export_to_xml() diff --git a/assembly/fresh/plots.xml b/assembly/fresh/plots.xml index d4443af..cd2f539 100644 --- a/assembly/fresh/plots.xml +++ b/assembly/fresh/plots.xml @@ -4,20 +4,5 @@ 0.0 0.0 195.0 21.41728 21.41728 1000 1000 - - - - - - - - - - - - - - - diff --git a/assembly/fresh/tallies.xml b/assembly/fresh/tallies.xml index a695c72..9556684 100644 --- a/assembly/fresh/tallies.xml +++ b/assembly/fresh/tallies.xml @@ -3,6 +3,6 @@ O16 O17 U234 U235 U238 - (n,p) (n,a) (n,gamma) fission (n,2n) (n,3n) (n,4) + (n,p) (n,a) (n,gamma) fission (n,2n) (n,3n) (n,4n)