Skip to content

Commit

Permalink
Merge pull request #220 from fusion-energy/develop
Browse files Browse the repository at this point in the history
Develop updates
  • Loading branch information
shimwell authored Jul 6, 2023
2 parents f511677 + f6fa747 commit 9e88e9d
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -10,6 +11,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -48,6 +50,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -69,6 +72,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -82,11 +86,11 @@
"outputs": [],
"source": [
"import openmc\n",
"import openmc_plasma_source as ops # makes plasma sources\n",
"import neutronics_material_maker as nmm # makes materials from a database"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -126,9 +130,20 @@
"# here an instance of the settings object has been created and attributes set on creation\n",
"my_settings = openmc.Settings(batches = 1, particles = 100, run_mode = 'fixed source')\n",
"\n",
"# assigns a ring source of DT energy neutrons to the source using the openmc_plasma_source package.\n",
"# This source has a 14MeV neutron energy, with a radius of 350cm and is half a ring (0 to 180 degrees)\n",
"my_settings.source = ops.FusionRingSource(fuel=\"DT\", radius=350, angles=(0, 3.14))\n",
"# Assigns a ring source of DT energy neutrons to the source. This source has a\n",
"# 14MeV neutron energy, with a radius of 350cm and is half a ring (0 to 180 degrees)\n",
"# If you are keen to make more realistic plasma sources take a looks at the\n",
"# openmc_plasma_source python package https://github.com/fusion-energy/openmc-plasma-source\n",
"my_source = openmc.Source()\n",
"my_source.angle = openmc.stats.Isotropic()\n",
"my_source.energy = openmc.stats.Discrete([14e6], [1])\n",
"my_source.space = openmc.stats.CylindricalIndependent(\n",
" r=openmc.stats.Discrete([350], [1]), # all source points at a radius of 350 cm\n",
" phi=openmc.stats.Uniform(a=0, b=3.14), # angular distribution between 0 and pi\n",
" z=openmc.stats.Discrete([0], [1]), # all source points at 0 on the z axis\n",
" origin=(0.0, 0.0, 0.0), # centered around 0,0,0 x,y,z\n",
")\n",
"my_settings.source = my_source\n",
"\n",
"my_model = openmc.Model(\n",
" materials=materials, geometry=my_geometry, settings=my_settings, tallies=my_tallies\n",
Expand All @@ -143,6 +158,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -164,6 +180,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -186,6 +203,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -205,6 +223,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -225,6 +244,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 @@ -14,6 +15,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -41,6 +43,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -71,6 +74,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -89,6 +93,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -105,6 +110,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -140,6 +146,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -158,6 +165,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -188,10 +196,17 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Makes a simple ring source with a DT neutron energy spectrum"
"Assigns a ring source of DT energy neutrons to the source.\n",
"\n",
"This source has a 14MeV neutron energy, with a radius of 350cm and is half a ring (0 to 180 degrees).\n",
"\n",
"If you are keen to make more realistic plasma sources take a looks at the openmc_plasma_source python package\n",
"\n",
"https://github.com/fusion-energy/openmc-plasma-source"
]
},
{
Expand All @@ -200,14 +215,19 @@
"metadata": {},
"outputs": [],
"source": [
"import openmc_plasma_source as ops\n",
"# assigns a ring source of DT energy neutrons to the source using the\n",
"# openmc_plasma_source package, more details here\n",
"# https://github.com/fusion-energy/openmc-plasma-source/\n",
"my_source = ops.FusionRingSource(fuel=\"DT\", radius=350)"
"my_source = openmc.Source()\n",
"my_source.angle = openmc.stats.Isotropic()\n",
"my_source.energy = openmc.stats.Discrete([14e6], [1])\n",
"my_source.space = openmc.stats.CylindricalIndependent(\n",
" r=openmc.stats.Discrete([350], [1]), # all source points at a radius of 350 cm\n",
" phi=openmc.stats.Uniform(a=0, b=3.14), # angular distribution between 0 and pi\n",
" z=openmc.stats.Discrete([0], [1]), # all source points at 0 on the z axis\n",
" origin=(0.0, 0.0, 0.0), # centered around 0,0,0 x,y,z\n",
")"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -229,6 +249,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -252,6 +273,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -282,6 +304,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -291,6 +314,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": []
Expand Down
Loading

0 comments on commit 9e88e9d

Please sign in to comment.