Update Jupyter notebooks

This commit is contained in:
Paul Romano 2016-04-25 10:44:20 -05:00
parent 50a80693b5
commit 68f7de1315
6 changed files with 78 additions and 108 deletions

View file

@ -108,8 +108,8 @@
},
"outputs": [],
"source": [
"# Instantiate a MaterialsFile, add Materials\n",
"materials_file = openmc.MaterialsFile()\n",
"# Instantiate a Materials object, add Materials\n",
"materials_file = openmc.Materials()\n",
"materials_file.add_material(fuel)\n",
"materials_file.add_material(water)\n",
"materials_file.add_material(zircaloy)\n",
@ -239,7 +239,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We now must create a geometry that is assigned a root universe, put the geometry into a `GeometryFile` object, and export it to XML."
"We now must create a geometry that is assigned a root universe and export it to XML."
]
},
{
@ -263,12 +263,8 @@
},
"outputs": [],
"source": [
"# Instantiate a GeometryFile\n",
"geometry_file = openmc.GeometryFile()\n",
"geometry_file.geometry = geometry\n",
"\n",
"# Export to \"geometry.xml\"\n",
"geometry_file.export_to_xml()"
"geometry.export_to_xml()"
]
},
{
@ -292,8 +288,8 @@
"inactive = 5\n",
"particles = 2500\n",
"\n",
"# Instantiate a SettingsFile\n",
"settings_file = openmc.SettingsFile()\n",
"# Instantiate a Settings object\n",
"settings_file = openmc.Settings()\n",
"settings_file.batches = min_batches\n",
"settings_file.inactive = inactive\n",
"settings_file.particles = particles\n",
@ -333,8 +329,8 @@
"plot.pixels = [250, 250]\n",
"plot.color = 'mat'\n",
"\n",
"# Instantiate a PlotsFile, add Plot, and export to \"plots.xml\"\n",
"plot_file = openmc.PlotsFile()\n",
"# Instantiate a Plots object, add Plot, and export to \"plots.xml\"\n",
"plot_file = openmc.Plots()\n",
"plot_file.add_plot(plot)\n",
"plot_file.export_to_xml()"
]
@ -366,8 +362,7 @@
],
"source": [
"# Run openmc in plotting mode\n",
"executor = openmc.Executor()\n",
"executor.plot_geometry(output=False)"
"openmc.plot_geometry(output=False)"
]
},
{
@ -412,8 +407,8 @@
},
"outputs": [],
"source": [
"# Instantiate an empty TalliesFile\n",
"tallies_file = openmc.TalliesFile()\n",
"# Instantiate an empty Tallies object\n",
"tallies_file = openmc.Tallies()\n",
"tallies_file._tallies = []"
]
},
@ -453,7 +448,7 @@
"tally.filters = [mesh_filter, energy_filter]\n",
"tally.scores = ['fission', 'nu-fission']\n",
"\n",
"# Add mesh and Tally to TalliesFile\n",
"# Add mesh and Tally to Tallies\n",
"tallies_file.add_mesh(mesh)\n",
"tallies_file.add_tally(tally)"
]
@ -482,7 +477,7 @@
"tally.scores = ['scatter-y2']\n",
"tally.nuclides = [u235, u238]\n",
"\n",
"# Add mesh and tally to TalliesFile\n",
"# Add mesh and tally to Tallies\n",
"tallies_file.add_tally(tally)"
]
},
@ -514,7 +509,7 @@
"tally.scores = ['absorption', 'scatter']\n",
"tally.triggers = [trigger]\n",
"\n",
"# Add mesh and tally to TalliesFile\n",
"# Add mesh and tally to Tallies\n",
"tallies_file.add_tally(tally)"
]
},
@ -669,8 +664,8 @@
"# Remove old HDF5 (summary, statepoint) files\n",
"!rm statepoint.*\n",
"\n",
"# Run OpenMC with MPI!\n",
"executor.run_simulation()"
"# Run OpenMC!\n",
"openmc.run()"
]
},
{