Skip to content

Commit

Permalink
done t2 and t3
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Sep 30, 2024
1 parent 21fdf64 commit c80667b
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The following code block is a simple example of creating a material (water H2O) from elements. (Note how Hydrogen and Oxygen elements have been specified rather than each specific isotope)."
"First import OpenMC and configure the nuclear data path"
]
},
{
Expand All @@ -26,6 +26,24 @@
"source": [
"import openmc\n",
"\n",
"# Setting the cross section path to the correct location in the docker image.\n",
"# If you are running this outside the docker image you will have to change this path to your local cross section path.\n",
"openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The following code block is a simple example of creating a material (water H2O) from elements. (Note how Hydrogen and Oxygen elements have been specified rather than each specific isotope)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Making water from elements\n",
"\n",
"water_mat = openmc.Material()\n",
Expand Down
14 changes: 12 additions & 2 deletions tasks/task_02_making_materials/5_example_materials_mixed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,25 @@
"This python notebook allows users to make mixed materials using OpenMC and the Neutronics Material Maker."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First import packages needed and configure the OpenMC nuclear data path"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# import the packages needed for the task\n",
"import neutronics_material_maker as nmm\n",
"import openmc\n",
"import neutronics_material_maker as nmm"
"\n",
"# Setting the cross section path to the correct location in the docker image.\n",
"# If you are running this outside the docker image you will have to change this path to your local cross section path.\n",
"openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml'"
]
},
{
Expand Down
22 changes: 20 additions & 2 deletions tasks/task_03_making_CSG_geometry/1_simple_csg_geometry.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@
"IFrame(src=\"https://www.youtube.com/embed/Ovr7oYukYRw\", width=560, height=340)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First import OpenMC and configure the nuclear data path"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import openmc\n",
"\n",
"# Setting the cross section path to the correct location in the docker image.\n",
"# If you are running this outside the docker image you will have to change this path to your local cross section path.\n",
"openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml'"
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand All @@ -38,8 +58,6 @@
"metadata": {},
"outputs": [],
"source": [
"import openmc\n",
"\n",
"# example surfaces\n",
"inner_sphere_surface = openmc.Sphere(r=500)\n",
"outer_sphere_surface = openmc.Sphere(r=600)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,33 @@
"\n",
"This python notebook allows users to build upon the geometry constructed in Part 1 by adding a center column to the model.\n",
"\n",
"The center column requires a different surface type. OpenMC has several different surface types in addition to spheres. The documentation contains useful information on all surface types supported: https://openmc.readthedocs.io/en/stable/usersguide/geometry.html#surfaces-and-regions.\n",
"The center column requires a different surface type. OpenMC has several different surface types in addition to spheres. The documentation contains useful information on all surface types supported: https://openmc.readthedocs.io/en/stable/usersguide/geometry.html#surfaces-and-regions."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First import OpenMC and configure the nuclear data path"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import openmc\n",
"\n",
"# Setting the cross section path to the correct location in the docker image.\n",
"# If you are running this outside the docker image you will have to change this path to your local cross section path.\n",
"openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For the center column we will use a cylinder with Z axis orientation.\n",
"\n",
"The code block below shows how the center column can be defined."
Expand All @@ -22,8 +47,6 @@
"metadata": {},
"outputs": [],
"source": [
"import openmc\n",
"\n",
"# surfaces\n",
"central_column_surface = openmc.ZCylinder(r=100) # note the new surface type\n",
"inner_sphere_surface = openmc.Sphere(r=480)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
"This first code block recreates the simple reactor geometry seen in Part 2, but also assigns materials to each cell."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First import OpenMC and configure the nuclear data path"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -32,6 +39,17 @@
"source": [
"import openmc\n",
"\n",
"# Setting the cross section path to the correct location in the docker image.\n",
"# If you are running this outside the docker image you will have to change this path to your local cross section path.\n",
"openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"copper = openmc.Material()\n",
"copper.set_density('g/cm3', 8.5)\n",
"copper.add_element('Cu', 1.0) # Note, percent_type does not have to be specified as material is 100% copper\n",
Expand Down

0 comments on commit c80667b

Please sign in to comment.