Skip to content

Commit

Permalink
added new task
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Jan 30, 2024
1 parent bd01846 commit 006cb3b
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ RUN cp tasks/task_01_cross_sections/3_material_xs_plot.ipynb tasks/half-day-work
RUN cp tasks/task_02_making_materials/1_example_materials_from_isotopes.ipynb tasks/half-day-workshop/task_04_example_materials_from_isotopes.ipynb
RUN cp tasks/task_02_making_materials/2_example_materials_from_elements.ipynb tasks/half-day-workshop/task_05_example_materials_from_elements.ipynb
RUN cp tasks/task_03_making_CSG_geometry/1_simple_csg_geometry.ipynb tasks/half-day-workshop/task_06_simple_csg_geometry.ipynb
RUN cp tasks/task_04_make_sources/1_point_source_plots.ipynb tasks/half-day-workshop/task_08_point_source_plots.ipynb
RUN cp tasks/task_04_make_sources/2_ring_source.ipynb tasks/half-day-workshop/task_09_ring_source.ipynb
RUN cp tasks/task_04_make_sources/3_plasma_source_plots.ipynb tasks/half-day-workshop/task_10_plasma_source_plots.ipynb
RUN cp tasks/task_05_CSG_cell_tally_TBR/1_example_tritium_production.ipynb tasks/half-day-workshop/task_11_example_tritium_production.ipynb
RUN cp tasks/task_06_CSG_cell_tally_DPA/1_find_dpa.ipynb tasks/half-day-workshop/task_12_find_dpa.ipynb
RUN cp tasks/task_07_CSG_cell_tally_spectra/2_example_neutron_spectra_on_cell.ipynb tasks/half-day-workshop/task_13_example_neutron_spectra_on_cell.ipynb
RUN cp tasks/task_07_CSG_cell_tally_spectra/4_example_photon_spectra.ipynb tasks/half-day-workshop/task_14_example_photon_spectra.ipynb
RUN cp tasks/task_08_CSG_mesh_tally/1_example_2d_regular_mesh_tallies.ipynb tasks/half-day-workshop/task_15_example_2d_regular_mesh_tallies.ipynb
RUN cp tasks/task_08_CSG_mesh_tally/2_example_3d_regular_mesh_tallies.ipynb tasks/half-day-workshop/task_16_example_3d_regular_mesh_tallies.ipynb
RUN cp tasks/task_04_make_sources/1_point_source_plots.ipynb tasks/half-day-workshop/task_07_point_source_plots.ipynb
RUN cp tasks/task_04_make_sources/2_ring_source.ipynb tasks/half-day-workshop/task_08_ring_source.ipynb
RUN cp tasks/task_04_make_sources/3_plasma_source_plots.ipynb tasks/half-day-workshop/task_09_plasma_source_plots.ipynb
RUN cp tasks/task_05_CSG_cell_tally_TBR/1_example_tritium_production.ipynb tasks/half-day-workshop/task_10_example_tritium_production.ipynb
RUN cp tasks/task_06_CSG_cell_tally_DPA/1_find_dpa.ipynb tasks/half-day-workshop/task_11_find_dpa.ipynb
RUN cp tasks/task_07_CSG_cell_tally_spectra/2_example_neutron_spectra_on_cell.ipynb tasks/half-day-workshop/task_12_example_neutron_spectra_on_cell.ipynb
RUN cp tasks/task_07_CSG_cell_tally_spectra/4_example_photon_spectra.ipynb tasks/half-day-workshop/task_13_example_photon_spectra.ipynb
RUN cp tasks/task_08_CSG_mesh_tally/1_example_2d_regular_mesh_tallies.ipynb tasks/half-day-workshop/task_14_example_2d_regular_mesh_tallies.ipynb
RUN cp tasks/task_10_activation_transmutation_depletion/3_full_pulse_schedule.ipynb tasks/half-day-workshop/task_15_full_pulse_schedule.ipynb
RUN cp tasks/optimal_design.ipynb tasks/half-day-workshop/optimal_design.ipynb

