mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-25 20:45:35 -04:00
Update Jupyter notebooks
This commit is contained in:
parent
50a80693b5
commit
68f7de1315
6 changed files with 78 additions and 108 deletions
|
|
@ -104,8 +104,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",
|
||||
|
|
@ -236,12 +236,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()"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -264,8 +260,8 @@
|
|||
"inactive = 10\n",
|
||||
"particles = 5000\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",
|
||||
|
|
@ -302,8 +298,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()"
|
||||
]
|
||||
|
|
@ -335,8 +331,7 @@
|
|||
],
|
||||
"source": [
|
||||
"# Run openmc in plotting mode\n",
|
||||
"executor = openmc.Executor()\n",
|
||||
"executor.plot_geometry(output=False)"
|
||||
"openmc.plot_geometry(output=False)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -381,8 +376,8 @@
|
|||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Instantiate an empty TalliesFile\n",
|
||||
"tallies_file = openmc.TalliesFile()"
|
||||
"# Instantiate an empty Tallies object\n",
|
||||
"tallies_file = openmc.Tallies()"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -634,7 +629,7 @@
|
|||
],
|
||||
"source": [
|
||||
"# Run OpenMC!\n",
|
||||
"executor.run_simulation()"
|
||||
"openmc.run()"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue