{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "q9Vo6HOQUQbS",
    "outputId": "020190f0-fec4-4a85-a716-2a98b03b3340"
   },
   "source": [
    "# A Sodium Fast Reactor geometry \n",
    "This notebook can be used as a template for modeling Sodium fast reactors.\n",
    "\n",
    "SOURCES:\n",
    "A. Facchini, V. Giusti, R. Ciolini, K. Tucek, D. Thomas, E. D'Agata, \"Detailed Neutornics Study of the Power Evolution for the European Sodium Fast Reactor During a Positive Insertion of Reactivity,\" Nuc. Eng. Design  313 1-9 (2017)\n",
    "A. Ponomarev, A. Bednarova, K. Mikityuk, \"New Sodium Fast Reactor Neutronics Benchmark,\" PHYSOR 2018"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "id": "EChOeJ7qVUB7"
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import openmc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "id": "jlu98MGXV9MP"
   },
   "outputs": [],
   "source": [
    "# Materials definitions\n",
    "\n",
    "u235 = openmc.Material(name='U235')\n",
    "u235.add_nuclide('U235', 1.0)\n",
    "u235.set_density('g/cm3', 10.0)\n",
    "\n",
    "u238 = openmc.Material(name='U238')\n",
    "u238.add_nuclide('U238', 1.0)\n",
    "u238.set_density('g/cm3', 10.0)\n",
    "\n",
    "pu238 = openmc.Material(name='Pu238')\n",
    "pu238.add_nuclide('Pu238', 1.0)\n",
    "pu238.set_density('g/cm3', 10.0)\n",
    "\n",
    "pu239 = openmc.Material(name='U235')\n",
    "pu239.add_nuclide('Pu239', 1.0)\n",
    "pu239.set_density('g/cm3', 10.0)\n",
    "\n",
    "pu240 = openmc.Material(name='Pu240')\n",
    "pu240.add_nuclide('Pu240', 1.0)\n",
    "pu240.set_density('g/cm3', 10.0)\n",
    "\n",
    "pu241 = openmc.Material(name='Pu241')\n",
    "pu241.add_nuclide('Pu241', 1.0)\n",
    "pu241.set_density('g/cm3', 10.0)\n",
    "\n",
    "pu242 = openmc.Material(name='Pu242')\n",
    "pu242.add_nuclide('Pu242', 1.0)\n",
    "pu242.set_density('g/cm3', 10.0)\n",
    "\n",
    "am241 = openmc.Material(name='Am241')\n",
    "am241.add_nuclide('Am241', 1.0)\n",
    "am241.set_density('g/cm3', 10.0)\n",
    "\n",
    "o16 = openmc.Material(name='O16')\n",
    "o16.add_nuclide('O16', 1.0)\n",
    "o16.set_density('g/cm3', 10.0)\n",
    "\n",
    "sodium = openmc.Material(name='Na')\n",
    "sodium.add_nuclide('Na23', 1.0)\n",
    "sodium.set_density('g/cm3', 0.96)\n",
    "\n",
    "cu63 = openmc.Material(name='Cu63')\n",
    "cu63.set_density('g/cm3', 10.0)\n",
    "cu63.add_nuclide('Cu63', 1.0)\n",
    "\n",
    "Al2O3 = openmc.Material(name='Al2O3')\n",
    "Al2O3.set_density('g/cm3', 10.0)\n",
    "Al2O3.add_element('O', 3.0)\n",
    "Al2O3.add_element('Al', 2.0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "id": "_ltK5VzGZ8kk"
   },
   "outputs": [],
   "source": [
    "# Material mixtures\n",
    "inner = openmc.Material.mix_materials(\n",
    "    [u235, u238, pu238, pu239, pu240, pu241, pu242, am241, o16],\n",
    "    [0.0019, 0.7509, 0.0046, 0.0612, 0.0383, 0.0106, 0.0134, 0.001, 0.1181],\n",
    "    'wo')\n",
    "outer = openmc.Material.mix_materials(\n",
    "    [u235, u238, pu238, pu239, pu240, pu241, pu242, am241, o16],\n",
    "    [0.0018, 0.73, 0.0053, 0.0711, 0.0445, 0.0124, 0.0156, 0.0017, 0.1176],\n",
    "    'wo')\n",
    "clad = openmc.Material.mix_materials(\n",
    "    [cu63,Al2O3], [0.997,0.003], 'wo')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "id": "A2kNKaErZ7JR"
   },
   "outputs": [],
   "source": [
    "# Instantiate a Materials collection and export to xml\n",
    "materials_file = openmc.Materials([inner, outer, sodium, clad])\n",
    "materials_file.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "id": "OrML6oju4spK"
   },
   "outputs": [],
   "source": [
    "# Geometry definitions\n",
    "\n",
    "fuel_or = openmc.ZCylinder(surface_id=1, r=0.943/2)\n",
    "clad_ir = openmc.ZCylinder(surface_id=2, r=0.973/2)\n",
    "clad_or = openmc.ZCylinder(surface_id=3, r=1.073/2)\n",
    "\n",
    "top = openmc.ZPlane(surface_id=4, z0=+50, boundary_type='vacuum')\n",
    "bottom = openmc.ZPlane(surface_id=5, z0=-50, boundary_type='vacuum')\n",
    "\n",
    "fuel_region = -fuel_or & -top & +bottom\n",
    "gap_region  = +fuel_or & -clad_ir  & -top & +bottom\n",
    "clad_region = +clad_ir & -clad_or  & -top & +bottom\n",
    "moderator_region = +clad_or & -top & +bottom\n",
    "\n",
    "gap_cell = openmc.Cell(cell_id=1, fill=inner, region=gap_region)\n",
    "clad_cell = openmc.Cell(cell_id=2, fill=clad, region=clad_region)\n",
    "sodium_cell = openmc.Cell(cell_id=3, fill=sodium, region=moderator_region)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "id": "8L0zqqhZfxKh"
   },
   "outputs": [],
   "source": [
    "inner_fuel_cell = openmc.Cell(cell_id=4, fill=inner, region=fuel_region)\n",
    "inner_u = openmc.Universe(universe_id=1, cells=(inner_fuel_cell, gap_cell, clad_cell, sodium_cell))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "id": "iAHLhKZYh6y5"
   },
   "outputs": [],
   "source": [
    "outer_fuel_cell = openmc.Cell(cell_id=5, fill=outer, region=fuel_region)\n",
    "outer_u = openmc.Universe(universe_id=2, cells=(outer_fuel_cell, gap_cell, clad_cell, sodium_cell))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Creating filling for emtpy space in the core\n",
    "\n",
    "sodium_mod_cell = openmc.Cell(cell_id=6, fill=sodium)\n",
    "sodium_mod_u = openmc.Universe(universe_id=3, cells=(sodium_mod_cell,))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "id": "cWTxCkwKRwYj"
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/aparler/.conda/envs/openmc-env/lib/python3.11/site-packages/openmc/mixin.py:70: IDWarning: Another Lattice instance already exists with id=1.\n",
      "  warn(msg, IDWarning)\n"
     ]
    }
   ],
   "source": [
    "# Define a lattice for inner assemblies\n",
    "in_lat = openmc.HexLattice(lattice_id=1, name='inner assembly')\n",
    "in_lat.center = (0., 0.)\n",
    "in_lat.pitch = (21.08/17,)\n",
    "in_lat.orientation = 'x'\n",
    "in_lat.outer = sodium_mod_u\n",
    "\n",
    "# Create rings of fuel universes that will fill the lattice\n",
    "inone = [inner_u]*48\n",
    "intwo = [inner_u]*42\n",
    "inthree = [inner_u]*36\n",
    "infour = [inner_u]*30\n",
    "infive = [inner_u]*24\n",
    "insix = [inner_u]*18\n",
    "inseven = [inner_u]*12\n",
    "ineight = [inner_u]*6\n",
    "innine = [inner_u]*1\n",
    "in_lat.universes = [inone,intwo,inthree,infour,infive,insix,inseven,ineight,innine]\n",
    "\n",
    "# Create the prism that will contain the lattice\n",
    "outer_in_surface = openmc.model.hexagonal_prism(edge_length=12.1705, orientation='x')\n",
    "\n",
    "# Fill a cell with the lattice. This cell is filled with the lattice and contained within the prism.\n",
    "main_in_assembly = openmc.Cell(cell_id=7, fill=in_lat, region=outer_in_surface & -top & +bottom)\n",
    "\n",
    "# Fill a cell with a material that will surround the lattice\n",
    "out_in_assembly  = openmc.Cell(cell_id=8, fill=sodium, region=~outer_in_surface & -top & +bottom)\n",
    "\n",
    "# Create a universe that contains both\n",
    "main_in_u = openmc.Universe(universe_id=4, cells=[main_in_assembly, out_in_assembly])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f53cd4e1750>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 10528 characters]",
      "text/plain": [
       "<Figure size 645.161x649.351 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "main_in_u.plot(origin = (0,0,0), pixels=(500, 500), width = (30.,30.), color_by = 'material')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "id": "1SIgRmjLTuPJ"
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/aparler/.conda/envs/openmc-env/lib/python3.11/site-packages/openmc/mixin.py:70: IDWarning: Another Lattice instance already exists with id=2.\n",
      "  warn(msg, IDWarning)\n"
     ]
    }
   ],
   "source": [
    "# Define a lattice for outer assemblies\n",
    "out_lat = openmc.HexLattice(lattice_id=2, name='outer assembly')\n",
    "out_lat.center = (0., 0.)\n",
    "out_lat.pitch = (21.08/17,)\n",
    "out_lat.orientation = 'x'\n",
    "out_lat.outer = sodium_mod_u\n",
    "\n",
    "# Create rings of fuel universes that will fill the lattice\n",
    "outone = [outer_u]*48\n",
    "outtwo = [outer_u]*42\n",
    "outthree = [outer_u]*36\n",
    "outfour = [outer_u]*30\n",
    "outfive = [outer_u]*24\n",
    "outsix = [outer_u]*18\n",
    "outseven = [outer_u]*12\n",
    "outeight = [outer_u]*6\n",
    "outnine = [outer_u]*1\n",
    "out_lat.universes = [outone,outtwo,outthree,outfour,outfive,outsix,outseven,outeight,outnine]\n",
    "\n",
    "# Create the prism that will contain the lattice\n",
    "outer_out_surface = openmc.model.hexagonal_prism(edge_length=12.1705)\n",
    "\n",
    "# Fill a cell with the lattice. This cell is filled with the lattice and contained within the prism.\n",
    "main_out_assembly = openmc.Cell(cell_id=9, fill=out_lat, region=outer_out_surface & -top & +bottom)\n",
    "\n",
    "# Fill a cell with a material that will surround the lattice\n",
    "out_out_assembly  = openmc.Cell(cell_id=10, fill=sodium,  region=~outer_out_surface & -top & +bottom)\n",
    "\n",
    "# Create a universe that contains both\n",
    "main_out_u = openmc.Universe(universe_id=5, cells=[main_out_assembly, out_out_assembly])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 283
    },
    "id": "pDf5K0t-eYRM",
    "outputId": "97396467-3a79-41bb-e9bd-8d4ff43369cf"
   },
   "outputs": [],
   "source": [
    "# Create a hexagonal water cell\n",
    "\n",
    "reflector_assembly = openmc.model.hexagonal_prism(edge_length=12.1705, orientation='x')\n",
    "ref_cell = openmc.Cell(cell_id=11, fill=sodium, region=reflector_assembly & -top & +bottom)\n",
    "out_ref_cell  = openmc.Cell(cell_id=12, fill=sodium, region=~reflector_assembly & -top & +bottom)\n",
    "ref_u = openmc.Universe(universe_id=6, cells=[ref_cell, out_ref_cell])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We have 3 types of assemblies created. We can now make the entire reactor core by creating a lattice that is filled with the assemblies. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "id": "6lDqg4lLWD7v"
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/aparler/.conda/envs/openmc-env/lib/python3.11/site-packages/openmc/mixin.py:70: IDWarning: Another Lattice instance already exists with id=3.\n",
      "  warn(msg, IDWarning)\n"
     ]
    }
   ],
   "source": [
    "# Define the core lattice\n",
    "\n",
    "core_lat = openmc.HexLattice(lattice_id=3, name='core')\n",
    "core_lat.center = (0., 0.)\n",
    "core_lat.pitch = (21.08,)\n",
    "core_lat.outer = sodium_mod_u"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "id": "M1FcPGAbjH3J"
   },
   "outputs": [],
   "source": [
    "# Create rings of fuel universes that will fill the lattice\n",
    "ref_one = [ref_u] * 96\n",
    "ref_two = [ref_u] * 90\n",
    "ref_three = [ref_u] * 84\n",
    "ref_four = ([ref_u] * 5 + [main_out_u] * 4 + [ref_u] * 4) * 6\n",
    "ref_five = ([ref_u] + [main_out_u] * 11) * 6\n",
    "out_one = [main_out_u]*66\n",
    "out_two = [main_out_u]*60\n",
    "out_three = ([main_out_u]*2 + [main_in_u]*6 + [main_out_u] * 1)*6\n",
    "in_one = [main_in_u]*48\n",
    "in_two = [main_in_u]*42\n",
    "in_three = [main_in_u]*36\n",
    "in_four = [main_in_u]*30\n",
    "in_five = [main_in_u]*24\n",
    "in_six = [main_in_u]*18\n",
    "in_seven = [main_in_u]*12\n",
    "in_eight = [main_in_u]*6\n",
    "in_nine = [main_in_u]*1\n",
    "core_lat.universes = [ref_one,ref_two,ref_three,ref_four,ref_five,out_one,out_two,out_three,in_one,in_two,in_three,in_four,in_five,in_six,in_seven,in_eight,in_nine]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 283
    },
    "id": "nzVEvJgpjyY2",
    "outputId": "3f678f02-4a6c-4768-dc46-419ad37019a0",
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# Create the prism that will contain the lattice\n",
    "outer_core_surface = openmc.model.hexagonal_prism(edge_length=347.82, boundary_type='vacuum')\n",
    "\n",
    "# Fill a cell with the lattice. This cell is filled with the lattice and contained within the prism.\n",
    "core = openmc.Cell(cell_id=13, fill=core_lat, region=outer_core_surface & -top & +bottom)\n",
    "\n",
    "# Fill a cell with a material that will surround the lattice\n",
    "out_core = openmc.Cell(cell_id=14, fill=outer, region=~outer_core_surface & -top & +bottom)\n",
    "\n",
    "# Create a universe that contains both\n",
    "main_u = openmc.Universe(universe_id=7, cells=[core, out_core])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f53cd351750>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 24416 characters]",
      "text/plain": [
       "<Figure size 1290.32x1298.7 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "main_u.plot(origin = (0,0,0), pixels=(1000, 1000), width = (660.,660.), color_by = 'material')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We now have an entire reactor core defined! We can export the geometry and run the code. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "geom = openmc.Geometry(main_u)\n",
    "geom.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "5mPhUg7QWVw4",
    "outputId": "f110f4ab-94b5-477b-8c55-cab8ed7c3116"
   },
   "outputs": [],
   "source": [
    "# OpenMC simulation parameters\n",
    "\n",
    "lower_left = [-300, -300, -50]\n",
    "upper_right = [300, 300, 50]\n",
    "uniform_dist = openmc.stats.Box(lower_left, upper_right, only_fissionable=True)\n",
    "src = openmc.IndependentSource(space=uniform_dist)\n",
    "\n",
    "settings = openmc.Settings()\n",
    "settings.source = src\n",
    "settings.batches = 100\n",
    "settings.inactive = 10\n",
    "settings.particles = 1000\n",
    "\n",
    "settings.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000
    },
    "id": "A_f292ebWZFM",
    "outputId": "d6710d6c-aea6-43c9-e63c-b2e62ea7ea08"
   },
   "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-2023 MIT, UChicago Argonne LLC, and contributors\n",
      "         License | https://docs.openmc.org/en/latest/license.html\n",
      "         Version | 0.13.3\n",
      "        Git SHA1 | 50e39a4e20dc9e0f3d7ccf07333f6a5e6c797c8c\n",
      "       Date/Time | 2023-10-31 23:03:13\n",
      "  OpenMP Threads | 4\n",
      "\n",
      " Reading settings XML file...\n",
      " Reading cross sections XML file...\n",
      " Reading materials XML file...\n",
      " Reading geometry XML file...\n",
      " Reading Na23 from /opt/xdata/endfb-vii.1-hdf5/neutron/Na23.h5\n",
      " Reading U235 from /opt/xdata/endfb-vii.1-hdf5/neutron/U235.h5\n",
      " Reading U238 from /opt/xdata/endfb-vii.1-hdf5/neutron/U238.h5\n",
      " Reading Pu238 from /opt/xdata/endfb-vii.1-hdf5/neutron/Pu238.h5\n",
      " Reading Pu239 from /opt/xdata/endfb-vii.1-hdf5/neutron/Pu239.h5\n",
      " Reading Pu240 from /opt/xdata/endfb-vii.1-hdf5/neutron/Pu240.h5\n",
      " Reading Pu241 from /opt/xdata/endfb-vii.1-hdf5/neutron/Pu241.h5\n",
      " Reading Pu242 from /opt/xdata/endfb-vii.1-hdf5/neutron/Pu242.h5\n",
      " Reading Am241 from /opt/xdata/endfb-vii.1-hdf5/neutron/Am241.h5\n",
      " Reading O16 from /opt/xdata/endfb-vii.1-hdf5/neutron/O16.h5\n",
      " Reading Cu63 from /opt/xdata/endfb-vii.1-hdf5/neutron/Cu63.h5\n",
      " Reading O17 from /opt/xdata/endfb-vii.1-hdf5/neutron/O17.h5\n",
      " Reading Al27 from /opt/xdata/endfb-vii.1-hdf5/neutron/Al27.h5\n",
      " Minimum neutron data temperature: 294 K\n",
      " Maximum neutron data temperature: 294 K\n",
      " Preparing distributed cell instances...\n",
      " Reading plot XML file...\n",
      " Writing summary.h5 file...\n",
      " Maximum neutron transport energy: 20000000 eV for Na23\n",
      " Initializing source particles...\n",
      "\n",
      " ====================>     K EIGENVALUE SIMULATION     <====================\n",
      "\n",
      "  Bat./Gen.      k            Average k\n",
      "  =========   ========   ====================\n",
      "        1/1    1.04699\n",
      "        2/1    1.12523\n",
      "        3/1    1.17382\n",
      "        4/1    1.16683\n",
      "        5/1    1.18119\n",
      "        6/1    1.13185\n",
      "        7/1    1.24435\n",
      "        8/1    1.23315\n",
      "        9/1    1.24378\n",
      "       10/1    1.20888\n",
      "       11/1    1.22414\n",
      "       12/1    1.32255    1.27335 +/- 0.04921\n",
      "       13/1    1.24438    1.26369 +/- 0.03000\n",
      "       14/1    1.25849    1.26239 +/- 0.02126\n",
      "       15/1    1.28094    1.26610 +/- 0.01688\n",
      "       16/1    1.28031    1.26847 +/- 0.01398\n",
      "       17/1    1.23444    1.26361 +/- 0.01278\n",
      "       18/1    1.29480    1.26751 +/- 0.01173\n",
      "       19/1    1.26095    1.26678 +/- 0.01037\n",
      "       20/1    1.26231    1.26633 +/- 0.00929\n",
      "       21/1    1.26926    1.26660 +/- 0.00841\n",
      "       22/1    1.20316    1.26131 +/- 0.00932\n",
      "       23/1    1.22121    1.25823 +/- 0.00911\n",
      "       24/1    1.20218    1.25423 +/- 0.00934\n",
      "       25/1    1.22391    1.25220 +/- 0.00892\n",
      "       26/1    1.25396    1.25231 +/- 0.00835\n",
      "       27/1    1.28043    1.25397 +/- 0.00801\n",
      "       28/1    1.22878    1.25257 +/- 0.00768\n",
      "       29/1    1.22032    1.25087 +/- 0.00746\n",
      "       30/1    1.24110    1.25038 +/- 0.00710\n",
      "       31/1    1.29465    1.25249 +/- 0.00707\n",
      "       32/1    1.28911    1.25416 +/- 0.00695\n",
      "       33/1    1.24766    1.25387 +/- 0.00664\n",
      "       34/1    1.26931    1.25452 +/- 0.00639\n",
      "       35/1    1.23518    1.25374 +/- 0.00618\n",
      "       36/1    1.22691    1.25271 +/- 0.00603\n",
      "       37/1    1.27089    1.25338 +/- 0.00584\n",
      "       38/1    1.26381    1.25376 +/- 0.00564\n",
      "       39/1    1.26946    1.25430 +/- 0.00547\n",
      "       40/1    1.29565    1.25568 +/- 0.00546\n",
      "       41/1    1.30199    1.25717 +/- 0.00549\n",
      "       42/1    1.29832    1.25846 +/- 0.00547\n",
      "       43/1    1.30429    1.25985 +/- 0.00548\n",
      "       44/1    1.23412    1.25909 +/- 0.00537\n",
      "       45/1    1.19238    1.25718 +/- 0.00555\n",
      "       46/1    1.26488    1.25740 +/- 0.00540\n",
      "       47/1    1.20769    1.25605 +/- 0.00542\n",
      "       48/1    1.27040    1.25643 +/- 0.00529\n",
      "       49/1    1.26829    1.25673 +/- 0.00516\n",
      "       50/1    1.26095    1.25684 +/- 0.00503\n",
      "       51/1    1.26016    1.25692 +/- 0.00491\n",
      "       52/1    1.29856    1.25791 +/- 0.00489\n",
      "       53/1    1.22021    1.25704 +/- 0.00485\n",
      "       54/1    1.24146    1.25668 +/- 0.00476\n",
      "       55/1    1.31027    1.25787 +/- 0.00480\n",
      "       56/1    1.33790    1.25961 +/- 0.00501\n",
      "       57/1    1.32021    1.26090 +/- 0.00506\n",
      "       58/1    1.27750    1.26125 +/- 0.00497\n",
      "       59/1    1.25761    1.26117 +/- 0.00487\n",
      "       60/1    1.22570    1.26046 +/- 0.00482\n",
      "       61/1    1.19148    1.25911 +/- 0.00492\n",
      "       62/1    1.22782    1.25851 +/- 0.00486\n",
      "       63/1    1.28075    1.25893 +/- 0.00478\n",
      "       64/1    1.26974    1.25913 +/- 0.00470\n",
      "       65/1    1.24164    1.25881 +/- 0.00462\n",
      "       66/1    1.21168    1.25797 +/- 0.00462\n",
      "       67/1    1.34108    1.25943 +/- 0.00476\n",
      "       68/1    1.28362    1.25984 +/- 0.00470\n",
      "       69/1    1.24096    1.25952 +/- 0.00463\n",
      "       70/1    1.19983    1.25853 +/- 0.00466\n",
      "       71/1    1.19210    1.25744 +/- 0.00471\n",
      "       72/1    1.29086    1.25798 +/- 0.00467\n",
      "       73/1    1.22653    1.25748 +/- 0.00462\n",
      "       74/1    1.28594    1.25793 +/- 0.00457\n",
      "       75/1    1.26671    1.25806 +/- 0.00450\n",
      "       76/1    1.22778    1.25760 +/- 0.00445\n",
      "       77/1    1.29830    1.25821 +/- 0.00443\n",
      "       78/1    1.26676    1.25833 +/- 0.00436\n",
      "       79/1    1.34382    1.25957 +/- 0.00448\n",
      "       80/1    1.34639    1.26081 +/- 0.00458\n",
      "       81/1    1.24390    1.26058 +/- 0.00452\n",
      "       82/1    1.23100    1.26016 +/- 0.00448\n",
      "       83/1    1.25639    1.26011 +/- 0.00442\n",
      "       84/1    1.27107    1.26026 +/- 0.00436\n",
      "       85/1    1.23460    1.25992 +/- 0.00432\n",
      "       86/1    1.25413    1.25984 +/- 0.00426\n",
      "       87/1    1.26993    1.25997 +/- 0.00421\n",
      "       88/1    1.30799    1.26059 +/- 0.00420\n",
      "       89/1    1.29570    1.26103 +/- 0.00417\n",
      "       90/1    1.23098    1.26066 +/- 0.00413\n",
      "       91/1    1.24434    1.26046 +/- 0.00408\n",
      "       92/1    1.21353    1.25988 +/- 0.00408\n",
      "       93/1    1.23516    1.25959 +/- 0.00404\n",
      "       94/1    1.26028    1.25959 +/- 0.00399\n",
      "       95/1    1.24533    1.25943 +/- 0.00394\n",
      "       96/1    1.24886    1.25930 +/- 0.00390\n",
      "       97/1    1.22476    1.25891 +/- 0.00388\n",
      "       98/1    1.24816    1.25878 +/- 0.00383\n",
      "       99/1    1.29129    1.25915 +/- 0.00381\n",
      "      100/1    1.18933    1.25837 +/- 0.00384\n",
      " Creating state point statepoint.100.h5...\n",
      "\n",
      " =======================>     TIMING STATISTICS     <=======================\n",
      "\n",
      " Total time for initialization     = 1.3231e+00 seconds\n",
      "   Reading cross sections          = 1.2915e+00 seconds\n",
      " Total time in simulation          = 1.9764e+00 seconds\n",
      "   Time in transport only          = 1.9524e+00 seconds\n",
      "   Time in inactive batches        = 1.8251e-01 seconds\n",
      "   Time in active batches          = 1.7939e+00 seconds\n",
      "   Time synchronizing fission bank = 8.0367e-03 seconds\n",
      "     Sampling source sites         = 7.1113e-03 seconds\n",
      "     SEND/RECV source sites        = 8.7842e-04 seconds\n",
      "   Time accumulating tallies       = 4.3793e-05 seconds\n",
      "   Time writing statepoints        = 3.8865e-03 seconds\n",
      " Total time for finalization       = 5.4700e-07 seconds\n",
      " Total time elapsed                = 3.3079e+00 seconds\n",
      " Calculation Rate (inactive)       = 54792.6 particles/second\n",
      " Calculation Rate (active)         = 50169.6 particles/second\n",
      "\n",
      " ============================>     RESULTS     <============================\n",
      "\n",
      " k-effective (Collision)     = 1.26011 +/- 0.00343\n",
      " k-effective (Track-length)  = 1.25837 +/- 0.00384\n",
      " k-effective (Absorption)    = 1.26192 +/- 0.00372\n",
      " Combined k-effective        = 1.26163 +/- 0.00219\n",
      " Leakage Fraction            = 0.11733 +/- 0.00149\n",
      "\n"
     ]
    }
   ],
   "source": [
    "openmc.run()"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "collapsed_sections": [],
   "name": "FastReactor_3layers.ipynb",
   "provenance": []
  },
  "kernelspec": {
   "display_name": "openmc-env",
   "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.11.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
