diff --git a/tasks/task_09_CSG_instantaneous_dose_tallies/1_surface_dose_from_gamma_source.ipynb b/tasks/task_09_CSG_instantaneous_dose_tallies/1_surface_dose_from_gamma_source.ipynb index f951da8e..a2a7e343 100644 --- a/tasks/task_09_CSG_instantaneous_dose_tallies/1_surface_dose_from_gamma_source.ipynb +++ b/tasks/task_09_CSG_instantaneous_dose_tallies/1_surface_dose_from_gamma_source.ipynb @@ -27,6 +27,26 @@ "The following section plots effective dose coefficient as a function of incident particle energy for neutrons and photons." ] }, + { + "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 plotly.graph_objects as go\n", + "import openmc\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, @@ -35,9 +55,6 @@ }, "outputs": [], "source": [ - "import openmc\n", - "import plotly.graph_objects as go\n", - "\n", "energy_bins_n, dose_coeffs_n = openmc.data.dose_coefficients(\n", " particle='neutron',\n", " geometry='AP' # AP defines the direction of the source to person, for more details see documentation https://docs.openmc.org/en/stable/pythonapi/generated/openmc.data.dose_coefficients.html\n", diff --git a/tasks/task_09_CSG_instantaneous_dose_tallies/2_surface_dose_from_gamma_source_study.ipynb b/tasks/task_09_CSG_instantaneous_dose_tallies/2_surface_dose_from_gamma_source_study.ipynb index 57a937ce..cae8f30d 100644 --- a/tasks/task_09_CSG_instantaneous_dose_tallies/2_surface_dose_from_gamma_source_study.ipynb +++ b/tasks/task_09_CSG_instantaneous_dose_tallies/2_surface_dose_from_gamma_source_study.ipynb @@ -22,6 +22,26 @@ "This is the similar to the previous task geometry, but this time we have nested spheres which will be used to tally the dose on." ] }, + { + "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": "code", "execution_count": null, diff --git a/tasks/task_09_CSG_instantaneous_dose_tallies/3_cell_dose_from_neutron.py b/tasks/task_09_CSG_instantaneous_dose_tallies/3_cell_dose_from_neutron.py index eccc3923..e4fc7e48 100644 --- a/tasks/task_09_CSG_instantaneous_dose_tallies/3_cell_dose_from_neutron.py +++ b/tasks/task_09_CSG_instantaneous_dose_tallies/3_cell_dose_from_neutron.py @@ -7,6 +7,11 @@ import openmc + +# Setting the cross section path to the correct location in the docker image. +# If you are running this outside the docker image you will have to change this path to your local cross section path. +openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml' + import math import matplotlib.pyplot as plt diff --git a/tasks/task_09_CSG_instantaneous_dose_tallies/4_cell_dose_from_photon.py b/tasks/task_09_CSG_instantaneous_dose_tallies/4_cell_dose_from_photon.py index 260fbcfd..3834535d 100644 --- a/tasks/task_09_CSG_instantaneous_dose_tallies/4_cell_dose_from_photon.py +++ b/tasks/task_09_CSG_instantaneous_dose_tallies/4_cell_dose_from_photon.py @@ -12,6 +12,10 @@ import matplotlib.pyplot as plt +# Setting the cross section path to the correct location in the docker image. +# If you are running this outside the docker image you will have to change this path to your local cross section path. +openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml' + # Tissue Equivalent, MS20 from PNNL mat_tissue = openmc.Material() mat_tissue.add_element("O", 0.079013) diff --git a/tasks/task_09_CSG_instantaneous_dose_tallies/5_mesh_dose_from_neutrons.py b/tasks/task_09_CSG_instantaneous_dose_tallies/5_mesh_dose_from_neutrons.py index c24cd5d3..1ade1c38 100644 --- a/tasks/task_09_CSG_instantaneous_dose_tallies/5_mesh_dose_from_neutrons.py +++ b/tasks/task_09_CSG_instantaneous_dose_tallies/5_mesh_dose_from_neutrons.py @@ -3,6 +3,9 @@ import openmc import matplotlib.pyplot as plt +# Setting the cross section path to the correct location in the docker image. +# If you are running this outside the docker image you will have to change this path to your local cross section path. +openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml' mat = openmc.Material() mat.add_element("Al", 1) diff --git a/tasks/task_09_CSG_instantaneous_dose_tallies/compare_dose_simulation_with_back_of_envelope.py b/tasks/task_09_CSG_instantaneous_dose_tallies/compare_dose_simulation_with_back_of_envelope.py index 1dbbbddf..48ff0a39 100644 --- a/tasks/task_09_CSG_instantaneous_dose_tallies/compare_dose_simulation_with_back_of_envelope.py +++ b/tasks/task_09_CSG_instantaneous_dose_tallies/compare_dose_simulation_with_back_of_envelope.py @@ -10,6 +10,9 @@ import matplotlib.pyplot as plt import numpy as np +# Setting the cross section path to the correct location in the docker image. +# If you are running this outside the docker image you will have to change this path to your local cross section path. +openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml' def manual_dose_calc( particles_per_shot:int,