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

@ -122,7 +122,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"With our materials, we can now create a `MaterialsFile` object that can be exported to an actual XML file."
"With our materials, we can now create a `Materials` object that can be exported to an actual XML file."
]
},
{
@ -133,8 +133,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",
@ -238,7 +238,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."
]
},
{
@ -253,12 +253,8 @@
"openmc_geometry = openmc.Geometry()\n",
"openmc_geometry.root_universe = root_universe\n",
"\n",
"# Instantiate a GeometryFile\n",
"geometry_file = openmc.GeometryFile()\n",
"geometry_file.geometry = openmc_geometry\n",
"\n",
"# Export to \"geometry.xml\"\n",
"geometry_file.export_to_xml()"
"openmc_geometry.export_to_xml()"
]
},
{
@ -281,8 +277,8 @@
"inactive = 10\n",
"particles = 10000\n",
"\n",
"# Instantiate a SettingsFile\n",
"settings_file = openmc.SettingsFile()\n",
"# Instantiate a Settings object\n",
"settings_file = openmc.Settings()\n",
"settings_file.batches = batches\n",
"settings_file.inactive = inactive\n",
"settings_file.particles = particles\n",
@ -396,8 +392,8 @@
},
"outputs": [],
"source": [
"# Instantiate an empty TalliesFile\n",
"tallies_file = openmc.TalliesFile()\n",
"# Instantiate an empty Tallies object\n",
"tallies_file = openmc.Tallies()\n",
"\n",
"# Iterate over all cells and cross section types\n",
"for cell in openmc_cells:\n",
@ -607,8 +603,7 @@
],
"source": [
"# Run OpenMC\n",
"executor = openmc.Executor()\n",
"executor.run_simulation(output=True)"
"openmc.run(output=True)"
]
},
{
@ -1360,7 +1355,7 @@
],
"source": [
"# Generate tracks for OpenMOC\n",
"track_generator = openmoc.TrackGenerator(openmoc_geometry, num_azim=128, spacing=0.1)\n",
"track_generator = openmoc.TrackGenerator(openmoc_geometry, num_azim=128, azim_spacing=0.1)\n",
"track_generator.generateTracks()\n",
"\n",
"# Run OpenMOC\n",
@ -1699,7 +1694,7 @@
],
"source": [
"# Generate tracks for OpenMOC\n",
"track_generator = openmoc.TrackGenerator(openmoc_geometry, num_azim=128, spacing=0.1)\n",
"track_generator = openmoc.TrackGenerator(openmoc_geometry, num_azim=128, azim_spacing=0.1)\n",
"track_generator.generateTracks()\n",
"\n",
"# Run OpenMOC\n",