From eeb7925376dda670e2ed2e301c63c7bce9014a8e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 15 Feb 2020 11:40:25 -0600 Subject: [PATCH] Remove basic and boxes examples --- examples/python/basic/build-xml.py | 121 ---------------------------- examples/python/boxes/build-xml.py | 125 ----------------------------- examples/xml/basic/geometry.xml | 15 ---- examples/xml/basic/materials.xml | 16 ---- examples/xml/basic/settings.xml | 16 ---- examples/xml/basic/tallies.xml | 31 ------- examples/xml/boxes/geometry.xml | 39 --------- examples/xml/boxes/materials.xml | 21 ----- examples/xml/boxes/plots.xml | 9 --- examples/xml/boxes/settings.xml | 15 ---- 10 files changed, 408 deletions(-) delete mode 100644 examples/python/basic/build-xml.py delete mode 100644 examples/python/boxes/build-xml.py delete mode 100644 examples/xml/basic/geometry.xml delete mode 100644 examples/xml/basic/materials.xml delete mode 100644 examples/xml/basic/settings.xml delete mode 100644 examples/xml/basic/tallies.xml delete mode 100644 examples/xml/boxes/geometry.xml delete mode 100644 examples/xml/boxes/materials.xml delete mode 100644 examples/xml/boxes/plots.xml delete mode 100644 examples/xml/boxes/settings.xml diff --git a/examples/python/basic/build-xml.py b/examples/python/basic/build-xml.py deleted file mode 100644 index 5caed2810..000000000 --- a/examples/python/basic/build-xml.py +++ /dev/null @@ -1,121 +0,0 @@ -import openmc - - -############################################################################### -# Simulation Input File Parameters -############################################################################### - -# OpenMC simulation parameters -batches = 15 -inactive = 5 -particles = 10000 - - -############################################################################### -# Exporting to OpenMC materials.xml file -############################################################################### - -# Instantiate some Materials and register the appropriate Nuclides -moderator = openmc.Material(material_id=41, name='moderator') -moderator.set_density('g/cc', 1.0) -moderator.add_element('H', 2.) -moderator.add_element('O', 1.) -moderator.add_s_alpha_beta('c_H_in_H2O') - -fuel = openmc.Material(material_id=40, name='fuel') -fuel.set_density('g/cc', 4.5) -fuel.add_nuclide('U235', 1.) - -# Instantiate a Materials collection and export to XML -materials_file = openmc.Materials([moderator, fuel]) -materials_file.export_to_xml() - - -############################################################################### -# Exporting to OpenMC geometry.xml file -############################################################################### - -# Instantiate ZCylinder surfaces -surf1 = openmc.ZCylinder(surface_id=1, x0=0, y0=0, r=7, name='surf 1') -surf2 = openmc.ZCylinder(surface_id=2, x0=0, y0=0, r=9, name='surf 2') -surf3 = openmc.ZCylinder(surface_id=3, x0=0, y0=0, r=11, name='surf 3') -surf3.boundary_type = 'vacuum' - -# Instantiate Cells -cell1 = openmc.Cell(cell_id=1, name='cell 1') -cell2 = openmc.Cell(cell_id=100, name='cell 2') -cell3 = openmc.Cell(cell_id=101, name='cell 3') -cell4 = openmc.Cell(cell_id=2, name='cell 4') - -# Use surface half-spaces to define regions -cell1.region = -surf2 -cell2.region = -surf1 -cell3.region = +surf1 -cell4.region = +surf2 & -surf3 - -# Register Materials with Cells -cell2.fill = fuel -cell3.fill = moderator -cell4.fill = moderator - -# Instantiate Universes -universe1 = openmc.Universe(universe_id=37) -root = openmc.Universe(universe_id=0, name='root universe') -cell1.fill = universe1 - -# Register Cells with Universes -universe1.add_cells([cell2, cell3]) -root.add_cells([cell1, cell4]) - -# Instantiate a Geometry, register the root Universe, and export to XML -geometry = openmc.Geometry(root) -geometry.export_to_xml() - - -############################################################################### -# Exporting to OpenMC settings.xml file -############################################################################### - -# Instantiate a Settings object, set all runtime parameters, and export to XML -settings_file = openmc.Settings() -settings_file.batches = batches -settings_file.inactive = inactive -settings_file.particles = particles - -# Create an initial uniform spatial source distribution over fissionable zones -bounds = [-4., -4., -4., 4., 4., 4.] -uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True) -settings_file.source = openmc.source.Source(space=uniform_dist) - -settings_file.export_to_xml() - - -############################################################################### -# Exporting to OpenMC tallies.xml file -############################################################################### - -# Instantiate some tally Filters -cell_filter = openmc.CellFilter(cell2) -energy_filter = openmc.EnergyFilter([0., 20.e6]) -energyout_filter = openmc.EnergyoutFilter([0., 20.e6]) - -# Instantiate the first Tally -first_tally = openmc.Tally(tally_id=1, name='first tally') -first_tally.filters = [cell_filter] -scores = ['total', 'scatter', 'nu-scatter', - 'absorption', 'fission', 'nu-fission'] -first_tally.scores = scores - -# Instantiate the second Tally -second_tally = openmc.Tally(tally_id=2, name='second tally') -second_tally.filters = [cell_filter, energy_filter] -second_tally.scores = scores - -# Instantiate the third Tally -third_tally = openmc.Tally(tally_id=3, name='third tally') -third_tally.filters = [cell_filter, energy_filter, energyout_filter] -third_tally.scores = ['scatter', 'nu-scatter', 'nu-fission'] - -# Instantiate a Tallies collection and export to XML -tallies_file = openmc.Tallies((first_tally, second_tally, third_tally)) -tallies_file.export_to_xml() diff --git a/examples/python/boxes/build-xml.py b/examples/python/boxes/build-xml.py deleted file mode 100644 index d04f0f67a..000000000 --- a/examples/python/boxes/build-xml.py +++ /dev/null @@ -1,125 +0,0 @@ -import numpy as np -import openmc - -############################################################################### -# Simulation Input File Parameters -############################################################################### - -# OpenMC simulation parameters -batches = 15 -inactive = 5 -particles = 10000 - - -############################################################################### -# Exporting to OpenMC materials.xml File -############################################################################### - -# Instantiate some Materials and register the appropriate Nuclides -fuel1 = openmc.Material(material_id=1, name='fuel') -fuel1.set_density('g/cc', 4.5) -fuel1.add_nuclide('U235', 1.) - -fuel2 = openmc.Material(material_id=2, name='depleted fuel') -fuel2.set_density('g/cc', 4.5) -fuel2.add_nuclide('U238', 1.) - -moderator = openmc.Material(material_id=3, name='moderator') -moderator.set_density('g/cc', 1.0) -moderator.add_element('H', 2.) -moderator.add_element('O', 1.) -moderator.add_s_alpha_beta('c_H_in_H2O') - -# Instantiate a Materials collection and export to XML -materials_file = openmc.Materials([fuel1, fuel2, moderator]) -materials_file.export_to_xml() - - -############################################################################### -# Exporting to OpenMC geometry.xml file -############################################################################### - -# Instantiate planar surfaces -x1 = openmc.XPlane(surface_id=1, x0=-10) -x2 = openmc.XPlane(surface_id=2, x0=-7) -x3 = openmc.XPlane(surface_id=3, x0=-4) -x4 = openmc.XPlane(surface_id=4, x0=4) -x5 = openmc.XPlane(surface_id=5, x0=7) -x6 = openmc.XPlane(surface_id=6, x0=10) -y1 = openmc.YPlane(surface_id=11, y0=-10) -y2 = openmc.YPlane(surface_id=12, y0=-7) -y3 = openmc.YPlane(surface_id=13, y0=-4) -y4 = openmc.YPlane(surface_id=14, y0=4) -y5 = openmc.YPlane(surface_id=15, y0=7) -y6 = openmc.YPlane(surface_id=16, y0=10) -z1 = openmc.ZPlane(surface_id=21, z0=-10) -z2 = openmc.ZPlane(surface_id=22, z0=-7) -z3 = openmc.ZPlane(surface_id=23, z0=-4) -z4 = openmc.ZPlane(surface_id=24, z0=4) -z5 = openmc.ZPlane(surface_id=25, z0=7) -z6 = openmc.ZPlane(surface_id=26, z0=10) - -# Set vacuum boundary conditions on outside -for surface in [x1, x6, y1, y6, z1, z6]: - surface.boundary_type = 'vacuum' - -# Instantiate Cells -inner_box = openmc.Cell(cell_id=1, name='inner box') -middle_box = openmc.Cell(cell_id=2, name='middle box') -outer_box = openmc.Cell(cell_id=3, name='outer box') - -# Use each set of six planes to create solid cube regions. We can then use these -# to create cubic shells. -inner_cube = +x3 & -x4 & +y3 & -y4 & +z3 & -z4 -middle_cube = +x2 & -x5 & +y2 & -y5 & +z2 & -z5 -outer_cube = +x1 & -x6 & +y1 & -y6 & +z1 & -z6 -outside_inner_cube = -x3 | +x4 | -y3 | +y4 | -z3 | +z4 - -# Use surface half-spaces to define regions -inner_box.region = inner_cube -middle_box.region = middle_cube & outside_inner_cube -outer_box.region = outer_cube & ~middle_cube - -# Register Materials with Cells -inner_box.fill = fuel1 -middle_box.fill = fuel2 -outer_box.fill = moderator - -# Instantiate root universe -root = openmc.Universe(universe_id=0, name='root universe') -root.add_cells([inner_box, middle_box, outer_box]) - -# Instantiate a Geometry, register the root Universe, and export to XML -geometry = openmc.Geometry(root) -geometry.export_to_xml() - - -############################################################################### -# Exporting to OpenMC settings.xml File -############################################################################### - -# Instantiate a Settings object, set all runtime parameters, and export to XML -settings_file = openmc.Settings() -settings_file.batches = batches -settings_file.inactive = inactive -settings_file.particles = particles - -# Create an initial uniform spatial source distribution over fissionable zones -uniform_dist = openmc.stats.Box(*outer_cube.bounding_box, only_fissionable=True) -settings_file.source = openmc.source.Source(space=uniform_dist) - -settings_file.export_to_xml() - -############################################################################### -# Exporting to OpenMC plots.xml File -############################################################################### - -plot = openmc.Plot(plot_id=1) -plot.origin = [0, 0, 0] -plot.width = [20, 20] -plot.pixels = [200, 200] -plot.color_by = 'cell' - -# Instantiate a Plots collection and export to XML -plot_file = openmc.Plots([plot]) -plot_file.export_to_xml() diff --git a/examples/xml/basic/geometry.xml b/examples/xml/basic/geometry.xml deleted file mode 100644 index b30884f8c..000000000 --- a/examples/xml/basic/geometry.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/examples/xml/basic/materials.xml b/examples/xml/basic/materials.xml deleted file mode 100644 index 606c676df..000000000 --- a/examples/xml/basic/materials.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/examples/xml/basic/settings.xml b/examples/xml/basic/settings.xml deleted file mode 100644 index 6e622b6ce..000000000 --- a/examples/xml/basic/settings.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - eigenvalue - 15 - 5 - 10000 - - - - - -4 -4 -4 4 4 4 - - - - diff --git a/examples/xml/basic/tallies.xml b/examples/xml/basic/tallies.xml deleted file mode 100644 index a125e9ca2..000000000 --- a/examples/xml/basic/tallies.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - 100 - - - - 0 20.0e6 - - - - 0 20.0e6 - - - - 1 - total scatter nu-scatter absorption fission nu-fission - - - - 1 2 - total scatter nu-scatter absorption fission nu-fission - - - - 1 2 3 - scatter nu-scatter nu-fission - - - diff --git a/examples/xml/boxes/geometry.xml b/examples/xml/boxes/geometry.xml deleted file mode 100644 index abe4924e6..000000000 --- a/examples/xml/boxes/geometry.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/xml/boxes/materials.xml b/examples/xml/boxes/materials.xml deleted file mode 100644 index 1d0ab4a1c..000000000 --- a/examples/xml/boxes/materials.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/xml/boxes/plots.xml b/examples/xml/boxes/plots.xml deleted file mode 100644 index 0a75f574e..000000000 --- a/examples/xml/boxes/plots.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - cell - 0. 0. 0. - 20. 20. - 200 200 - - diff --git a/examples/xml/boxes/settings.xml b/examples/xml/boxes/settings.xml deleted file mode 100644 index 9007a12c5..000000000 --- a/examples/xml/boxes/settings.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - eigenvalue - 15 - 5 - 10000 - - - - - - -