Skip to content

Commit

Permalink
Merge pull request #295 from fusion-energy/remove_nuc_data_env_from_d…
Browse files Browse the repository at this point in the history
…ocker

Remove nuc data env from docker
  • Loading branch information
shimwell authored Oct 9, 2024
2 parents c80667b + 295ca24 commit d039b92
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 10 deletions.
7 changes: 2 additions & 5 deletions .devcontainer/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ RUN pip install neutronics_material_maker[density] \
RUN pip install git+https://github.com/fusion-energy/openmc-plasma-source

RUN pip install git+https://github.com/CadQuery/cadquery.git@bc82cb04c59668a1369d9ce648361c8786bbd1c8 --no-deps
RUN pip install cadquery-ocp==7.7.1 "multimethod>=1.7<2.0" nlopt typish casadi path ezdxf nptyping==2.0.1
RUN pip install cadquery-ocp==7.7.1 "multimethod>=1.7,<2.0" nlopt typish casadi path ezdxf nptyping==2.0.1

# Python libraries used in the workshop
RUN pip install cmake\
Expand Down Expand Up @@ -170,7 +170,7 @@ RUN if [ "$build_double_down" = "ON" ] ; \
RUN mkdir MOAB && \
cd MOAB && \
# newer versions of moab (5.4.0, 5.4.1) don't produce an importable pymoab package!
# TODO try moab 5.5.0
# TODO try moab 5.5.0 and 5.5.1
git clone --single-branch --branch 5.3.1 --depth 1 https://bitbucket.org/fathomteam/moab.git && \
mkdir build && \
cd build && \
Expand Down Expand Up @@ -249,6 +249,3 @@ RUN download_endf_chain -d nuclear_data -r b8.0
RUN wget https://github.com/mit-crpg/WMP_Library/releases/download/v1.1/WMP_Library_v1.1.tar.gz && \
tar -xf WMP_Library_v1.1.tar.gz -C / && \
rm WMP_Library_v1.1.tar.gz

ENV OPENMC_CROSS_SECTIONS=/nuclear_data/cross_sections.xml
ENV OPENMC_CHAIN_FILE=/nuclear_data/chain-endf-b8.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@
"IFrame(src=\"https://www.youtube.com/embed/KYIsDjip1nQ\", width=560, height=340)"
]
},
{
"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 matplotlib.pyplot as plt\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": "markdown",
"metadata": {},
Expand All @@ -42,9 +62,6 @@
"metadata": {},
"outputs": [],
"source": [
"import openmc\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# MATERIALS\n",
"\n",
"# creates two materials, one is a neutron multiplier (lead) and the other a tritium breeder (lithium)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@
"This first code block defines the model geometry, materials and neutron source."
]
},
{
"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",
"# 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": 1,
Expand All @@ -28,8 +47,6 @@
},
"outputs": [],
"source": [
"import openmc\n",
"\n",
"# MATERIALS\n",
"\n",
"breeder_material = openmc.Material() # Pb84.2Li15.8\n",
Expand Down
19 changes: 19 additions & 0 deletions tasks/task_08_CSG_mesh_tally/3_example_cylinder_mesh_tallies.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@
"This first code block defines the model geometry and materials."
]
},
{
"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",
"# 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,
Expand Down

0 comments on commit d039b92

Please sign in to comment.