WORKDIR /tasks

Expand Down
115 changes: 115 additions & 0 deletions tasks/optimal_design.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "72324188-e724-46bf-9a3c-f7f6501ccc73",
"metadata": {},
"source": [
"This activity allows you to put lots of simulation skills to the test.\n",
"\n",
"We are going to simulate a tokamak where you get to decide the materials.\n",
"\n",
"The goal is to:\n",
"\n",
"maximize the Tritium Breeding Ratio\n",
"minimize the heating on the center colum\n",
"maximize the heat in the blanket"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7114fda7-b184-46d4-bbce-0d88206c573e",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "ef814191-35a3-44a9-b088-f27c1bb53457",
"metadata": {},
"outputs": [],
"source": [
"import openmc\n",
"\n",
"# surfaces\n",
"central_column_surface_outer = openmc.ZCylinder(r=100)\n",
"central_column_surface_mid = openmc.ZCylinder(r=90)\n",
"central_column_surface_inner = openmc.ZCylinder(r=80)\n",
"\n",
"inner_sphere_surface = openmc.Sphere(r=480)\n",
"middle_sphere_surface = openmc.Sphere(r=500) \n",
"outer_sphere_surface = openmc.Sphere(r=600)\n",
"outer_outer_sphere_surface = openmc.Sphere(r=650)\n",
"edge_of_simulation_surface = openmc.Sphere(r=650, boundary_type='vacuum')\n",
"\n",
"# regions\n",
"central_column_region = -central_column_surface_inner & -edge_of_simulation_surface\n",
"central_column_coolant_region = +central_column_surface_inner & -central_column_surface_mid & -edge_of_simulation_surface\n",
"central_column_fw_region = +central_column_surface_mid & -central_column_surface_outer & -edge_of_simulation_surface\n",
"\n",
"inner_vessel_region = +central_column_surface_outer & -inner_sphere_surface\n",
"\n",
"blanket_fw_region = -middle_sphere_surface & +inner_sphere_surface & +central_column_surface_outer\n",
"blanket_coolant_region = +middle_sphere_surface & -outer_sphere_surface & +central_column_surface_outer\n",
"blanket_breeder_region = +outer_sphere_surface & -outer_outer_sphere_surface & +central_column_surface_outer\n",
"blanket_reflector_region = +outer_outer_sphere_surface & -edge_of_simulation_surface & +central_column_surface_outer\n",
"\n",
"# cells\n",
"central_column_cell = openmc.Cell(region=central_column_region)\n",
"central_column_coolant_cell = openmc.Cell(region=central_column_coolant_region)\n",
"central_column_fw_cell = openmc.Cell(region=central_column_fw_region)\n",
"\n",
"inner_vessel_cell = openmc.Cell(region=inner_vessel_region)\n",
"\n",
"blanket_fw_cell = openmc.Cell(region=blanket_fw_region)\n",
"blanket_coolant_cell = openmc.Cell(region=blanket_coolant_region)\n",
"blanket_breeder_cell = openmc.Cell(region=blanket_breeder_region)\n",
"blanket_reflector_cell = openmc.Cell(region=blanket_reflector_region)\n",
"\n",
"geometry = openmc.Geometry([\n",
" central_column_cell,\n",
" central_column_coolant_cell,\n",
" central_column_fw_cell,\n",
" inner_vessel_cell,\n",
" blanket_fw_cell,\n",
" blanket_coolant_cell,\n",
" blanket_breeder_cell,\n",
" blanket_reflector_cell,\n",
"])\n",
"\n",
"# visualization\n",
"plot = geometry.plot(basis='xz')\n",
"plot.figure.savefig('xz-cell.png')\n",
"\n",
"plot = geometry.plot(basis='xy')\n",
"plot.figure.savefig('xy-cell.png')\n",
"\n",
"plot = geometry.plot(basis='yz')\n",
"plot.figure.savefig('yz-cell.png')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.16"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit 006cb3b

Please sign in to comment.