mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-24 20:15:26 -04:00
implemented mesh domain in mgxs
This commit is contained in:
parent
736d7aa5ba
commit
9686543fa0
4 changed files with 468 additions and 470 deletions
|
|
@ -326,7 +326,7 @@
|
|||
"# OpenMC simulation parameters\n",
|
||||
"batches = 50\n",
|
||||
"inactive = 10\n",
|
||||
"particles = 2500\n",
|
||||
"particles = 1000\n",
|
||||
"\n",
|
||||
"# Instantiate a Settings object\n",
|
||||
"settings_file = openmc.Settings()\n",
|
||||
|
|
@ -398,10 +398,17 @@
|
|||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Instantiate a tally Mesh\n",
|
||||
"mesh = openmc.Mesh(name='mesh')\n",
|
||||
"mesh.type = 'regular'\n",
|
||||
"mesh.dimension = [2, 2]\n",
|
||||
"mesh.lower_left = [-0.63, -0.63]\n",
|
||||
"mesh.upper_right = [+0.63, +0.63]\n",
|
||||
"\n",
|
||||
"# Instantiate a few different sections\n",
|
||||
"total = mgxs.TotalXS(domain=cell, groups=groups)\n",
|
||||
"absorption = mgxs.AbsorptionXS(domain=cell, groups=groups)\n",
|
||||
"scattering = mgxs.ScatterXS(domain=cell, groups=groups)"
|
||||
"total = mgxs.TotalXS(domain=mesh, groups=groups)\n",
|
||||
"absorption = mgxs.AbsorptionXS(domain=mesh, groups=groups)\n",
|
||||
"scattering = mgxs.ScatterXS(domain=mesh, groups=groups)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -422,24 +429,22 @@
|
|||
"data": {
|
||||
"text/plain": [
|
||||
"OrderedDict([('flux', Tally\n",
|
||||
"\tID =\t10000\n",
|
||||
"\tName =\t\n",
|
||||
"\tFilters =\t\n",
|
||||
" \t\tcell\t[1]\n",
|
||||
" \t\tenergy\t[ 0.00000000e+00 6.25000000e-07 2.00000000e+01]\n",
|
||||
"\tNuclides =\ttotal \n",
|
||||
"\tScores =\t['flux']\n",
|
||||
"\tEstimator =\ttracklength\n",
|
||||
"), ('absorption', Tally\n",
|
||||
"\tID =\t10001\n",
|
||||
"\tName =\t\n",
|
||||
"\tFilters =\t\n",
|
||||
" \t\tcell\t[1]\n",
|
||||
" \t\tenergy\t[ 0.00000000e+00 6.25000000e-07 2.00000000e+01]\n",
|
||||
"\tNuclides =\ttotal \n",
|
||||
"\tScores =\t['absorption']\n",
|
||||
"\tEstimator =\ttracklength\n",
|
||||
")])"
|
||||
" \tID =\t10000\n",
|
||||
" \tName =\t\n",
|
||||
" \tFilters =\t\n",
|
||||
" \t\tmesh\t[10000]\n",
|
||||
" \t\tenergy\t[ 0.00000000e+00 6.25000000e-07 2.00000000e+01]\n",
|
||||
" \tNuclides =\ttotal \n",
|
||||
" \tScores =\t['flux']\n",
|
||||
" \tEstimator =\ttracklength), ('absorption', Tally\n",
|
||||
" \tID =\t10001\n",
|
||||
" \tName =\t\n",
|
||||
" \tFilters =\t\n",
|
||||
" \t\tmesh\t[10000]\n",
|
||||
" \t\tenergy\t[ 0.00000000e+00 6.25000000e-07 2.00000000e+01]\n",
|
||||
" \tNuclides =\ttotal \n",
|
||||
" \tScores =\t['absorption']\n",
|
||||
" \tEstimator =\ttracklength)])"
|
||||
]
|
||||
},
|
||||
"execution_count": 13,
|
||||
|
|
@ -516,9 +521,9 @@
|
|||
" Copyright: 2011-2016 Massachusetts Institute of Technology\n",
|
||||
" License: http://openmc.readthedocs.io/en/latest/license.html\n",
|
||||
" Version: 0.7.1\n",
|
||||
" Git SHA1: 19feb55e6d5e8350398627f39fb55ee8e2e63011\n",
|
||||
" Date/Time: 2016-05-13 10:19:16\n",
|
||||
" MPI Processes: 1\n",
|
||||
" Git SHA1: 736d7aa5ba3bcd1a8a1614ce4b6769babcb1d8ca\n",
|
||||
" Date/Time: 2016-07-05 16:23:08\n",
|
||||
" MPI Processes: 4\n",
|
||||
"\n",
|
||||
" ===========================================================================\n",
|
||||
" ========================> INITIALIZATION <=========================\n",
|
||||
|
|
@ -544,56 +549,56 @@
|
|||
"\n",
|
||||
" Bat./Gen. k Average k \n",
|
||||
" ========= ======== ==================== \n",
|
||||
" 1/1 1.11184 \n",
|
||||
" 2/1 1.15820 \n",
|
||||
" 3/1 1.18468 \n",
|
||||
" 4/1 1.17492 \n",
|
||||
" 5/1 1.19645 \n",
|
||||
" 6/1 1.18436 \n",
|
||||
" 7/1 1.14070 \n",
|
||||
" 8/1 1.15150 \n",
|
||||
" 9/1 1.19202 \n",
|
||||
" 10/1 1.17677 \n",
|
||||
" 11/1 1.20272 \n",
|
||||
" 12/1 1.21366 1.20819 +/- 0.00547\n",
|
||||
" 13/1 1.15906 1.19181 +/- 0.01668\n",
|
||||
" 14/1 1.14687 1.18058 +/- 0.01629\n",
|
||||
" 15/1 1.14570 1.17360 +/- 0.01442\n",
|
||||
" 16/1 1.13480 1.16713 +/- 0.01343\n",
|
||||
" 17/1 1.17680 1.16852 +/- 0.01144\n",
|
||||
" 18/1 1.16866 1.16853 +/- 0.00990\n",
|
||||
" 19/1 1.19253 1.17120 +/- 0.00913\n",
|
||||
" 20/1 1.18124 1.17220 +/- 0.00823\n",
|
||||
" 21/1 1.19206 1.17401 +/- 0.00766\n",
|
||||
" 22/1 1.17681 1.17424 +/- 0.00700\n",
|
||||
" 23/1 1.17634 1.17440 +/- 0.00644\n",
|
||||
" 24/1 1.13659 1.17170 +/- 0.00654\n",
|
||||
" 25/1 1.17144 1.17169 +/- 0.00609\n",
|
||||
" 26/1 1.20649 1.17386 +/- 0.00610\n",
|
||||
" 27/1 1.11238 1.17024 +/- 0.00678\n",
|
||||
" 28/1 1.18911 1.17129 +/- 0.00647\n",
|
||||
" 29/1 1.14681 1.17000 +/- 0.00626\n",
|
||||
" 30/1 1.12152 1.16758 +/- 0.00641\n",
|
||||
" 31/1 1.12729 1.16566 +/- 0.00639\n",
|
||||
" 32/1 1.15399 1.16513 +/- 0.00612\n",
|
||||
" 33/1 1.13547 1.16384 +/- 0.00599\n",
|
||||
" 34/1 1.17723 1.16440 +/- 0.00576\n",
|
||||
" 35/1 1.09296 1.16154 +/- 0.00622\n",
|
||||
" 36/1 1.19621 1.16287 +/- 0.00612\n",
|
||||
" 37/1 1.12560 1.16149 +/- 0.00605\n",
|
||||
" 38/1 1.17872 1.16211 +/- 0.00586\n",
|
||||
" 39/1 1.17721 1.16263 +/- 0.00568\n",
|
||||
" 40/1 1.13724 1.16178 +/- 0.00555\n",
|
||||
" 41/1 1.18526 1.16254 +/- 0.00542\n",
|
||||
" 42/1 1.13779 1.16177 +/- 0.00531\n",
|
||||
" 43/1 1.15066 1.16143 +/- 0.00516\n",
|
||||
" 44/1 1.12174 1.16026 +/- 0.00514\n",
|
||||
" 45/1 1.17479 1.16068 +/- 0.00501\n",
|
||||
" 46/1 1.14146 1.16014 +/- 0.00489\n",
|
||||
" 47/1 1.20464 1.16135 +/- 0.00491\n",
|
||||
" 48/1 1.15119 1.16108 +/- 0.00479\n",
|
||||
" 49/1 1.17938 1.16155 +/- 0.00468\n",
|
||||
" 50/1 1.15798 1.16146 +/- 0.00457\n",
|
||||
" 1/1 1.07993 \n",
|
||||
" 2/1 1.23691 \n",
|
||||
" 3/1 1.17407 \n",
|
||||
" 4/1 1.08258 \n",
|
||||
" 5/1 1.21012 \n",
|
||||
" 6/1 1.23825 \n",
|
||||
" 7/1 1.18016 \n",
|
||||
" 8/1 1.20989 \n",
|
||||
" 9/1 1.15475 \n",
|
||||
" 10/1 1.13462 \n",
|
||||
" 11/1 1.12749 \n",
|
||||
" 12/1 1.09502 1.11125 +/- 0.01623\n",
|
||||
" 13/1 1.24722 1.15657 +/- 0.04628\n",
|
||||
" 14/1 1.14700 1.15418 +/- 0.03281\n",
|
||||
" 15/1 1.13889 1.15112 +/- 0.02560\n",
|
||||
" 16/1 1.19008 1.15762 +/- 0.02189\n",
|
||||
" 17/1 1.11320 1.15127 +/- 0.01956\n",
|
||||
" 18/1 1.12093 1.14748 +/- 0.01736\n",
|
||||
" 19/1 1.13809 1.14643 +/- 0.01534\n",
|
||||
" 20/1 1.09886 1.14168 +/- 0.01452\n",
|
||||
" 21/1 1.15457 1.14285 +/- 0.01319\n",
|
||||
" 22/1 1.19951 1.14757 +/- 0.01293\n",
|
||||
" 23/1 1.13296 1.14645 +/- 0.01195\n",
|
||||
" 24/1 1.15322 1.14693 +/- 0.01107\n",
|
||||
" 25/1 1.26213 1.15461 +/- 0.01286\n",
|
||||
" 26/1 1.11758 1.15230 +/- 0.01225\n",
|
||||
" 27/1 1.19061 1.15455 +/- 0.01172\n",
|
||||
" 28/1 1.17562 1.15572 +/- 0.01111\n",
|
||||
" 29/1 1.15989 1.15594 +/- 0.01051\n",
|
||||
" 30/1 1.19989 1.15814 +/- 0.01021\n",
|
||||
" 31/1 1.14498 1.15751 +/- 0.00974\n",
|
||||
" 32/1 1.11494 1.15558 +/- 0.00948\n",
|
||||
" 33/1 1.13251 1.15457 +/- 0.00912\n",
|
||||
" 34/1 1.17943 1.15561 +/- 0.00879\n",
|
||||
" 35/1 1.21182 1.15786 +/- 0.00872\n",
|
||||
" 36/1 1.16118 1.15798 +/- 0.00838\n",
|
||||
" 37/1 1.13679 1.15720 +/- 0.00811\n",
|
||||
" 38/1 1.15684 1.15719 +/- 0.00781\n",
|
||||
" 39/1 1.12450 1.15606 +/- 0.00762\n",
|
||||
" 40/1 1.30157 1.16091 +/- 0.00882\n",
|
||||
" 41/1 1.04558 1.15719 +/- 0.00930\n",
|
||||
" 42/1 1.16538 1.15745 +/- 0.00901\n",
|
||||
" 43/1 1.17710 1.15804 +/- 0.00875\n",
|
||||
" 44/1 1.13273 1.15730 +/- 0.00853\n",
|
||||
" 45/1 1.19156 1.15828 +/- 0.00834\n",
|
||||
" 46/1 1.19404 1.15927 +/- 0.00816\n",
|
||||
" 47/1 1.19058 1.16012 +/- 0.00798\n",
|
||||
" 48/1 1.12943 1.15931 +/- 0.00781\n",
|
||||
" 49/1 1.22428 1.16097 +/- 0.00779\n",
|
||||
" 50/1 1.07496 1.15882 +/- 0.00789\n",
|
||||
" Creating state point statepoint.50.h5...\n",
|
||||
"\n",
|
||||
" ===========================================================================\n",
|
||||
|
|
@ -603,27 +608,27 @@
|
|||
"\n",
|
||||
" =======================> TIMING STATISTICS <=======================\n",
|
||||
"\n",
|
||||
" Total time for initialization = 4.2300E-01 seconds\n",
|
||||
" Reading cross sections = 9.3000E-02 seconds\n",
|
||||
" Total time in simulation = 1.6549E+01 seconds\n",
|
||||
" Time in transport only = 1.6535E+01 seconds\n",
|
||||
" Time in inactive batches = 2.3650E+00 seconds\n",
|
||||
" Time in active batches = 1.4184E+01 seconds\n",
|
||||
" Time synchronizing fission bank = 5.0000E-03 seconds\n",
|
||||
" Sampling source sites = 3.0000E-03 seconds\n",
|
||||
" Total time for initialization = 8.6600E-01 seconds\n",
|
||||
" Reading cross sections = 2.2400E-01 seconds\n",
|
||||
" Total time in simulation = 3.0950E+00 seconds\n",
|
||||
" Time in transport only = 2.9310E+00 seconds\n",
|
||||
" Time in inactive batches = 2.8000E-01 seconds\n",
|
||||
" Time in active batches = 2.8150E+00 seconds\n",
|
||||
" Time synchronizing fission bank = 1.4200E-01 seconds\n",
|
||||
" Sampling source sites = 1.0000E-03 seconds\n",
|
||||
" SEND/RECV source sites = 0.0000E+00 seconds\n",
|
||||
" Time accumulating tallies = 0.0000E+00 seconds\n",
|
||||
" Total time for finalization = 0.0000E+00 seconds\n",
|
||||
" Total time elapsed = 1.6981E+01 seconds\n",
|
||||
" Calculation Rate (inactive) = 10570.8 neutrons/second\n",
|
||||
" Calculation Rate (active) = 7050.20 neutrons/second\n",
|
||||
" Time accumulating tallies = 2.0000E-03 seconds\n",
|
||||
" Total time for finalization = 3.0000E-03 seconds\n",
|
||||
" Total time elapsed = 3.9660E+00 seconds\n",
|
||||
" Calculation Rate (inactive) = 35714.3 neutrons/second\n",
|
||||
" Calculation Rate (active) = 14209.6 neutrons/second\n",
|
||||
"\n",
|
||||
" ============================> RESULTS <============================\n",
|
||||
"\n",
|
||||
" k-effective (Collision) = 1.15984 +/- 0.00411\n",
|
||||
" k-effective (Track-length) = 1.16146 +/- 0.00457\n",
|
||||
" k-effective (Absorption) = 1.16177 +/- 0.00380\n",
|
||||
" Combined k-effective = 1.16105 +/- 0.00364\n",
|
||||
" k-effective (Collision) = 1.15707 +/- 0.00744\n",
|
||||
" k-effective (Track-length) = 1.15882 +/- 0.00789\n",
|
||||
" k-effective (Absorption) = 1.16215 +/- 0.00476\n",
|
||||
" Combined k-effective = 1.16131 +/- 0.00452\n",
|
||||
" Leakage Fraction = 0.00000 +/- 0.00000\n",
|
||||
"\n"
|
||||
]
|
||||
|
|
@ -641,7 +646,7 @@
|
|||
],
|
||||
"source": [
|
||||
"# Run OpenMC\n",
|
||||
"openmc.run()"
|
||||
"openmc.run(mpi_procs=4)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -732,11 +737,26 @@
|
|||
"text": [
|
||||
"Multi-Group XS\n",
|
||||
"\tReaction Type =\ttotal\n",
|
||||
"\tDomain Type =\tcell\n",
|
||||
"\tDomain ID =\t1\n",
|
||||
"\tDomain Type =\tmesh\n",
|
||||
"\tDomain ID =\t10000\n",
|
||||
"\tCross Sections [cm^-1]:\n",
|
||||
" Group 1 [6.25e-07 - 20.0 MeV]:\t6.81e-01 +/- 2.69e-01%\n",
|
||||
" Group 2 [0.0 - 6.25e-07 MeV]:\t1.40e+00 +/- 5.93e-01%\n",
|
||||
" Group 1 [6.25e-07 - 20.0 MeV]:\t6.83e-01 +/- 4.53e-01%\n",
|
||||
" Group 2 [0.0 - 6.25e-07 MeV]:\t1.40e+00 +/- 1.16e+00%\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\tCross Sections [cm^-1]:\n",
|
||||
" Group 1 [6.25e-07 - 20.0 MeV]:\t6.81e-01 +/- 3.23e-01%\n",
|
||||
" Group 2 [0.0 - 6.25e-07 MeV]:\t1.40e+00 +/- 1.30e+00%\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\tCross Sections [cm^-1]:\n",
|
||||
" Group 1 [6.25e-07 - 20.0 MeV]:\t6.83e-01 +/- 3.88e-01%\n",
|
||||
" Group 2 [0.0 - 6.25e-07 MeV]:\t1.40e+00 +/- 9.89e-01%\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\tCross Sections [cm^-1]:\n",
|
||||
" Group 1 [6.25e-07 - 20.0 MeV]:\t6.82e-01 +/- 4.92e-01%\n",
|
||||
" Group 2 [0.0 - 6.25e-07 MeV]:\t1.40e+00 +/- 1.20e+00%\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n"
|
||||
|
|
@ -767,40 +787,121 @@
|
|||
"<div>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <th>cell</th>\n",
|
||||
" <th colspan=\"3\" halign=\"left\">mesh 10000</th>\n",
|
||||
" <th>group in</th>\n",
|
||||
" <th>nuclide</th>\n",
|
||||
" <th>mean</th>\n",
|
||||
" <th>std. dev.</th>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th></th>\n",
|
||||
" <th>x</th>\n",
|
||||
" <th>y</th>\n",
|
||||
" <th>z</th>\n",
|
||||
" <th></th>\n",
|
||||
" <th></th>\n",
|
||||
" <th></th>\n",
|
||||
" <th></th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>0.667787</td>\n",
|
||||
" <td>0.001802</td>\n",
|
||||
" <td>0.669016</td>\n",
|
||||
" <td>0.003015</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>1.292013</td>\n",
|
||||
" <td>0.007642</td>\n",
|
||||
" <td>1.293138</td>\n",
|
||||
" <td>0.014971</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>0.667930</td>\n",
|
||||
" <td>0.002132</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>1.292741</td>\n",
|
||||
" <td>0.016747</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>5</th>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>0.669513</td>\n",
|
||||
" <td>0.002584</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>1.294423</td>\n",
|
||||
" <td>0.012750</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>7</th>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>0.668773</td>\n",
|
||||
" <td>0.003314</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>6</th>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>1.292515</td>\n",
|
||||
" <td>0.015479</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cell group in nuclide mean std. dev.\n",
|
||||
"1 1 1 total 0.667787 0.001802\n",
|
||||
"0 1 2 total 1.292013 0.007642"
|
||||
" mesh 10000 group in nuclide mean std. dev.\n",
|
||||
" x y z \n",
|
||||
"1 1 1 1 1 total 0.669016 0.003015\n",
|
||||
"0 1 1 1 2 total 1.293138 0.014971\n",
|
||||
"3 1 2 1 1 total 0.667930 0.002132\n",
|
||||
"2 1 2 1 2 total 1.292741 0.016747\n",
|
||||
"5 2 1 1 1 total 0.669513 0.002584\n",
|
||||
"4 2 1 1 2 total 1.294423 0.012750\n",
|
||||
"7 2 2 1 1 total 0.668773 0.003314\n",
|
||||
"6 2 2 1 2 total 1.292515 0.015479"
|
||||
]
|
||||
},
|
||||
"execution_count": 19,
|
||||
|
|
@ -824,9 +925,23 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"ename": "TypeError",
|
||||
"evalue": "Setting <class 'pandas.core.index.MultiIndex'> dtype to anything other than object is not supported",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
|
||||
"\u001b[0;32m<ipython-input-20-18b1a393a900>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mabsorption\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexport_xs_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'absorption-xs'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mformat\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'excel'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
|
||||
"\u001b[0;32m/Users/sam/.local/lib/python2.7/site-packages/openmc-0.7.1-py2.7.egg/openmc/mgxs/mgxs.pyc\u001b[0m in \u001b[0;36mexport_xs_data\u001b[0;34m(self, filename, directory, format, groups, xs_type)\u001b[0m\n\u001b[1;32m 1430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1431\u001b[0m \u001b[0;31m# Capitalize column label strings\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1432\u001b[0;31m \u001b[0mdf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mastype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1433\u001b[0m \u001b[0mdf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmap\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1434\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/core/index.pyc\u001b[0m in \u001b[0;36mastype\u001b[0;34m(self, dtype)\u001b[0m\n\u001b[1;32m 5922\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mis_object_dtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5923\u001b[0m raise TypeError('Setting %s dtype to anything other than object '\n\u001b[0;32m-> 5924\u001b[0;31m 'is not supported' % self.__class__)\n\u001b[0m\u001b[1;32m 5925\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_shallow_copy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5926\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;31mTypeError\u001b[0m: Setting <class 'pandas.core.index.MultiIndex'> dtype to anything other than object is not supported"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"absorption.export_xs_data(filename='absorption-xs', format='excel')"
|
||||
]
|
||||
|
|
@ -840,7 +955,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
|
|
@ -867,68 +982,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>cell</th>\n",
|
||||
" <th>energy low [MeV]</th>\n",
|
||||
" <th>energy high [MeV]</th>\n",
|
||||
" <th>nuclide</th>\n",
|
||||
" <th>score</th>\n",
|
||||
" <th>mean</th>\n",
|
||||
" <th>std. dev.</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>6.250000e-07</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>(((total / flux) - (absorption / flux)) - (sca...</td>\n",
|
||||
" <td>-3.774758e-15</td>\n",
|
||||
" <td>0.011292</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>6.250000e-07</td>\n",
|
||||
" <td>2.000000e+01</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>(((total / flux) - (absorption / flux)) - (sca...</td>\n",
|
||||
" <td>1.443290e-15</td>\n",
|
||||
" <td>0.002570</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cell energy low [MeV] energy high [MeV] nuclide \\\n",
|
||||
"0 1 0.00e+00 6.25e-07 total \n",
|
||||
"1 1 6.25e-07 2.00e+01 total \n",
|
||||
"\n",
|
||||
" score mean std. dev. \n",
|
||||
"0 (((total / flux) - (absorption / flux)) - (sca... -3.77e-15 1.13e-02 \n",
|
||||
"1 (((total / flux) - (absorption / flux)) - (sca... 1.44e-15 2.57e-03 "
|
||||
]
|
||||
},
|
||||
"execution_count": 22,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Use tally arithmetic to compute the difference between the total, absorption and scattering\n",
|
||||
"difference = total.xs_tally - absorption.xs_tally - scattering.xs_tally\n",
|
||||
|
|
@ -946,68 +1004,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>cell</th>\n",
|
||||
" <th>energy low [MeV]</th>\n",
|
||||
" <th>energy high [MeV]</th>\n",
|
||||
" <th>nuclide</th>\n",
|
||||
" <th>score</th>\n",
|
||||
" <th>mean</th>\n",
|
||||
" <th>std. dev.</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>6.250000e-07</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>((absorption / flux) / (total / flux))</td>\n",
|
||||
" <td>0.076115</td>\n",
|
||||
" <td>0.000649</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>6.250000e-07</td>\n",
|
||||
" <td>2.000000e+01</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>((absorption / flux) / (total / flux))</td>\n",
|
||||
" <td>0.019263</td>\n",
|
||||
" <td>0.000095</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cell energy low [MeV] energy high [MeV] nuclide \\\n",
|
||||
"0 1 0.00e+00 6.25e-07 total \n",
|
||||
"1 1 6.25e-07 2.00e+01 total \n",
|
||||
"\n",
|
||||
" score mean std. dev. \n",
|
||||
"0 ((absorption / flux) / (total / flux)) 7.61e-02 6.49e-04 \n",
|
||||
"1 ((absorption / flux) / (total / flux)) 1.93e-02 9.46e-05 "
|
||||
]
|
||||
},
|
||||
"execution_count": 23,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Use tally arithmetic to compute the absorption-to-total MGXS ratio\n",
|
||||
"absorption_to_total = absorption.xs_tally / total.xs_tally\n",
|
||||
|
|
@ -1018,68 +1019,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>cell</th>\n",
|
||||
" <th>energy low [MeV]</th>\n",
|
||||
" <th>energy high [MeV]</th>\n",
|
||||
" <th>nuclide</th>\n",
|
||||
" <th>score</th>\n",
|
||||
" <th>mean</th>\n",
|
||||
" <th>std. dev.</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>6.250000e-07</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>((scatter / flux) / (total / flux))</td>\n",
|
||||
" <td>0.923885</td>\n",
|
||||
" <td>0.007736</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>6.250000e-07</td>\n",
|
||||
" <td>2.000000e+01</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>((scatter / flux) / (total / flux))</td>\n",
|
||||
" <td>0.980737</td>\n",
|
||||
" <td>0.003737</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cell energy low [MeV] energy high [MeV] nuclide \\\n",
|
||||
"0 1 0.00e+00 6.25e-07 total \n",
|
||||
"1 1 6.25e-07 2.00e+01 total \n",
|
||||
"\n",
|
||||
" score mean std. dev. \n",
|
||||
"0 ((scatter / flux) / (total / flux)) 9.24e-01 7.74e-03 \n",
|
||||
"1 ((scatter / flux) / (total / flux)) 9.81e-01 3.74e-03 "
|
||||
]
|
||||
},
|
||||
"execution_count": 24,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Use tally arithmetic to compute the scattering-to-total MGXS ratio\n",
|
||||
"scattering_to_total = scattering.xs_tally / total.xs_tally\n",
|
||||
|
|
@ -1097,68 +1041,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>cell</th>\n",
|
||||
" <th>energy low [MeV]</th>\n",
|
||||
" <th>energy high [MeV]</th>\n",
|
||||
" <th>nuclide</th>\n",
|
||||
" <th>score</th>\n",
|
||||
" <th>mean</th>\n",
|
||||
" <th>std. dev.</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>6.250000e-07</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>(((absorption / flux) / (total / flux)) + ((sc...</td>\n",
|
||||
" <td>1.0</td>\n",
|
||||
" <td>0.007763</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>6.250000e-07</td>\n",
|
||||
" <td>2.000000e+01</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>(((absorption / flux) / (total / flux)) + ((sc...</td>\n",
|
||||
" <td>1.0</td>\n",
|
||||
" <td>0.003739</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cell energy low [MeV] energy high [MeV] nuclide \\\n",
|
||||
"0 1 0.00e+00 6.25e-07 total \n",
|
||||
"1 1 6.25e-07 2.00e+01 total \n",
|
||||
"\n",
|
||||
" score mean std. dev. \n",
|
||||
"0 (((absorption / flux) / (total / flux)) + ((sc... 1.00e+00 7.76e-03 \n",
|
||||
"1 (((absorption / flux) / (total / flux)) + ((sc... 1.00e+00 3.74e-03 "
|
||||
]
|
||||
},
|
||||
"execution_count": 25,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Use tally arithmetic to ensure that the absorption- and scattering-to-total MGXS ratios sum to unity\n",
|
||||
"sum_ratio = absorption_to_total + scattering_to_total\n",
|
||||
|
|
@ -1166,6 +1053,15 @@
|
|||
"# The scattering-to-total ratio is a derived tally which can generate Pandas DataFrames for inspection\n",
|
||||
"sum_ratio.get_pandas_dataframe()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue