Skip to content

Commit

Permalink
goemetry plot
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Aug 23, 2023
1 parent f5f27fe commit 0f18ed8
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 175 deletions.
14 changes: 12 additions & 2 deletions tasks/task_04_make_sources/4_neutron_tracks.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -12,6 +13,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -57,8 +59,7 @@
"\n",
"vaccum_cell = openmc.Cell(region=-sph0)\n",
"\n",
"universe = openmc.Universe(cells=[simple_moderator_cell, simple_transparent_cell, vaccum_cell])\n",
"geom = openmc.Geometry(universe)\n",
"geom = openmc.Geometry([simple_moderator_cell, simple_transparent_cell, vaccum_cell])\n",
"\n",
"\n",
"# SIMULATION SETTINGS\n",
Expand All @@ -83,6 +84,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -101,6 +103,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -117,6 +120,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -133,6 +137,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -149,6 +154,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -174,6 +180,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -202,6 +209,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -234,6 +242,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -244,6 +253,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down
11 changes: 9 additions & 2 deletions tasks/task_06_CSG_cell_tally_DPA/1_find_dpa.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -24,6 +25,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -60,8 +62,7 @@
"vessel_cell.id = 1 # the id is set so that is can be accessed later from the volume calculation\n",
"vessel_cell.fill = mat_iron\n",
"\n",
"universe = openmc.Universe(cells=[vessel_cell])\n",
"my_geometry = openmc.Geometry(universe)\n",
"my_geometry = openmc.Geometry([vessel_cell])\n",
"\n",
"\n",
"# SIMULATION SETTINGS\n",
Expand All @@ -83,6 +84,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -105,6 +107,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -123,6 +126,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -146,6 +150,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -193,6 +198,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -227,6 +233,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": []
Expand Down
12 changes: 9 additions & 3 deletions tasks/task_08_CSG_mesh_tally/2_example_3d_mesh_tallies.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -12,6 +13,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -27,7 +29,6 @@
"outputs": [],
"source": [
"import openmc\n",
"import os\n",
"\n",
"# MATERIALS\n",
"\n",
Expand Down Expand Up @@ -77,8 +78,7 @@
"breeder_blanket_cell = openmc.Cell(region=breeder_blanket_region)\n",
"breeder_blanket_cell.fill = breeder_material\n",
"\n",
"universe = openmc.Universe(cells=[central_sol_cell, central_shield_cell, inner_vessel_cell, first_wall_cell, breeder_blanket_cell])\n",
"my_geometry = openmc.Geometry(universe)\n",
"my_geometry = openmc.Geometry([central_sol_cell, central_shield_cell, inner_vessel_cell, first_wall_cell, breeder_blanket_cell])\n",
"\n",
"\n",
"# SIMULATION SETTINGS\n",
Expand All @@ -101,6 +101,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -121,6 +122,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -151,6 +153,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -172,6 +175,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -211,6 +215,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -221,6 +226,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -17,6 +18,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -69,6 +71,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -78,6 +81,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -99,6 +103,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -157,14 +162,13 @@
"sphere_2_region = +sphere_1 & -sphere_2\n",
"sphere_2_cell = openmc.Cell(region= sphere_2_region)\n",
"\n",
"universe = openmc.Universe(cells=[\n",
"my_geometry = openmc.Geometry([\n",
" inner_void_cell, cylinder_cell, top_cap_cell,\n",
" bottom_cap_cell, sphere_1_cell, sphere_2_cell])\n",
"\n",
"my_geometry = openmc.Geometry(universe)"
" bottom_cap_cell, sphere_1_cell, sphere_2_cell])"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -188,11 +192,15 @@
" cylinder_cell:'yellow',\n",
" }\n",
"x, y = 200, 200\n",
"plt.show(universe.plot(basis='xz', color_by='material', colors=color_assignment))\n",
"plt.show(universe.plot(basis='xy', color_by='material', colors=color_assignment))"
"plot = my_geometry.plot(basis='xz', color_by='material', colors=color_assignment) \n",
"plot.figure.savefig('xz.png')\n",
"\n",
"plot = my_geometry.plot(basis='xy', color_by='material', colors=color_assignment) \n",
"plot.figure.savefig('xy.png')"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -223,6 +231,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -261,6 +270,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -280,6 +290,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -319,6 +330,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down
Loading

0 comments on commit 0f18ed8

Please sign in to comment.