diff --git a/analysis/neutron/openmc_model.py b/analysis/neutron/openmc_model.py index c98ee69..d1198b6 100644 --- a/analysis/neutron/openmc_model.py +++ b/analysis/neutron/openmc_model.py @@ -312,7 +312,7 @@ def baby_geometry(x_c: float, y_c: float, z_c: float): return sphere, cllif_cell, cells -def baby_model(): +def baby_model() -> openmc.Model: """Returns an openmc model of the BABY experiment. Returns: diff --git a/analysis/neutron/solid_angle.ipynb b/analysis/neutron/solid_angle.ipynb new file mode 100644 index 0000000..0571a70 --- /dev/null +++ b/analysis/neutron/solid_angle.ipynb @@ -0,0 +1,661 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "isotopes ['Al27', 'Ar36', 'Ar38', 'Ar40', 'B10', 'B11', 'Be9', 'C12', 'C13', 'Ca40', 'Ca42', 'Ca43', 'Ca44', 'Ca46', 'Ca48', 'Cl35', 'Cl37', 'Co59', 'Cr50', 'Cr52', 'Cr53', 'Cr54', 'Cu63', 'Cu65', 'F19', 'Fe54', 'Fe56', 'Fe57', 'Fe58', 'H1', 'H2', 'He3', 'He4', 'K39', 'K40', 'K41', 'Li6', 'Li7', 'Mg24', 'Mg25', 'Mg26', 'Mn55', 'Mo100', 'Mo92', 'Mo94', 'Mo95', 'Mo96', 'Mo97', 'Mo98', 'N14', 'N15', 'Na23', 'Nb93', 'Ni58', 'Ni60', 'Ni61', 'Ni62', 'Ni64', 'O16', 'O17', 'O18', 'P31', 'Pb204', 'Pb206', 'Pb207', 'Pb208', 'S32', 'S33', 'S34', 'S36', 'Si28', 'Si29', 'Si30', 'Ti46', 'Ti47', 'Ti48', 'Ti49', 'Ti50', 'W182', 'W183', 'W184', 'W186', 'Zr90', 'Zr91', 'Zr92', 'Zr94', 'Zr96']\n", + "Searching libraries with the following priority {'ENDFB-8.0-NNDC': 1}\n", + "Isotopes found matching library requirements 556\n", + "Isotopes found matching particle requirements 1789\n", + "Isotopes found matching isotope requirements 345\n", + "Isotopes found matching all requirements 87\n", + " library remote_file \\\n", + "1233 ENDFB-8.0-NNDC H1.h5 \n", + "1234 ENDFB-8.0-NNDC H2.h5 \n", + "1236 ENDFB-8.0-NNDC He3.h5 \n", + "1237 ENDFB-8.0-NNDC He4.h5 \n", + "1238 ENDFB-8.0-NNDC Li6.h5 \n", + "... ... ... \n", + "1649 ENDFB-8.0-NNDC W186.h5 \n", + "1689 ENDFB-8.0-NNDC Pb204.h5 \n", + "1691 ENDFB-8.0-NNDC Pb206.h5 \n", + "1692 ENDFB-8.0-NNDC Pb207.h5 \n", + "1693 ENDFB-8.0-NNDC Pb208.h5 \n", + "\n", + " url \\\n", + "1233 https://github.com/openmc-data-storage/ENDF-B-... \n", + "1234 https://github.com/openmc-data-storage/ENDF-B-... \n", + "1236 https://github.com/openmc-data-storage/ENDF-B-... \n", + "1237 https://github.com/openmc-data-storage/ENDF-B-... \n", + "1238 https://github.com/openmc-data-storage/ENDF-B-... \n", + "... ... \n", + "1649 https://github.com/openmc-data-storage/ENDF-B-... \n", + "1689 https://github.com/openmc-data-storage/ENDF-B-... \n", + "1691 https://github.com/openmc-data-storage/ENDF-B-... \n", + "1692 https://github.com/openmc-data-storage/ENDF-B-... \n", + "1693 https://github.com/openmc-data-storage/ENDF-B-... \n", + "\n", + " local_file particle isotope element priority \n", + "1233 ENDFB-8.0-NNDC_H1.h5 neutron H1 H 1 \n", + "1234 ENDFB-8.0-NNDC_H2.h5 neutron H2 H 1 \n", + "1236 ENDFB-8.0-NNDC_He3.h5 neutron He3 He 1 \n", + "1237 ENDFB-8.0-NNDC_He4.h5 neutron He4 He 1 \n", + "1238 ENDFB-8.0-NNDC_Li6.h5 neutron Li6 Li 1 \n", + "... ... ... ... ... ... \n", + "1649 ENDFB-8.0-NNDC_W186.h5 neutron W186 W 1 \n", + "1689 ENDFB-8.0-NNDC_Pb204.h5 neutron Pb204 Pb 1 \n", + "1691 ENDFB-8.0-NNDC_Pb206.h5 neutron Pb206 Pb 1 \n", + "1692 ENDFB-8.0-NNDC_Pb207.h5 neutron Pb207 Pb 1 \n", + "1693 ENDFB-8.0-NNDC_Pb208.h5 neutron Pb208 Pb 1 \n", + "\n", + "[87 rows x 8 columns]\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_H1.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_H2.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_He3.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_He4.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Li6.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Li7.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Be9.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_B10.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_B11.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_C12.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_C13.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_N14.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_N15.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_O16.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_O17.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_O18.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_F19.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Na23.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mg24.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mg25.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mg26.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Al27.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Si28.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Si29.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Si30.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_P31.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_S32.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_S33.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_S34.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_S36.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Cl35.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Cl37.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ar36.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ar38.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ar40.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_K39.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_K40.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_K41.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ca40.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ca42.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ca43.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ca44.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ca46.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ca48.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ti46.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ti47.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ti48.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ti49.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ti50.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Cr50.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Cr52.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Cr53.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Cr54.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mn55.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Fe54.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Fe56.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Fe57.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Fe58.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Co59.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ni58.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ni60.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ni61.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ni62.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Ni64.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Cu63.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Cu65.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Zr90.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Zr91.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Zr92.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Zr94.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Zr96.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Nb93.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mo92.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mo94.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mo95.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mo96.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mo97.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mo98.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Mo100.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_W182.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_W183.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_W184.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_W186.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Pb204.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Pb206.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Pb207.h5, already downloaded\n", + "Skipping cross_sections/ENDFB-8.0-NNDC_Pb208.h5, already downloaded\n", + "written cross sections xml file to /home/remidm/baby-1L-run-4/analysis/neutron/cross_sections/cross_sections.xml\n", + "setting OPENMC_CROSS_SECTIONS to /home/remidm/baby-1L-run-4/analysis/neutron/cross_sections/cross_sections.xml\n" + ] + } + ], + "source": [ + "from openmc_model import baby_model, cllif_nat\n", + "\n", + "my_model = baby_model()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "for cell_id, cell in my_model.geometry.get_all_cells().items():\n", + " if cell.fill == cllif_nat:\n", + " salt_cell = cell\n", + " \n", + " cell.fill = None" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Surface\n", + " \tID =\t7\n", + " \tName =\t\n", + " \tType =\tz-plane\n", + " \tBoundary =\ttransmission\n", + " \tCoefficients \n", + " z0 =\t107.401,\n", + " Surface\n", + " \tID =\t8\n", + " \tName =\t\n", + " \tType =\tz-plane\n", + " \tBoundary =\ttransmission\n", + " \tCoefficients \n", + " z0 =\t113.91922,\n", + " Surface\n", + " \tID =\t16\n", + " \tName =\t\n", + " \tType =\tz-cylinder\n", + " \tBoundary =\ttransmission\n", + " \tCoefficients \n", + " x0 =\t587\n", + " y0 =\t60\n", + " r =\t7.0,\n", + " Surface\n", + " \tID =\t22\n", + " \tName =\t\n", + " \tType =\tz-cylinder\n", + " \tBoundary =\ttransmission\n", + " \tCoefficients \n", + " x0 =\t587\n", + " y0 =\t60\n", + " r =\t0.439,\n", + " Surface\n", + " \tID =\t23\n", + " \tName =\t\n", + " \tType =\tz-plane\n", + " \tBoundary =\ttransmission\n", + " \tCoefficients \n", + " z0 =\t108.279,\n", + " Surface\n", + " \tID =\t24\n", + " \tName =\t\n", + " \tType =\tz-plane\n", + " \tBoundary =\ttransmission\n", + " \tCoefficients \n", + " z0 =\t133.679]" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "salt_surfaces = list(salt_cell.region.get_surfaces().values())\n", + "\n", + "salt_surfaces" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "import openmc\n", + "\n", + "surf_filter = openmc.SurfaceFilter(salt_surfaces)\n", + "\n", + "cell_filter = openmc.CellFilter(salt_cell)\n", + "\n", + "all_cells = list(my_model.geometry.get_all_cells().values())\n", + "from_cell_filter = openmc.CellFromFilter([cell for cell in all_cells if cell != salt_cell]) \n", + "# from_cell_filter = openmc.CellFromFilter([salt_cell])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "tally = openmc.Tally(name=\"salt tally\")\n", + "tally.filters = [surf_filter, from_cell_filter, cell_filter]\n", + "tally.scores = [\"current\"]\n", + "\n", + "my_model.tallies = [tally]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "my_model.materials = []" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " %%%%%%%%%%%%%%%\n", + " %%%%%%%%%%%%%%%%%%%%%%%%\n", + " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", + " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", + " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", + " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", + " %%%%%%%%%%%%%%%%%%%%%%%%\n", + " %%%%%%%%%%%%%%%%%%%%%%%%\n", + " ############### %%%%%%%%%%%%%%%%%%%%%%%%\n", + " ################## %%%%%%%%%%%%%%%%%%%%%%%\n", + " ################### %%%%%%%%%%%%%%%%%%%%%%%\n", + " #################### %%%%%%%%%%%%%%%%%%%%%%\n", + " ##################### %%%%%%%%%%%%%%%%%%%%%\n", + " ###################### %%%%%%%%%%%%%%%%%%%%\n", + " ####################### %%%%%%%%%%%%%%%%%%\n", + " ####################### %%%%%%%%%%%%%%%%%\n", + " ###################### %%%%%%%%%%%%%%%%%\n", + " #################### %%%%%%%%%%%%%%%%%\n", + " ################# %%%%%%%%%%%%%%%%%\n", + " ############### %%%%%%%%%%%%%%%%\n", + " ############ %%%%%%%%%%%%%%%\n", + " ######## %%%%%%%%%%%%%%\n", + " %%%%%%%%%%%\n", + "\n", + " | The OpenMC Monte Carlo Code\n", + " Copyright | 2011-2025 MIT, UChicago Argonne LLC, and contributors\n", + " License | https://docs.openmc.org/en/latest/license.html\n", + " Version | 0.15.2\n", + " Commit Hash | e23760b0264c66fb7bb373aa0596801e5209d920\n", + " Date/Time | 2025-05-13 20:51:16\n", + " MPI Processes | 1\n", + " OpenMP Threads | 32\n", + "\n", + " Reading model XML file 'model.xml' ...\n", + " Reading cross sections XML file...\n", + " Minimum neutron data temperature: 1.7976931348623157e+308 K\n", + " Maximum neutron data temperature: 0 K\n", + " Preparing distributed cell instances...\n", + " Writing summary.h5 file...\n", + "\n", + " ===============> FIXED SOURCE TRANSPORT SIMULATION <===============\n", + "\n", + " Simulating batch 1\n", + " Simulating batch 2\n", + " Simulating batch 3\n", + " Simulating batch 4\n", + " Simulating batch 5\n", + " Simulating batch 6\n", + " Simulating batch 7\n", + " Simulating batch 8\n", + " Simulating batch 9\n", + " Simulating batch 10\n", + " Simulating batch 11\n", + " Simulating batch 12\n", + " Simulating batch 13\n", + " Simulating batch 14\n", + " Simulating batch 15\n", + " Simulating batch 16\n", + " Simulating batch 17\n", + " Simulating batch 18\n", + " Simulating batch 19\n", + " Simulating batch 20\n", + " Simulating batch 21\n", + " Simulating batch 22\n", + " Simulating batch 23\n", + " Simulating batch 24\n", + " Simulating batch 25\n", + " Simulating batch 26\n", + " Simulating batch 27\n", + " Simulating batch 28\n", + " Simulating batch 29\n", + " Simulating batch 30\n", + " Simulating batch 31\n", + " Simulating batch 32\n", + " Simulating batch 33\n", + " Simulating batch 34\n", + " Simulating batch 35\n", + " Simulating batch 36\n", + " Simulating batch 37\n", + " Simulating batch 38\n", + " Simulating batch 39\n", + " Simulating batch 40\n", + " Simulating batch 41\n", + " Simulating batch 42\n", + " Simulating batch 43\n", + " Simulating batch 44\n", + " Simulating batch 45\n", + " Simulating batch 46\n", + " Simulating batch 47\n", + " Simulating batch 48\n", + " Simulating batch 49\n", + " Simulating batch 50\n", + " Simulating batch 51\n", + " Simulating batch 52\n", + " Simulating batch 53\n", + " Simulating batch 54\n", + " Simulating batch 55\n", + " Simulating batch 56\n", + " Simulating batch 57\n", + " Simulating batch 58\n", + " Simulating batch 59\n", + " Simulating batch 60\n", + " Simulating batch 61\n", + " Simulating batch 62\n", + " Simulating batch 63\n", + " Simulating batch 64\n", + " Simulating batch 65\n", + " Simulating batch 66\n", + " Simulating batch 67\n", + " Simulating batch 68\n", + " Simulating batch 69\n", + " Simulating batch 70\n", + " Simulating batch 71\n", + " Simulating batch 72\n", + " Simulating batch 73\n", + " Simulating batch 74\n", + " Simulating batch 75\n", + " Simulating batch 76\n", + " Simulating batch 77\n", + " Simulating batch 78\n", + " Simulating batch 79\n", + " Simulating batch 80\n", + " Simulating batch 81\n", + " Simulating batch 82\n", + " Simulating batch 83\n", + " Simulating batch 84\n", + " Simulating batch 85\n", + " Simulating batch 86\n", + " Simulating batch 87\n", + " Simulating batch 88\n", + " Simulating batch 89\n", + " Simulating batch 90\n", + " Simulating batch 91\n", + " Simulating batch 92\n", + " Simulating batch 93\n", + " Simulating batch 94\n", + " Simulating batch 95\n", + " Simulating batch 96\n", + " Simulating batch 97\n", + " Simulating batch 98\n", + " Simulating batch 99\n", + " Simulating batch 100\n", + " Creating state point statepoint.100.h5...\n", + "\n", + " =======================> TIMING STATISTICS <=======================\n", + "\n", + " Total time for initialization = 7.1622e-02 seconds\n", + " Reading cross sections = 3.0352e-05 seconds\n", + " Total time in simulation = 2.2002e+01 seconds\n", + " Time in transport only = 2.1141e+01 seconds\n", + " Time in active batches = 2.2002e+01 seconds\n", + " Time accumulating tallies = 7.7813e-01 seconds\n", + " Time writing statepoints = 1.1754e-02 seconds\n", + " Total time for finalization = 1.2298e-05 seconds\n", + " Total time elapsed = 2.2073e+01 seconds\n", + " Calculation Rate (active) = 45451.3 particles/second\n", + "\n", + " ============================> RESULTS <============================\n", + "\n", + " Leakage Fraction = 1.00000 +/- 0.00000\n", + "\n" + ] + }, + { + "data": { + "text/plain": [ + "PosixPath('/home/remidm/baby-1L-run-4/analysis/neutron/statepoint.100.h5')" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_model.run()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Cell\n", + "\tID =\t7\n", + "\tName =\t\n", + "\tFill =\tNone\n", + "\tRegion =\t(7 -8 -16 (22 | -23 | 24))\n", + "\tRotation =\tNone\n", + "\tTranslation =\tNone\n", + "\tVolume =\tNone" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "salt_cell" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
surfacecellfromcellnuclidescoremeanstd. dev.
25797totalcurrent0.0615310.000223
13622117totalcurrent0.0001070.000011
\n", + "
" + ], + "text/plain": [ + " surface cellfrom cell nuclide score mean std. dev.\n", + "25 7 9 7 total current 0.061531 0.000223\n", + "136 22 11 7 total current 0.000107 0.000011" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sp = openmc.StatePoint(f\"statepoint.{my_model.settings.batches}.h5\")\n", + "tally = sp.get_tally(name=\"salt tally\").get_pandas_dataframe()\n", + "\n", + "# filter where mean is not zero\n", + "tally = tally[tally['mean'] != 0]\n", + "\n", + "tally" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Solid angle: 6.16% of the source neutrons enter the salt cell\n" + ] + } + ], + "source": [ + "print(f\"Solid angle: {tally['mean'].sum():.2%} of the source neutrons enter the salt cell\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Analytical" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Solid angle: 9.05e-01 sr\n" + ] + } + ], + "source": [ + "distance_between_source_and_salt = 107.401 - (94.365)\n", + "baby_diameter = 14 # cm\n", + "baby_radius = 0.5 * baby_diameter\n", + "salt_area = 3.14 * (baby_radius**2)\n", + "\n", + "solid_angle = salt_area/distance_between_source_and_salt**2\n", + "\n", + "print(f\"Solid angle: {solid_angle:.2e} sr\")" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Solid angle: 7.21% of 4pi sr\n" + ] + } + ], + "source": [ + "# to percentage\n", + "solid_angle_percentage = solid_angle / (4 * 3.14)\n", + "\n", + "print(f\"Solid angle: {solid_angle_percentage:.2%} of 4pi sr\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "baby-1l-run-4", + "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.12.10" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}