Skip to content

Instantly share code, notes, and snippets.

@wbinventor
Created October 20, 2015 19:58
Show Gist options
  • Save wbinventor/fa385bf9bb7a6e8e39e4 to your computer and use it in GitHub Desktop.
Save wbinventor/fa385bf9bb7a6e8e39e4 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import glob\n",
"\n",
"import numpy as np\n",
"\n",
"import openmc\n",
"import openmc.mgxs as mgxs\n",
"\n",
"import openmoc\n",
"import openmoc.process\n",
"from openmoc.compatible import get_openmoc_geometry\n",
"from openmoc.materialize import load_from_hdf5\n",
"\n",
"from infermc.datasets.energy_groups import group_structures"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Compute cross-sections from OpenMC tally data"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Load OpenMC statepoint and summary files\n",
"statepoint_filename = glob.glob('statepoint.*.h5')[-1]\n",
"sp = openmc.StatePoint(statepoint_filename)\n",
"su = openmc.Summary('summary.h5')\n",
"sp.link_with_summary(su)\n",
"su.make_opencg_geometry()\n",
"openmc_keff = sp.k_combined[0]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.py:1497: RuntimeWarning: invalid value encountered in divide\n",
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.py:1498: RuntimeWarning: invalid value encountered in divide\n",
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.py:1499: RuntimeWarning: invalid value encountered in divide\n"
]
}
],
"source": [
"# Initialize a fine (70-)group MGXS Library from OpenMC statepoint data\n",
"mgxs_lib = mgxs.Library(su.openmc_geometry, by_nuclide=True)\n",
"mgxs_lib.energy_groups = group_structures['CASMO']['70-group']\n",
"mgxs_lib.mgxs_types = ['transport', 'nu-fission', 'nu-scatter matrix', 'chi']\n",
"mgxs_lib.domain_type = 'cell'\n",
"mgxs_lib.build_library()\n",
"mgxs_lib.load_from_statepoint(sp)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Build a coarse group Library from the fine (70-)group Library\n",
"coarse_groups = group_structures['CASMO']['2-group']\n",
"condense_lib = mgxs_lib.get_condensed_library(coarse_groups)\n",
"condense_lib.build_hdf5_store(nuclides='sum', subdomains='avg')\n",
"\n",
"# Create an OpenMOC Geometry from the OpenCG Geometry\n",
"openmoc_geometry = get_openmoc_geometry(su.opencg_geometry)\n",
"\n",
"# Load the coarse group MGXS library data from HDF5 data store\n",
"openmoc_materials = load_from_hdf5(geometry=openmoc_geometry,\n",
" domain_type='cell', suffix='average')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Initialize OpenMOC Model "
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Set OpenMOC log level to reduce verbosity\n",
"openmoc.log.set_log_level('WARNING')\n",
"\n",
"# Initialize an OpenMOC TrackGenerator and Solver\n",
"openmoc_geometry.initializeFlatSourceRegions()\n",
"track_generator = openmoc.TrackGenerator(openmoc_geometry, 128, 0.01)\n",
"track_generator.generateTracks()\n",
"\n",
"# Initialize an OpenMOC Solver\n",
"solver = openmoc.CPUSolver(track_generator)\n",
"solver.setConvergenceThreshold(1E-5)\n",
"solver.setNumThreads(4)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Create variables for the number of FSRs and energy groups\n",
"num_fsrs = openmoc_geometry.getNumFSRs()\n",
"num_groups = coarse_groups.num_groups"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"openmc_fluxes = np.zeros((num_fsrs, num_groups))\n",
"\n",
"# Compute fixed sources for all FSRs\n",
"for fsr in range(num_fsrs):\n",
"\n",
" # Get the OpenMOC cell for this FSR\n",
" cell = openmoc_geometry.findCellContainingFSR(fsr)\n",
" fsr_volume = track_generator.getFSRVolume(fsr)\n",
"\n",
" # Get the scattering cross-section\n",
" nu_scatter = condense_lib.get_mgxs(cell.getId(), 'nu-scatter matrix')\n",
" nu_scatter = nu_scatter.get_xs(nuclides='sum')\n",
"\n",
" # Get chi\n",
" chi = condense_lib.get_mgxs(cell.getId(), 'chi')\n",
" chi = chi.get_xs(nuclides='sum')\n",
"\n",
" # Get fission cross-section\n",
" nu_fission = condense_lib.get_mgxs(cell.getId(), 'nu-fission')\n",
" nu_fission = nu_fission.get_xs(nuclides='sum')\n",
"\n",
" # Store OpenMC's volume-averaged flux for SPH factor calculation\n",
" mgxs = condense_lib.get_mgxs(cell.getId(), 'nu-fission')\n",
" flux = mgxs.tallies['flux'].mean.flatten()\n",
" openmc_fluxes[fsr, :] = np.atleast_1d(flux / fsr_volume)\n",
"\n",
" # Compute and store volume-averaged fission + scatter sources\n",
" for group in range(num_groups):\n",
" in_scatter = nu_scatter[:, group] * openmc_fluxes[fsr, :]\n",
" fission = (chi[group] / openmc_keff) * nu_fission * openmc_fluxes[fsr, :]\n",
" source = np.sum(in_scatter) + np.sum(fission)\n",
" solver.setFixedSourceByFSR(fsr, group+1, source)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Helper Routines for SPH Iteration"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def get_fission_rate(solver):\n",
" \"\"\"Compute the total energy- and volume-integrated fission rate\n",
" \n",
" Parameters\n",
" ----------\n",
" solver : openmoc.Solver\n",
" A subclass of the OpenMOC Solver\n",
" \n",
" Returns\n",
" -------\n",
" float\n",
" The total energy- and volume-integrated fission rate\n",
" \"\"\"\n",
"\n",
" geometry = solver.getGeometry()\n",
" track_generator = solver.getTrackGenerator()\n",
" fluxes = openmoc.process.get_scalar_fluxes(solver)\n",
" \n",
" num_fsrs = geometry.getNumFSRs()\n",
" num_groups = geometry.getNumEnergyGroups()\n",
"\n",
" fission_rate = 0.\n",
"\n",
" # Compute energy-/volume-integrated fission rate for flux normalization\n",
" for fsr in range(num_fsrs):\n",
" cell = geometry.findCellContainingFSR(fsr)\n",
" material = cell.getFillMaterial()\n",
" fsr_volume = track_generator.getFSRVolume(fsr)\n",
"\n",
" for group in range(num_groups):\n",
" nu_sigma_f = material.getNuSigmaFByGroup(group+1)\n",
" fission_rate += nu_sigma_f * fluxes[fsr,group] * fsr_volume\n",
"\n",
" return fission_rate"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def apply_sph_factors(solver, sph):\n",
" \"\"\"Multiply all cross sections by the appropriate SPH factors\n",
"\n",
" Parameters\n",
" ----------\n",
" solver : openmoc.Solver\n",
" A subclass of the OpenMOC Solver\n",
" sph : ndarray\n",
" An array of SPH factors indexed by FSR and energy group\n",
" \n",
" \"\"\"\n",
" \n",
" geometry = solver.getGeometry()\n",
" track_generator = solver.getTrackGenerator()\n",
" fluxes = openmoc.process.get_scalar_fluxes(solver)\n",
" \n",
" num_fsrs = geometry.getNumFSRs()\n",
" num_groups = geometry.getNumEnergyGroups()\n",
" \n",
" # Apply SPH factors to the total cross sections in each FSR, group\n",
" for fsr in range(num_fsrs):\n",
" cell = geometry.findCellContainingFSR(fsr)\n",
" material = cell.getFillMaterial()\n",
" \n",
" if not material.isFissionable():\n",
" continue\n",
"\n",
" # TOTAL\n",
" tot_xs = condense_lib.get_mgxs(cell.getId(), 'transport')\n",
" tot_xs = tot_xs.get_xs(xs_type='macro', nuclides='sum')\n",
" tot_xs *= sph[fsr,:]\n",
" material.setSigmaT(tot_xs)\n",
"\n",
" # NU-FISSION\n",
" nufiss_xs = condense_lib.get_mgxs(cell.getId(), 'nu-fission')\n",
" nufiss_xs = nufiss_xs.get_xs(xs_type='macro', nuclides='sum')\n",
" nufiss_xs *= sph[fsr,:]\n",
" material.setNuSigmaF(nufiss_xs)\n",
" \n",
" # NU-SCATTER\n",
" nuscatt_xs = condense_lib.get_mgxs(cell.getId(), 'nu-scatter matrix')\n",
" nuscatt_xs = nuscatt_xs.get_xs(xs_type='macro', nuclides='sum')\n",
" sph_arr = np.repeat(sph[fsr,:][:,np.newaxis], coarse_groups.num_groups, axis=1)\n",
" nuscatt_xs *= sph_arr\n",
" material.setSigmaS(nuscatt_xs.flatten())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## SPH ITERATION!!!"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(array([[ 10.67301169, 19.30600691],\n",
" [ 11.20527225, 18.85936595],\n",
" [ 11.44791031, 18.7065345 ],\n",
" [ 12.23091339, 18.21226379]]), array([[ 5.00142113, 20.4912737 ],\n",
" [ 4.80935692, 20.71784109],\n",
" [ 4.7207709 , 20.63210182],\n",
" [ 4.59665592, 20.96958541]]))\n",
"------------------------------------iter 0------------------------------------\n",
"Max. SPH Res = 6.241772e-01\n",
"Fission rate = 3.47581077415\n",
"SPH factors = \n",
"[[ 0.46860448 1.06139368]\n",
" [ 0.42920483 1.09854388]\n",
" [ 0.41236966 1.10293554]\n",
" [ 0.37582278 1.15139917]]\n",
"applying factor to material fuel 1.6%\n",
"[[ 0.37582278 0.37582278]\n",
" [ 1.15139917 1.15139917]]\n",
"((2, 2), (2, 2))\n",
"(array([[ 14.10046325, 18.95674679],\n",
" [ 14.94901898, 18.32978197],\n",
" [ 15.32506106, 18.1141655 ],\n",
" [ 16.42081679, 17.40340646]]), array([[ 5.00142113, 20.4912737 ],\n",
" [ 4.80935692, 20.71784109],\n",
" [ 4.7207709 , 20.63210182],\n",
" [ 4.59665592, 20.96958541]]))\n",
"------------------------------------iter 1------------------------------------\n",
"Max. SPH Res = 7.200714e-01\n",
"Fission rate = 3.76305656402\n",
"SPH factors = \n",
"[[ 0.35469907 1.08094885]\n",
" [ 0.32171723 1.13028301]\n",
" [ 0.30804255 1.13900372]\n",
" [ 0.27992858 1.2049127 ]]\n",
"applying factor to material fuel 1.6%\n",
"[[ 0.27992858 0.27992858]\n",
" [ 1.2049127 1.2049127 ]]\n",
"((2, 2), (2, 2))\n",
"(array([[ 14.84700944, 18.84084506],\n",
" [ 15.77039487, 18.15452017],\n",
" [ 16.17671857, 17.91800955],\n",
" [ 17.32611311, 17.13331477]]), array([[ 5.00142113, 20.4912737 ],\n",
" [ 4.80935692, 20.71784109],\n",
" [ 4.7207709 , 20.63210182],\n",
" [ 4.59665592, 20.96958541]]))\n",
"------------------------------------iter 2------------------------------------\n",
"Max. SPH Res = 7.346978e-01\n",
"Fission rate = 3.86416175115\n",
"SPH factors = \n",
"[[ 0.33686388 1.08759844]\n",
" [ 0.3049611 1.14119464]\n",
" [ 0.291825 1.15147287]\n",
" [ 0.2653022 1.22390709]]\n",
"applying factor to material fuel 1.6%\n",
"[[ 0.2653022 0.2653022 ]\n",
" [ 1.22390709 1.22390709]]\n",
"((2, 2), (2, 2))\n",
"(array([[ 14.9679094 , 18.80059835],\n",
" [ 15.90367454, 18.0937122 ],\n",
" [ 16.31498905, 17.84993733],\n",
" [ 17.47447641, 17.03930932]]), array([[ 5.00142113, 20.4912737 ],\n",
" [ 4.80935692, 20.71784109],\n",
" [ 4.7207709 , 20.63210182],\n",
" [ 4.59665592, 20.96958541]]))\n",
"------------------------------------iter 3------------------------------------\n",
"Max. SPH Res = 7.369503e-01\n",
"Fission rate = 3.90132621955\n",
"SPH factors = \n",
"[[ 0.33414293 1.08992668]\n",
" [ 0.30240539 1.14502988]\n",
" [ 0.28935177 1.1558641 ]\n",
" [ 0.26304971 1.23065935]]\n",
"applying factor to material fuel 1.6%\n",
"[[ 0.26304971 0.26304971]\n",
" [ 1.23065935 1.23065935]]\n",
"((2, 2), (2, 2))\n",
"(array([[ 14.98663563, 18.78639726],\n",
" [ 15.9243206 , 18.07226164],\n",
" [ 16.3364212 , 17.82592223],\n",
" [ 17.49806512, 17.00613925]]), array([[ 5.00142113, 20.4912737 ],\n",
" [ 4.80935692, 20.71784109],\n",
" [ 4.7207709 , 20.63210182],\n",
" [ 4.59665592, 20.96958541]]))\n",
"------------------------------------iter 4------------------------------------\n",
"Max. SPH Res = 7.373049e-01\n",
"Fission rate = 3.91479577322\n",
"SPH factors = \n",
"[[ 0.33372541 1.09075058]\n",
" [ 0.30201332 1.14638895]\n",
" [ 0.28897216 1.15742129]\n",
" [ 0.2626951 1.23305973]]\n",
"applying factor to material fuel 1.6%\n",
"[[ 0.2626951 0.2626951 ]\n",
" [ 1.23305973 1.23305973]]\n",
"((2, 2), (2, 2))\n"
]
}
],
"source": [
"for i in range(5):\n",
"\n",
" # Run fixed source calculation\n",
" solver.computeFlux()\n",
"\n",
" # Extract the FSR scalar fluxes and total fission rate\n",
" openmoc_fluxes = openmoc.process.get_scalar_fluxes(solver)\n",
" openmoc_fission_rate = get_fission_rate(solver)\n",
" \n",
" print('openmc flux: {}'.format(openmc_fluxes))\n",
" print('openmoc flux: {}'.format(openmoc_fluxes))\n",
"\n",
" # Compute SPH factors\n",
" sph = openmc_fluxes / openmoc_fluxes\n",
"\n",
" # Report maximum SPH factor deviation from unity, etc.\n",
" print('-'*36 + 'iter {}'.format(i) + '-'*36)\n",
" print('Max. SPH Res = {0:1.6e}'.format(np.abs(sph - 1).max()))\n",
" print('Fission rate = {}'.format(openmoc_fission_rate))\n",
" print('SPH factors = \\n{}'.format(sph))\n",
" \n",
" # Update multi-group cross sections with SPH factors\n",
" apply_sph_factors(solver, sph)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ WARNING ] Over-riding fixed source 1.303830 in FSR ID=0 with 0.000000\n",
"[ WARNING ] Over-riding fixed source 30.894616 in FSR ID=0 with 0.000000\n",
"[ WARNING ] Over-riding fixed source 1.289549 in FSR ID=1 with 0.000000\n",
"[ WARNING ] Over-riding fixed source 6.077006 in FSR ID=1 with 0.000000\n",
"[ WARNING ] Over-riding fixed source 0.001830 in FSR ID=2 with 0.000000\n",
"[ WARNING ] Over-riding fixed source 0.003546 in FSR ID=2 with 0.000000\n",
"[ WARNING ] Over-riding fixed source 8.548812 in FSR ID=3 with 0.000000\n",
"[ WARNING ] Over-riding fixed source 8.152816 in FSR ID=3 with 0.000000\n"
]
}
],
"source": [
"for fsr in range(num_fsrs):\n",
" for group in range(num_groups):\n",
" solver.setFixedSourceByFSR(fsr, group+1, 0.0)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ NORMAL ] Computing the eigenvalue...\n",
"[ NORMAL ] Iteration 0:\tk_eff = 0.614876\tres = 1.546E-316\n",
"[ NORMAL ] Iteration 1:\tk_eff = 0.627357\tres = 3.851E-01\n",
"[ NORMAL ] Iteration 2:\tk_eff = 0.585894\tres = 2.030E-02\n",
"[ NORMAL ] Iteration 3:\tk_eff = 0.564913\tres = 6.609E-02\n",
"[ NORMAL ] Iteration 4:\tk_eff = 0.543784\tres = 3.581E-02\n",
"[ NORMAL ] Iteration 5:\tk_eff = 0.526773\tres = 3.740E-02\n",
"[ NORMAL ] Iteration 6:\tk_eff = 0.512454\tres = 3.128E-02\n",
"[ NORMAL ] Iteration 7:\tk_eff = 0.500866\tres = 2.718E-02\n",
"[ NORMAL ] Iteration 8:\tk_eff = 0.491719\tres = 2.261E-02\n",
"[ NORMAL ] Iteration 9:\tk_eff = 0.484822\tres = 1.826E-02\n",
"[ NORMAL ] Iteration 10:\tk_eff = 0.479980\tres = 1.403E-02\n",
"[ NORMAL ] Iteration 11:\tk_eff = 0.477015\tres = 9.988E-03\n",
"[ NORMAL ] Iteration 12:\tk_eff = 0.475763\tres = 6.177E-03\n",
"[ NORMAL ] Iteration 13:\tk_eff = 0.476068\tres = 2.625E-03\n",
"[ NORMAL ] Iteration 14:\tk_eff = 0.477788\tres = 6.416E-04\n",
"[ NORMAL ] Iteration 15:\tk_eff = 0.480788\tres = 3.612E-03\n",
"[ NORMAL ] Iteration 16:\tk_eff = 0.484946\tres = 6.279E-03\n",
"[ NORMAL ] Iteration 17:\tk_eff = 0.490148\tres = 8.649E-03\n",
"[ NORMAL ] Iteration 18:\tk_eff = 0.496288\tres = 1.073E-02\n",
"[ NORMAL ] Iteration 19:\tk_eff = 0.503266\tres = 1.253E-02\n",
"[ NORMAL ] Iteration 20:\tk_eff = 0.510993\tres = 1.406E-02\n",
"[ NORMAL ] Iteration 21:\tk_eff = 0.519385\tres = 1.535E-02\n",
"[ NORMAL ] Iteration 22:\tk_eff = 0.528363\tres = 1.642E-02\n",
"[ NORMAL ] Iteration 23:\tk_eff = 0.537856\tres = 1.729E-02\n",
"[ NORMAL ] Iteration 24:\tk_eff = 0.547798\tres = 1.797E-02\n",
"[ NORMAL ] Iteration 25:\tk_eff = 0.558127\tres = 1.848E-02\n",
"[ NORMAL ] Iteration 26:\tk_eff = 0.568787\tres = 1.886E-02\n",
"[ NORMAL ] Iteration 27:\tk_eff = 0.579726\tres = 1.910E-02\n",
"[ NORMAL ] Iteration 28:\tk_eff = 0.590897\tres = 1.923E-02\n",
"[ NORMAL ] Iteration 29:\tk_eff = 0.602256\tres = 1.927E-02\n",
"[ NORMAL ] Iteration 30:\tk_eff = 0.613762\tres = 1.922E-02\n",
"[ NORMAL ] Iteration 31:\tk_eff = 0.625380\tres = 1.911E-02\n",
"[ NORMAL ] Iteration 32:\tk_eff = 0.637075\tres = 1.893E-02\n",
"[ NORMAL ] Iteration 33:\tk_eff = 0.648816\tres = 1.870E-02\n",
"[ NORMAL ] Iteration 34:\tk_eff = 0.660576\tres = 1.843E-02\n",
"[ NORMAL ] Iteration 35:\tk_eff = 0.672330\tres = 1.813E-02\n",
"[ NORMAL ] Iteration 36:\tk_eff = 0.684053\tres = 1.779E-02\n",
"[ NORMAL ] Iteration 37:\tk_eff = 0.695726\tres = 1.744E-02\n",
"[ NORMAL ] Iteration 38:\tk_eff = 0.707329\tres = 1.706E-02\n",
"[ NORMAL ] Iteration 39:\tk_eff = 0.718845\tres = 1.668E-02\n",
"[ NORMAL ] Iteration 40:\tk_eff = 0.730259\tres = 1.628E-02\n",
"[ NORMAL ] Iteration 41:\tk_eff = 0.741557\tres = 1.588E-02\n",
"[ NORMAL ] Iteration 42:\tk_eff = 0.752727\tres = 1.547E-02\n",
"[ NORMAL ] Iteration 43:\tk_eff = 0.763758\tres = 1.506E-02\n",
"[ NORMAL ] Iteration 44:\tk_eff = 0.774641\tres = 1.465E-02\n",
"[ NORMAL ] Iteration 45:\tk_eff = 0.785367\tres = 1.425E-02\n",
"[ NORMAL ] Iteration 46:\tk_eff = 0.795928\tres = 1.385E-02\n",
"[ NORMAL ] Iteration 47:\tk_eff = 0.806320\tres = 1.345E-02\n",
"[ NORMAL ] Iteration 48:\tk_eff = 0.816535\tres = 1.306E-02\n",
"[ NORMAL ] Iteration 49:\tk_eff = 0.826570\tres = 1.267E-02\n",
"[ NORMAL ] Iteration 50:\tk_eff = 0.836420\tres = 1.229E-02\n",
"[ NORMAL ] Iteration 51:\tk_eff = 0.846084\tres = 1.192E-02\n",
"[ NORMAL ] Iteration 52:\tk_eff = 0.855558\tres = 1.155E-02\n",
"[ NORMAL ] Iteration 53:\tk_eff = 0.864840\tres = 1.120E-02\n",
"[ NORMAL ] Iteration 54:\tk_eff = 0.873930\tres = 1.085E-02\n",
"[ NORMAL ] Iteration 55:\tk_eff = 0.882827\tres = 1.051E-02\n",
"[ NORMAL ] Iteration 56:\tk_eff = 0.891529\tres = 1.018E-02\n",
"[ NORMAL ] Iteration 57:\tk_eff = 0.900039\tres = 9.858E-03\n",
"[ NORMAL ] Iteration 58:\tk_eff = 0.908355\tres = 9.545E-03\n",
"[ NORMAL ] Iteration 59:\tk_eff = 0.916480\tres = 9.240E-03\n",
"[ NORMAL ] Iteration 60:\tk_eff = 0.924413\tres = 8.944E-03\n",
"[ NORMAL ] Iteration 61:\tk_eff = 0.932157\tres = 8.656E-03\n",
"[ NORMAL ] Iteration 62:\tk_eff = 0.939713\tres = 8.377E-03\n",
"[ NORMAL ] Iteration 63:\tk_eff = 0.947083\tres = 8.106E-03\n",
"[ NORMAL ] Iteration 64:\tk_eff = 0.954269\tres = 7.843E-03\n",
"[ NORMAL ] Iteration 65:\tk_eff = 0.961274\tres = 7.588E-03\n",
"[ NORMAL ] Iteration 66:\tk_eff = 0.968101\tres = 7.341E-03\n",
"[ NORMAL ] Iteration 67:\tk_eff = 0.974750\tres = 7.101E-03\n",
"[ NORMAL ] Iteration 68:\tk_eff = 0.981226\tres = 6.869E-03\n",
"[ NORMAL ] Iteration 69:\tk_eff = 0.987531\tres = 6.644E-03\n",
"[ NORMAL ] Iteration 70:\tk_eff = 0.993668\tres = 6.426E-03\n",
"[ NORMAL ] Iteration 71:\tk_eff = 0.999640\tres = 6.215E-03\n",
"[ NORMAL ] Iteration 72:\tk_eff = 1.005450\tres = 6.010E-03\n",
"[ NORMAL ] Iteration 73:\tk_eff = 1.011102\tres = 5.812E-03\n",
"[ NORMAL ] Iteration 74:\tk_eff = 1.016597\tres = 5.621E-03\n",
"[ NORMAL ] Iteration 75:\tk_eff = 1.021940\tres = 5.435E-03\n",
"[ NORMAL ] Iteration 76:\tk_eff = 1.027133\tres = 5.256E-03\n",
"[ NORMAL ] Iteration 77:\tk_eff = 1.032180\tres = 5.082E-03\n",
"[ NORMAL ] Iteration 78:\tk_eff = 1.037085\tres = 4.914E-03\n",
"[ NORMAL ] Iteration 79:\tk_eff = 1.041849\tres = 4.751E-03\n",
"[ NORMAL ] Iteration 80:\tk_eff = 1.046476\tres = 4.594E-03\n",
"[ NORMAL ] Iteration 81:\tk_eff = 1.050970\tres = 4.442E-03\n",
"[ NORMAL ] Iteration 82:\tk_eff = 1.055334\tres = 4.294E-03\n",
"[ NORMAL ] Iteration 83:\tk_eff = 1.059570\tres = 4.152E-03\n",
"[ NORMAL ] Iteration 84:\tk_eff = 1.063683\tres = 4.014E-03\n",
"[ NORMAL ] Iteration 85:\tk_eff = 1.067674\tres = 3.881E-03\n",
"[ NORMAL ] Iteration 86:\tk_eff = 1.071547\tres = 3.752E-03\n",
"[ NORMAL ] Iteration 87:\tk_eff = 1.075305\tres = 3.627E-03\n",
"[ NORMAL ] Iteration 88:\tk_eff = 1.078950\tres = 3.507E-03\n",
"[ NORMAL ] Iteration 89:\tk_eff = 1.082487\tres = 3.390E-03\n",
"[ NORMAL ] Iteration 90:\tk_eff = 1.085917\tres = 3.278E-03\n",
"[ NORMAL ] Iteration 91:\tk_eff = 1.089243\tres = 3.169E-03\n",
"[ NORMAL ] Iteration 92:\tk_eff = 1.092468\tres = 3.063E-03\n",
"[ NORMAL ] Iteration 93:\tk_eff = 1.095596\tres = 2.961E-03\n",
"[ NORMAL ] Iteration 94:\tk_eff = 1.098628\tres = 2.863E-03\n",
"[ NORMAL ] Iteration 95:\tk_eff = 1.101567\tres = 2.767E-03\n",
"[ NORMAL ] Iteration 96:\tk_eff = 1.104416\tres = 2.675E-03\n",
"[ NORMAL ] Iteration 97:\tk_eff = 1.107177\tres = 2.586E-03\n",
"[ NORMAL ] Iteration 98:\tk_eff = 1.109852\tres = 2.500E-03\n",
"[ NORMAL ] Iteration 99:\tk_eff = 1.112445\tres = 2.417E-03\n",
"[ NORMAL ] Iteration 100:\tk_eff = 1.114957\tres = 2.336E-03\n",
"[ NORMAL ] Iteration 101:\tk_eff = 1.117391\tres = 2.258E-03\n",
"[ NORMAL ] Iteration 102:\tk_eff = 1.119749\tres = 2.183E-03\n",
"[ NORMAL ] Iteration 103:\tk_eff = 1.122033\tres = 2.110E-03\n",
"[ NORMAL ] Iteration 104:\tk_eff = 1.124245\tres = 2.040E-03\n",
"[ NORMAL ] Iteration 105:\tk_eff = 1.126388\tres = 1.972E-03\n",
"[ NORMAL ] Iteration 106:\tk_eff = 1.128463\tres = 1.906E-03\n",
"[ NORMAL ] Iteration 107:\tk_eff = 1.130472\tres = 1.842E-03\n",
"[ NORMAL ] Iteration 108:\tk_eff = 1.132418\tres = 1.781E-03\n",
"[ NORMAL ] Iteration 109:\tk_eff = 1.134303\tres = 1.721E-03\n",
"[ NORMAL ] Iteration 110:\tk_eff = 1.136127\tres = 1.664E-03\n",
"[ NORMAL ] Iteration 111:\tk_eff = 1.137893\tres = 1.608E-03\n",
"[ NORMAL ] Iteration 112:\tk_eff = 1.139603\tres = 1.555E-03\n",
"[ NORMAL ] Iteration 113:\tk_eff = 1.141258\tres = 1.503E-03\n",
"[ NORMAL ] Iteration 114:\tk_eff = 1.142861\tres = 1.452E-03\n",
"[ NORMAL ] Iteration 115:\tk_eff = 1.144412\tres = 1.404E-03\n",
"[ NORMAL ] Iteration 116:\tk_eff = 1.145913\tres = 1.357E-03\n",
"[ NORMAL ] Iteration 117:\tk_eff = 1.147365\tres = 1.312E-03\n",
"[ NORMAL ] Iteration 118:\tk_eff = 1.148771\tres = 1.268E-03\n",
"[ NORMAL ] Iteration 119:\tk_eff = 1.150132\tres = 1.225E-03\n",
"[ NORMAL ] Iteration 120:\tk_eff = 1.151449\tres = 1.184E-03\n",
"[ NORMAL ] Iteration 121:\tk_eff = 1.152723\tres = 1.145E-03\n",
"[ NORMAL ] Iteration 122:\tk_eff = 1.153956\tres = 1.107E-03\n",
"[ NORMAL ] Iteration 123:\tk_eff = 1.155148\tres = 1.069E-03\n",
"[ NORMAL ] Iteration 124:\tk_eff = 1.156303\tres = 1.034E-03\n",
"[ NORMAL ] Iteration 125:\tk_eff = 1.157419\tres = 9.991E-04\n",
"[ NORMAL ] Iteration 126:\tk_eff = 1.158499\tres = 9.657E-04\n",
"[ NORMAL ] Iteration 127:\tk_eff = 1.159545\tres = 9.333E-04\n",
"[ NORMAL ] Iteration 128:\tk_eff = 1.160555\tres = 9.021E-04\n",
"[ NORMAL ] Iteration 129:\tk_eff = 1.161533\tres = 8.719E-04\n",
"[ NORMAL ] Iteration 130:\tk_eff = 1.162479\tres = 8.427E-04\n",
"[ NORMAL ] Iteration 131:\tk_eff = 1.163394\tres = 8.144E-04\n",
"[ NORMAL ] Iteration 132:\tk_eff = 1.164280\tres = 7.872E-04\n",
"[ NORMAL ] Iteration 133:\tk_eff = 1.165136\tres = 7.608E-04\n",
"[ NORMAL ] Iteration 134:\tk_eff = 1.165964\tres = 7.353E-04\n",
"[ NORMAL ] Iteration 135:\tk_eff = 1.166764\tres = 7.106E-04\n",
"[ NORMAL ] Iteration 136:\tk_eff = 1.167539\tres = 6.868E-04\n",
"[ NORMAL ] Iteration 137:\tk_eff = 1.168288\tres = 6.638E-04\n",
"[ NORMAL ] Iteration 138:\tk_eff = 1.169012\tres = 6.415E-04\n",
"[ NORMAL ] Iteration 139:\tk_eff = 1.169713\tres = 6.200E-04\n",
"[ NORMAL ] Iteration 140:\tk_eff = 1.170390\tres = 5.992E-04\n",
"[ NORMAL ] Iteration 141:\tk_eff = 1.171045\tres = 5.791E-04\n",
"[ NORMAL ] Iteration 142:\tk_eff = 1.171679\tres = 5.597E-04\n",
"[ NORMAL ] Iteration 143:\tk_eff = 1.172291\tres = 5.409E-04\n",
"[ NORMAL ] Iteration 144:\tk_eff = 1.172883\tres = 5.227E-04\n",
"[ NORMAL ] Iteration 145:\tk_eff = 1.173456\tres = 5.052E-04\n",
"[ NORMAL ] Iteration 146:\tk_eff = 1.174010\tres = 4.882E-04\n",
"[ NORMAL ] Iteration 147:\tk_eff = 1.174545\tres = 4.718E-04\n",
"[ NORMAL ] Iteration 148:\tk_eff = 1.175063\tres = 4.560E-04\n",
"[ NORMAL ] Iteration 149:\tk_eff = 1.175563\tres = 4.407E-04\n",
"[ NORMAL ] Iteration 150:\tk_eff = 1.176047\tres = 4.259E-04\n",
"[ NORMAL ] Iteration 151:\tk_eff = 1.176515\tres = 4.116E-04\n",
"[ NORMAL ] Iteration 152:\tk_eff = 1.176967\tres = 3.978E-04\n",
"[ NORMAL ] Iteration 153:\tk_eff = 1.177404\tres = 3.844E-04\n",
"[ NORMAL ] Iteration 154:\tk_eff = 1.177827\tres = 3.715E-04\n",
"[ NORMAL ] Iteration 155:\tk_eff = 1.178235\tres = 3.590E-04\n",
"[ NORMAL ] Iteration 156:\tk_eff = 1.178630\tres = 3.469E-04\n",
"[ NORMAL ] Iteration 157:\tk_eff = 1.179012\tres = 3.353E-04\n",
"[ NORMAL ] Iteration 158:\tk_eff = 1.179381\tres = 3.240E-04\n",
"[ NORMAL ] Iteration 159:\tk_eff = 1.179738\tres = 3.131E-04\n",
"[ NORMAL ] Iteration 160:\tk_eff = 1.180083\tres = 3.026E-04\n",
"[ NORMAL ] Iteration 161:\tk_eff = 1.180417\tres = 2.924E-04\n",
"[ NORMAL ] Iteration 162:\tk_eff = 1.180739\tres = 2.825E-04\n",
"[ NORMAL ] Iteration 163:\tk_eff = 1.181050\tres = 2.730E-04\n",
"[ NORMAL ] Iteration 164:\tk_eff = 1.181352\tres = 2.639E-04\n",
"[ NORMAL ] Iteration 165:\tk_eff = 1.181643\tres = 2.550E-04\n",
"[ NORMAL ] Iteration 166:\tk_eff = 1.181924\tres = 2.464E-04\n",
"[ NORMAL ] Iteration 167:\tk_eff = 1.182196\tres = 2.381E-04\n",
"[ NORMAL ] Iteration 168:\tk_eff = 1.182459\tres = 2.301E-04\n",
"[ NORMAL ] Iteration 169:\tk_eff = 1.182713\tres = 2.223E-04\n",
"[ NORMAL ] Iteration 170:\tk_eff = 1.182958\tres = 2.149E-04\n",
"[ NORMAL ] Iteration 171:\tk_eff = 1.183196\tres = 2.076E-04\n",
"[ NORMAL ] Iteration 172:\tk_eff = 1.183425\tres = 2.006E-04\n",
"[ NORMAL ] Iteration 173:\tk_eff = 1.183647\tres = 1.939E-04\n",
"[ NORMAL ] Iteration 174:\tk_eff = 1.183861\tres = 1.873E-04\n",
"[ NORMAL ] Iteration 175:\tk_eff = 1.184068\tres = 1.810E-04\n",
"[ NORMAL ] Iteration 176:\tk_eff = 1.184269\tres = 1.749E-04\n",
"[ NORMAL ] Iteration 177:\tk_eff = 1.184462\tres = 1.690E-04\n",
"[ NORMAL ] Iteration 178:\tk_eff = 1.184649\tres = 1.634E-04\n",
"[ NORMAL ] Iteration 179:\tk_eff = 1.184830\tres = 1.578E-04\n",
"[ NORMAL ] Iteration 180:\tk_eff = 1.185004\tres = 1.525E-04\n",
"[ NORMAL ] Iteration 181:\tk_eff = 1.185173\tres = 1.474E-04\n",
"[ NORMAL ] Iteration 182:\tk_eff = 1.185336\tres = 1.424E-04\n",
"[ NORMAL ] Iteration 183:\tk_eff = 1.185494\tres = 1.376E-04\n",
"[ NORMAL ] Iteration 184:\tk_eff = 1.185646\tres = 1.330E-04\n",
"[ NORMAL ] Iteration 185:\tk_eff = 1.185793\tres = 1.285E-04\n",
"[ NORMAL ] Iteration 186:\tk_eff = 1.185936\tres = 1.242E-04\n",
"[ NORMAL ] Iteration 187:\tk_eff = 1.186073\tres = 1.200E-04\n",
"[ NORMAL ] Iteration 188:\tk_eff = 1.186206\tres = 1.159E-04\n",
"[ NORMAL ] Iteration 189:\tk_eff = 1.186334\tres = 1.120E-04\n",
"[ NORMAL ] Iteration 190:\tk_eff = 1.186458\tres = 1.082E-04\n",
"[ NORMAL ] Iteration 191:\tk_eff = 1.186578\tres = 1.046E-04\n",
"[ NORMAL ] Iteration 192:\tk_eff = 1.186694\tres = 1.011E-04\n",
"[ NORMAL ] Iteration 193:\tk_eff = 1.186806\tres = 9.766E-05\n",
"[ NORMAL ] Iteration 194:\tk_eff = 1.186914\tres = 9.437E-05\n",
"[ NORMAL ] Iteration 195:\tk_eff = 1.187019\tres = 9.118E-05\n",
"[ NORMAL ] Iteration 196:\tk_eff = 1.187120\tres = 8.811E-05\n",
"[ NORMAL ] Iteration 197:\tk_eff = 1.187218\tres = 8.513E-05\n",
"[ NORMAL ] Iteration 198:\tk_eff = 1.187312\tres = 8.226E-05\n",
"[ NORMAL ] Iteration 199:\tk_eff = 1.187403\tres = 7.948E-05\n",
"[ NORMAL ] Iteration 200:\tk_eff = 1.187491\tres = 7.680E-05\n",
"[ NORMAL ] Iteration 201:\tk_eff = 1.187577\tres = 7.421E-05\n",
"[ NORMAL ] Iteration 202:\tk_eff = 1.187659\tres = 7.171E-05\n",
"[ NORMAL ] Iteration 203:\tk_eff = 1.187738\tres = 6.929E-05\n",
"[ NORMAL ] Iteration 204:\tk_eff = 1.187815\tres = 6.695E-05\n",
"[ NORMAL ] Iteration 205:\tk_eff = 1.187889\tres = 6.469E-05\n",
"[ NORMAL ] Iteration 206:\tk_eff = 1.187961\tres = 6.250E-05\n",
"[ NORMAL ] Iteration 207:\tk_eff = 1.188030\tres = 6.039E-05\n",
"[ NORMAL ] Iteration 208:\tk_eff = 1.188097\tres = 5.835E-05\n",
"[ NORMAL ] Iteration 209:\tk_eff = 1.188162\tres = 5.638E-05\n",
"[ NORMAL ] Iteration 210:\tk_eff = 1.188225\tres = 5.448E-05\n",
"[ NORMAL ] Iteration 211:\tk_eff = 1.188285\tres = 5.264E-05\n",
"[ NORMAL ] Iteration 212:\tk_eff = 1.188344\tres = 5.086E-05\n",
"[ NORMAL ] Iteration 213:\tk_eff = 1.188400\tres = 4.915E-05\n",
"[ NORMAL ] Iteration 214:\tk_eff = 1.188454\tres = 4.749E-05\n",
"[ NORMAL ] Iteration 215:\tk_eff = 1.188507\tres = 4.588E-05\n",
"[ NORMAL ] Iteration 216:\tk_eff = 1.188558\tres = 4.433E-05\n",
"[ NORMAL ] Iteration 217:\tk_eff = 1.188607\tres = 4.283E-05\n",
"[ NORMAL ] Iteration 218:\tk_eff = 1.188655\tres = 4.139E-05\n",
"[ NORMAL ] Iteration 219:\tk_eff = 1.188701\tres = 3.999E-05\n",
"[ NORMAL ] Iteration 220:\tk_eff = 1.188745\tres = 3.864E-05\n",
"[ NORMAL ] Iteration 221:\tk_eff = 1.188788\tres = 3.733E-05\n",
"[ NORMAL ] Iteration 222:\tk_eff = 1.188829\tres = 3.607E-05\n",
"[ NORMAL ] Iteration 223:\tk_eff = 1.188869\tres = 3.485E-05\n",
"[ NORMAL ] Iteration 224:\tk_eff = 1.188908\tres = 3.368E-05\n",
"[ NORMAL ] Iteration 225:\tk_eff = 1.188946\tres = 3.254E-05\n",
"[ NORMAL ] Iteration 226:\tk_eff = 1.188982\tres = 3.144E-05\n",
"[ NORMAL ] Iteration 227:\tk_eff = 1.189017\tres = 3.038E-05\n",
"[ NORMAL ] Iteration 228:\tk_eff = 1.189050\tres = 2.935E-05\n",
"[ NORMAL ] Iteration 229:\tk_eff = 1.189083\tres = 2.836E-05\n",
"[ NORMAL ] Iteration 230:\tk_eff = 1.189114\tres = 2.740E-05\n",
"[ NORMAL ] Iteration 231:\tk_eff = 1.189145\tres = 2.647E-05\n",
"[ NORMAL ] Iteration 232:\tk_eff = 1.189174\tres = 2.558E-05\n",
"[ NORMAL ] Iteration 233:\tk_eff = 1.189203\tres = 2.472E-05\n",
"[ NORMAL ] Iteration 234:\tk_eff = 1.189230\tres = 2.388E-05\n",
"[ NORMAL ] Iteration 235:\tk_eff = 1.189256\tres = 2.307E-05\n",
"[ NORMAL ] Iteration 236:\tk_eff = 1.189282\tres = 2.229E-05\n",
"[ NORMAL ] Iteration 237:\tk_eff = 1.189307\tres = 2.154E-05\n",
"[ NORMAL ] Iteration 238:\tk_eff = 1.189331\tres = 2.081E-05\n",
"[ NORMAL ] Iteration 239:\tk_eff = 1.189354\tres = 2.011E-05\n",
"[ NORMAL ] Iteration 240:\tk_eff = 1.189376\tres = 1.943E-05\n",
"[ NORMAL ] Iteration 241:\tk_eff = 1.189398\tres = 1.877E-05\n",
"[ NORMAL ] Iteration 242:\tk_eff = 1.189419\tres = 1.814E-05\n",
"[ NORMAL ] Iteration 243:\tk_eff = 1.189439\tres = 1.752E-05\n",
"[ NORMAL ] Iteration 244:\tk_eff = 1.189458\tres = 1.693E-05\n",
"[ NORMAL ] Iteration 245:\tk_eff = 1.189477\tres = 1.636E-05\n",
"[ NORMAL ] Iteration 246:\tk_eff = 1.189495\tres = 1.581E-05\n",
"[ NORMAL ] Iteration 247:\tk_eff = 1.189513\tres = 1.527E-05\n",
"[ NORMAL ] Iteration 248:\tk_eff = 1.189530\tres = 1.476E-05\n",
"[ NORMAL ] Iteration 249:\tk_eff = 1.189546\tres = 1.426E-05\n",
"[ NORMAL ] Iteration 250:\tk_eff = 1.189562\tres = 1.377E-05\n",
"[ NORMAL ] Iteration 251:\tk_eff = 1.189577\tres = 1.331E-05\n",
"[ NORMAL ] Iteration 252:\tk_eff = 1.189592\tres = 1.286E-05\n",
"[ NORMAL ] Iteration 253:\tk_eff = 1.189606\tres = 1.242E-05\n",
"[ NORMAL ] Iteration 254:\tk_eff = 1.189620\tres = 1.200E-05\n",
"[ NORMAL ] Iteration 255:\tk_eff = 1.189633\tres = 1.160E-05\n",
"[ NORMAL ] Iteration 256:\tk_eff = 1.189646\tres = 1.121E-05\n",
"[ NORMAL ] Iteration 257:\tk_eff = 1.189659\tres = 1.083E-05\n",
"[ NORMAL ] Iteration 258:\tk_eff = 1.189671\tres = 1.046E-05\n",
"[ NORMAL ] Iteration 259:\tk_eff = 1.189682\tres = 1.011E-05\n"
]
}
],
"source": [
"openmoc.log.set_log_level('NORMAL')\n",
"solver.computeEigenvalue()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"1.0275073190806019"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"openmc_keff"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment