{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "q9Vo6HOQUQbS",
    "outputId": "a8c1843c-272d-461a-faf3-4b78fdbced3b"
   },
   "source": [
    "# A TRIGA geometry \n",
    "This notebook can be used as a template for modeling TRIGA reactors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "id": "EChOeJ7qVUB7"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import openmc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "id": "jlu98MGXV9MP"
   },
   "outputs": [],
   "source": [
    "# Materials definitions\n",
    "\n",
    "# Borated water\n",
    "water = openmc.Material(name='Borated Water')\n",
    "water.set_density('g/cm3', 0.740582)\n",
    "water.add_nuclide('H1', 4.9457e-2)\n",
    "water.add_nuclide('O16', 2.4732e-2)\n",
    "water.add_nuclide('B10', 8.0042e-6)\n",
    "\n",
    "# 20% enriched uranium zirconium hydride fuel\n",
    "uzrh = openmc.Material(name='UZrH')\n",
    "uzrh.set_density('g/cm3', 6.128)\n",
    "uzrh.add_nuclide('U235', .02376, 'wo')\n",
    "uzrh.add_nuclide('U238', .09619, 'wo')\n",
    "uzrh.add_element('H', .03, 'wo')\n",
    "uzrh.add_element('Zr', .85, 'wo')\n",
    "\n",
    "molybdenum = openmc.Material(name='Molybdenum')\n",
    "molybdenum.add_element('Mo', 1.0)\n",
    "molybdenum.set_density('g/cm3', 10.22)\n",
    "\n",
    "graphite = openmc.Material(name='Graphite')\n",
    "graphite.set_density('g/cm3', 1.70)\n",
    "graphite.add_element('C', 1.0)\n",
    "graphite.add_s_alpha_beta('c_Graphite')\n",
    "\n",
    "# Stainless steel\n",
    "ss304 = openmc.Material(name='Stainless Steel 304')\n",
    "ss304.set_density('g/cm3', 8.0)\n",
    "ss304.add_element('C',.002,'wo')\n",
    "ss304.add_element('Si',.004,'wo')\n",
    "ss304.add_element('P',.0003,'wo')\n",
    "ss304.add_element('S',.0002,'wo')\n",
    "ss304.add_element('V',.003,'wo')\n",
    "ss304.add_element('Cr',.115,'wo')\n",
    "ss304.add_element('Mn',.006,'wo')\n",
    "ss304.add_element('Fe',.8495,'wo')\n",
    "ss304.add_element('Ni',.005,'wo')\n",
    "ss304.add_element('Mo',.01,'wo')\n",
    "ss304.add_element('W',.005,'wo')\n",
    "\n",
    "# Boron carbide\n",
    "b4c = openmc.Material(name='Boron Carbide')\n",
    "b4c.set_density('g/cm3', 2.52)\n",
    "b4c.add_element('B', 4)\n",
    "b4c.add_element('C', 1)\n",
    "\n",
    "zirconium = openmc.Material(name='Zirconium')\n",
    "zirconium.add_element('Zr', 1.0)\n",
    "zirconium.set_density('g/cm3', 6.506)\n",
    "\n",
    "void = openmc.Material(name='Void')\n",
    "void.set_density('g/cm3', 0.001205)\n",
    "void.add_element('Ni', 0.755268, 'wo')\n",
    "void.add_element('C', 0.000124, 'wo')\n",
    "void.add_element('O', 0.231781, 'wo')\n",
    "void.add_element('Ar', 0.012827, 'wo')\n",
    "\n",
    "aluminum = openmc.Material(name='Aluminum')\n",
    "aluminum.add_element('Al', 1.0)\n",
    "aluminum.set_density('g/cm3', 2.6)\n",
    "\n",
    "# Instantiate a Materials collection and export to xml\n",
    "materials_file = openmc.Materials([aluminum, zirconium, b4c, ss304, graphite, molybdenum, uzrh, water, void])\n",
    "materials_file.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "id": "6lDqg4lLWD7v"
   },
   "outputs": [],
   "source": [
    "# Geometry definitions for the fuel rod\n",
    "\n",
    "rod_outer_radius = openmc.ZCylinder(r=0.635)\n",
    "uzrh_outer_radius = openmc.ZCylinder(r=3.6449)\n",
    "molybdenum_outer_radius = openmc.ZCylinder(r=3.6449)\n",
    "graphite_outer_radius = openmc.ZCylinder(r=3.6449)\n",
    "ss304_outer_radius = openmc.ZCylinder(r=3.6449)\n",
    "clad_outer_radius = openmc.ZCylinder(r=3.75412)\n",
    "\n",
    "empty_space_min = openmc.ZPlane(z0=-114.3)\n",
    "empty_space_max = openmc.ZPlane(z0=-55.079265)\n",
    "rod_min = openmc.ZPlane(z0=-55.079265)\n",
    "rod_max = openmc.ZPlane(z0=-16.979265)\n",
    "uzrh_min = openmc.ZPlane(z0=-55.079265)\n",
    "uzrh_max = openmc.ZPlane(z0=-16.979265)\n",
    "molybdenum_min = openmc.ZPlane(z0=-55.15864)\n",
    "molybdenum_max = openmc.ZPlane(z0=-55.079265)\n",
    "graphite_upper_min = openmc.ZPlane(z0=-16.979265)\n",
    "graphite_upper_max = openmc.ZPlane(z0=-10.375265)\n",
    "graphite_lower_min = openmc.ZPlane(z0=-64.621664)\n",
    "graphite_lower_max = openmc.ZPlane(z0=-55.15864)\n",
    "ss304_upper_min = openmc.ZPlane(z0=-10.375265)\n",
    "ss304_upper_max = openmc.ZPlane(z0=+0)\n",
    "ss304_lower_min = openmc.ZPlane(z0=-72.0598)\n",
    "ss304_lower_max = openmc.ZPlane(z0=-64.621664)\n",
    "clad_min = openmc.ZPlane(z0=-72.0598)\n",
    "clad_max = openmc.ZPlane(z0=0)\n",
    "\n",
    "# Create a Universe to encapsulate the fuel rod\n",
    "fuel_universe = openmc.Universe(name='UZrH Fuel Universe')\n",
    "\n",
    "# Create rod cell\n",
    "rod_cell = openmc.Cell(name='Zr Rod')\n",
    "rod_cell.fill = zirconium\n",
    "rod_cell.region = -rod_outer_radius & +rod_min & -rod_max\n",
    "fuel_universe.add_cell(rod_cell)\n",
    "\n",
    "# Create uzrh cell\n",
    "uzrh_cell = openmc.Cell(name='UZrH')\n",
    "uzrh_cell.fill = uzrh\n",
    "uzrh_cell.region = +rod_outer_radius & -uzrh_outer_radius & +uzrh_min & -uzrh_max\n",
    "fuel_universe.add_cell(uzrh_cell)\n",
    "\n",
    "# Create molybdenum disk\n",
    "molybdenum_cell = openmc.Cell(name='Molybdenum')\n",
    "molybdenum_cell.fill = molybdenum\n",
    "molybdenum_cell.region = -molybdenum_outer_radius & +molybdenum_min & -molybdenum_max\n",
    "fuel_universe.add_cell(molybdenum_cell)\n",
    "\n",
    "# Create upper graphite cell\n",
    "graphite_upper_cell = openmc.Cell(name='Upper Graphite')\n",
    "graphite_upper_cell.fill = graphite\n",
    "graphite_upper_cell.region = -graphite_outer_radius & +graphite_upper_min & -graphite_upper_max\n",
    "fuel_universe.add_cell(graphite_upper_cell)\n",
    "\n",
    "# Create lower graphite cell\n",
    "graphite_lower_cell = openmc.Cell(name='Lower Graphite')\n",
    "graphite_lower_cell.fill = graphite\n",
    "graphite_lower_cell.region = -graphite_outer_radius & +graphite_lower_min & -graphite_lower_max\n",
    "fuel_universe.add_cell(graphite_lower_cell)\n",
    "\n",
    "# Create upper ss304 cell\n",
    "ss304_upper_cell = openmc.Cell(name='Upper Stainless Steel 304')\n",
    "ss304_upper_cell.fill = ss304\n",
    "ss304_upper_cell.region = -ss304_outer_radius & +ss304_upper_min & -ss304_upper_max\n",
    "fuel_universe.add_cell(ss304_upper_cell)\n",
    "\n",
    "# Create lower ss304 cell\n",
    "ss304_lower_cell = openmc.Cell(name='Lower Stainless Steel 304')\n",
    "ss304_lower_cell.fill = ss304\n",
    "ss304_lower_cell.region = -ss304_outer_radius & +ss304_lower_min & -ss304_lower_max\n",
    "fuel_universe.add_cell(ss304_lower_cell)\n",
    "\n",
    "# Create clad cell\n",
    "clad_cell = openmc.Cell(name='Stainless Steel 304 Cladding')\n",
    "clad_cell.fill = ss304\n",
    "clad_cell.region = -clad_outer_radius & +ss304_outer_radius & +clad_min & -clad_max\n",
    "fuel_universe.add_cell(clad_cell)\n",
    "\n",
    "# Create empty space cell\n",
    "empty_space_cell = openmc.Cell(name='Empty space before fuel rod')\n",
    "empty_space_cell.fill = water\n",
    "empty_space_cell.region = -clad_outer_radius & +empty_space_min & -empty_space_max\n",
    "fuel_universe.add_cell(empty_space_cell)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "id": "osv05TS3yNUT"
   },
   "outputs": [],
   "source": [
    "# Geometry definitions for the transient rod\n",
    "\n",
    "void_outer_radius = openmc.ZCylinder(r=3.03276)\n",
    "b4c_outer_radius = openmc.ZCylinder(r=3.03276)\n",
    "clad_outer_radius = openmc.ZCylinder(r=3.38455)\n",
    "aluminum_outer_radius = openmc.ZCylinder(r=3.03276)\n",
    "\n",
    "aluminum_1_min = openmc.ZPlane(z0=-114.3)\n",
    "aluminum_1_max = openmc.ZPlane(z0=-113.03)\n",
    "void_1_min = openmc.ZPlane(z0=-113.03)\n",
    "void_1_max = openmc.ZPlane(z0=-57.785)\n",
    "aluminum_2_min = openmc.ZPlane(z0=-57.785)\n",
    "aluminum_2_max = openmc.ZPlane(z0=-56.515)\n",
    "b4c_min = openmc.ZPlane(z0=-56.515)\n",
    "b4c_max = openmc.ZPlane(z0=-18.415)\n",
    "void_2_min = openmc.ZPlane(z0=-18.415)\n",
    "void_2_max = openmc.ZPlane(z0=-18.0975)\n",
    "aluminum_3_min = openmc.ZPlane(z0=-18.0975)\n",
    "aluminum_3_max = openmc.ZPlane(z0=-16.8275)\n",
    "void_3_min = openmc.ZPlane(z0=-16.8275)\n",
    "void_3_max = openmc.ZPlane(z0=-7.3025)\n",
    "aluminum_4_min = openmc.ZPlane(z0=-7.3025)\n",
    "aluminum_4_max = openmc.ZPlane(z0=0)\n",
    "clad_min = openmc.ZPlane(z0=-114.3)\n",
    "clad_max = openmc.ZPlane(z0=0)\n",
    "\n",
    "# Create a Universe to encapsulate the transient rod\n",
    "transient_universe = openmc.Universe(name='Transient Universe')\n",
    "\n",
    "# Create void 1 cell\n",
    "void_1_cell = openmc.Cell(name= 'Void 1')\n",
    "void_1_cell.fill = void\n",
    "void_1_cell.region = -void_outer_radius & +void_1_min & -void_1_max\n",
    "transient_universe.add_cell(void_1_cell)\n",
    "\n",
    "# Create void 2 cell\n",
    "void_2_cell = openmc.Cell(name= 'Void 2')\n",
    "void_2_cell.fill = void\n",
    "void_2_cell.region = -void_outer_radius & +void_2_min & -void_2_max\n",
    "transient_universe.add_cell(void_2_cell)\n",
    "\n",
    "# Create void 3 cell\n",
    "void_3_cell = openmc.Cell(name= 'Void 3')\n",
    "void_3_cell.fill = void\n",
    "void_3_cell.region = -void_outer_radius & +void_3_min & -void_3_max\n",
    "transient_universe.add_cell(void_3_cell)\n",
    "\n",
    "# Create b4c cell\n",
    "b4c_cell = openmc.Cell(name='Boron Carbide')\n",
    "b4c_cell.fill = b4c\n",
    "b4c_cell.region = -b4c_outer_radius & -b4c_max & +b4c_min\n",
    "transient_universe.add_cell(b4c_cell)\n",
    "\n",
    "# Create aluminum 1 cell\n",
    "aluminum_1_cell = openmc.Cell(name='Aluminum')\n",
    "aluminum_1_cell.fill = aluminum\n",
    "aluminum_1_cell.region = -aluminum_outer_radius & +aluminum_1_min & -aluminum_1_max\n",
    "transient_universe.add_cell(aluminum_1_cell)\n",
    "\n",
    "# Create aluminum 2 cell\n",
    "aluminum_2_cell = openmc.Cell(name='Aluminum')\n",
    "aluminum_2_cell.fill = aluminum\n",
    "aluminum_2_cell.region = -aluminum_outer_radius & +aluminum_2_min & -aluminum_2_max\n",
    "transient_universe.add_cell(aluminum_2_cell)\n",
    "\n",
    "# Create aluminum 3 cell\n",
    "aluminum_3_cell = openmc.Cell(name='Aluminum')\n",
    "aluminum_3_cell.fill = aluminum\n",
    "aluminum_3_cell.region = -aluminum_outer_radius & +aluminum_3_min & -aluminum_3_max\n",
    "transient_universe.add_cell(aluminum_3_cell)\n",
    "\n",
    "# Create aluminum 4 cell\n",
    "aluminum_4_cell = openmc.Cell(name='Aluminum')\n",
    "aluminum_4_cell.fill = aluminum\n",
    "aluminum_4_cell.region = -aluminum_outer_radius & +aluminum_4_min & -aluminum_4_max\n",
    "transient_universe.add_cell(aluminum_4_cell)\n",
    "\n",
    "# Create a clad cell\n",
    "clad_cell = openmc.Cell(name='Aluminum Cladding')\n",
    "clad_cell.fill = aluminum\n",
    "clad_cell.region = -clad_outer_radius & +b4c_outer_radius & +clad_min & -clad_max\n",
    "transient_universe.add_cell(clad_cell)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "id": "-0xO897aWbft"
   },
   "outputs": [],
   "source": [
    "# Geometry definitions for the control rod\n",
    "\n",
    "rod_outer_radius = openmc.ZCylinder(r=0.635)\n",
    "uzrh_outer_radius = openmc.ZCylinder(r=3.33375)\n",
    "void_outer_radius = openmc.ZCylinder(r=3.33375)\n",
    "b4c_outer_radius = openmc.ZCylinder(r=3.33375)\n",
    "ss304_outer_radius = openmc.ZCylinder(r=3.33375)\n",
    "clad_outer_radius = openmc.ZCylinder(r=3.38455)\n",
    "\n",
    "ss304_5_min = openmc.ZPlane(z0=-114.3)\n",
    "ss304_5_max = openmc.ZPlane(z0=-113.03)\n",
    "void_4_min = openmc.ZPlane(z0=-113.03)\n",
    "void_4_max = openmc.ZPlane(z0=-99.06)\n",
    "ss304_4_min = openmc.ZPlane(z0=-99.06)\n",
    "ss304_4_max = openmc.ZPlane(z0=-96.52)\n",
    "rod_min = openmc.ZPlane(z0=-96.52)\n",
    "rod_max = openmc.ZPlane(z0=-58.42)\n",
    "uzrh_min = openmc.ZPlane(z0=-96.52)\n",
    "uzrh_max = openmc.ZPlane(z0=-58.42)\n",
    "void_1_min = openmc.ZPlane(z0=-58.42)\n",
    "void_1_max = openmc.ZPlane(z0=-57.785)\n",
    "ss304_1_min = openmc.ZPlane(z0=-57.785)\n",
    "ss304_1_max = openmc.ZPlane(z0=-56.515)\n",
    "b4c_1_min = openmc.ZPlane(z0=-56.515)\n",
    "b4c_1_max = openmc.ZPlane(z0=-18.415)\n",
    "void_2_min = openmc.ZPlane(z0=-18.415)\n",
    "void_2_max = openmc.ZPlane(z0=-18.0975)\n",
    "ss304_2_min = openmc.ZPlane(z0=-18.0975)\n",
    "ss304_2_max = openmc.ZPlane(z0=-16.8275)\n",
    "void_3_min = openmc.ZPlane(z0=-16.8275)\n",
    "void_3_max = openmc.ZPlane(z0=-7.3025)\n",
    "ss304_3_min = openmc.ZPlane(z0=-7.3025)\n",
    "ss304_3_max = openmc.ZPlane(z0=0.0)\n",
    "clad_min = openmc.ZPlane(z0=-114.3)\n",
    "clad_max = openmc.ZPlane(z0=0.0)\n",
    "\n",
    "# Create a Universe to encapsulate the control rod\n",
    "control_universe = openmc.Universe(name='Control Universe')\n",
    "\n",
    "# Create rod cell\n",
    "rod_cell = openmc.Cell(name='Zr Rod')\n",
    "rod_cell.fill = zirconium\n",
    "rod_cell.region = -rod_outer_radius & +rod_min & -rod_max\n",
    "control_universe.add_cell(rod_cell)\n",
    "\n",
    "# Create uzrh cell\n",
    "uzrh_cell = openmc.Cell(name='UZrH')\n",
    "uzrh_cell.fill = uzrh\n",
    "uzrh_cell.region = +rod_outer_radius & -uzrh_outer_radius & +uzrh_min & -uzrh_max\n",
    "control_universe.add_cell(uzrh_cell)\n",
    "\n",
    "# Create void 1 cell\n",
    "void_1_cell = openmc.Cell(name= 'Void 1')\n",
    "void_1_cell.fill = void\n",
    "void_1_cell.region = -void_outer_radius & +void_1_min & -void_1_max\n",
    "control_universe.add_cell(void_1_cell)\n",
    "\n",
    "# Create void 2 cell\n",
    "void_2_cell = openmc.Cell(name= 'Void 2')\n",
    "void_2_cell.fill = void\n",
    "void_2_cell.region = -void_outer_radius & +void_2_min & -void_2_max\n",
    "control_universe.add_cell(void_2_cell)\n",
    "\n",
    "# Create void 3 cell\n",
    "void_3_cell = openmc.Cell(name= 'Void 3')\n",
    "void_3_cell.fill = void\n",
    "void_3_cell.region = -void_outer_radius & +void_3_min & -void_3_max\n",
    "control_universe.add_cell(void_3_cell)\n",
    "\n",
    "# Create void 4 cell\n",
    "void_4_cell = openmc.Cell(name= 'Void 3')\n",
    "void_4_cell.fill = void\n",
    "void_4_cell.region = -void_outer_radius & +void_4_min & -void_4_max\n",
    "control_universe.add_cell(void_4_cell)\n",
    "\n",
    "# Create ss304 1 cell\n",
    "ss304_1_cell = openmc.Cell(name='Stainless Steel 304 Cell 1')\n",
    "ss304_1_cell.fill = ss304\n",
    "ss304_1_cell.region = -ss304_outer_radius & +ss304_1_min & -ss304_1_max\n",
    "control_universe.add_cell(ss304_1_cell)\n",
    "\n",
    "# Create ss304 2 cell\n",
    "ss304_2_cell = openmc.Cell(name='Stainless Steel 304 Cell 2')\n",
    "ss304_2_cell.fill = ss304\n",
    "ss304_2_cell.region = -ss304_outer_radius & +ss304_2_min & -ss304_2_max\n",
    "control_universe.add_cell(ss304_2_cell)\n",
    "\n",
    "# Create ss304 3 cell\n",
    "ss304_3_cell = openmc.Cell(name='Stainless Steel 304 Cell 3')\n",
    "ss304_3_cell.fill = ss304\n",
    "ss304_3_cell.region = -ss304_outer_radius & +ss304_3_min & -ss304_3_max\n",
    "control_universe.add_cell(ss304_3_cell)\n",
    "\n",
    "# Create ss304 4 cell\n",
    "ss304_4_cell = openmc.Cell(name='Stainless Steel 304 Cell 4')\n",
    "ss304_4_cell.fill = ss304\n",
    "ss304_4_cell.region = -ss304_outer_radius & +ss304_4_min & -ss304_4_max\n",
    "control_universe.add_cell(ss304_4_cell)\n",
    "\n",
    "# Create ss304 5 cell\n",
    "ss304_5_cell = openmc.Cell(name='Stainless Steel 304 Cell 5')\n",
    "ss304_5_cell.fill = ss304\n",
    "ss304_5_cell.region = -ss304_outer_radius & +ss304_5_min & -ss304_5_max\n",
    "control_universe.add_cell(ss304_5_cell)\n",
    "\n",
    "# Create b4c 1 cell\n",
    "b4c_1_cell = openmc.Cell(name='B4C cell')\n",
    "b4c_1_cell.fill = b4c\n",
    "b4c_1_cell.region = -b4c_outer_radius & +b4c_1_min & -b4c_1_max\n",
    "control_universe.add_cell(b4c_1_cell)\n",
    "\n",
    "# Create a clad Cell\n",
    "clad_cell = openmc.Cell(name='Stainless Steel 304 Cladding')\n",
    "clad_cell.fill = ss304\n",
    "clad_cell.region = -clad_outer_radius & +ss304_outer_radius & +clad_min & -clad_max #Miriam: cladding is only the exterior coat.\n",
    "control_universe.add_cell(clad_cell)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "id": "8h9JMENTw9P3"
   },
   "outputs": [],
   "source": [
    "# Create water universe to surround the lattice\n",
    "\n",
    "all_water_cell = openmc.Cell(fill=water)\n",
    "outer_universe = openmc.Universe(cells=(all_water_cell,))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "id": "q-VaKsxT8v3b"
   },
   "outputs": [],
   "source": [
    "# Create surfaces that will divide rings in the circular lattice\n",
    "\n",
    "ring_radii = np.array([0.0, 8.0, 16.0, 24.0, 32.0, 40.0])\n",
    "radial_surf = [openmc.ZCylinder(r=r) for r in\n",
    "               (ring_radii[:-1] + ring_radii[1:])/2]\n",
    "\n",
    "water_cells = []\n",
    "for i in range(ring_radii.size):\n",
    "    # Create annular region\n",
    "    if i == 0:\n",
    "        water_region = -radial_surf[i]\n",
    "    elif i == ring_radii.size - 1:\n",
    "        water_region = +radial_surf[i-1]\n",
    "    else:\n",
    "        water_region = +radial_surf[i-1] & -radial_surf[i]\n",
    "    water_cells.append(openmc.Cell(fill=water, region=water_region))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 282
    },
    "id": "Ggrtg9BT8w9D",
    "outputId": "9ba193b2-edc8-4540-d234-1f0cb00d5a5d"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f7b3be42c10>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 8640 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot the rings to visualize the circular lattice, without rods\n",
    "\n",
    "plot_args = {'width': (2*24.1, 2*24.1)}\n",
    "bundle_universe = openmc.Universe(cells=water_cells)\n",
    "bundle_universe.plot(**plot_args)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "DGqaeEPN8z2K",
    "outputId": "e68c720d-cb6d-45c2-92b2-a96b9e1d6dd2"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding in a control rod...\n",
      "Adding in a transient rod...\n",
      "Adding in a water rod...\n",
      "Adding in a transient rod...\n",
      "Adding in a control rod...\n",
      "Adding in a control rod...\n",
      "Adding in a water rod...\n"
     ]
    }
   ],
   "source": [
    "# Arrange the pins in the circular lattice\n",
    "\n",
    "num_pins = [1, 6, 12, 18, 24, 30]\n",
    "angles = [0, 0, 0, 0, 0, 0]\n",
    "\n",
    "controlRods = {'numPins'  :[num_pins[1], num_pins[3], num_pins[5]],\n",
    "               'howLeftFrom3oclock':[4          , 2 ,          0]}\n",
    "\n",
    "transientRods = {'numPins'  :[num_pins[3], num_pins[2]],\n",
    "                 'howLeftFrom3oclock':[1          , 0]}\n",
    "\n",
    "waterRods = {'numPins'  :[num_pins[5], num_pins[2]],\n",
    "             'howLeftFrom3oclock':[1          , 8]}\n",
    "\n",
    "def ControlRod(controlRods,n,j):\n",
    "    for irod in range(len(controlRods['numPins'])):\n",
    "        if n   == controlRods['numPins'][irod] and \\\n",
    "           j-1 == controlRods['howLeftFrom3oclock'][irod]:\n",
    "                return True\n",
    "    return False\n",
    "\n",
    "def TransientRod(transientRods,n,j):\n",
    "    for irod in range(len(transientRods['numPins'])):\n",
    "        if n   == transientRods['numPins'][irod] and \\\n",
    "           j-1 == transientRods['howLeftFrom3oclock'][irod]:\n",
    "                return True\n",
    "    return False\n",
    "\n",
    "def WaterRod(waterRods,n,j):\n",
    "    for irod in range(len(waterRods['numPins'])):\n",
    "        if n   == waterRods['numPins'][irod] and \\\n",
    "           j-1 == waterRods['howLeftFrom3oclock'][irod]:\n",
    "                return True\n",
    "    return False\n",
    "\n",
    "\n",
    "for i, (r, n, a) in enumerate(zip(ring_radii, num_pins, angles)):\n",
    "\n",
    "    for j in range(n):\n",
    "\n",
    "        # Determine location of center of pin\n",
    "        theta = (a + j/n*360.) * np.pi/180.\n",
    "        x = r*np.cos(theta)\n",
    "        y = r*np.sin(theta)\n",
    "\n",
    "        pin_boundary = openmc.ZCylinder(x0=x, y0=y, r=clad_outer_radius.r)\n",
    "        water_cells[i].region &= +pin_boundary\n",
    "\n",
    "        # Create each fuel pin -- note that we explicitly assign an ID so\n",
    "        # that we can identify the pin later when looking at tallies\n",
    "        if ControlRod(controlRods,n,j):\n",
    "            print('Adding in a control rod...')\n",
    "            pin = openmc.Cell(fill=control_universe, region=-pin_boundary)\n",
    "        elif TransientRod(transientRods,n,j):\n",
    "            print('Adding in a transient rod...')\n",
    "            pin = openmc.Cell(fill=transient_universe, region=-pin_boundary)\n",
    "        elif WaterRod(waterRods,n,j):\n",
    "            print('Adding in a water rod...')\n",
    "            pin = openmc.Cell(fill=outer_universe, region=-pin_boundary)\n",
    "        else:\n",
    "            pin = openmc.Cell(fill=fuel_universe, region=-pin_boundary)\n",
    "        pin.translation = (x, y, 0)\n",
    "        pin.id = (i + 1)*100 + j\n",
    "        bundle_universe.add_cell(pin)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 282
    },
    "id": "HyyFkCzS843z",
    "outputId": "cbaa5f36-cfe2-4e1b-9178-00cb8272ea21"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f7b3be25e10>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 12076 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot the rings to visualize the filled circular lattice\n",
    "\n",
    "bundle_universe.plot(width=(100, 100), origin=[0,0,-40],\n",
    "                   basis='xy', color_by='material',\n",
    "                   colors={water:'blue',uzrh:'orange',\n",
    "                   zirconium:'green',graphite:'gray',\n",
    "                   b4c:'yellow'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "id": "XTzZHTnr0fO7"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f7b3bfd4c10>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 5620 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plotting fuel rod\n",
    "\n",
    "fuel_universe.plot(width=(20, 150), origin=[0,0,-40], basis='yz', color_by='material', colors={ss304:'fuchsia'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f7b33827f50>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 5572 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plotting transient rod\n",
    "\n",
    "transient_universe.plot(width=(20, 150), origin=[0,0,-40], basis='yz', color_by='material', colors={water:'fuchsia'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f7b33818310>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 5776 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plotting control rod\n",
    "\n",
    "control_universe.plot(width=(20, 150), origin=[0,0,-40], basis='yz', color_by='material', colors={ss304:'fuchsia'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 8004 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Geometry definitions for the reactor\n",
    "\n",
    "reactor_wall = openmc.ZCylinder(r=50.0, boundary_type='vacuum')\n",
    "reactor_top = openmc.ZPlane(z0=0.0, boundary_type='vacuum')\n",
    "reactor_bottom = openmc.ZPlane(z0=-114.3, boundary_type='vacuum')\n",
    "reactor = openmc.Cell()\n",
    "reactor.region = -reactor_wall & -reactor_top & +reactor_bottom\n",
    "reactor.fill = bundle_universe\n",
    "reactor_universe = openmc.Universe(cells=[reactor])\n",
    "\n",
    "reactor_universe.plot(width=(100, 100), origin=[0,0,-40],\n",
    "                   basis='yz', color_by='material',\n",
    "                   colors={water:'blue',uzrh:'orange',\n",
    "                   zirconium:'green',graphite:'gray',\n",
    "                   b4c:'yellow'})\n",
    "\n",
    "geometry = openmc.Geometry(reactor_universe)\n",
    "geometry.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "cellView": "code",
    "id": "5mPhUg7QWVw4"
   },
   "outputs": [],
   "source": [
    "# OpenMC simulation parameters\n",
    "\n",
    "batches = 100\n",
    "inactive = 10\n",
    "particles = 5000\n",
    "\n",
    "settings_file = openmc.Settings()\n",
    "settings_file.batches = batches\n",
    "settings_file.inactive = inactive\n",
    "settings_file.particles = particles\n",
    "\n",
    "bounds = [-28.527375, -28.527375, -28.527375, 28.527375, 28.527375, 28.527375]\n",
    "uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True)\n",
    "settings_file.source = openmc.IndependentSource(space=uniform_dist)\n",
    "\n",
    "settings_file.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "id": "A_f292ebWZFM"
   },
   "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:01:37\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 H1 from /opt/xdata/endfb-vii.1-hdf5/neutron/H1.h5\n",
      " Reading O16 from /opt/xdata/endfb-vii.1-hdf5/neutron/O16.h5\n",
      " Reading B10 from /opt/xdata/endfb-vii.1-hdf5/neutron/B10.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 H2 from /opt/xdata/endfb-vii.1-hdf5/neutron/H2.h5\n",
      " Reading Zr90 from /opt/xdata/endfb-vii.1-hdf5/neutron/Zr90.h5\n",
      " Reading Zr91 from /opt/xdata/endfb-vii.1-hdf5/neutron/Zr91.h5\n",
      " Reading Zr92 from /opt/xdata/endfb-vii.1-hdf5/neutron/Zr92.h5\n",
      " Reading Zr94 from /opt/xdata/endfb-vii.1-hdf5/neutron/Zr94.h5\n",
      " Reading Zr96 from /opt/xdata/endfb-vii.1-hdf5/neutron/Zr96.h5\n",
      " Reading Mo92 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mo92.h5\n",
      " Reading Mo94 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mo94.h5\n",
      " Reading Mo95 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mo95.h5\n",
      " Reading Mo96 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mo96.h5\n",
      " Reading Mo97 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mo97.h5\n",
      " Reading Mo98 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mo98.h5\n",
      " Reading Mo100 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mo100.h5\n",
      " Reading C0 from /opt/xdata/endfb-vii.1-hdf5/neutron/C0.h5\n",
      " Reading Si28 from /opt/xdata/endfb-vii.1-hdf5/neutron/Si28.h5\n",
      " Reading Si29 from /opt/xdata/endfb-vii.1-hdf5/neutron/Si29.h5\n",
      " Reading Si30 from /opt/xdata/endfb-vii.1-hdf5/neutron/Si30.h5\n",
      " Reading P31 from /opt/xdata/endfb-vii.1-hdf5/neutron/P31.h5\n",
      " Reading S32 from /opt/xdata/endfb-vii.1-hdf5/neutron/S32.h5\n",
      " Reading S33 from /opt/xdata/endfb-vii.1-hdf5/neutron/S33.h5\n",
      " Reading S34 from /opt/xdata/endfb-vii.1-hdf5/neutron/S34.h5\n",
      " Reading S36 from /opt/xdata/endfb-vii.1-hdf5/neutron/S36.h5\n",
      " Reading V50 from /opt/xdata/endfb-vii.1-hdf5/neutron/V50.h5\n",
      " Reading V51 from /opt/xdata/endfb-vii.1-hdf5/neutron/V51.h5\n",
      " Reading Cr50 from /opt/xdata/endfb-vii.1-hdf5/neutron/Cr50.h5\n",
      " Reading Cr52 from /opt/xdata/endfb-vii.1-hdf5/neutron/Cr52.h5\n",
      " Reading Cr53 from /opt/xdata/endfb-vii.1-hdf5/neutron/Cr53.h5\n",
      " Reading Cr54 from /opt/xdata/endfb-vii.1-hdf5/neutron/Cr54.h5\n",
      " Reading Mn55 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mn55.h5\n",
      " Reading Fe54 from /opt/xdata/endfb-vii.1-hdf5/neutron/Fe54.h5\n",
      " Reading Fe56 from /opt/xdata/endfb-vii.1-hdf5/neutron/Fe56.h5\n",
      " Reading Fe57 from /opt/xdata/endfb-vii.1-hdf5/neutron/Fe57.h5\n",
      " Reading Fe58 from /opt/xdata/endfb-vii.1-hdf5/neutron/Fe58.h5\n",
      " Reading Ni58 from /opt/xdata/endfb-vii.1-hdf5/neutron/Ni58.h5\n",
      " Reading Ni60 from /opt/xdata/endfb-vii.1-hdf5/neutron/Ni60.h5\n",
      " Reading Ni61 from /opt/xdata/endfb-vii.1-hdf5/neutron/Ni61.h5\n",
      " Reading Ni62 from /opt/xdata/endfb-vii.1-hdf5/neutron/Ni62.h5\n",
      " Reading Ni64 from /opt/xdata/endfb-vii.1-hdf5/neutron/Ni64.h5\n",
      " Reading W180 from /opt/xdata/endfb-vii.1-hdf5/neutron/W180.h5\n",
      " Reading W182 from /opt/xdata/endfb-vii.1-hdf5/neutron/W182.h5\n",
      " Reading W183 from /opt/xdata/endfb-vii.1-hdf5/neutron/W183.h5\n",
      " Reading W184 from /opt/xdata/endfb-vii.1-hdf5/neutron/W184.h5\n",
      " Reading W186 from /opt/xdata/endfb-vii.1-hdf5/neutron/W186.h5\n",
      " Reading B11 from /opt/xdata/endfb-vii.1-hdf5/neutron/B11.h5\n",
      " Reading O17 from /opt/xdata/endfb-vii.1-hdf5/neutron/O17.h5\n",
      " Reading Ar36 from /opt/xdata/endfb-vii.1-hdf5/neutron/Ar36.h5\n",
      " WARNING: Negative value(s) found on probability table for nuclide Ar36 at 294K\n",
      " Reading Ar38 from /opt/xdata/endfb-vii.1-hdf5/neutron/Ar38.h5\n",
      " Reading Ar40 from /opt/xdata/endfb-vii.1-hdf5/neutron/Ar40.h5\n",
      " Reading Al27 from /opt/xdata/endfb-vii.1-hdf5/neutron/Al27.h5\n",
      " Reading c_Graphite from /opt/xdata/endfb-vii.1-hdf5/neutron/c_Graphite.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 H1\n",
      " Initializing source particles...\n",
      "\n",
      " ====================>     K EIGENVALUE SIMULATION     <====================\n",
      "\n",
      "  Bat./Gen.      k            Average k\n",
      "  =========   ========   ====================\n",
      "        1/1    1.10037\n",
      "        2/1    1.13359\n",
      "        3/1    1.19525\n",
      "        4/1    1.17773\n",
      "        5/1    1.18679\n",
      "        6/1    1.19587\n",
      "        7/1    1.15853\n",
      "        8/1    1.20775\n",
      "        9/1    1.16209\n",
      "       10/1    1.16847\n",
      "       11/1    1.20309\n",
      "       12/1    1.16104    1.18206 +/- 0.02102\n",
      "       13/1    1.16397    1.17603 +/- 0.01355\n",
      "       14/1    1.14591    1.16850 +/- 0.01219\n",
      "       15/1    1.17191    1.16918 +/- 0.00947\n",
      "       16/1    1.16651    1.16874 +/- 0.00774\n",
      "       17/1    1.19610    1.17265 +/- 0.00762\n",
      "       18/1    1.20282    1.17642 +/- 0.00760\n",
      "       19/1    1.18597    1.17748 +/- 0.00679\n",
      "       20/1    1.17570    1.17730 +/- 0.00607\n",
      "       21/1    1.16712    1.17638 +/- 0.00557\n",
      "       22/1    1.16823    1.17570 +/- 0.00513\n",
      "       23/1    1.19360    1.17707 +/- 0.00492\n",
      "       24/1    1.18422    1.17759 +/- 0.00458\n",
      "       25/1    1.19166    1.17852 +/- 0.00437\n",
      "       26/1    1.24363    1.18259 +/- 0.00577\n",
      "       27/1    1.16911    1.18180 +/- 0.00547\n",
      "       28/1    1.19028    1.18227 +/- 0.00518\n",
      "       29/1    1.18476    1.18240 +/- 0.00490\n",
      "       30/1    1.18887    1.18272 +/- 0.00466\n",
      "       31/1    1.16268    1.18177 +/- 0.00454\n",
      "       32/1    1.17464    1.18145 +/- 0.00434\n",
      "       33/1    1.21646    1.18297 +/- 0.00442\n",
      "       34/1    1.18471    1.18304 +/- 0.00423\n",
      "       35/1    1.19146    1.18338 +/- 0.00407\n",
      "       36/1    1.22839    1.18511 +/- 0.00428\n",
      "       37/1    1.19880    1.18562 +/- 0.00415\n",
      "       38/1    1.18704    1.18567 +/- 0.00400\n",
      "       39/1    1.21846    1.18680 +/- 0.00402\n",
      "       40/1    1.18147    1.18662 +/- 0.00389\n",
      "       41/1    1.18398    1.18654 +/- 0.00376\n",
      "       42/1    1.17972    1.18632 +/- 0.00365\n",
      "       43/1    1.17833    1.18608 +/- 0.00354\n",
      "       44/1    1.18282    1.18598 +/- 0.00344\n",
      "       45/1    1.18647    1.18600 +/- 0.00334\n",
      "       46/1    1.22036    1.18695 +/- 0.00338\n",
      "       47/1    1.18680    1.18695 +/- 0.00329\n",
      "       48/1    1.18704    1.18695 +/- 0.00320\n",
      "       49/1    1.18955    1.18702 +/- 0.00312\n",
      "       50/1    1.20479    1.18746 +/- 0.00307\n",
      "       51/1    1.18734    1.18746 +/- 0.00300\n",
      "       52/1    1.19721    1.18769 +/- 0.00293\n",
      "       53/1    1.17690    1.18744 +/- 0.00287\n",
      "       54/1    1.18976    1.18749 +/- 0.00281\n",
      "       55/1    1.22134    1.18824 +/- 0.00285\n",
      "       56/1    1.19238    1.18833 +/- 0.00279\n",
      "       57/1    1.22054    1.18902 +/- 0.00281\n",
      "       58/1    1.17055    1.18864 +/- 0.00278\n",
      "       59/1    1.20104    1.18889 +/- 0.00273\n",
      "       60/1    1.22188    1.18955 +/- 0.00276\n",
      "       61/1    1.17142    1.18919 +/- 0.00273\n",
      "       62/1    1.19069    1.18922 +/- 0.00267\n",
      "       63/1    1.20999    1.18961 +/- 0.00265\n",
      "       64/1    1.13833    1.18866 +/- 0.00277\n",
      "       65/1    1.20940    1.18904 +/- 0.00275\n",
      "       66/1    1.19219    1.18910 +/- 0.00270\n",
      "       67/1    1.17385    1.18883 +/- 0.00266\n",
      "       68/1    1.18968    1.18884 +/- 0.00262\n",
      "       69/1    1.23384    1.18961 +/- 0.00268\n",
      "       70/1    1.21239    1.18999 +/- 0.00266\n",
      "       71/1    1.16257    1.18954 +/- 0.00266\n",
      "       72/1    1.14933    1.18889 +/- 0.00269\n",
      "       73/1    1.19769    1.18903 +/- 0.00265\n",
      "       74/1    1.20393    1.18926 +/- 0.00262\n",
      "       75/1    1.23103    1.18990 +/- 0.00266\n",
      "       76/1    1.16576    1.18954 +/- 0.00265\n",
      "       77/1    1.17253    1.18928 +/- 0.00262\n",
      "       78/1    1.18191    1.18918 +/- 0.00258\n",
      "       79/1    1.15952    1.18875 +/- 0.00258\n",
      "       80/1    1.20504    1.18898 +/- 0.00255\n",
      "       81/1    1.22039    1.18942 +/- 0.00256\n",
      "       82/1    1.18295    1.18933 +/- 0.00252\n",
      "       83/1    1.23484    1.18995 +/- 0.00256\n",
      "       84/1    1.20951    1.19022 +/- 0.00254\n",
      "       85/1    1.20073    1.19036 +/- 0.00251\n",
      "       86/1    1.21033    1.19062 +/- 0.00249\n",
      "       87/1    1.20197    1.19077 +/- 0.00247\n",
      "       88/1    1.18129    1.19065 +/- 0.00244\n",
      "       89/1    1.22345    1.19106 +/- 0.00244\n",
      "       90/1    1.14146    1.19044 +/- 0.00249\n",
      "       91/1    1.19893    1.19055 +/- 0.00246\n",
      "       92/1    1.20454    1.19072 +/- 0.00244\n",
      "       93/1    1.22963    1.19119 +/- 0.00245\n",
      "       94/1    1.19911    1.19128 +/- 0.00242\n",
      "       95/1    1.20091    1.19139 +/- 0.00240\n",
      "       96/1    1.23388    1.19189 +/- 0.00242\n",
      "       97/1    1.17890    1.19174 +/- 0.00240\n",
      "       98/1    1.17312    1.19153 +/- 0.00238\n",
      "       99/1    1.18415    1.19144 +/- 0.00235\n",
      "      100/1    1.19391    1.19147 +/- 0.00233\n",
      " Creating state point statepoint.100.h5...\n",
      "\n",
      " =======================>     TIMING STATISTICS     <=======================\n",
      "\n",
      " Total time for initialization     = 4.8327e+00 seconds\n",
      "   Reading cross sections          = 4.7094e+00 seconds\n",
      " Total time in simulation          = 1.1295e+01 seconds\n",
      "   Time in transport only          = 1.1222e+01 seconds\n",
      "   Time in inactive batches        = 1.1395e+00 seconds\n",
      "   Time in active batches          = 1.0156e+01 seconds\n",
      "   Time synchronizing fission bank = 4.0753e-02 seconds\n",
      "     Sampling source sites         = 3.4971e-02 seconds\n",
      "     SEND/RECV source sites        = 5.7304e-03 seconds\n",
      "   Time accumulating tallies       = 6.2803e-05 seconds\n",
      "   Time writing statepoints        = 4.9304e-03 seconds\n",
      " Total time for finalization       = 7.0600e-07 seconds\n",
      " Total time elapsed                = 1.6170e+01 seconds\n",
      " Calculation Rate (inactive)       = 43877.4 particles/second\n",
      " Calculation Rate (active)         = 44309.8 particles/second\n",
      "\n",
      " ============================>     RESULTS     <============================\n",
      "\n",
      " k-effective (Collision)     = 1.19145 +/- 0.00225\n",
      " k-effective (Track-length)  = 1.19147 +/- 0.00233\n",
      " k-effective (Absorption)    = 1.18806 +/- 0.00164\n",
      " Combined k-effective        = 1.18901 +/- 0.00154\n",
      " Leakage Fraction            = 0.04108 +/- 0.00032\n",
      "\n"
     ]
    }
   ],
   "source": [
    "openmc.run()"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "collapsed_sections": [],
   "name": "2 TRIGA_IPYNB.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
}
