From b53ee88b9bd1de53bd5c99e83f551379fb9a26d0 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 14 Apr 2021 18:45:35 +0100 Subject: [PATCH 1/4] ring source now using muir not watt --- tasks/task_04_make_sources/2_ring_source.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/task_04_make_sources/2_ring_source.ipynb b/tasks/task_04_make_sources/2_ring_source.ipynb index 4884781..71e7db6 100644 --- a/tasks/task_04_make_sources/2_ring_source.ipynb +++ b/tasks/task_04_make_sources/2_ring_source.ipynb @@ -63,7 +63,7 @@ "source.angle = openmc.stats.Isotropic()\n", "\n", "# sets the energy distribution to a Muir distribution neutrons\n", - "source.energy = openmc.stats.Watt(a=988000.0, b=2.249e-06)\n", + "source.energy = openmc.stats.Muir(e0=14080000.0, m_rat=5.0, kt=20000.0)\n", "\n", "create_inital_particles(source)\n", "plot_postion_from_initial_source()" From 643ec98772e06f6e9b5567ec1cc7850b0366afe2 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 19 Apr 2021 18:37:19 +0100 Subject: [PATCH 2/4] updated nmm.Material usage to new API --- ...xample_materials_from_material_maker.ipynb | 8 ++-- .../4_example_materials_parameter_study.ipynb | 8 ++-- .../5_example_materials_mixed.ipynb | 42 +++++++++---------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tasks/task_02_making_materials/3_example_materials_from_material_maker.ipynb b/tasks/task_02_making_materials/3_example_materials_from_material_maker.ipynb index 1d4c1c8..139f687 100644 --- a/tasks/task_02_making_materials/3_example_materials_from_material_maker.ipynb +++ b/tasks/task_02_making_materials/3_example_materials_from_material_maker.ipynb @@ -39,7 +39,7 @@ "\n", "import neutronics_material_maker as nmm\n", "\n", - "eurofer_mat = nmm.Material('eurofer')\n", + "eurofer_mat = nmm.Material.from_library('eurofer')\n", "\n", "eurofer_mat.openmc_material" ] @@ -62,7 +62,7 @@ "outputs": [], "source": [ "# Water requires temperature and pressure arguments to be passed\n", - "water = nmm.Material('H2O', temperature_in_C=25, pressure_in_Pa=100000)\n", + "water = nmm.Material.from_library('H2O', temperature=300, pressure=100000)\n", "\n", "water.openmc_material" ] @@ -85,7 +85,7 @@ "# Lithium Orthosilicate (Li4SiO4) can take arguments of 'enrichment', 'enrichment_target', 'enrichment_type' and 'packing_fraction'\n", "# Note: for some lithium crystals, 'enrichment_target' and 'enrichment_type' are defined by default, but can be changed\n", "\n", - "default_Li4SiO4 = nmm.Material('Li4SiO4')\n", + "default_Li4SiO4 = nmm.Material.from_library('Li4SiO4')\n", "default_Li4SiO4.openmc_material" ] }, @@ -98,7 +98,7 @@ "# the following command creates Li4SiO4 with respect to given arguments but uses the default values for enrichment_target and enrichment_type\n", "# enrichment_target='Li6', enrichment_type='ao' defined by default\n", "\n", - "enriched_and_packed_Li4SiO4 = nmm.Material(\n", + "enriched_and_packed_Li4SiO4 = nmm.Material.from_library(\n", " 'Li4SiO4',\n", " enrichment=60,\n", " packing_fraction=0.64\n", diff --git a/tasks/task_02_making_materials/4_example_materials_parameter_study.ipynb b/tasks/task_02_making_materials/4_example_materials_parameter_study.ipynb index 2f66831..ec960b5 100644 --- a/tasks/task_02_making_materials/4_example_materials_parameter_study.ipynb +++ b/tasks/task_02_making_materials/4_example_materials_parameter_study.ipynb @@ -47,9 +47,9 @@ "metadata": {}, "outputs": [], "source": [ - "temperatures = np.linspace(0.1, 600., 200)\n", + "temperatures = np.linspace(400, 800., 100)\n", "\n", - "water_densities = [nmm.Material('H2O', temperature_in_C=temperature, pressure_in_Pa=15500000).openmc_material.density for temperature in temperatures]\n", + "water_densities = [nmm.Material.from_library('H2O', temperature=temperature, pressure=15500000).openmc_material.density for temperature in temperatures]\n", "\n", "fig = go.Figure()\n", "\n", @@ -84,7 +84,7 @@ "source": [ "pressures = np.linspace(1000000., 10000000., 100)\n", "\n", - "helium_densities = [nmm.Material('He', temperature_in_C=400, pressure_in_Pa=pressure).openmc_material.density for pressure in pressures]\n", + "helium_densities = [nmm.Material.from_library('He', temperature=700, pressure=pressure).openmc_material.density for pressure in pressures]\n", "\n", "fig = go.Figure()\n", "\n", @@ -119,7 +119,7 @@ "source": [ "enrichments = np.linspace(0., 100., 50)\n", "\n", - "li4sio4_densities = [nmm.Material('Li4SiO4', enrichment=enrichment).openmc_material.density for enrichment in enrichments]\n", + "li4sio4_densities = [nmm.Material.from_library('Li4SiO4', enrichment=enrichment).openmc_material.density for enrichment in enrichments]\n", "\n", "fig =go.Figure()\n", "\n", diff --git a/tasks/task_02_making_materials/5_example_materials_mixed.ipynb b/tasks/task_02_making_materials/5_example_materials_mixed.ipynb index 58b2872..ffc9c3a 100644 --- a/tasks/task_02_making_materials/5_example_materials_mixed.ipynb +++ b/tasks/task_02_making_materials/5_example_materials_mixed.ipynb @@ -99,10 +99,10 @@ "steel_mat.add_element('C', 0.025)\n", "steel_mat.set_density('g/cm3', 7.7)\n", "\n", - "h20_material = nmm.Material(\n", + "h20_material = nmm.Material.from_library(\n", " 'H2O',\n", - " temperature_in_C=500,\n", - " pressure_in_Pa=80000\n", + " temperature=500,\n", + " pressure=80000\n", ").openmc_material\n", "\n", "mixed_mat = openmc.Material.mix_materials(\n", @@ -135,12 +135,12 @@ "metadata": {}, "outputs": [], "source": [ - "steel_mat = nmm.Material('a36_steel').openmc_material\n", + "steel_mat = nmm.Material.from_library('a36_steel').openmc_material\n", "\n", - "h20_material = nmm.Material(\n", + "h20_material = nmm.Material.from_library(\n", " 'H2O',\n", - " temperature_in_C=500,\n", - " pressure_in_Pa=80000\n", + " temperature=500,\n", + " pressure=80000\n", ").openmc_material\n", "\n", "mixed_mat = openmc.Material.mix_materials(\n", @@ -182,8 +182,8 @@ "h20_mat.add_elements_from_formula('H2O')\n", "h20_mat.set_density('g/cm3', 1.)\n", "\n", - "mixed_mat = nmm.MultiMaterial(\n", - " material_tag='mixed_material', # name of homogeneous material\n", + "mixed_mat = nmm.Material.from_mixture(\n", + " name='mixed_material', # name of homogeneous material\n", " materials=[\n", " steel_mat,\n", " h20_material\n", @@ -218,14 +218,14 @@ "steel_mat.add_element('C', 0.025)\n", "steel_mat.set_density('g/cm3', 7.7)\n", "\n", - "h20_material = nmm.Material(\n", + "h20_material = nmm.Material.from_library(\n", " 'H2O',\n", - " temperature_in_C=500,\n", - " pressure_in_Pa=80000\n", + " temperature=700,\n", + " pressure=80000\n", ").openmc_material\n", "\n", - "mixed_mat = nmm.MultiMaterial(\n", - " material_tag='mixed_material', # name of homogeneous material\n", + "mixed_mat = nmm.Material.from_mixture(\n", + " name='mixed_material', # name of homogeneous material\n", " materials=[\n", " steel_mat,\n", " h20_material\n", @@ -255,16 +255,16 @@ "metadata": {}, "outputs": [], "source": [ - "steel_mat = nmm.Material('a36_steel').openmc_material\n", + "steel_mat = nmm.Material.from_library('a36_steel').openmc_material\n", "\n", - "h20_material = nmm.Material(\n", - " 'H2O',\n", - " temperature_in_C=500,\n", - " pressure_in_Pa=80000\n", + "h20_material = nmm.Material.from_library(\n", + " name='H2O',\n", + " temperature=500,\n", + " pressure=80000\n", ").openmc_material\n", "\n", - "mixed_mat = nmm.MultiMaterial(\n", - " material_tag='mixed_material', # name of homogeneous material\n", + "mixed_mat = nmm.Material.from_mixture(\n", + " name='mixed_material', # name of homogeneous material\n", " materials=[\n", " steel_mat,\n", " h20_material\n", From c8cfabb99210566675d1e9246a8b53b4f8b73988 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 19 Apr 2021 18:37:47 +0100 Subject: [PATCH 3/4] added extra python packages for optimisation --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 11ae6da..06f02a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -85,7 +85,10 @@ RUN pip install cmake\ # cython is needed for moab cython \ paramak \ - openmc_data_downloader + openmc_data_downloader \ + itkwidgets \ + nest_asyncio \ + ipywidgets # svalinn-tools should be added but it is not working with python 3 at the moment From 1b3bec78c690c1b1fa3b8e1c9ba55696f4159255 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 12 May 2021 15:28:04 +0100 Subject: [PATCH 4/4] updated ood command to use all --- Dockerfile | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/Dockerfile b/Dockerfile index 06f02a5..5e8442b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -192,46 +192,14 @@ RUN cd /opt && \ cd /opt/openmc/ && \ pip install . -# NJOY2016 install from source -# RUN mkdir njoy && \ -# cd njoy && \ -# git clone --single-branch --branch 2016.61 --depth 1 https://github.com/njoy/NJOY2016.git && \ -# mkdir build && \ -# cd build && \ -# cmake -Dstatic=on ../NJOY2016 && \ -# make 2>/dev/null && \ -# rm -rf /njoy/NJOY2016 - -# ENV PATH=$PATH:/njoy/build - # install nuclear data 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=/cross_sections.xml - - -# COPY scripts/delete_nuclear_data_not_used_in_cross_section_xml.py . - - -# RUN wget -O nndc-b7.1.tar.xz https://anl.box.com/shared/static/9igk353zpy8fn9ttvtrqgzvw1vtejoz6.xz && \ -# mkdir nndc-b7.1-hdf5 && \ -# tar -xf nndc-b7.1.tar.xz -C nndc-b7.1-hdf5 && \ -# rm nndc-b7.1.tar.xz - RUN git clone --single-branch --branch master --depth 1 https://github.com/openmc-dev/data.git && \ - openmc_data_downloader -l ENDFB-7.1-NNDC TENDL-2019 -d cross_section_data -p neutron photon -e H He Li Be B C N O F Ne Na Mg Al Si P S Cl Ar K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr Rb Sr Y Zr Nb Mo Ru Rh Pd Ag Cd In Sn Sb Te I Xe Cs Ba La Ce Pr Nd Sm Eu Gd Tb Dy Ho Er Tm Yb Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Th Pa U - # python data/convert_nndc71.py --cleanup && \ - # rm -rf nndc-b7.1-endf && \ - # rm -rf nndc-b7.1-ace/ && \ - # rm -rf nndc-b7.1-download && \ - # python data/convert_tendl.py --cleanup && \ - # rm -rf tendl-2019-ace/ && \ - # rm -rf tendl-2019-download && \ - # python data/combine_libraries.py -l nndc-b7.1-hdf5/cross_sections.xml tendl-2019-hdf5/cross_sections.xml -o cross_sections.xml && \ - # python delete_nuclear_data_not_used_in_cross_section_xml.py + openmc_data_downloader -l ENDFB-7.1-NNDC TENDL-2019 -d cross_section_data -p neutron photon -e all ENV OPENMC_CROSS_SECTIONS=/cross_section_data/cross_sections.xml