{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# A BWR geometry \n",
    "This notebook can be used as a template for modeling BWR reactors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "id": "EChOeJ7qVUB7"
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import openmc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "id": "-0xO897aWbft"
   },
   "outputs": [],
   "source": [
    "# Materials definitions\n",
    "\n",
    "uo2 = openmc.Material(name='UO2')\n",
    "uo2.add_element('U', 1.0, enrichment=1.5)\n",
    "uo2.add_element('O', 2.0)\n",
    "uo2.set_density('g/cc', 10.0)\n",
    "\n",
    "zircaloy = openmc.Material(name='Zircaloy')\n",
    "zircaloy.set_density('g/cm3', 6.55)\n",
    "zircaloy.add_nuclide('Zr90', 7.2758e-3)\n",
    "\n",
    "steel = openmc.Material(name='Stainless Steel')\n",
    "steel.set_density('g/cm3', 8.00)\n",
    "steel.add_element('C', 0.08, percent_type='wo')\n",
    "steel.add_element('Si', 1.00, percent_type='wo')\n",
    "steel.add_element('Mn', 2.00, percent_type='wo')\n",
    "steel.add_element('P', 0.045, percent_type='wo')\n",
    "steel.add_element('S', 0.030, percent_type='wo')\n",
    "steel.add_element('Cr', 20.0, percent_type='wo')\n",
    "steel.add_element('Ni', 11.0, percent_type='wo')\n",
    "steel.add_element('Fe', 65.845, percent_type='wo')\n",
    "\n",
    "water = openmc.Material(name='Water')\n",
    "water.set_density('g/cm3', 0.76)\n",
    "water.add_element('H', 2)\n",
    "water.add_element('O', 1)\n",
    "water.add_s_alpha_beta('c_H_in_H2O')\n",
    "\n",
    "# Instantiate a Materials collection and export to xml\n",
    "materials_file = openmc.Materials([uo2, water, zircaloy, steel])\n",
    "materials_file.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Geometry definitions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "id": "J90KA6zdol04"
   },
   "outputs": [],
   "source": [
    "bottom = openmc.ZPlane(z0=-1.0, boundary_type = 'reflective')\n",
    "top = openmc.ZPlane(z0=1.0, boundary_type = 'reflective')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "id": "7UFi6yivaxDS"
   },
   "outputs": [],
   "source": [
    "pitch = 1.6256\n",
    "pin_cell_box = openmc.model.RectangularPrism(width=pitch, height=pitch)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Geometry definitions for the fuel rod\n",
    "\n",
    "fuel_or  = openmc.ZCylinder(r=1.0414/2, name='Fuel OR')\n",
    "fclad_ir = openmc.ZCylinder(r=1.06426/2, name='Clad IR')\n",
    "fclad_or = openmc.ZCylinder(r=1.22682/2, name='Clad OR')\n",
    "\n",
    "fuel_region = -fuel_or\n",
    "gap_region  = +fuel_or & -fclad_ir\n",
    "fclad_region  = +fclad_ir & -fclad_or\n",
    "fwater_region = pin_cell_box & +fclad_or\n",
    "\n",
    "fuel_cell = openmc.Cell(name='fuel')\n",
    "fuel_cell.fill = uo2\n",
    "fuel_cell.region = fuel_region\n",
    "\n",
    "gap_cell = openmc.Cell(name='air gap')\n",
    "gap_cell.region = gap_region\n",
    "\n",
    "clad_cell = openmc.Cell(name='clad')\n",
    "clad_cell.fill = zircaloy\n",
    "clad_cell.region = fclad_region\n",
    "\n",
    "fwater_cell = openmc.Cell(name='fwater')\n",
    "fwater_cell.fill = water\n",
    "fwater_cell.region = fwater_region\n",
    "\n",
    "fuel_pin_universe = openmc.Universe(cells=[fuel_cell, gap_cell, clad_cell, fwater_cell])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f94b0077250>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 7012 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fuel_pin_universe.plot(width=(2.5, 2.5), colors = {fuel_cell: 'orange', gap_cell: 'white', clad_cell: 'grey', fwater_cell: 'blue'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Geometry definitions for the water rod\n",
    "\n",
    "water_or = openmc.ZCylinder(r=1.34874/2)\n",
    "wclad_or = openmc.ZCylinder(r=1.50114/2)\n",
    "\n",
    "wwater_inner_region = -water_or\n",
    "wclad_region = -wclad_or & +water_or\n",
    "wwater_outer_region = pin_cell_box & +wclad_or\n",
    "\n",
    "wwater_inner_cell = openmc.Cell(name='wwater_inner')\n",
    "wwater_inner_cell.region = wwater_inner_region\n",
    "wwater_inner_cell.fill = water\n",
    "\n",
    "wclad_cell = openmc.Cell(name='wclad')\n",
    "wclad_cell.fill = zircaloy\n",
    "wclad_cell.region = wclad_region\n",
    "\n",
    "wwater_outer_cell = openmc.Cell(name='wwater_outer')\n",
    "wwater_outer_cell.fill = water\n",
    "wwater_outer_cell.region = wwater_outer_region\n",
    "\n",
    "water_pin_universe = openmc.Universe(cells=[wwater_inner_cell, wclad_cell, wwater_outer_cell])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 282
    },
    "id": "FklxPQ-1xvNs",
    "outputId": "9e4cb490-0ba5-4838-9f47-0442493b9f6d"
   },
   "outputs": [],
   "source": [
    "# Geometry definitions for the corner rod\n",
    "\n",
    "corner_fuel_or = openmc.ZCylinder(r=1.0414/2, name = 'Corner Cell: Fuel OR')\n",
    "corner_clad_ir = openmc.ZCylinder(r=1.06426/2, name = 'Corner Cell: Clad IR')\n",
    "corner_clad_or = openmc.ZCylinder(r=1.22682/2, name = 'Corner Cell: Clad OR')\n",
    "\n",
    "corner_fuel_cell = openmc.Cell(name='fuel')\n",
    "corner_fuel_cell.fill = uo2\n",
    "corner_fuel_cell.region = -corner_fuel_or\n",
    "\n",
    "corner_gap_cell = openmc.Cell(name='air gap')\n",
    "corner_gap_cell.region = -corner_clad_ir & +corner_fuel_or\n",
    "\n",
    "corner_clad_cell = openmc.Cell(name='clad')\n",
    "corner_clad_cell.fill = zircaloy\n",
    "corner_clad_cell.region = +corner_clad_ir & -corner_clad_or"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Defining an Assembly"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "margin = 1e-8\n",
    "sleave_thickness = 0.2032\n",
    "sleave_inner_radius = 0.9652 + margin"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 282
    },
    "id": "FklxPQ-1xvNs",
    "outputId": "9e4cb490-0ba5-4838-9f47-0442493b9f6d"
   },
   "outputs": [],
   "source": [
    "ur_corner_fuel_or = openmc.ZCylinder(r=1.0414/2, name='ur Corner Cell: Fuel OR')\n",
    "ur_corner_clad_ir = openmc.ZCylinder(r=1.06426/2, name='ur Corner Cell: Clad IR')\n",
    "ur_corner_clad_or = openmc.ZCylinder(r=1.22682/2, name='ur Corner Cell: Clad OR')\n",
    "\n",
    "ur_corner_fuel_cell = openmc.Cell(name='ur fuel')\n",
    "ur_corner_fuel_cell.fill = uo2\n",
    "ur_corner_fuel_cell.region = -ur_corner_fuel_or\n",
    "\n",
    "ur_corner_gap_cell = openmc.Cell(name='ul air gap')\n",
    "ur_corner_gap_cell.region = -ur_corner_clad_ir & +ur_corner_fuel_or\n",
    "\n",
    "ur_corner_clad_cell = openmc.Cell(name='ul clad')\n",
    "ur_corner_clad_cell.fill = zircaloy\n",
    "ur_corner_clad_cell.region = +ur_corner_clad_ir & -ur_corner_clad_or\n",
    "\n",
    "ur_sleave_ir = openmc.ZCylinder(x0=pitch/2-sleave_inner_radius-margin, y0=pitch/2-sleave_inner_radius+margin, r=sleave_inner_radius)\n",
    "ur_sleave_or = openmc.ZCylinder(x0=pitch/2-sleave_inner_radius-margin, y0=pitch/2-sleave_inner_radius+margin, r=sleave_inner_radius+sleave_thickness)\n",
    "\n",
    "ur_sleave_hor_bound = openmc.XPlane(x0=pitch/2 - sleave_inner_radius - margin)\n",
    "ur_sleave_ver_bound = openmc.YPlane(y0=pitch/2 - sleave_inner_radius + margin)\n",
    "\n",
    "ur_sleave_cell = openmc.Cell(name='ur sleave cell')\n",
    "ur_sleave_cell.region = -ur_sleave_or & +ur_sleave_ir & +ur_sleave_hor_bound & +ur_sleave_ver_bound & pin_cell_box\n",
    "ur_sleave_cell.fill = zircaloy\n",
    "\n",
    "ur_sleave_water_cell = openmc.Cell(name = 'ur sleave water')\n",
    "ur_sleave_water_cell.region = pin_cell_box & +ur_sleave_hor_bound & +ur_sleave_ver_bound & +ur_sleave_or\n",
    "ur_sleave_water_cell.fill = water\n",
    "\n",
    "ur_sleave_ver_water_cell = openmc.Cell(name='ur vertically-equivalent sleave water')\n",
    "ur_sleave_ver_water_cell.region = pin_cell_box & -ur_sleave_hor_bound & +ur_sleave_ver_bound & +ur_sleave_ir\n",
    "ur_sleave_ver_water_cell.fill = water\n",
    "\n",
    "ur_opposite_water_cell = openmc.Cell(name='ur opposite water')\n",
    "ur_opposite_water_cell.region = pin_cell_box & -ur_sleave_hor_bound & -ur_sleave_ver_bound & +ur_sleave_ir\n",
    "ur_opposite_water_cell.fill = water\n",
    "\n",
    "ur_sleave_hor_water_cell = openmc.Cell(name='ur horizontally-equivalent sleave water')\n",
    "ur_sleave_hor_water_cell.region = pin_cell_box & +ur_sleave_hor_bound & -ur_sleave_ver_bound & +ur_sleave_ir\n",
    "ur_sleave_hor_water_cell.fill = water\n",
    "\n",
    "ur_inner_water_cell = openmc.Cell(name='ur inner water cell')\n",
    "ur_inner_water_cell.region = pin_cell_box & -ur_sleave_ir & +ur_corner_clad_or\n",
    "ur_inner_water_cell.fill = water\n",
    "\n",
    "ur_corner_pin_universe = openmc.Universe(cells=[ur_corner_fuel_cell, ur_corner_gap_cell, ur_corner_clad_cell, ur_sleave_cell, ur_inner_water_cell, ur_sleave_water_cell, ur_sleave_ver_water_cell, ur_opposite_water_cell, ur_sleave_hor_water_cell])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f94b8738650>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 7272 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ur_corner_pin_universe.plot(width=(2.5, 2.5), basis = 'xy', colors = {ur_corner_fuel_cell: 'orange', ur_corner_gap_cell: 'white', ur_corner_clad_cell: 'grey', ur_sleave_cell:'brown', ur_inner_water_cell: 'blue', ur_sleave_water_cell: 'blue', ur_sleave_ver_water_cell: 'blue', ur_opposite_water_cell: 'blue', ur_sleave_hor_water_cell: 'blue'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "ul_corner_fuel_or = openmc.ZCylinder(r=(1.0414/2), name='ul Corner Cell: Fuel OR')\n",
    "ul_corner_clad_ir = openmc.ZCylinder(r=(1.06426/2), name='ul Corner Cell: Clad IR')\n",
    "ul_corner_clad_or = openmc.ZCylinder(r=(1.22682/2), name='ul Corner Cell: Clad OR')\n",
    "\n",
    "ul_corner_fuel_cell = openmc.Cell(name='ul fuel')\n",
    "ul_corner_fuel_cell.fill = uo2\n",
    "ul_corner_fuel_cell.region = -ul_corner_fuel_or\n",
    "\n",
    "ul_corner_gap_cell = openmc.Cell(name='ul air gap')\n",
    "ul_corner_gap_cell.region = -ul_corner_clad_ir & +ul_corner_fuel_or\n",
    "\n",
    "ul_corner_clad_cell = openmc.Cell(name='ul clad')\n",
    "ul_corner_clad_cell.fill = zircaloy\n",
    "ul_corner_clad_cell.region = +ul_corner_clad_ir & -ul_corner_clad_or\n",
    "\n",
    "ul_sleave_ir = openmc.ZCylinder(x0=-pitch/2+sleave_inner_radius+margin, y0=pitch/2-sleave_inner_radius+margin, r=sleave_inner_radius) #Shouldn't have margin\n",
    "ul_sleave_or = openmc.ZCylinder(x0=-pitch/2+sleave_inner_radius+margin, y0=pitch/2-sleave_inner_radius+margin, r=sleave_inner_radius + sleave_thickness)\n",
    "\n",
    "ul_sleave_hor_bound = openmc.XPlane(x0=-pitch/2+sleave_inner_radius+margin)\n",
    "ul_sleave_ver_bound = openmc.YPlane(y0=pitch/2-sleave_inner_radius+margin)\n",
    "\n",
    "ul_sleave_cell = openmc.Cell(name='ul sleave cell')\n",
    "ul_sleave_cell.region = -ul_sleave_or & +ul_sleave_ir & -ul_sleave_hor_bound & +ul_sleave_ver_bound & pin_cell_box\n",
    "ul_sleave_cell.fill = zircaloy\n",
    "\n",
    "ul_sleave_water_cell = openmc.Cell(name='ul sleave water')\n",
    "ul_sleave_water_cell.region = pin_cell_box & -ul_sleave_hor_bound & +ul_sleave_ver_bound & +ul_sleave_or\n",
    "ul_sleave_water_cell.fill = water\n",
    "\n",
    "ul_sleave_ver_water_cell = openmc.Cell(name='ul vertically-equivalent sleave water')\n",
    "ul_sleave_ver_water_cell.region = pin_cell_box & +ul_sleave_hor_bound & +ul_sleave_ver_bound & +ul_sleave_ir\n",
    "ul_sleave_ver_water_cell.fill = water\n",
    "\n",
    "ul_opposite_water_cell = openmc.Cell(name='ul opposite water')\n",
    "ul_opposite_water_cell.region = pin_cell_box & +ul_sleave_hor_bound & -ul_sleave_ver_bound & +ul_sleave_ir\n",
    "ul_opposite_water_cell.fill = water\n",
    "\n",
    "ul_sleave_hor_water_cell = openmc.Cell(name='ul horizontally-equivalent sleave water')\n",
    "ul_sleave_hor_water_cell.region = pin_cell_box & -ul_sleave_hor_bound & -ul_sleave_ver_bound & +ul_sleave_ir\n",
    "ul_sleave_hor_water_cell.fill = water\n",
    "\n",
    "ul_inner_water_cell = openmc.Cell(name='ul inner water cell')\n",
    "ul_inner_water_cell.region = pin_cell_box & -ul_sleave_ir & +ul_corner_clad_or\n",
    "ul_inner_water_cell.fill = water\n",
    "\n",
    "ul_corner_pin_universe = openmc.Universe(cells=[ul_corner_fuel_cell, ul_corner_gap_cell, ul_corner_clad_cell, ul_sleave_cell, ul_inner_water_cell, ul_sleave_water_cell, ul_sleave_ver_water_cell, ul_opposite_water_cell, ul_sleave_hor_water_cell])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f94aff2be90>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 7216 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ul_corner_pin_universe.plot(width=(2.5, 2.5), basis = 'xy', colors = {ul_corner_fuel_cell: 'orange', ul_corner_gap_cell: 'white', ul_corner_clad_cell: 'grey', ul_sleave_cell:'brown', ul_inner_water_cell: 'blue', ul_sleave_water_cell: 'blue', ul_sleave_ver_water_cell: 'blue', ul_opposite_water_cell: 'blue', ul_sleave_hor_water_cell: 'blue'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "ll_corner_fuel_or = openmc.ZCylinder(r=1.0414/2, name='ll Corner Cell: Fuel OR')\n",
    "ll_corner_clad_ir = openmc.ZCylinder(r=1.06426/2, name='ll Corner Cell: Clad IR')\n",
    "ll_corner_clad_or = openmc.ZCylinder(r=1.22682/2, name='ll Corner Cell: Clad OR')\n",
    "\n",
    "ll_corner_fuel_cell = openmc.Cell(name='ll fuel')\n",
    "ll_corner_fuel_cell.fill = uo2\n",
    "ll_corner_fuel_cell.region = -ll_corner_fuel_or\n",
    "\n",
    "ll_corner_gap_cell = openmc.Cell(name='ll air gap')\n",
    "ll_corner_gap_cell.region = -ll_corner_clad_ir & +ll_corner_fuel_or\n",
    "\n",
    "ll_corner_clad_cell = openmc.Cell(name='ll clad')\n",
    "ll_corner_clad_cell.fill = zircaloy\n",
    "ll_corner_clad_cell.region = +ll_corner_clad_ir & -ll_corner_clad_or\n",
    "\n",
    "ll_sleave_ir = openmc.ZCylinder(x0=-pitch/2+sleave_inner_radius+margin, y0=-pitch/2+sleave_inner_radius-margin, r=sleave_inner_radius)\n",
    "ll_sleave_or = openmc.ZCylinder(x0=-pitch/2+sleave_inner_radius+margin, y0=-pitch/2+sleave_inner_radius-margin, r=sleave_inner_radius+sleave_thickness)\n",
    "\n",
    "ll_sleave_hor_bound = openmc.XPlane(x0=-pitch/2+sleave_inner_radius+margin)\n",
    "ll_sleave_ver_bound = openmc.YPlane(y0=-pitch/2+sleave_inner_radius-margin)\n",
    "\n",
    "ll_sleave_cell = openmc.Cell(name='ul sleave cell')\n",
    "ll_sleave_cell.region = -ll_sleave_or & +ll_sleave_ir & -ll_sleave_hor_bound & -ll_sleave_ver_bound & pin_cell_box\n",
    "ll_sleave_cell.fill = zircaloy\n",
    "\n",
    "ll_sleave_water_cell = openmc.Cell(name='ul sleave water')\n",
    "ll_sleave_water_cell.region = pin_cell_box & -ll_sleave_hor_bound & -ll_sleave_ver_bound & +ll_sleave_or\n",
    "ll_sleave_water_cell.fill = water\n",
    "\n",
    "ll_sleave_ver_water_cell = openmc.Cell(name='ul vertically-equivalent sleave water')\n",
    "ll_sleave_ver_water_cell.region = pin_cell_box & +ll_sleave_hor_bound & -ll_sleave_ver_bound & +ll_sleave_ir\n",
    "ll_sleave_ver_water_cell.fill = water\n",
    "\n",
    "ll_opposite_water_cell = openmc.Cell(name='ul opposite water')\n",
    "ll_opposite_water_cell.region = pin_cell_box & +ll_sleave_hor_bound & +ll_sleave_ver_bound & +ll_sleave_ir\n",
    "ll_opposite_water_cell.fill = water\n",
    "\n",
    "ll_sleave_hor_water_cell = openmc.Cell(name='ul horizontally-equivalent sleave water')\n",
    "ll_sleave_hor_water_cell.region = pin_cell_box & -ll_sleave_hor_bound & +ll_sleave_ver_bound & +ll_sleave_ir\n",
    "ll_sleave_hor_water_cell.fill = water\n",
    "\n",
    "ll_inner_water_cell = openmc.Cell(name='ul inner water cell')\n",
    "ll_inner_water_cell.region = pin_cell_box & -ll_sleave_ir & +ll_corner_clad_or\n",
    "ll_inner_water_cell.fill = water\n",
    "\n",
    "ll_corner_pin_universe = openmc.Universe(cells=[ll_corner_fuel_cell, ll_corner_gap_cell, ll_corner_clad_cell, ll_sleave_cell, ll_inner_water_cell, ll_sleave_water_cell, ll_sleave_ver_water_cell, ll_opposite_water_cell, ll_sleave_hor_water_cell])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f94b00e16d0>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 7340 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ll_corner_pin_universe.plot(width=(2.5, 2.5), basis = 'xy', colors = {ll_corner_fuel_cell: 'orange', ll_corner_gap_cell: 'white', ll_corner_clad_cell: 'grey', ll_sleave_cell:'brown', ll_inner_water_cell: 'blue', ll_sleave_water_cell: 'blue', ll_sleave_ver_water_cell: 'blue', ll_opposite_water_cell: 'blue', ll_sleave_hor_water_cell: 'blue'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "lr_corner_fuel_or = openmc.ZCylinder(r=1.0414/2, name='lr Corner Cell: Fuel OR')\n",
    "lr_corner_clad_ir = openmc.ZCylinder(r=1.06426/2, name='lr Corner Cell: Clad IR')\n",
    "lr_corner_clad_or = openmc.ZCylinder(r=1.22682/2, name='lr Corner Cell: Clad OR')\n",
    "\n",
    "lr_corner_fuel_cell = openmc.Cell(name='lr fuel')\n",
    "lr_corner_fuel_cell.fill = uo2\n",
    "lr_corner_fuel_cell.region = -lr_corner_fuel_or\n",
    "\n",
    "lr_corner_gap_cell = openmc.Cell(name='lr air gap')\n",
    "lr_corner_gap_cell.region = -lr_corner_clad_ir & +lr_corner_fuel_or\n",
    "\n",
    "lr_corner_clad_cell = openmc.Cell(name='lr clad')\n",
    "lr_corner_clad_cell.fill = zircaloy\n",
    "lr_corner_clad_cell.region = +lr_corner_clad_ir & -lr_corner_clad_or\n",
    "\n",
    "lr_sleave_ir = openmc.ZCylinder(x0=pitch/2-sleave_inner_radius-margin, y0=-pitch/2+sleave_inner_radius-margin, r=sleave_inner_radius)\n",
    "lr_sleave_or = openmc.ZCylinder(x0=pitch/2-sleave_inner_radius-margin, y0=-pitch/2+sleave_inner_radius-margin, r=sleave_inner_radius+sleave_thickness)\n",
    "\n",
    "lr_sleave_hor_bound = openmc.XPlane(x0=pitch/2 - sleave_inner_radius - margin)\n",
    "lr_sleave_ver_bound = openmc.YPlane(y0=-pitch/2 + sleave_inner_radius - margin)\n",
    "\n",
    "lr_sleave_cell = openmc.Cell(name='ur sleave cell')\n",
    "lr_sleave_cell.region = -lr_sleave_or & +lr_sleave_ir & +lr_sleave_hor_bound & -lr_sleave_ver_bound & pin_cell_box\n",
    "lr_sleave_cell.fill = zircaloy\n",
    "\n",
    "lr_sleave_water_cell = openmc.Cell(name='ur sleave water')\n",
    "lr_sleave_water_cell.region = pin_cell_box & +lr_sleave_hor_bound & -lr_sleave_ver_bound & +lr_sleave_or\n",
    "lr_sleave_water_cell.fill = water\n",
    "\n",
    "lr_sleave_ver_water_cell = openmc.Cell(name='ur vertically-equivalent sleave water')\n",
    "lr_sleave_ver_water_cell.region = pin_cell_box & -lr_sleave_hor_bound & -lr_sleave_ver_bound & +lr_sleave_ir\n",
    "lr_sleave_ver_water_cell.fill = water\n",
    "\n",
    "lr_opposite_water_cell = openmc.Cell(name='ur opposite water')\n",
    "lr_opposite_water_cell.region = pin_cell_box & -lr_sleave_hor_bound & +lr_sleave_ver_bound & +lr_sleave_ir\n",
    "lr_opposite_water_cell.fill = water\n",
    "\n",
    "lr_sleave_hor_water_cell = openmc.Cell(name='ur horizontally-equivalent sleave water')\n",
    "lr_sleave_hor_water_cell.region = pin_cell_box & +lr_sleave_hor_bound & +lr_sleave_ver_bound & +lr_sleave_ir\n",
    "lr_sleave_hor_water_cell.fill = water\n",
    "\n",
    "lr_inner_water_cell = openmc.Cell(name='ur inner water cell')\n",
    "lr_inner_water_cell.region = pin_cell_box & -lr_sleave_ir & +lr_corner_clad_or\n",
    "lr_inner_water_cell.fill = water\n",
    "\n",
    "lr_corner_pin_universe = openmc.Universe(cells=[lr_corner_fuel_cell, lr_corner_gap_cell, lr_corner_clad_cell, lr_sleave_cell, lr_inner_water_cell, lr_sleave_water_cell, lr_sleave_ver_water_cell, lr_opposite_water_cell, lr_sleave_hor_water_cell])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f94affee650>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 7292 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "lr_corner_pin_universe.plot(width=(2.5, 2.5), basis = 'xy', colors = {lr_corner_fuel_cell: 'orange', lr_corner_gap_cell: 'white', lr_corner_clad_cell: 'grey', lr_sleave_cell:'brown', lr_inner_water_cell: 'blue', lr_sleave_water_cell: 'blue', lr_sleave_ver_water_cell: 'blue', lr_opposite_water_cell: 'blue', lr_sleave_hor_water_cell: 'blue'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "quarter_pitch = pitch * 8\n",
    "\n",
    "assembly = openmc.RectLattice(name='Quarter Assembly')\n",
    "assembly.pitch = (pitch, pitch)\n",
    "assembly.lower_left = [-quarter_pitch/2, -quarter_pitch/2]\n",
    "\n",
    "assembly.universes = [\n",
    "                      [ul_corner_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, ur_corner_pin_universe],\n",
    "                      [fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe],\n",
    "                      [fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe],\n",
    "                      [fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, water_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe],\n",
    "                      [fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, water_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe],\n",
    "                      [fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe],\n",
    "                      [fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe],\n",
    "                      [ll_corner_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, fuel_pin_universe, lr_corner_pin_universe]\n",
    "]\n",
    "\n",
    "assembly_region = openmc.model.RectangularPrism(width=quarter_pitch, height=quarter_pitch, origin=(0,0))\n",
    "assembly_cell = openmc.Cell(name='quarter assembly cell', fill=assembly, region=assembly_region)\n",
    "\n",
    "assembly_sleave = openmc.Cell(name='quarter assembly sleave')\n",
    "assembly_sleave.region = openmc.model.RectangularPrism(width=quarter_pitch+2*sleave_thickness, height=quarter_pitch+2*sleave_thickness, corner_radius=sleave_inner_radius+sleave_thickness) & ~assembly_cell.region\n",
    "assembly_sleave.fill = zircaloy\n",
    "\n",
    "assembly_outer_water = openmc.Cell(name='assembly outer water')\n",
    "assembly_outer_water.region = ~assembly_sleave.region & ~assembly_cell.region & openmc.model.RectangularPrism(width=quarter_pitch+2*sleave_thickness+1, height=quarter_pitch+2*sleave_thickness+1, boundary_type='reflective')\n",
    "assembly_outer_water.fill = water\n",
    "\n",
    "quarter_assembly_universe = openmc.Universe(cells=[assembly_cell, assembly_sleave, assembly_outer_water])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f94afffffd0>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 13036 characters]",
      "text/plain": [
       "<Figure size 258.065x259.74 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "quarter_assembly_universe.plot(width=(15,15), colors={assembly_outer_water: 'blue'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "geom = openmc.Geometry(quarter_assembly_universe)\n",
    "geom.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "JPOk4874OR3w",
    "outputId": "b15d56c2-f9a1-42c4-b06f-3e779a1953ec"
   },
   "outputs": [],
   "source": [
    "# OpenMC simulation parameters\n",
    "\n",
    "point = openmc.stats.Point((0, 0, 0))\n",
    "src = openmc.IndependentSource(space=point)\n",
    "settings = openmc.Settings()\n",
    "settings.source = src\n",
    "settings.batches = 100\n",
    "settings.inactive = 10\n",
    "settings.particles = 1000\n",
    "settings.export_to_xml()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "lkX_1LrAzw71",
    "outputId": "6331f2a0-42fc-4919-91d3-7bca6b5d735f"
   },
   "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-11-06 17:17:14\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 U234 from /opt/xdata/endfb-vii.1-hdf5/neutron/U234.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 U236 from /opt/xdata/endfb-vii.1-hdf5/neutron/U236.h5\n",
      " Reading O16 from /opt/xdata/endfb-vii.1-hdf5/neutron/O16.h5\n",
      " Reading O17 from /opt/xdata/endfb-vii.1-hdf5/neutron/O17.h5\n",
      " Reading Zr90 from /opt/xdata/endfb-vii.1-hdf5/neutron/Zr90.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 Mn55 from /opt/xdata/endfb-vii.1-hdf5/neutron/Mn55.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 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 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 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 H1 from /opt/xdata/endfb-vii.1-hdf5/neutron/H1.h5\n",
      " Reading H2 from /opt/xdata/endfb-vii.1-hdf5/neutron/H2.h5\n",
      " Reading c_H_in_H2O from /opt/xdata/endfb-vii.1-hdf5/neutron/c_H_in_H2O.h5\n",
      " Minimum neutron data temperature: 250 K\n",
      " Maximum neutron data temperature: 2500 K\n",
      " Preparing distributed cell instances...\n",
      " Reading plot XML file...\n",
      " Writing summary.h5 file...\n",
      " Maximum neutron transport energy: 20000000 eV for U235\n",
      " Initializing source particles...\n",
      "\n",
      " ====================>     K EIGENVALUE SIMULATION     <====================\n",
      "\n",
      "  Bat./Gen.      k            Average k\n",
      "  =========   ========   ====================\n",
      "        1/1    1.18695\n",
      "        2/1    1.18586\n",
      "        3/1    1.18066\n",
      "        4/1    1.23704\n",
      "        5/1    1.34124\n",
      "        6/1    1.20816\n",
      "        7/1    1.13376\n",
      "        8/1    1.23014\n",
      "        9/1    1.21221\n",
      "       10/1    1.23195\n",
      "       11/1    1.24414\n",
      "       12/1    1.26430    1.25422 +/- 0.01008\n",
      "       13/1    1.22695    1.24513 +/- 0.01079\n",
      "       14/1    1.18946    1.23122 +/- 0.01587\n",
      "       15/1    1.16584    1.21814 +/- 0.01795\n",
      "       16/1    1.23050    1.22020 +/- 0.01480\n",
      "       17/1    1.23301    1.22203 +/- 0.01264\n",
      "       18/1    1.21507    1.22116 +/- 0.01098\n",
      "       19/1    1.23984    1.22324 +/- 0.00990\n",
      "       20/1    1.20697    1.22161 +/- 0.00901\n",
      "       21/1    1.16825    1.21676 +/- 0.00948\n",
      "       22/1    1.18190    1.21385 +/- 0.00913\n",
      "       23/1    1.19190    1.21216 +/- 0.00857\n",
      "       24/1    1.18259    1.21005 +/- 0.00821\n",
      "       25/1    1.17806    1.20792 +/- 0.00793\n",
      "       26/1    1.19388    1.20704 +/- 0.00747\n",
      "       27/1    1.32180    1.21379 +/- 0.00974\n",
      "       28/1    1.20340    1.21322 +/- 0.00920\n",
      "       29/1    1.16900    1.21089 +/- 0.00901\n",
      "       30/1    1.13895    1.20729 +/- 0.00927\n",
      "       31/1    1.28009    1.21076 +/- 0.00948\n",
      "       32/1    1.18101    1.20941 +/- 0.00914\n",
      "       33/1    1.20429    1.20918 +/- 0.00873\n",
      "       34/1    1.21962    1.20962 +/- 0.00837\n",
      "       35/1    1.15463    1.20742 +/- 0.00833\n",
      "       36/1    1.24914    1.20902 +/- 0.00816\n",
      "       37/1    1.15683    1.20709 +/- 0.00808\n",
      "       38/1    1.30567    1.21061 +/- 0.00855\n",
      "       39/1    1.14090    1.20821 +/- 0.00859\n",
      "       40/1    1.16673    1.20682 +/- 0.00842\n",
      "       41/1    1.23274    1.20766 +/- 0.00818\n",
      "       42/1    1.26725    1.20952 +/- 0.00814\n",
      "       43/1    1.23986    1.21044 +/- 0.00794\n",
      "       44/1    1.23982    1.21131 +/- 0.00775\n",
      "       45/1    1.13098    1.20901 +/- 0.00787\n",
      "       46/1    1.16702    1.20784 +/- 0.00774\n",
      "       47/1    1.18802    1.20731 +/- 0.00754\n",
      "       48/1    1.22467    1.20777 +/- 0.00736\n",
      "       49/1    1.26050    1.20912 +/- 0.00729\n",
      "       50/1    1.17882    1.20836 +/- 0.00715\n",
      "       51/1    1.21542    1.20853 +/- 0.00697\n",
      "       52/1    1.12269    1.20649 +/- 0.00711\n",
      "       53/1    1.28169    1.20824 +/- 0.00716\n",
      "       54/1    1.25741    1.20936 +/- 0.00708\n",
      "       55/1    1.18334    1.20878 +/- 0.00694\n",
      "       56/1    1.18327    1.20822 +/- 0.00681\n",
      "       57/1    1.24340    1.20897 +/- 0.00671\n",
      "       58/1    1.19818    1.20875 +/- 0.00657\n",
      "       59/1    1.24698    1.20953 +/- 0.00648\n",
      "       60/1    1.24759    1.21029 +/- 0.00640\n",
      "       61/1    1.18303    1.20975 +/- 0.00629\n",
      "       62/1    1.22328    1.21001 +/- 0.00618\n",
      "       63/1    1.24701    1.21071 +/- 0.00610\n",
      "       64/1    1.11837    1.20900 +/- 0.00623\n",
      "       65/1    1.19725    1.20879 +/- 0.00611\n",
      "       66/1    1.22784    1.20913 +/- 0.00601\n",
      "       67/1    1.19362    1.20886 +/- 0.00591\n",
      "       68/1    1.21721    1.20900 +/- 0.00581\n",
      "       69/1    1.15824    1.20814 +/- 0.00578\n",
      "       70/1    1.14602    1.20710 +/- 0.00577\n",
      "       71/1    1.14405    1.20607 +/- 0.00577\n",
      "       72/1    1.18892    1.20579 +/- 0.00569\n",
      "       73/1    1.22762    1.20614 +/- 0.00561\n",
      "       74/1    1.17562    1.20566 +/- 0.00554\n",
      "       75/1    1.18612    1.20536 +/- 0.00546\n",
      "       76/1    1.24534    1.20597 +/- 0.00541\n",
      "       77/1    1.20016    1.20588 +/- 0.00533\n",
      "       78/1    1.20002    1.20580 +/- 0.00525\n",
      "       79/1    1.18411    1.20548 +/- 0.00518\n",
      "       80/1    1.12877    1.20439 +/- 0.00523\n",
      "       81/1    1.24220    1.20492 +/- 0.00518\n",
      "       82/1    1.15698    1.20425 +/- 0.00515\n",
      "       83/1    1.18614    1.20400 +/- 0.00509\n",
      "       84/1    1.21038    1.20409 +/- 0.00502\n",
      "       85/1    1.24440    1.20463 +/- 0.00498\n",
      "       86/1    1.20403    1.20462 +/- 0.00491\n",
      "       87/1    1.21992    1.20482 +/- 0.00485\n",
      "       88/1    1.12710    1.20382 +/- 0.00489\n",
      "       89/1    1.17221    1.20342 +/- 0.00485\n",
      "       90/1    1.22071    1.20364 +/- 0.00479\n",
      "       91/1    1.18175    1.20337 +/- 0.00474\n",
      "       92/1    1.26316    1.20410 +/- 0.00474\n",
      "       93/1    1.27595    1.20496 +/- 0.00476\n",
      "       94/1    1.16567    1.20449 +/- 0.00473\n",
      "       95/1    1.23074    1.20480 +/- 0.00468\n",
      "       96/1    1.25140    1.20535 +/- 0.00466\n",
      "       97/1    1.26655    1.20605 +/- 0.00466\n",
      "       98/1    1.19701    1.20595 +/- 0.00460\n",
      "       99/1    1.19891    1.20587 +/- 0.00455\n",
      "      100/1    1.14200    1.20516 +/- 0.00456\n",
      " Creating state point statepoint.100.h5...\n",
      "\n",
      " =======================>     TIMING STATISTICS     <=======================\n",
      "\n",
      " Total time for initialization     = 5.4015e+00 seconds\n",
      "   Reading cross sections          = 5.3518e+00 seconds\n",
      " Total time in simulation          = 4.6274e+00 seconds\n",
      "   Time in transport only          = 4.6037e+00 seconds\n",
      "   Time in inactive batches        = 4.7393e-01 seconds\n",
      "   Time in active batches          = 4.1535e+00 seconds\n",
      "   Time synchronizing fission bank = 8.0842e-03 seconds\n",
      "     Sampling source sites         = 7.1760e-03 seconds\n",
      "     SEND/RECV source sites        = 8.6601e-04 seconds\n",
      "   Time accumulating tallies       = 4.4106e-05 seconds\n",
      "   Time writing statepoints        = 3.5152e-03 seconds\n",
      " Total time for finalization       = 9.1700e-07 seconds\n",
      " Total time elapsed                = 1.0066e+01 seconds\n",
      " Calculation Rate (inactive)       = 21100.3 particles/second\n",
      " Calculation Rate (active)         = 21668.6 particles/second\n",
      "\n",
      " ============================>     RESULTS     <============================\n",
      "\n",
      " k-effective (Collision)     = 1.20082 +/- 0.00390\n",
      " k-effective (Track-length)  = 1.20516 +/- 0.00456\n",
      " k-effective (Absorption)    = 1.21266 +/- 0.00357\n",
      " Combined k-effective        = 1.20776 +/- 0.00315\n",
      " Leakage Fraction            = 0.00000 +/- 0.00000\n",
      "\n"
     ]
    }
   ],
   "source": [
    "openmc.run()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "accelerator": "GPU",
  "colab": {
   "collapsed_sections": [],
   "name": "thick_thin.IPYNB",
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "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": 4
}
