mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-21 14:35:27 -04:00
Fixed merge conflicts and a bug in Tally.add_score(...)
This commit is contained in:
commit
5e732f99a0
383 changed files with 8257 additions and 17506 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -36,6 +36,7 @@ src/xml-fortran/xmlreader
|
|||
|
||||
# Test results error file
|
||||
results_error.dat
|
||||
inputs_error.dat
|
||||
|
||||
# Test build files
|
||||
tests/build/
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -174,7 +174,18 @@
|
|||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n",
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n",
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n",
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Create a Universe to encapsulate a fuel pin\n",
|
||||
"pin_cell_universe = openmc.Universe(name='1.6% Fuel Pin')\n",
|
||||
|
|
@ -212,7 +223,20 @@
|
|||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n",
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n",
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n",
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n",
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n",
|
||||
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/universe.py:199: DeprecationWarning: Cell.add_surface(...) has been deprecated and may be removed in a future version. The region for a Cell should be defined using the region property directly.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Create root Cell\n",
|
||||
"root_cell = openmc.Cell(name='root cell')\n",
|
||||
|
|
@ -369,7 +393,7 @@
|
|||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAAAFzUkdC\nAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAxQTFRF\n////chIS6YCRTb/E6kGE+wAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAALKSURB\nVGje7dpLcqQwDAbgHHE2YeEj+D4cwQucBUfo+3CEXoSp8OhuhF70T4qpKXmdr21LogK2Pj7A8QmN\nP+HDhw8fPnz48Kf6VH9G+66vy+je8k19jnf8C5dXIPv86ms56lPdjvaYbyodx3ze+XLE76cXFiD4\nzPji99z0/AJ4n1lfvJ6fnl0A6x+578efMSg1wPr172/jPO5yFXM+Ef78gdblM+WPHyguP//t1/g6\npA0wfln+ho/fwgYYn19C/xwDvwHGc9OvC+hs37DTrwuwfWanXxdQTC9Mvyygs3wjTL8uwPJpn/tN\nDbSGz7T0SBEWw4vLXzbQ6b6RoveIoO6TvPxlA63qs7z8ZQPF9F+SH22vbX8OQKf5Rtv+EgDNJ3X5\n8wZaxWd1+fMGiuFvir8bvjp8J/tGy/6jAmRvhW8fwL3vVT+o3grfPoB7r/IpALI3tz8FoJN84/NV\n873hB8UnM3xzANtf8nb4dwmg3grfFEDJO8JPE0i9Ff4pAYL3pI8mkHor/HMCeO9JH00g9SafEsh7\nT/ppARBvp48UwJnelT5SACd7O31TAlnvKx9SQCd7B58KgPO+8iMFuPWe9E8F8BveWX7bAjzX9y4/\n/Jve+fhsH6Ctv7n8PTzjvY/v9gEOHz58+PBX+6v/f/wPvnd54f3j6venE/yl769Xv7+j3x/o98/V\n32/o9+fl389Xnx+g5x/o+Qt6/oOeP6HnX+j5G3z+h54/ouefV5/foufP6Pk3ev4On/+j9w/o/Qd6\n/4Le/6D3T/D9V67Y/ZsVQBq+s+8f0ftP+P41axXguP9NWgDuu/Cdfv+N3r/D9/9TAID+A7T/Ae2/\ngPs/0P4TtP8F7r9J3AIO9P+g/Udw/9Oygbf7r9D+L7j/DO1/Q/vv4P4/tP8Q7n9E+y/h/k+0/xTu\nf4X7b+H+X7T/+BPuf3aM8OHDhw8fPnz4w/4vzcvgeY10sY0AAAAldEVYdGRhdGU6Y3JlYXRlADIw\nMTUtMTAtMDNUMTM6MDI6MDItMDQ6MDCXyx9dAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTEwLTAz\nVDEzOjAyOjAyLTA0OjAw5pan4QAAAABJRU5ErkJggg==\n",
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAAAFzUkdC\nAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAxQTFRF\n////chIS6YCRTb/E6kGE+wAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAALKSURB\nVGje7dpLcqQwDAbgHHE2YeEj+D4cwQucBUfo+3CEXoSp8OhuhF70T4qpKXmdr21LogK2Pj7A8QmN\nP+HDhw8fPnz48Kf6VH9G+66vy+je8k19jnf8C5dXIPv86ms56lPdjvaYbyodx3ze+XLE76cXFiD4\nzPji99z0/AJ4n1lfvJ6fnl0A6x+578efMSg1wPr172/jPO5yFXM+Ef78gdblM+WPHyguP//t1/g6\npA0wfln+ho/fwgYYn19C/xwDvwHGc9OvC+hs37DTrwuwfWanXxdQTC9Mvyygs3wjTL8uwPJpn/tN\nDbSGz7T0SBEWw4vLXzbQ6b6RoveIoO6TvPxlA63qs7z8ZQPF9F+SH22vbX8OQKf5Rtv+EgDNJ3X5\n8wZaxWd1+fMGiuFvir8bvjp8J/tGy/6jAmRvhW8fwL3vVT+o3grfPoB7r/IpALI3tz8FoJN84/NV\n873hB8UnM3xzANtf8nb4dwmg3grfFEDJO8JPE0i9Ff4pAYL3pI8mkHor/HMCeO9JH00g9SafEsh7\nT/ppARBvp48UwJnelT5SACd7O31TAlnvKx9SQCd7B58KgPO+8iMFuPWe9E8F8BveWX7bAjzX9y4/\n/Jve+fhsH6Ctv7n8PTzjvY/v9gEOHz58+PBX+6v/f/wPvnd54f3j6venE/yl769Xv7+j3x/o98/V\n32/o9+fl389Xnx+g5x/o+Qt6/oOeP6HnX+j5G3z+h54/ouefV5/foufP6Pk3ev4On/+j9w/o/Qd6\n/4Le/6D3T/D9V67Y/ZsVQBq+s+8f0ftP+P41axXguP9NWgDuu/Cdfv+N3r/D9/9TAID+A7T/Ae2/\ngPs/0P4TtP8F7r9J3AIO9P+g/Udw/9Oygbf7r9D+L7j/DO1/Q/vv4P4/tP8Q7n9E+y/h/k+0/xTu\nf4X7b+H+X7T/+BPuf3aM8OHDhw8fPnz4w/4vzcvgeY10sY0AAAAldEVYdGRhdGU6Y3JlYXRlADIw\nMTUtMTAtMDhUMTM6NDI6MDYtMDQ6MDCJhmNxAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTEwLTA4\nVDEzOjQyOjA2LTA0OjAw+NvbzQAAAABJRU5ErkJggg==\n",
|
||||
"text/plain": [
|
||||
"<IPython.core.display.Image object>"
|
||||
]
|
||||
|
|
@ -563,6 +587,7 @@
|
|||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"rm: cannot remove ‘statepoint.*’: No such file or directory\n",
|
||||
"\n",
|
||||
" .d88888b. 888b d888 .d8888b.\n",
|
||||
" d88P\" \"Y88b 8888b d8888 d88P Y88b\n",
|
||||
|
|
@ -579,8 +604,8 @@
|
|||
" Copyright: 2011-2015 Massachusetts Institute of Technology\n",
|
||||
" License: http://mit-crpg.github.io/openmc/license.html\n",
|
||||
" Version: 0.7.0\n",
|
||||
" Git SHA1: e0c2aace2e73367536fa03e153b67a2d038cd2b3\n",
|
||||
" Date/Time: 2015-10-03 13:02:02\n",
|
||||
" Git SHA1: 23535afa1c69644bb299bde18a094c3b99d53ae0\n",
|
||||
" Date/Time: 2015-10-08 13:42:07\n",
|
||||
" MPI Processes: 1\n",
|
||||
"\n",
|
||||
" ===========================================================================\n",
|
||||
|
|
@ -593,11 +618,11 @@
|
|||
" Reading materials XML file...\n",
|
||||
" Reading tallies XML file...\n",
|
||||
" Building neighboring cells lists for each surface...\n",
|
||||
" Loading ACE cross section table: 92235.71c\n",
|
||||
" Loading ACE cross section table: 92238.71c\n",
|
||||
" Loading ACE cross section table: 8016.71c\n",
|
||||
" Loading ACE cross section table: 92235.71c\n",
|
||||
" Loading ACE cross section table: 5010.71c\n",
|
||||
" Loading ACE cross section table: 1001.71c\n",
|
||||
" Loading ACE cross section table: 5010.71c\n",
|
||||
" Loading ACE cross section table: 40090.71c\n",
|
||||
" Initializing source particles...\n",
|
||||
"\n",
|
||||
|
|
@ -607,26 +632,26 @@
|
|||
"\n",
|
||||
" Bat./Gen. k Average k \n",
|
||||
" ========= ======== ==================== \n",
|
||||
" 1/1 1.00279 \n",
|
||||
" 2/1 1.03320 \n",
|
||||
" 3/1 1.04467 \n",
|
||||
" 4/1 1.09693 \n",
|
||||
" 5/1 1.05008 \n",
|
||||
" 6/1 1.08426 \n",
|
||||
" 7/1 1.05363 1.06894 +/- 0.01531\n",
|
||||
" 8/1 0.97961 1.03917 +/- 0.03106\n",
|
||||
" 9/1 1.06444 1.04549 +/- 0.02285\n",
|
||||
" 10/1 1.08345 1.05308 +/- 0.01926\n",
|
||||
" 11/1 1.06871 1.05568 +/- 0.01594\n",
|
||||
" 12/1 1.03183 1.05228 +/- 0.01390\n",
|
||||
" 13/1 1.04486 1.05135 +/- 0.01207\n",
|
||||
" 14/1 1.06468 1.05283 +/- 0.01075\n",
|
||||
" 15/1 1.04185 1.05173 +/- 0.00968\n",
|
||||
" 16/1 1.01268 1.04818 +/- 0.00944\n",
|
||||
" 17/1 1.04129 1.04761 +/- 0.00864\n",
|
||||
" 18/1 1.01127 1.04481 +/- 0.00843\n",
|
||||
" 19/1 1.03738 1.04428 +/- 0.00782\n",
|
||||
" 20/1 1.04410 1.04427 +/- 0.00728\n",
|
||||
" 1/1 1.05992 \n",
|
||||
" 2/1 1.05251 \n",
|
||||
" 3/1 1.05204 \n",
|
||||
" 4/1 1.02100 \n",
|
||||
" 5/1 1.07784 \n",
|
||||
" 6/1 1.04814 \n",
|
||||
" 7/1 1.02335 1.03574 +/- 0.01239\n",
|
||||
" 8/1 1.02415 1.03188 +/- 0.00813\n",
|
||||
" 9/1 1.10331 1.04974 +/- 0.01876\n",
|
||||
" 10/1 1.05452 1.05069 +/- 0.01456\n",
|
||||
" 11/1 1.07867 1.05536 +/- 0.01277\n",
|
||||
" 12/1 1.04203 1.05345 +/- 0.01096\n",
|
||||
" 13/1 1.04482 1.05237 +/- 0.00955\n",
|
||||
" 14/1 1.04117 1.05113 +/- 0.00852\n",
|
||||
" 15/1 1.07581 1.05360 +/- 0.00801\n",
|
||||
" 16/1 1.04235 1.05257 +/- 0.00731\n",
|
||||
" 17/1 1.02710 1.05045 +/- 0.00701\n",
|
||||
" 18/1 1.01970 1.04809 +/- 0.00687\n",
|
||||
" 19/1 1.01022 1.04538 +/- 0.00691\n",
|
||||
" 20/1 1.01449 1.04332 +/- 0.00675\n",
|
||||
" Creating state point statepoint.20.h5...\n",
|
||||
"\n",
|
||||
" ===========================================================================\n",
|
||||
|
|
@ -636,27 +661,27 @@
|
|||
"\n",
|
||||
" =======================> TIMING STATISTICS <=======================\n",
|
||||
"\n",
|
||||
" Total time for initialization = 4.1600E-01 seconds\n",
|
||||
" Reading cross sections = 9.1000E-02 seconds\n",
|
||||
" Total time in simulation = 1.4793E+01 seconds\n",
|
||||
" Time in transport only = 1.4785E+01 seconds\n",
|
||||
" Time in inactive batches = 2.1450E+00 seconds\n",
|
||||
" Time in active batches = 1.2648E+01 seconds\n",
|
||||
" Total time for initialization = 4.6000E-01 seconds\n",
|
||||
" Reading cross sections = 1.3900E-01 seconds\n",
|
||||
" Total time in simulation = 1.6630E+01 seconds\n",
|
||||
" Time in transport only = 1.6613E+01 seconds\n",
|
||||
" Time in inactive batches = 2.1710E+00 seconds\n",
|
||||
" Time in active batches = 1.4459E+01 seconds\n",
|
||||
" Time synchronizing fission bank = 2.0000E-03 seconds\n",
|
||||
" Sampling source sites = 2.0000E-03 seconds\n",
|
||||
" SEND/RECV source sites = 0.0000E+00 seconds\n",
|
||||
" Sampling source sites = 0.0000E+00 seconds\n",
|
||||
" SEND/RECV source sites = 1.0000E-03 seconds\n",
|
||||
" Time accumulating tallies = 0.0000E+00 seconds\n",
|
||||
" Total time for finalization = 1.0000E-03 seconds\n",
|
||||
" Total time elapsed = 1.5219E+01 seconds\n",
|
||||
" Calculation Rate (inactive) = 5827.51 neutrons/second\n",
|
||||
" Calculation Rate (active) = 2964.90 neutrons/second\n",
|
||||
" Total time elapsed = 1.7100E+01 seconds\n",
|
||||
" Calculation Rate (inactive) = 5757.72 neutrons/second\n",
|
||||
" Calculation Rate (active) = 2593.54 neutrons/second\n",
|
||||
"\n",
|
||||
" ============================> RESULTS <============================\n",
|
||||
"\n",
|
||||
" k-effective (Collision) = 1.04044 +/- 0.00527\n",
|
||||
" k-effective (Track-length) = 1.04427 +/- 0.00728\n",
|
||||
" k-effective (Absorption) = 1.04794 +/- 0.00535\n",
|
||||
" Combined k-effective = 1.04628 +/- 0.00467\n",
|
||||
" k-effective (Collision) = 1.03935 +/- 0.00682\n",
|
||||
" k-effective (Track-length) = 1.04332 +/- 0.00675\n",
|
||||
" k-effective (Absorption) = 1.03845 +/- 0.00598\n",
|
||||
" Combined k-effective = 1.04024 +/- 0.00523\n",
|
||||
" Leakage Fraction = 0.00000 +/- 0.00000\n",
|
||||
"\n"
|
||||
]
|
||||
|
|
@ -696,7 +721,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": 27,
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"scrolled": true
|
||||
|
|
@ -716,7 +741,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"execution_count": 28,
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"scrolled": true
|
||||
|
|
@ -739,45 +764,24 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"execution_count": 29,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></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>total</td>\n",
|
||||
" <td>(nu-fission / absorption)</td>\n",
|
||||
" <td>1.046353</td>\n",
|
||||
" <td>0.00935</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" nuclide score mean std. dev.\n",
|
||||
"0 total (nu-fission / absorption) 1.046353 0.00935"
|
||||
]
|
||||
},
|
||||
"execution_count": 26,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
"ename": "AttributeError",
|
||||
"evalue": "'CrossScore' object has no attribute 'strip'",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
|
||||
"\u001b[1;32m<ipython-input-29-176e9015006a>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mfiss_rate\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0msp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_tally\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'fiss. rate'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mabs_rate\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0msp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_tally\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'abs. rate'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[0mkeff\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfiss_rate\u001b[0m \u001b[1;33m/\u001b[0m \u001b[0mabs_rate\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 5\u001b[0m \u001b[0mkeff\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_pandas_dataframe\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[1;32m/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.pyc\u001b[0m in \u001b[0;36m__div__\u001b[1;34m(self, other)\u001b[0m\n\u001b[0;32m 2051\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2052\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mTally\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2053\u001b[1;33m \u001b[0mnew_tally\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_outer_product\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mbinary_op\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'/'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2054\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2055\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mReal\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[1;32m/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.pyc\u001b[0m in \u001b[0;36m_outer_product\u001b[1;34m(self, other, binary_op)\u001b[0m\n\u001b[0;32m 1548\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mself_score\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mother_score\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mitertools\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mproduct\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mall_scores\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1549\u001b[0m \u001b[0mnew_score\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mCrossScore\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself_score\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mother_score\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mbinary_op\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1550\u001b[1;33m \u001b[0mnew_tally\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd_score\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnew_score\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1551\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1552\u001b[0m \u001b[1;31m# Generate nuclide \"outer products\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[1;32m/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.pyc\u001b[0m in \u001b[0;36madd_score\u001b[1;34m(self, score)\u001b[0m\n\u001b[0;32m 434\u001b[0m \u001b[1;32mreturn\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 435\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 436\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_scores\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mscore\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstrip\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 437\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 438\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mnum_score_bins\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msetter\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[1;31mAttributeError\u001b[0m: 'CrossScore' object has no attribute 'strip'"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
|
|
@ -799,49 +803,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 27,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>energy [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>(0.0e+00 - 6.2e-01)</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>absorption</td>\n",
|
||||
" <td>0.95873</td>\n",
|
||||
" <td>0.00774</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" energy [MeV] nuclide score mean std. dev.\n",
|
||||
"0 (0.0e+00 - 6.2e-01) total absorption 0.95873 0.00774"
|
||||
]
|
||||
},
|
||||
"execution_count": 27,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Compute resonance escape probability using tally arithmetic\n",
|
||||
"therm_abs_rate = sp.get_tally(name='therm. abs. rate')\n",
|
||||
|
|
@ -859,47 +825,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></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>total</td>\n",
|
||||
" <td>nu-fission</td>\n",
|
||||
" <td>1.091622</td>\n",
|
||||
" <td>0.011163</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" nuclide score mean std. dev.\n",
|
||||
"0 total nu-fission 1.091622 0.011163"
|
||||
]
|
||||
},
|
||||
"execution_count": 28,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Compute fast fission factor factor using tally arithmetic\n",
|
||||
"therm_fiss_rate = sp.get_tally(name='therm. fiss. rate')\n",
|
||||
|
|
@ -918,51 +848,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 29,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>energy [MeV]</th>\n",
|
||||
" <th>cell</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>(0.0e+00 - 6.2e-01)</td>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>absorption</td>\n",
|
||||
" <td>0.802012</td>\n",
|
||||
" <td>0.006609</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" energy [MeV] cell nuclide score mean std. dev.\n",
|
||||
"0 (0.0e+00 - 6.2e-01) 10000 total absorption 0.802012 0.006609"
|
||||
]
|
||||
},
|
||||
"execution_count": 29,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Compute thermal flux utilization factor using tally arithmetic\n",
|
||||
"fuel_therm_abs_rate = sp.get_tally(name='fuel therm. abs. rate')\n",
|
||||
|
|
@ -979,49 +869,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 30,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>energy [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>(0.0e+00 - 6.2e-01)</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>(nu-fission / absorption)</td>\n",
|
||||
" <td>1.246604</td>\n",
|
||||
" <td>0.011825</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" energy [MeV] nuclide score mean std. dev.\n",
|
||||
"0 (0.0e+00 - 6.2e-01) total (nu-fission / absorption) 1.246604 0.011825"
|
||||
]
|
||||
},
|
||||
"execution_count": 30,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Compute neutrons produced per absorption (eta) using tally arithmetic\n",
|
||||
"eta = therm_fiss_rate / fuel_therm_abs_rate\n",
|
||||
|
|
@ -1037,52 +889,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>energy [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>(0.0e+00 - 6.2e-01)</td>\n",
|
||||
" <td>total</td>\n",
|
||||
" <td>(((absorption * nu-fission) * absorption) * (n...</td>\n",
|
||||
" <td>1.046353</td>\n",
|
||||
" <td>0.01894</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" energy [MeV] nuclide \\\n",
|
||||
"0 (0.0e+00 - 6.2e-01) total \n",
|
||||
"\n",
|
||||
" score mean std. dev. \n",
|
||||
"0 (((absorption * nu-fission) * absorption) * (n... 1.046353 0.01894 "
|
||||
]
|
||||
},
|
||||
"execution_count": 31,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"keff = res_esc * fast_fiss * therm_util * eta\n",
|
||||
"keff.get_pandas_dataframe()"
|
||||
|
|
@ -1099,7 +910,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"scrolled": true
|
||||
|
|
@ -1115,131 +926,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 33,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>cell</th>\n",
|
||||
" <th>energy [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>10000</td>\n",
|
||||
" <td>(0.0e+00 - 6.3e-07)</td>\n",
|
||||
" <td>(U-238 / total)</td>\n",
|
||||
" <td>(nu-fission / flux)</td>\n",
|
||||
" <td>6.641746e-07</td>\n",
|
||||
" <td>6.859257e-09</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(0.0e+00 - 6.3e-07)</td>\n",
|
||||
" <td>(U-238 / total)</td>\n",
|
||||
" <td>(scatter / flux)</td>\n",
|
||||
" <td>2.099861e-01</td>\n",
|
||||
" <td>1.966887e-03</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(0.0e+00 - 6.3e-07)</td>\n",
|
||||
" <td>(U-235 / total)</td>\n",
|
||||
" <td>(nu-fission / flux)</td>\n",
|
||||
" <td>3.556665e-01</td>\n",
|
||||
" <td>3.717881e-03</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(0.0e+00 - 6.3e-07)</td>\n",
|
||||
" <td>(U-235 / total)</td>\n",
|
||||
" <td>(scatter / flux)</td>\n",
|
||||
" <td>5.554650e-03</td>\n",
|
||||
" <td>5.218094e-05</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(6.3e-07 - 2.0e+01)</td>\n",
|
||||
" <td>(U-238 / total)</td>\n",
|
||||
" <td>(nu-fission / flux)</td>\n",
|
||||
" <td>7.165057e-03</td>\n",
|
||||
" <td>5.625590e-05</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>5</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(6.3e-07 - 2.0e+01)</td>\n",
|
||||
" <td>(U-238 / total)</td>\n",
|
||||
" <td>(scatter / flux)</td>\n",
|
||||
" <td>2.276535e-01</td>\n",
|
||||
" <td>8.544314e-04</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>6</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(6.3e-07 - 2.0e+01)</td>\n",
|
||||
" <td>(U-235 / total)</td>\n",
|
||||
" <td>(nu-fission / flux)</td>\n",
|
||||
" <td>8.089493e-03</td>\n",
|
||||
" <td>5.080374e-05</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>7</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(6.3e-07 - 2.0e+01)</td>\n",
|
||||
" <td>(U-235 / total)</td>\n",
|
||||
" <td>(scatter / flux)</td>\n",
|
||||
" <td>3.370111e-03</td>\n",
|
||||
" <td>1.361116e-05</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cell energy [MeV] nuclide score \\\n",
|
||||
"0 10000 (0.0e+00 - 6.3e-07) (U-238 / total) (nu-fission / flux) \n",
|
||||
"1 10000 (0.0e+00 - 6.3e-07) (U-238 / total) (scatter / flux) \n",
|
||||
"2 10000 (0.0e+00 - 6.3e-07) (U-235 / total) (nu-fission / flux) \n",
|
||||
"3 10000 (0.0e+00 - 6.3e-07) (U-235 / total) (scatter / flux) \n",
|
||||
"4 10000 (6.3e-07 - 2.0e+01) (U-238 / total) (nu-fission / flux) \n",
|
||||
"5 10000 (6.3e-07 - 2.0e+01) (U-238 / total) (scatter / flux) \n",
|
||||
"6 10000 (6.3e-07 - 2.0e+01) (U-235 / total) (nu-fission / flux) \n",
|
||||
"7 10000 (6.3e-07 - 2.0e+01) (U-235 / total) (scatter / flux) \n",
|
||||
"\n",
|
||||
" mean std. dev. \n",
|
||||
"0 6.641746e-07 6.859257e-09 \n",
|
||||
"1 2.099861e-01 1.966887e-03 \n",
|
||||
"2 3.556665e-01 3.717881e-03 \n",
|
||||
"3 5.554650e-03 5.218094e-05 \n",
|
||||
"4 7.165057e-03 5.625590e-05 \n",
|
||||
"5 2.276535e-01 8.544314e-04 \n",
|
||||
"6 8.089493e-03 5.080374e-05 \n",
|
||||
"7 3.370111e-03 1.361116e-05 "
|
||||
]
|
||||
},
|
||||
"execution_count": 33,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"fuel_xs = fuel_rxn_rates / flux\n",
|
||||
"fuel_xs.get_pandas_dataframe()"
|
||||
|
|
@ -1254,23 +945,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 34,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[[[ 6.64174599e-07]\n",
|
||||
" [ 3.55666541e-01]]\n",
|
||||
"\n",
|
||||
" [[ 7.16505734e-03]\n",
|
||||
" [ 8.08949336e-03]]]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Show how to use Tally.get_values(...) with a CrossScore\n",
|
||||
"nu_fiss_xs = fuel_xs.get_values(scores=['(nu-fission / flux)'])\n",
|
||||
|
|
@ -1286,21 +965,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[[[ 0.00555465]]\n",
|
||||
"\n",
|
||||
" [[ 0.00337011]]]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Show how to use Tally.get_values(...) with a CrossScore and CrossNuclide\n",
|
||||
"u235_scatter_xs = fuel_xs.get_values(nuclides=['(U-235 / total)'], \n",
|
||||
|
|
@ -1310,20 +979,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 36,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[[[ 0.22765348]\n",
|
||||
" [ 0.00337011]]]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Show how to use Tally.get_values(...) with a CrossFilter and CrossScore\n",
|
||||
"fast_scatter_xs = fuel_xs.get_values(filters=['energy'], \n",
|
||||
|
|
@ -1341,81 +1001,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 37,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>cell</th>\n",
|
||||
" <th>energy [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>10000</td>\n",
|
||||
" <td>(0.0e+00 - 6.3e-07)</td>\n",
|
||||
" <td>U-238</td>\n",
|
||||
" <td>nu-fission</td>\n",
|
||||
" <td>0.000002</td>\n",
|
||||
" <td>1.284890e-08</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(0.0e+00 - 6.3e-07)</td>\n",
|
||||
" <td>U-235</td>\n",
|
||||
" <td>nu-fission</td>\n",
|
||||
" <td>0.867982</td>\n",
|
||||
" <td>7.022256e-03</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(6.3e-07 - 2.0e+01)</td>\n",
|
||||
" <td>U-238</td>\n",
|
||||
" <td>nu-fission</td>\n",
|
||||
" <td>0.082801</td>\n",
|
||||
" <td>6.087096e-04</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>10000</td>\n",
|
||||
" <td>(6.3e-07 - 2.0e+01)</td>\n",
|
||||
" <td>U-235</td>\n",
|
||||
" <td>nu-fission</td>\n",
|
||||
" <td>0.093484</td>\n",
|
||||
" <td>5.275039e-04</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cell energy [MeV] nuclide score mean std. dev.\n",
|
||||
"0 10000 (0.0e+00 - 6.3e-07) U-238 nu-fission 0.000002 1.284890e-08\n",
|
||||
"1 10000 (0.0e+00 - 6.3e-07) U-235 nu-fission 0.867982 7.022256e-03\n",
|
||||
"2 10000 (6.3e-07 - 2.0e+01) U-238 nu-fission 0.082801 6.087096e-04\n",
|
||||
"3 10000 (6.3e-07 - 2.0e+01) U-235 nu-fission 0.093484 5.275039e-04"
|
||||
]
|
||||
},
|
||||
"execution_count": 37,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# \"Slice\" the nu-fission data into a new derived Tally\n",
|
||||
"nu_fission_rates = fuel_rxn_rates.get_slice(scores=['nu-fission'])\n",
|
||||
|
|
@ -1424,131 +1014,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 38,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>cell</th>\n",
|
||||
" <th>energy [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>10002</td>\n",
|
||||
" <td>(1.0e-08 - 1.1e-07)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>4.620525</td>\n",
|
||||
" <td>0.038249</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>10002</td>\n",
|
||||
" <td>(1.1e-07 - 1.2e-06)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>2.036841</td>\n",
|
||||
" <td>0.013203</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>10002</td>\n",
|
||||
" <td>(1.2e-06 - 1.3e-05)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>1.659916</td>\n",
|
||||
" <td>0.010107</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>10002</td>\n",
|
||||
" <td>(1.3e-05 - 1.4e-04)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>1.861546</td>\n",
|
||||
" <td>0.013328</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>10002</td>\n",
|
||||
" <td>(1.4e-04 - 1.5e-03)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>2.049664</td>\n",
|
||||
" <td>0.008215</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>5</th>\n",
|
||||
" <td>10002</td>\n",
|
||||
" <td>(1.5e-03 - 1.6e-02)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>2.162157</td>\n",
|
||||
" <td>0.010245</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>6</th>\n",
|
||||
" <td>10002</td>\n",
|
||||
" <td>(1.6e-02 - 1.7e-01)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>2.224496</td>\n",
|
||||
" <td>0.013796</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>7</th>\n",
|
||||
" <td>10002</td>\n",
|
||||
" <td>(1.7e-01 - 1.9e+00)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>1.997585</td>\n",
|
||||
" <td>0.009161</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>8</th>\n",
|
||||
" <td>10002</td>\n",
|
||||
" <td>(1.9e+00 - 2.0e+01)</td>\n",
|
||||
" <td>H-1</td>\n",
|
||||
" <td>scatter</td>\n",
|
||||
" <td>0.373472</td>\n",
|
||||
" <td>0.003922</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cell energy [MeV] nuclide score mean std. dev.\n",
|
||||
"0 10002 (1.0e-08 - 1.1e-07) H-1 scatter 4.620525 0.038249\n",
|
||||
"1 10002 (1.1e-07 - 1.2e-06) H-1 scatter 2.036841 0.013203\n",
|
||||
"2 10002 (1.2e-06 - 1.3e-05) H-1 scatter 1.659916 0.010107\n",
|
||||
"3 10002 (1.3e-05 - 1.4e-04) H-1 scatter 1.861546 0.013328\n",
|
||||
"4 10002 (1.4e-04 - 1.5e-03) H-1 scatter 2.049664 0.008215\n",
|
||||
"5 10002 (1.5e-03 - 1.6e-02) H-1 scatter 2.162157 0.010245\n",
|
||||
"6 10002 (1.6e-02 - 1.7e-01) H-1 scatter 2.224496 0.013796\n",
|
||||
"7 10002 (1.7e-01 - 1.9e+00) H-1 scatter 1.997585 0.009161\n",
|
||||
"8 10002 (1.9e+00 - 2.0e+01) H-1 scatter 0.373472 0.003922"
|
||||
]
|
||||
},
|
||||
"execution_count": 38,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# \"Slice\" the H-1 scatter data in the moderator Cell into a new derived Tally\n",
|
||||
"need_to_slice = sp.get_tally(name='need-to-slice')\n",
|
||||
|
|
|
|||
|
|
@ -720,9 +720,8 @@ Geometry Specification -- geometry.xml
|
|||
The geometry in OpenMC is described using `constructive solid geometry`_ (CSG),
|
||||
also sometimes referred to as combinatorial geometry. CSG allows a user to
|
||||
create complex objects using Boolean operators on a set of simpler surfaces. In
|
||||
the geometry model, each unique closed volume in defined by its bounding
|
||||
surfaces. In OpenMC, most `quadratic surfaces`_ can be modeled and used as
|
||||
bounding surfaces.
|
||||
the geometry model, each unique volume is defined by its bounding surfaces. In
|
||||
OpenMC, most `quadratic surfaces`_ can be modeled and used as bounding surfaces.
|
||||
|
||||
Every geometry.xml must have an XML declaration at the beginning of the file and
|
||||
a root element named geometry. Within the root element the user can define any
|
||||
|
|
@ -745,7 +744,7 @@ number of cells, surfaces, and lattices. Let us look at the following example:
|
|||
<id>1</id>
|
||||
<universe>0</universe>
|
||||
<material>1</material>
|
||||
<surfaces>-1</surfaces>
|
||||
<region>-1</region>
|
||||
</cell>
|
||||
</geometry>
|
||||
|
||||
|
|
@ -763,7 +762,7 @@ could be written as:
|
|||
<!-- This is a comment -->
|
||||
|
||||
<surface id="1" type="sphere" coeffs="0.0 0.0 0.0 5.0" boundary="vacuum" />
|
||||
<cell id="1" universe="0" material="1" surfaces="-1" />
|
||||
<cell id="1" universe="0" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
||||
|
|
@ -787,7 +786,8 @@ Each ``<surface>`` element can have the following attributes or sub-elements:
|
|||
|
||||
:type:
|
||||
The type of the surfaces. This can be "x-plane", "y-plane", "z-plane",
|
||||
"plane", "x-cylinder", "y-cylinder", "z-cylinder", or "sphere".
|
||||
"plane", "x-cylinder", "y-cylinder", "z-cylinder", "sphere", "x-cone",
|
||||
"y-cone", or "z-cone".
|
||||
|
||||
*Default*: None
|
||||
|
||||
|
|
@ -891,15 +891,29 @@ Each ``<cell>`` element can have the following attributes or sub-elements:
|
|||
|
||||
*Default*: None
|
||||
|
||||
:surfaces:
|
||||
A list of the ``ids`` for surfaces that bound this cell, e.g. if the cell
|
||||
is on the negative side of surface 3 and the positive side of surface 5, the
|
||||
bounding surfaces would be given as "-3 5".
|
||||
:region:
|
||||
A Boolean expression of half-spaces that defines the spatial region which
|
||||
the cell occupies. Each half-space is identified by the unique ID of the
|
||||
surface prefixed by `-` or `+` to indicate that it is the negative or
|
||||
positive half-space, respectively. The `+` sign for a positive half-space
|
||||
can be omitted. Valid Boolean operators are parentheses, union `|`,
|
||||
complement `~`, and intersection. Intersection is implicit and indicated by
|
||||
the presence of whitespace. The order of operator precedence is parentheses,
|
||||
complement, intersection, and then union.
|
||||
|
||||
.. note:: The surface attribute/element can be omitted to make a cell fill
|
||||
its entire universe.
|
||||
As an example, the following code gives a cell that is the union of the
|
||||
negative half-space of surface 3 and the complement of the intersection of
|
||||
the positive half-space of surface 5 and the negative half-space of surface
|
||||
2:
|
||||
|
||||
*Default*: No surfaces
|
||||
.. code-block:: xml
|
||||
|
||||
<cell id="1" material="1" region="-3 | ~(5 -2)" />
|
||||
|
||||
.. note:: The ``region`` attribute/element can be omitted to make a cell
|
||||
fill its entire universe.
|
||||
|
||||
*Default*: A region filling all space.
|
||||
|
||||
:rotation:
|
||||
If the cell is filled with a universe, this element specifies the angles in
|
||||
|
|
@ -1239,17 +1253,87 @@ The ``<tally>`` element accepts the following sub-elements:
|
|||
:energy:
|
||||
A monotonically increasing list of bounding **pre-collision** energies
|
||||
for a number of groups. For example, if this filter is specified as
|
||||
``<filter type="energy" bins="0.0 1.0 20.0" />``, then two energy bins
|
||||
will be created, one with energies between 0 and 1 MeV and the other
|
||||
with energies between 1 and 20 MeV.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<filter type="energy" bins="0.0 1.0 20.0" />
|
||||
|
||||
then two energy bins will be created, one with energies between 0 and
|
||||
1 MeV and the other with energies between 1 and 20 MeV.
|
||||
|
||||
:energyout:
|
||||
A monotonically increasing list of bounding **post-collision**
|
||||
energies for a number of groups. For example, if this filter is
|
||||
specified as ``<filter type="energyout" bins="0.0 1.0 20.0" />``, then
|
||||
two post-collision energy bins will be created, one with energies
|
||||
specified as
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<filter type="energyout" bins="0.0 1.0 20.0" />
|
||||
|
||||
then two post-collision energy bins will be created, one with energies
|
||||
between 0 and 1 MeV and the other with energies between 1 and 20 MeV.
|
||||
|
||||
:mu:
|
||||
A monotonically increasing list of bounding **post-collision** cosines
|
||||
of the change in a particle's angle (i.e., :math:`\mu = \hat{\Omega}
|
||||
\cdot \hat{\Omega}'`), which represents a portion of the possible
|
||||
values of :math:`[-1,1]`. For example, spanning all of :math:`[-1,1]`
|
||||
with five equi-width bins can be specified as:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<filter type="mu" bins="-1.0 -0.6 -0.2 0.2 0.6 1.0" />
|
||||
|
||||
Alternatively, if only one value is provided as a bin, OpenMC will
|
||||
interpret this to mean the complete range of :math:`[-1,1]` should
|
||||
be automatically subdivided in to the provided value for the bin.
|
||||
That is, the above example of five equi-width bins spanning
|
||||
:math:`[-1,1]` can be instead written as:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<filter type="mu" bins="5" />
|
||||
|
||||
:polar:
|
||||
A monotonically increasing list of bounding particle polar angles
|
||||
which represents a portion of the possible values of :math:`[0,\pi]`.
|
||||
For example, spanning all of :math:`[0,\pi]` with five equi-width
|
||||
bins can be specified as:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<filter type="polar" bins="0.0 0.6283 1.2566 1.8850 2.5132 3.1416"/>
|
||||
|
||||
Alternatively, if only one value is provided as a bin, OpenMC will
|
||||
interpret this to mean the complete range of :math:`[0,\pi]` should
|
||||
be automatically subdivided in to the provided value for the bin.
|
||||
That is, the above example of five equi-width bins spanning
|
||||
:math:`[0,\pi]` can be instead written as:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<filter type="polar" bins="5" />
|
||||
|
||||
:azimuthal:
|
||||
A monotonically increasing list of bounding particle azimuthal angles
|
||||
which represents a portion of the possible values of :math:`[-\pi,\pi)`.
|
||||
For example, spanning all of :math:`[-\pi,\pi)` with two equi-width
|
||||
bins can be specified as:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<filter type="azimuthal" bins="0.0 3.1416 6.2832" />
|
||||
|
||||
Alternatively, if only one value is provided as a bin, OpenMC will
|
||||
interpret this to mean the complete range of :math:`[-\pi,\pi)` should
|
||||
be automatically subdivided in to the provided value for the bin.
|
||||
That is, the above example of five equi-width bins spanning
|
||||
:math:`[-\pi,\pi)` can be instead written as:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<filter type="azimuthal" bins="2" />
|
||||
|
||||
:mesh:
|
||||
The ``id`` of a structured mesh to be tallied over.
|
||||
|
||||
|
|
|
|||
|
|
@ -117,9 +117,9 @@ The current revision of the summary file format is 1.
|
|||
Unique ID of the lattice which fills the cell. Only present if fill_type is
|
||||
set to 'lattice'.
|
||||
|
||||
**/geometry/cells/cell <uid>/surfaces** (*int[]*)
|
||||
**/geometry/cells/cell <uid>/region** (*char[]*)
|
||||
|
||||
Surface specification for the cell.
|
||||
Region specification for the cell.
|
||||
|
||||
**/geometry/surfaces/surface <uid>/index** (*int*)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import openmc
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Simulation Input File Parameters
|
||||
###############################################################################
|
||||
|
|
@ -54,12 +53,11 @@ cell2 = openmc.Cell(cell_id=100, name='cell 2')
|
|||
cell3 = openmc.Cell(cell_id=101, name='cell 3')
|
||||
cell4 = openmc.Cell(cell_id=2, name='cell 4')
|
||||
|
||||
# Register Surfaces with Cells
|
||||
cell1.add_surface(surface=surf2, halfspace=-1)
|
||||
cell2.add_surface(surface=surf1, halfspace=-1)
|
||||
cell3.add_surface(surface=surf1, halfspace=+1)
|
||||
cell4.add_surface(surface=surf2, halfspace=+1)
|
||||
cell4.add_surface(surface=surf3, halfspace=-1)
|
||||
# Use surface half-spaces to define regions
|
||||
cell1.region = -surf2
|
||||
cell2.region = -surf1
|
||||
cell3.region = +surf1
|
||||
cell4.region = +surf2 & -surf3
|
||||
|
||||
# Register Materials with Cells
|
||||
cell2.fill = fuel
|
||||
|
|
|
|||
134
examples/python/boxes/build-xml.py
Normal file
134
examples/python/boxes/build-xml.py
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
import openmc
|
||||
|
||||
###############################################################################
|
||||
# Simulation Input File Parameters
|
||||
###############################################################################
|
||||
|
||||
# OpenMC simulation parameters
|
||||
batches = 15
|
||||
inactive = 5
|
||||
particles = 10000
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Exporting to OpenMC materials.xml File
|
||||
###############################################################################
|
||||
|
||||
# Instantiate some Nuclides
|
||||
h1 = openmc.Nuclide('H-1')
|
||||
o16 = openmc.Nuclide('O-16')
|
||||
u235 = openmc.Nuclide('U-235')
|
||||
u238 = openmc.Nuclide('U-238')
|
||||
|
||||
# Instantiate some Materials and register the appropriate Nuclides
|
||||
fuel1 = openmc.Material(material_id=1, name='fuel')
|
||||
fuel1.set_density('g/cc', 4.5)
|
||||
fuel1.add_nuclide(u235, 1.)
|
||||
|
||||
fuel2 = openmc.Material(material_id=2, name='depleted fuel')
|
||||
fuel2.set_density('g/cc', 4.5)
|
||||
fuel2.add_nuclide(u238, 1.)
|
||||
|
||||
moderator = openmc.Material(material_id=3, name='moderator')
|
||||
moderator.set_density('g/cc', 1.0)
|
||||
moderator.add_nuclide(h1, 2.)
|
||||
moderator.add_nuclide(o16, 1.)
|
||||
moderator.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
# Instantiate a MaterialsFile, register all Materials, and export to XML
|
||||
materials_file = openmc.MaterialsFile()
|
||||
materials_file.default_xs = '71c'
|
||||
materials_file.add_materials([fuel1, fuel2, moderator])
|
||||
materials_file.export_to_xml()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Exporting to OpenMC geometry.xml File
|
||||
###############################################################################
|
||||
|
||||
# Instantiate planar surfaces
|
||||
x1 = openmc.XPlane(surface_id=1, x0=-10)
|
||||
x2 = openmc.XPlane(surface_id=2, x0=-7)
|
||||
x3 = openmc.XPlane(surface_id=3, x0=-4)
|
||||
x4 = openmc.XPlane(surface_id=4, x0=4)
|
||||
x5 = openmc.XPlane(surface_id=5, x0=7)
|
||||
x6 = openmc.XPlane(surface_id=6, x0=10)
|
||||
y1 = openmc.YPlane(surface_id=11, y0=-10)
|
||||
y2 = openmc.YPlane(surface_id=12, y0=-7)
|
||||
y3 = openmc.YPlane(surface_id=13, y0=-4)
|
||||
y4 = openmc.YPlane(surface_id=14, y0=4)
|
||||
y5 = openmc.YPlane(surface_id=15, y0=7)
|
||||
y6 = openmc.YPlane(surface_id=16, y0=10)
|
||||
z1 = openmc.ZPlane(surface_id=21, z0=-10)
|
||||
z2 = openmc.ZPlane(surface_id=22, z0=-7)
|
||||
z3 = openmc.ZPlane(surface_id=23, z0=-4)
|
||||
z4 = openmc.ZPlane(surface_id=24, z0=4)
|
||||
z5 = openmc.ZPlane(surface_id=25, z0=7)
|
||||
z6 = openmc.ZPlane(surface_id=26, z0=10)
|
||||
|
||||
# Set vacuum boundary conditions on outside
|
||||
for surface in [x1, x6, y1, y6, z1, z6]:
|
||||
surface.boundary_type = 'vacuum'
|
||||
|
||||
# Instantiate Cells
|
||||
inner_box = openmc.Cell(cell_id=1, name='inner box')
|
||||
middle_box = openmc.Cell(cell_id=2, name='middle box')
|
||||
outer_box = openmc.Cell(cell_id=3, name='outer box')
|
||||
|
||||
# Use each set of six planes to create solid cube regions. We can then use these
|
||||
# to create cubic shells.
|
||||
inner_cube = +x3 & -x4 & +y3 & -y4 & +z3 & -z4
|
||||
middle_cube = +x2 & -x5 & +y2 & -y5 & +z2 & -z5
|
||||
outer_cube = +x1 & -x6 & +y1 & -y6 & +z1 & -z6
|
||||
outside_inner_cube = -x3 | +x4 | -y3 | +y4 | -z3 | +z4
|
||||
|
||||
# Use surface half-spaces to define regions
|
||||
inner_box.region = inner_cube
|
||||
middle_box.region = middle_cube & outside_inner_cube
|
||||
outer_box.region = outer_cube & ~middle_cube
|
||||
|
||||
# Register Materials with Cells
|
||||
inner_box.fill = fuel1
|
||||
middle_box.fill = fuel2
|
||||
outer_box.fill = moderator
|
||||
|
||||
# Instantiate root universe
|
||||
root = openmc.Universe(universe_id=0, name='root universe')
|
||||
root.add_cells([inner_box, middle_box, outer_box])
|
||||
|
||||
# Instantiate a Geometry and register the root Universe
|
||||
geometry = openmc.Geometry()
|
||||
geometry.root_universe = root
|
||||
|
||||
# Instantiate a GeometryFile, register Geometry, and export to XML
|
||||
geometry_file = openmc.GeometryFile()
|
||||
geometry_file.geometry = geometry
|
||||
geometry_file.export_to_xml()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Exporting to OpenMC settings.xml File
|
||||
###############################################################################
|
||||
|
||||
# Instantiate a SettingsFile, set all runtime parameters, and export to XML
|
||||
settings_file = openmc.SettingsFile()
|
||||
settings_file.batches = batches
|
||||
settings_file.inactive = inactive
|
||||
settings_file.particles = particles
|
||||
settings_file.set_source_space('point', [0., 0., 0.])
|
||||
settings_file.export_to_xml()
|
||||
|
||||
###############################################################################
|
||||
# Exporting to OpenMC plots.xml File
|
||||
###############################################################################
|
||||
|
||||
plot = openmc.Plot(plot_id=1)
|
||||
plot.origin = [0, 0, 0]
|
||||
plot.width = [20, 20]
|
||||
plot.pixels = [200, 200]
|
||||
plot.color = 'cell'
|
||||
|
||||
# Instantiate a PlotsFile, add Plot, and export to XML
|
||||
plot_file = openmc.PlotsFile()
|
||||
plot_file.add_plot(plot)
|
||||
plot_file.export_to_xml()
|
||||
|
|
@ -67,15 +67,12 @@ cell4 = openmc.Cell(cell_id=500, name='cell 4')
|
|||
cell5 = openmc.Cell(cell_id=600, name='cell 5')
|
||||
cell6 = openmc.Cell(cell_id=601, name='cell 6')
|
||||
|
||||
# Register Surfaces with Cells
|
||||
cell1.add_surface(left, halfspace=+1)
|
||||
cell1.add_surface(right, halfspace=-1)
|
||||
cell1.add_surface(bottom, halfspace=+1)
|
||||
cell1.add_surface(top, halfspace=-1)
|
||||
cell2.add_surface(fuel_surf, halfspace=-1)
|
||||
cell3.add_surface(fuel_surf, halfspace=+1)
|
||||
cell5.add_surface(fuel_surf, halfspace=-1)
|
||||
cell6.add_surface(fuel_surf, halfspace=+1)
|
||||
# Use surface half-spaces to define regions
|
||||
cell1.region = +left & -right & +bottom & -top
|
||||
cell2.region = -fuel_surf
|
||||
cell3.region = +fuel_surf
|
||||
cell5.region = -fuel_surf
|
||||
cell6.region = +fuel_surf
|
||||
|
||||
# Register Materials with Cells
|
||||
cell2.fill = fuel
|
||||
|
|
|
|||
|
|
@ -66,21 +66,15 @@ cell6 = openmc.Cell(cell_id=202, name='cell 6')
|
|||
cell7 = openmc.Cell(cell_id=301, name='cell 7')
|
||||
cell8 = openmc.Cell(cell_id=302, name='cell 8')
|
||||
|
||||
# Register Surfaces with Cells
|
||||
cell1.add_surface(left, halfspace=+1)
|
||||
cell1.add_surface(right, halfspace=-1)
|
||||
cell1.add_surface(bottom, halfspace=+1)
|
||||
cell1.add_surface(top, halfspace=-1)
|
||||
cell2.add_surface(left, halfspace=+1)
|
||||
cell2.add_surface(right, halfspace=-1)
|
||||
cell2.add_surface(bottom, halfspace=+1)
|
||||
cell2.add_surface(top, halfspace=-1)
|
||||
cell3.add_surface(fuel1, halfspace=-1)
|
||||
cell4.add_surface(fuel1, halfspace=+1)
|
||||
cell5.add_surface(fuel2, halfspace=-1)
|
||||
cell6.add_surface(fuel2, halfspace=+1)
|
||||
cell7.add_surface(fuel3, halfspace=-1)
|
||||
cell8.add_surface(fuel3, halfspace=+1)
|
||||
# Use surface half-space to define regions
|
||||
cell1.region = +left & -right & +bottom & -top
|
||||
cell2.region = +left & -right & +bottom & -top
|
||||
cell3.region = -fuel1
|
||||
cell4.region = +fuel1
|
||||
cell5.region = -fuel2
|
||||
cell6.region = +fuel2
|
||||
cell7.region = -fuel3
|
||||
cell8.region = +fuel3
|
||||
|
||||
# Register Materials with Cells
|
||||
cell3.fill = fuel
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import openmc
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Simulation Input File Parameters
|
||||
###############################################################################
|
||||
|
|
@ -65,17 +64,14 @@ cell5 = openmc.Cell(cell_id=202, name='cell 5')
|
|||
cell6 = openmc.Cell(cell_id=301, name='cell 6')
|
||||
cell7 = openmc.Cell(cell_id=302, name='cell 7')
|
||||
|
||||
# Register Surfaces with Cells
|
||||
cell1.add_surface(left, halfspace=+1)
|
||||
cell1.add_surface(right, halfspace=-1)
|
||||
cell1.add_surface(bottom, halfspace=+1)
|
||||
cell1.add_surface(top, halfspace=-1)
|
||||
cell2.add_surface(fuel1, halfspace=-1)
|
||||
cell3.add_surface(fuel1, halfspace=+1)
|
||||
cell4.add_surface(fuel2, halfspace=-1)
|
||||
cell5.add_surface(fuel2, halfspace=+1)
|
||||
cell6.add_surface(fuel3, halfspace=-1)
|
||||
cell7.add_surface(fuel3, halfspace=+1)
|
||||
# Use surface half-spaces to define regions
|
||||
cell1.region = +left & -right & +bottom & -top
|
||||
cell2.region = -fuel1
|
||||
cell3.region = +fuel1
|
||||
cell4.region = -fuel2
|
||||
cell5.region = +fuel2
|
||||
cell6.region = -fuel3
|
||||
cell7.region = +fuel3
|
||||
|
||||
# Register Materials with Cells
|
||||
cell2.fill = fuel
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import openmc
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Simulation Input File Parameters
|
||||
###############################################################################
|
||||
|
|
@ -132,17 +131,11 @@ gap = openmc.Cell(cell_id=2, name='cell 2')
|
|||
clad = openmc.Cell(cell_id=3, name='cell 3')
|
||||
water = openmc.Cell(cell_id=4, name='cell 4')
|
||||
|
||||
# Register Surfaces with Cells
|
||||
fuel.add_surface(fuel_or, halfspace=-1)
|
||||
gap.add_surface(fuel_or, halfspace=+1)
|
||||
gap.add_surface(clad_ir, halfspace=-1)
|
||||
clad.add_surface(clad_ir, halfspace=+1)
|
||||
clad.add_surface(clad_or, halfspace=-1)
|
||||
water.add_surface(clad_or, halfspace=+1)
|
||||
water.add_surface(left, halfspace=+1)
|
||||
water.add_surface(right, halfspace=-1)
|
||||
water.add_surface(bottom, halfspace=+1)
|
||||
water.add_surface(top, halfspace=-1)
|
||||
# Use surface half-spaces to define regions
|
||||
fuel.region = -fuel_or
|
||||
gap.region = +fuel_or & -clad_ir
|
||||
clad.region = +clad_ir & -clad_or
|
||||
water.region = +clad_or & +left & -right & +bottom & -top
|
||||
|
||||
# Register Materials with Cells
|
||||
fuel.fill = uo2
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import openmc
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Simulation Input File Parameters
|
||||
###############################################################################
|
||||
|
|
@ -52,13 +51,8 @@ surf6.boundary_type = 'reflective'
|
|||
# Instantiate Cell
|
||||
cell = openmc.Cell(cell_id=1, name='cell 1')
|
||||
|
||||
# Register Surfaces with Cell
|
||||
cell.add_surface(surface=surf1, halfspace=+1)
|
||||
cell.add_surface(surface=surf2, halfspace=-1)
|
||||
cell.add_surface(surface=surf3, halfspace=+1)
|
||||
cell.add_surface(surface=surf4, halfspace=-1)
|
||||
cell.add_surface(surface=surf5, halfspace=+1)
|
||||
cell.add_surface(surface=surf6, halfspace=-1)
|
||||
# Use surface half-spaces to define region
|
||||
cell.region = +surf1 & -surf2 & +surf3 & -surf4 & +surf5 & -surf6
|
||||
|
||||
# Register Material with Cell
|
||||
cell.fill = fuel
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
<geometry>
|
||||
|
||||
<!-- Definition of Cells -->
|
||||
<cell id="1" universe="0" fill="37" surfaces="-2" />
|
||||
<cell id="100" universe="37" material="40" surfaces="-1" />
|
||||
<cell id="101" universe="37" material="41" surfaces="1" />
|
||||
<cell id="2" universe="0" material="41" surfaces = "2 -3" />
|
||||
<cell id="1" universe="0" fill="37" region="-2" />
|
||||
<cell id="100" universe="37" material="40" region="-1" />
|
||||
<cell id="101" universe="37" material="41" region="1" />
|
||||
<cell id="2" universe="0" material="41" region="2 -3" />
|
||||
|
||||
<!-- Defition of Surfaces -->
|
||||
<surface id="1" type="z-cylinder" coeffs="0 0 7" />
|
||||
<surface id="2" type="z-cylinder" coeffs="0 0 9" />
|
||||
<surface id="3" type="z-cylinder" coeffs="0 0 11" boundary="vacuum" />
|
||||
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
39
examples/xml/boxes/geometry.xml
Normal file
39
examples/xml/boxes/geometry.xml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!--
|
||||
This example consists of three nested boxes, and is meant to show how to
|
||||
use Boolean operators to construct complex cell regions.
|
||||
-->
|
||||
|
||||
<surface id="1" type="x-plane" coeffs="-10" boundary="vacuum" />
|
||||
<surface id="2" type="x-plane" coeffs="-7" />
|
||||
<surface id="3" type="x-plane" coeffs="-4" />
|
||||
<surface id="4" type="x-plane" coeffs="4" />
|
||||
<surface id="5" type="x-plane" coeffs="7" />
|
||||
<surface id="6" type="x-plane" coeffs="10" boundary="vacuum" />
|
||||
|
||||
<surface id="11" type="y-plane" coeffs="-10" boundary="vacuum" />
|
||||
<surface id="12" type="y-plane" coeffs="-7" />
|
||||
<surface id="13" type="y-plane" coeffs="-4" />
|
||||
<surface id="14" type="y-plane" coeffs="4" />
|
||||
<surface id="15" type="y-plane" coeffs="7" />
|
||||
<surface id="16" type="y-plane" coeffs="10" boundary="vacuum" />
|
||||
|
||||
<surface id="21" type="z-plane" coeffs="-10" boundary="vacuum" />
|
||||
<surface id="22" type="z-plane" coeffs="-7" />
|
||||
<surface id="23" type="z-plane" coeffs="-4" />
|
||||
<surface id="24" type="z-plane" coeffs="4" />
|
||||
<surface id="25" type="z-plane" coeffs="7" />
|
||||
<surface id="26" type="z-plane" coeffs="10" boundary="vacuum" />
|
||||
|
||||
<!-- Innermost cube -->
|
||||
<cell id="1" material="1" region="3 -4 13 -14 23 -24" />
|
||||
|
||||
<!-- Middle cubic shell -->
|
||||
<cell id="2" material="2" region="2 -5 12 -15 22 -25 (-3 | 4 | -13 | 14 | -23 | 24)" />
|
||||
|
||||
<!-- Outermost cubic shell -->
|
||||
<cell id="3" material="3" region="1 -6 11 -16 21 -26 ~(2 -5 12 -15 22 -25)" />
|
||||
|
||||
</geometry>
|
||||
23
examples/xml/boxes/materials.xml
Normal file
23
examples/xml/boxes/materials.xml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<default_xs>71c</default_xs>
|
||||
|
||||
<material id="1">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-235" ao="1.0" />
|
||||
</material>
|
||||
|
||||
<material id="2">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-238" ao="1.0" />
|
||||
</material>
|
||||
|
||||
<material id="3">
|
||||
<density value="1.0" units="g/cc" />
|
||||
<nuclide name="O-16" ao="1.0" />
|
||||
<nuclide name="H-1" ao="2.0" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
9
examples/xml/boxes/plots.xml
Normal file
9
examples/xml/boxes/plots.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<plots>
|
||||
<plot id="1" type="slice">
|
||||
<color>cell</color>
|
||||
<origin>0. 0. 0.</origin>
|
||||
<width>20. 20.</width>
|
||||
<pixels>200 200</pixels>
|
||||
</plot>
|
||||
</plots>
|
||||
16
examples/xml/boxes/settings.xml
Normal file
16
examples/xml/boxes/settings.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<!-- Parameters for k-eigenvalue calculation -->
|
||||
<eigenvalue>
|
||||
<batches>15</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>10000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<!-- Starting source -->
|
||||
<source>
|
||||
<space type="point" parameters="0. 0. 0." />
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<cell id="1" fill="6" surfaces="1 -2 3 -4" />
|
||||
<cell id="2" universe="5" fill="4" surfaces="1 -2 3 -4" />
|
||||
<cell id="101" universe="1" material="1" surfaces="-5" />
|
||||
<cell id="102" universe="1" material="2" surfaces="5" />
|
||||
<cell id="201" universe="2" material="1" surfaces="-6" />
|
||||
<cell id="202" universe="2" material="2" surfaces="6" />
|
||||
<cell id="301" universe="3" material="1" surfaces="-7" />
|
||||
<cell id="302" universe="3" material="2" surfaces="7" />
|
||||
<cell id="1" fill="6" region="1 -2 3 -4" />
|
||||
<cell id="2" universe="5" fill="4" region="1 -2 3 -4" />
|
||||
<cell id="101" universe="1" material="1" region="-5" />
|
||||
<cell id="102" universe="1" material="2" region="5" />
|
||||
<cell id="201" universe="2" material="1" region="-6" />
|
||||
<cell id="202" universe="2" material="2" region="6" />
|
||||
<cell id="301" universe="3" material="1" region="-7" />
|
||||
<cell id="302" universe="3" material="2" region="7" />
|
||||
|
||||
<!-- 4 x 4 assembly -->
|
||||
<lattice id="4">
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<cell id="1" fill="5" surfaces="1 -2 3 -4" />
|
||||
<cell id="101" universe="1" material="1" surfaces="-5" />
|
||||
<cell id="102" universe="1" material="2" surfaces="5" />
|
||||
<cell id="201" universe="2" material="1" surfaces="-6" />
|
||||
<cell id="202" universe="2" material="2" surfaces="6" />
|
||||
<cell id="301" universe="3" material="1" surfaces="-7" />
|
||||
<cell id="302" universe="3" material="2" surfaces="7" />
|
||||
<cell id="1" fill="5" region="1 -2 3 -4" />
|
||||
<cell id="101" universe="1" material="1" region="-5" />
|
||||
<cell id="102" universe="1" material="2" region="5" />
|
||||
<cell id="201" universe="2" material="1" region="-6" />
|
||||
<cell id="202" universe="2" material="2" region="6" />
|
||||
<cell id="301" universe="3" material="1" region="-7" />
|
||||
<cell id="302" universe="3" material="2" region="7" />
|
||||
|
||||
<lattice id="5">
|
||||
<dimension>4 4</dimension>
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
<surface id="6" type="y-plane" coeffs="-0.62992" boundary="reflective" />
|
||||
<surface id="7" type="y-plane" coeffs=" 0.62992" boundary="reflective" />
|
||||
|
||||
<cell id="1" material="1" surfaces=" -1" /> <!-- UO2 Fuel -->
|
||||
<cell id="2" material="2" surfaces="1 -2" /> <!-- Helium gap -->
|
||||
<cell id="3" material="3" surfaces="2 -3" /> <!-- Zircaloy cladding -->
|
||||
<cell id="4" material="4" surfaces="3 4 -5 6 -7" /> <!-- Borated water -->
|
||||
<cell id="1" material="1" region=" -1" /> <!-- UO2 Fuel -->
|
||||
<cell id="2" material="2" region="1 -2" /> <!-- Helium gap -->
|
||||
<cell id="3" material="3" region="2 -3" /> <!-- Zircaloy cladding -->
|
||||
<cell id="4" material="4" region="3 4 -5 6 -7" /> <!-- Borated water -->
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@
|
|||
<cell id="1">
|
||||
<universe>0</universe>
|
||||
<material>1</material>
|
||||
<surfaces>1 -2 3 -4 5 -6</surfaces>
|
||||
<region>1 -2 3 -4 5 -6</region>
|
||||
</cell>
|
||||
|
||||
<!-- Defition of Surfaces -->
|
||||
<surface id="1" type="x-plane" coeffs="-1" boundary="vacuum" />
|
||||
<surface id="2" type="x-plane" coeffs="1" boundary="vacuum" />
|
||||
<surface id="3" type="y-plane" coeffs="-1" boundary="reflective" />
|
||||
<surface id="3" type="y-plane" coeffs="-1" boundary="reflective" />
|
||||
<surface id="4" type="y-plane" coeffs="1" boundary="reflective" />
|
||||
<surface id="5" type="z-plane" coeffs="-1" boundary="reflective" />
|
||||
<surface id="5" type="z-plane" coeffs="-1" boundary="reflective" />
|
||||
<surface id="6" type="z-plane" coeffs="1" boundary="reflective" />
|
||||
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ def sort_xml_elements(tree):
|
|||
comment_elements.append((element, next_element))
|
||||
|
||||
# Now iterate over all tags and order the elements within each tag
|
||||
for tag in tags:
|
||||
for tag in sorted(list(tags)):
|
||||
|
||||
# Retrieve all of the elements for this tag
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ if sys.version_info[0] >= 3:
|
|||
|
||||
|
||||
_FILTER_TYPES = ['universe', 'material', 'cell', 'cellborn', 'surface',
|
||||
'mesh', 'energy', 'energyout', 'distribcell']
|
||||
'mesh', 'energy', 'energyout', 'mu', 'polar', 'azimuthal',
|
||||
'distribcell']
|
||||
|
||||
class Filter(object):
|
||||
"""A filter used to constrain a tally to a specific criterion, e.g. only
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from collections import Iterable
|
||||
from collections import Iterable, OrderedDict
|
||||
from copy import deepcopy
|
||||
from numbers import Real, Integral
|
||||
import warnings
|
||||
|
|
@ -64,15 +64,15 @@ class Material(object):
|
|||
self._density = None
|
||||
self._density_units = ''
|
||||
|
||||
# A dictionary of Nuclides
|
||||
# An ordered dictionary of Nuclides (order affects OpenMC results)
|
||||
# Keys - Nuclide names
|
||||
# Values - tuple (nuclide, percent, percent type)
|
||||
self._nuclides = {}
|
||||
self._nuclides = OrderedDict()
|
||||
|
||||
# A dictionary of Elements
|
||||
# An ordered dictionary of Elements (order affects OpenMC results)
|
||||
# Keys - Element names
|
||||
# Values - tuple (element, percent, percent type)
|
||||
self._elements = {}
|
||||
self._elements = OrderedDict()
|
||||
|
||||
# If specified, a list of tuples of (table name, xs identifier)
|
||||
self._sab = []
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ except ImportError:
|
|||
raise ImportError(msg)
|
||||
|
||||
import openmc
|
||||
from openmc.region import Intersection
|
||||
from openmc.surface import Halfspace
|
||||
|
||||
|
||||
# A dictionary of all OpenMC Materials created
|
||||
|
|
@ -480,12 +482,24 @@ def get_opencg_cell(openmc_cell):
|
|||
if openmc_cell.translation is not None:
|
||||
opencg_cell.translation = openmc_cell.translation
|
||||
|
||||
surfaces = openmc_cell.surfaces
|
||||
|
||||
for surface_id in surfaces:
|
||||
surface = surfaces[surface_id][0]
|
||||
halfspace = surfaces[surface_id][1]
|
||||
# Add surfaces to OpenCG cell from OpenMC cell region. Right now this only
|
||||
# works if the region is a single half-space or an intersection of
|
||||
# half-spaces, i.e., no complex cells.
|
||||
region = openmc_cell.region
|
||||
if isinstance(region, Halfspace):
|
||||
surface = region.surface
|
||||
halfspace = -1 if region.side == '-' else 1
|
||||
opencg_cell.add_surface(get_opencg_surface(surface), halfspace)
|
||||
elif isinstance(region, Intersection):
|
||||
for node in region.nodes:
|
||||
if not isinstance(node, Halfspace):
|
||||
raise NotImplementedError("Complex cells not yet supported "
|
||||
"in OpenCG.")
|
||||
surface = node.surface
|
||||
halfspace = -1 if node.side == '-' else 1
|
||||
opencg_cell.add_surface(get_opencg_surface(surface), halfspace)
|
||||
else:
|
||||
raise NotImplementedError("Complex cells not yet supported in OpenCG.")
|
||||
|
||||
# Add the OpenMC Cell to the global collection of all OpenMC Cells
|
||||
OPENMC_CELLS[cell_id] = openmc_cell
|
||||
|
|
|
|||
308
openmc/region.py
Normal file
308
openmc/region.py
Normal file
|
|
@ -0,0 +1,308 @@
|
|||
from abc import ABCMeta, abstractmethod
|
||||
from collections import Iterable
|
||||
|
||||
from openmc.checkvalue import check_type
|
||||
|
||||
|
||||
class Region(object):
|
||||
"""Region of space that can be assigned to a cell.
|
||||
|
||||
Region is an abstract base class that is inherited by Halfspace,
|
||||
Intersection, Union, and Complement. Each of those respective classes are
|
||||
typically not instantiated directly but rather are created through operators
|
||||
of the Surface and Region classes.
|
||||
|
||||
"""
|
||||
|
||||
__metaclass__ = ABCMeta
|
||||
|
||||
def __and__(self, other):
|
||||
return Intersection(self, other)
|
||||
|
||||
def __or__(self, other):
|
||||
return Union(self, other)
|
||||
|
||||
def __invert__(self):
|
||||
return Complement(self)
|
||||
|
||||
@abstractmethod
|
||||
def __str__(self):
|
||||
return ''
|
||||
|
||||
@staticmethod
|
||||
def from_expression(expression, surfaces):
|
||||
"""Generate a region given an infix expression.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
expression : str
|
||||
Boolean expression relating surface half-spaces. The possible
|
||||
operators are union '|', intersection ' ', and complement '~'. For
|
||||
example, '(1 -2) | 3 ~(4 -5)'.
|
||||
surfaces : dict
|
||||
Dictionary whose keys are suface IDs that appear in the Boolean
|
||||
expression and whose values are Surface objects.
|
||||
|
||||
"""
|
||||
|
||||
# Strip leading and trailing whitespace
|
||||
expression = expression.strip()
|
||||
|
||||
# Convert the string expression into a list of tokens, i.e., operators
|
||||
# and surface half-spaces, representing the expression in infix
|
||||
# notation.
|
||||
i = 0
|
||||
i_start = -1
|
||||
tokens = []
|
||||
while i < len(expression):
|
||||
if expression[i] in '()|~ ':
|
||||
# If special character appears immediately after a non-operator,
|
||||
# create a token with the apporpriate half-space
|
||||
if i_start >= 0:
|
||||
j = int(expression[i_start:i])
|
||||
if j < 0:
|
||||
tokens.append(-surfaces[abs(j)])
|
||||
else:
|
||||
tokens.append(+surfaces[abs(j)])
|
||||
|
||||
if expression[i] in '()|~':
|
||||
# For everything other than intersection, add the operator
|
||||
# to the list of tokens
|
||||
tokens.append(expression[i])
|
||||
else:
|
||||
# Find next non-space character
|
||||
while expression[i+1] == ' ':
|
||||
i += 1
|
||||
|
||||
# If previous token is a halfspace or right parenthesis and next token
|
||||
# is not a left parenthese or union operator, that implies that the
|
||||
# whitespace is to be interpreted as an intersection operator
|
||||
if (i_start >= 0 or tokens[-1] == ')') and \
|
||||
expression[i+1] not in ')|':
|
||||
tokens.append(' ')
|
||||
|
||||
i_start = -1
|
||||
else:
|
||||
# Check for invalid characters
|
||||
if expression[i] not in '-0123456789':
|
||||
raise SyntaxError("Invalid character '{}' in expression"
|
||||
.format(expression[i]))
|
||||
|
||||
# If we haven't yet reached the start of a word, start one
|
||||
if i_start < 0:
|
||||
i_start = i
|
||||
i += 1
|
||||
|
||||
# If we've reached the end and we're still in a word, create a
|
||||
# half-space token and add it to the list
|
||||
if i_start >= 0:
|
||||
j = int(expression[i_start:])
|
||||
if j < 0:
|
||||
tokens.append(-surfaces[abs(j)])
|
||||
else:
|
||||
tokens.append(+surfaces[abs(j)])
|
||||
|
||||
# The functions below are used to apply an operator to operands on the
|
||||
# output queue during the shunting yard algorithm.
|
||||
def can_be_combined(region):
|
||||
return isinstance(region, Complement) or hasattr(region, 'surface')
|
||||
|
||||
def apply_operator(output, operator):
|
||||
r2 = output.pop()
|
||||
if operator == ' ':
|
||||
r1 = output.pop()
|
||||
if isinstance(r1, Intersection) and can_be_combined(r2):
|
||||
r1.nodes.append(r2)
|
||||
output.append(r1)
|
||||
elif isinstance(r2, Intersection) and can_be_combined(r1):
|
||||
r2.nodes.insert(0, r1)
|
||||
output.append(r2)
|
||||
elif isinstance(r1, Intersection) and isinstance(r2, Intersection):
|
||||
r1.nodes += r2.nodes
|
||||
output.append(r1)
|
||||
else:
|
||||
output.append(Intersection(r1, r2))
|
||||
elif operator == '|':
|
||||
r1 = output.pop()
|
||||
if isinstance(r1, Union) and can_be_combined(r2):
|
||||
r1.nodes.append(r2)
|
||||
output.append(r1)
|
||||
elif isinstance(r2, Union) and can_be_combined(r1):
|
||||
r2.nodes.insert(0, r1)
|
||||
output.append(r2)
|
||||
elif isinstance(r1, Union) and isinstance(r2, Union):
|
||||
r1.nodes += r2.nodes
|
||||
output.append(r1)
|
||||
else:
|
||||
output.append(Union(r1, r2))
|
||||
elif operator == '~':
|
||||
output.append(Complement(r2))
|
||||
|
||||
# The following is an implementation of the shunting yard algorithm to
|
||||
# generate an abstract syntax tree for the region expression.
|
||||
output = []
|
||||
stack = []
|
||||
precedence = {'|': 1, ' ': 2, '~': 3}
|
||||
associativity = {'|': 'left', ' ': 'left', '~': 'right'}
|
||||
for token in tokens:
|
||||
if token in (' ', '|', '~'):
|
||||
# Normal operators
|
||||
while stack:
|
||||
op = stack[-1]
|
||||
if (op not in ('(', ')') and
|
||||
((associativity[token] == 'right' and
|
||||
precedence[token] < precedence[op]) or
|
||||
(associativity[token] == 'left' and
|
||||
precedence[token] <= precedence[op]))):
|
||||
apply_operator(output, stack.pop())
|
||||
else:
|
||||
break
|
||||
stack.append(token)
|
||||
elif token == '(':
|
||||
# Left parentheses
|
||||
stack.append(token)
|
||||
elif token == ')':
|
||||
# Right parentheses
|
||||
while stack[-1] != '(':
|
||||
apply_operator(output, stack.pop())
|
||||
if len(stack) == 0:
|
||||
raise SyntaxError('Mismatched parentheses in '
|
||||
'region specification.')
|
||||
stack.pop()
|
||||
else:
|
||||
# Surface halfspaces
|
||||
output.append(token)
|
||||
while stack:
|
||||
if stack[-1] in '()':
|
||||
raise SyntaxError('Mismatched parentheses in region '
|
||||
'specification.')
|
||||
apply_operator(output, stack.pop())
|
||||
|
||||
# Since we are generating an abstract syntax tree rather than a reverse
|
||||
# Polish notation expression, the output queue should have a single item
|
||||
# at the end
|
||||
return output[0]
|
||||
|
||||
|
||||
class Intersection(Region):
|
||||
"""Intersection of two or more regions.
|
||||
|
||||
Instances of Intersection are generally created via the __and__ operator
|
||||
applied to two instances of Region. This is illustrated in the following
|
||||
example:
|
||||
|
||||
>>> equator = openmc.surface.ZPlane(z0=0.0)
|
||||
>>> earth = openmc.surface.Sphere(R=637.1e6)
|
||||
>>> northern_hemisphere = -earth & +equator
|
||||
>>> southern_hemisphere = -earth & -equator
|
||||
>>> type(northern_hemisphere)
|
||||
<class 'openmc.region.Intersection'>
|
||||
|
||||
Parameters
|
||||
----------
|
||||
*nodes
|
||||
Regions to take the intersection of
|
||||
|
||||
Attributes
|
||||
----------
|
||||
nodes : tuple of Region
|
||||
Regions to take the intersection of
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, *nodes):
|
||||
self.nodes = list(nodes)
|
||||
|
||||
@property
|
||||
def nodes(self):
|
||||
return self._nodes
|
||||
|
||||
@nodes.setter
|
||||
def nodes(self, nodes):
|
||||
check_type('nodes', nodes, Iterable, Region)
|
||||
self._nodes = nodes
|
||||
|
||||
def __str__(self):
|
||||
return '(' + ' '.join(map(str, self.nodes)) + ')'
|
||||
|
||||
|
||||
class Union(Region):
|
||||
"""Union of two or more regions.
|
||||
|
||||
Instances of Union are generally created via the __or__ operator applied to
|
||||
two instances of Region. This is illustrated in the following example:
|
||||
|
||||
>>> s1 = openmc.surface.ZPlane(z0=0.0)
|
||||
>>> s2 = openmc.surface.Sphere(R=637.1e6)
|
||||
>>> type(-s2 | +s1)
|
||||
<class 'openmc.region.Union'>
|
||||
|
||||
Parameters
|
||||
----------
|
||||
*nodes
|
||||
Regions to take the union of
|
||||
|
||||
Attributes
|
||||
----------
|
||||
nodes : tuple of Region
|
||||
Regions to take the union of
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, *nodes):
|
||||
self.nodes = list(nodes)
|
||||
|
||||
@property
|
||||
def nodes(self):
|
||||
return self._nodes
|
||||
|
||||
@nodes.setter
|
||||
def nodes(self, nodes):
|
||||
check_type('nodes', nodes, Iterable, Region)
|
||||
self._nodes = nodes
|
||||
|
||||
def __str__(self):
|
||||
return '(' + ' | '.join(map(str, self.nodes)) + ')'
|
||||
|
||||
|
||||
class Complement(Region):
|
||||
"""Complement of a region.
|
||||
|
||||
The Complement of an existing Region can be created by using the __invert__
|
||||
operator as the following example demonstrates:
|
||||
|
||||
>>> xl = openmc.surface.XPlane(x0=-10.0)
|
||||
>>> xr = openmc.surface.XPlane(x0=10.0)
|
||||
>>> yl = openmc.surface.YPlane(y0=-10.0)
|
||||
>>> yr = openmc.surface.YPlane(y0=10.0)
|
||||
>>> inside_box = +xl & -xr & +yl & -yl
|
||||
>>> outside_box = ~inside_box
|
||||
>>> type(outside_box)
|
||||
<class 'openmc.region.Complement'>
|
||||
|
||||
Parameters
|
||||
----------
|
||||
node : Region
|
||||
Region to take the complement of
|
||||
|
||||
Attributes
|
||||
----------
|
||||
node : Region
|
||||
Regions to take the complement of
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
|
||||
@property
|
||||
def node(self):
|
||||
return self._node
|
||||
|
||||
@node.setter
|
||||
def node(self, node):
|
||||
check_type('node', node, Region)
|
||||
self._node = node
|
||||
|
||||
def __str__(self):
|
||||
return '~' + str(self.node)
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import numpy as np
|
||||
|
||||
import openmc
|
||||
from openmc.region import Region
|
||||
|
||||
|
||||
class Summary(object):
|
||||
|
|
@ -212,10 +213,10 @@ class Summary(object):
|
|||
else:
|
||||
fill = self._f['geometry/cells'][key]['lattice'].value
|
||||
|
||||
if 'surfaces' in self._f['geometry/cells'][key].keys():
|
||||
surfaces = self._f['geometry/cells'][key]['surfaces'][...]
|
||||
if 'region' in self._f['geometry/cells'][key].keys():
|
||||
region = self._f['geometry/cells'][key]['region'].value.decode()
|
||||
else:
|
||||
surfaces = []
|
||||
region = []
|
||||
|
||||
# Create this Cell
|
||||
cell = openmc.Cell(cell_id=cell_id, name=name)
|
||||
|
|
@ -240,13 +241,10 @@ class Summary(object):
|
|||
# Store Cell fill information for after Universe/Lattice creation
|
||||
self._cell_fills[index] = (fill_type, fill)
|
||||
|
||||
# Iterate over all Surfaces and add them to the Cell
|
||||
for surface_halfspace in surfaces:
|
||||
|
||||
halfspace = np.sign(surface_halfspace)
|
||||
surface_id = abs(surface_halfspace)
|
||||
surface = self.get_surface_by_id(surface_id)
|
||||
cell.add_surface(surface, halfspace)
|
||||
# Generate Region object given infix expression
|
||||
if region:
|
||||
cell.region = Region.from_expression(
|
||||
region, {s.id: s for s in self.surfaces.values()})
|
||||
|
||||
# Add the Cell to the global dictionary of all Cells
|
||||
self.cells[index] = cell
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from xml.etree import ElementTree as ET
|
|||
import sys
|
||||
|
||||
from openmc.checkvalue import check_type, check_value, check_greater_than
|
||||
from openmc.region import Region
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
basestring = str
|
||||
|
|
@ -38,17 +39,17 @@ class Surface(object):
|
|||
|
||||
Attributes
|
||||
----------
|
||||
boundary_type : {'transmission, 'vacuum', 'reflective', 'periodic'}
|
||||
Boundary condition that defines the behavior for particles hitting the
|
||||
surface.
|
||||
coeffs : dict
|
||||
Dictionary of surface coefficients
|
||||
id : int
|
||||
Unique identifier for the surface
|
||||
name : str
|
||||
Name of the surface
|
||||
type : str
|
||||
Type of the surface, e.g. 'x-plane'
|
||||
boundary_type : {'transmission, 'vacuum', 'reflective', 'periodic'}
|
||||
Boundary condition that defines the behavior for particles hitting the
|
||||
surface.
|
||||
coeffs : dict
|
||||
Dictionary of surface coefficients
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -68,6 +69,12 @@ class Surface(object):
|
|||
# proper order
|
||||
self._coeff_keys = []
|
||||
|
||||
def __neg__(self):
|
||||
return Halfspace(self, '-')
|
||||
|
||||
def __pos__(self):
|
||||
return Halfspace(self, '+')
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return self._id
|
||||
|
|
@ -940,3 +947,68 @@ class ZCone(Cone):
|
|||
R2, name=name)
|
||||
|
||||
self._type = 'z-cone'
|
||||
|
||||
|
||||
class Halfspace(Region):
|
||||
"""A positive or negative half-space region.
|
||||
|
||||
A half-space is either of the two parts into which a two-dimension surface
|
||||
divides the three-dimensional Euclidean space. If the equation of the
|
||||
surface is :math:`f(x,y,z) = 0`, the region for which :math:`f(x,y,z) < 0`
|
||||
is referred to as the negative half-space and the region for which
|
||||
:math:`f(x,y,z) > 0` is referred to as the positive half-space.
|
||||
|
||||
Instances of Halfspace are generally not instantiated directly. Rather, they
|
||||
can be created from an existing Surface through the __neg__ and __pos__
|
||||
operators, as the following example demonstrates:
|
||||
|
||||
>>> sphere = openmc.surface.Sphere(surface_id=1, R=10.0)
|
||||
>>> inside_sphere = -sphere
|
||||
>>> outside_sphere = +sphere
|
||||
>>> type(inside_sphere)
|
||||
<class 'openmc.surface.Halfspace'>
|
||||
|
||||
Parameters
|
||||
----------
|
||||
surface : Surface
|
||||
Surface which divides Euclidean space.
|
||||
side : {'+', '-'}
|
||||
Indicates whether the positive or negative half-space is used.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
surface : Surface
|
||||
Surface which divides Euclidean space.
|
||||
side : {'+', '-'}
|
||||
Indicates whether the positive or negative half-space is used.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, surface, side):
|
||||
self.surface = surface
|
||||
self.side = side
|
||||
|
||||
def __invert__(self):
|
||||
return -self.surface if self.side == '+' else +self.surface
|
||||
|
||||
@property
|
||||
def surface(self):
|
||||
return self._surface
|
||||
|
||||
@surface.setter
|
||||
def surface(self, surface):
|
||||
check_type('surface', surface, Surface)
|
||||
self._surface = surface
|
||||
|
||||
@property
|
||||
def side(self):
|
||||
return self._side
|
||||
|
||||
@side.setter
|
||||
def side(self, side):
|
||||
check_value('side', side, ('+', '-'))
|
||||
self._side = side
|
||||
|
||||
def __str__(self):
|
||||
return '-' + str(self.surface.id) if self.side == '-' \
|
||||
else str(self.surface.id)
|
||||
|
|
|
|||
|
|
@ -432,6 +432,8 @@ class Tally(object):
|
|||
# If the score is already in the Tally, don't add it again
|
||||
if score in self.scores:
|
||||
return
|
||||
elif isinstance(score, basestring):
|
||||
self._scores.append(score.strip())
|
||||
else:
|
||||
self._scores.append(score)
|
||||
|
||||
|
|
@ -1168,7 +1170,6 @@ class Tally(object):
|
|||
# Append each Filter's DataFrame to the overall DataFrame
|
||||
for filter in self.filters:
|
||||
filter_df = filter.get_pandas_dataframe(data_size, summary)
|
||||
|
||||
df = pd.concat([df, filter_df], axis=1)
|
||||
|
||||
# Include DataFrame column for nuclides if user requested it
|
||||
|
|
|
|||
|
|
@ -3,11 +3,14 @@ from collections import OrderedDict, Iterable
|
|||
from numbers import Real, Integral
|
||||
from xml.etree import ElementTree as ET
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
import numpy as np
|
||||
|
||||
import openmc
|
||||
import openmc.checkvalue as cv
|
||||
from openmc.surface import Halfspace
|
||||
from openmc.region import Region, Intersection, Complement
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
basestring = str
|
||||
|
|
@ -45,10 +48,8 @@ class Cell(object):
|
|||
Name of the cell
|
||||
fill : Material or Universe or Lattice or 'void'
|
||||
Indicates what the region of space is filled with
|
||||
surfaces : dict
|
||||
Dictionary whose keys are surface IDs and values are 2-tuples of a
|
||||
Surface object and an integer identify whether the positive or negative
|
||||
half-space is to be used
|
||||
region : openmc.region.Region
|
||||
Region of space that is assigned to the cell.
|
||||
rotation : ndarray
|
||||
If the cell is filled with a universe, this array specifies the angles
|
||||
in degrees about the x, y, and z axes that the filled universe should be
|
||||
|
|
@ -67,7 +68,7 @@ class Cell(object):
|
|||
self.name = name
|
||||
self._fill = None
|
||||
self._type = None
|
||||
self._surfaces = {}
|
||||
self._region = None
|
||||
self._rotation = None
|
||||
self._translation = None
|
||||
self._offsets = None
|
||||
|
|
@ -96,8 +97,8 @@ class Cell(object):
|
|||
return None
|
||||
|
||||
@property
|
||||
def surfaces(self):
|
||||
return self._surfaces
|
||||
def region(self):
|
||||
return self._region
|
||||
|
||||
@property
|
||||
def rotation(self):
|
||||
|
|
@ -173,6 +174,11 @@ class Cell(object):
|
|||
cv.check_type('cell offsets', offsets, Iterable)
|
||||
self._offsets = offsets
|
||||
|
||||
@region.setter
|
||||
def region(self, region):
|
||||
cv.check_type('cell region', region, Region)
|
||||
self._region = region
|
||||
|
||||
def add_surface(self, surface, halfspace):
|
||||
"""Add a half-space to the list of half-spaces whose intersection defines the
|
||||
cell.
|
||||
|
|
@ -186,6 +192,12 @@ class Cell(object):
|
|||
|
||||
"""
|
||||
|
||||
warnings.simplefilter('always', DeprecationWarning)
|
||||
warnings.warn("Cell.add_surface(...) has been deprecated and may be "
|
||||
"removed in a future version. The region for a Cell "
|
||||
"should be defined using the region property directly.",
|
||||
DeprecationWarning)
|
||||
|
||||
if not isinstance(surface, openmc.Surface):
|
||||
msg = 'Unable to add Surface "{0}" to Cell ID="{1}" since it is ' \
|
||||
'not a Surface object'.format(surface, self._id)
|
||||
|
|
@ -196,28 +208,17 @@ class Cell(object):
|
|||
'"{2}" since it is not +/-1'.format(surface, self._id, halfspace)
|
||||
raise ValueError(msg)
|
||||
|
||||
# If the Cell does not already contain the Surface, add it
|
||||
if surface._id not in self._surfaces:
|
||||
self._surfaces[surface._id] = (surface, halfspace)
|
||||
|
||||
def remove_surface(self, surface):
|
||||
"""Remove the half-space associated with a particular surface.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
surface : openmc.surface.Surface
|
||||
Surface to remove from definition
|
||||
|
||||
"""
|
||||
|
||||
if not isinstance(surface, openmc.Surface):
|
||||
msg = 'Unable to remove Surface "{0}" from Cell ID="{1}" since it is ' \
|
||||
'not a Surface object'.format(surface, self._id)
|
||||
raise ValueError(msg)
|
||||
|
||||
# If the Cell contains the Surface, delete it
|
||||
if surface._id in self._surfaces:
|
||||
del self._surfaces[surface._id]
|
||||
# If no region has been assigned, simply use the half-space. Otherwise,
|
||||
# take the intersection of the current region and the half-space
|
||||
# specified
|
||||
region = +surface if halfspace == 1 else -surface
|
||||
if self.region is None:
|
||||
self.region = region
|
||||
else:
|
||||
if isinstance(self.region, Intersection):
|
||||
self.region.nodes.append(region)
|
||||
else:
|
||||
self.region = Intersection(self.region, region)
|
||||
|
||||
def get_offset(self, path, filter_offset):
|
||||
# Get the current element and remove it from the list
|
||||
|
|
@ -311,13 +312,7 @@ class Cell(object):
|
|||
else:
|
||||
string += '{0: <16}{1}{2}\n'.format('\tFill', '=\t', self._fill)
|
||||
|
||||
string += '{0: <16}{1}\n'.format('\tSurfaces', '=\t')
|
||||
|
||||
for surface_id in self._surfaces:
|
||||
halfspace = self._surfaces[surface_id][1]
|
||||
string += '{0} '.format(halfspace * surface_id)
|
||||
|
||||
string = string.rstrip(' ') + '\n'
|
||||
string += '{0: <16}{1}{2}\n'.format('\tRegion', '=\t', self._region)
|
||||
|
||||
string += '{0: <16}{1}{2}\n'.format('\tRotation', '=\t',
|
||||
self._rotation)
|
||||
|
|
@ -348,26 +343,30 @@ class Cell(object):
|
|||
element.set("fill", str(self._fill))
|
||||
self._fill.create_xml_subelement(xml_element)
|
||||
|
||||
if self._surfaces is not None:
|
||||
surfaces = ''
|
||||
if self.region is not None:
|
||||
# Set the region attribute with the region specification
|
||||
element.set("region", str(self.region))
|
||||
|
||||
for surface_id in self._surfaces:
|
||||
# Determine if XML element already includes this Surface
|
||||
path = './surface[@id=\'{0}\']'.format(surface_id)
|
||||
test = xml_element.find(path)
|
||||
# Only surfaces that appear in a region are added to the geometry
|
||||
# file, so the appropriate check is performed here. First we create
|
||||
# a function which is called recursively to navigate through the CSG
|
||||
# tree. When it reaches a leaf (a Halfspace), it creates a <surface>
|
||||
# element for the corresponding surface if none has been created
|
||||
# thus far.
|
||||
def create_surface_elements(node, element):
|
||||
if isinstance(node, Halfspace):
|
||||
path = './surface[@id=\'{0}\']'.format(node.surface.id)
|
||||
if xml_element.find(path) is None:
|
||||
surface_subelement = node.surface.create_xml_subelement()
|
||||
xml_element.append(surface_subelement)
|
||||
elif isinstance(node, Complement):
|
||||
create_surface_elements(node.node, element)
|
||||
else:
|
||||
for subnode in node.nodes:
|
||||
create_surface_elements(subnode, element)
|
||||
|
||||
# If the element does not contain the Surface subelement
|
||||
if test is None:
|
||||
# Create the XML subelement for this Surface
|
||||
surface = self._surfaces[surface_id][0]
|
||||
surface_subelement = surface.create_xml_subelement()
|
||||
xml_element.append(surface_subelement)
|
||||
|
||||
# Append the halfspace and Surface ID
|
||||
halfspace = self._surfaces[surface_id][1]
|
||||
surfaces += '{0} '.format(halfspace * surface_id)
|
||||
|
||||
element.set("surfaces", surfaces.rstrip(' '))
|
||||
# Call the recursive function from the top node
|
||||
create_surface_elements(self.region, xml_element)
|
||||
|
||||
if self._translation is not None:
|
||||
element.set("translation", ' '.join(map(str, self._translation)))
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
#!/usr/bin/env python
|
||||
"""Update OpenMC's input XML files to the latest format.
|
||||
|
||||
Usage information can be obtained by running 'update_inputs.py --help':
|
||||
Usage information can be obtained by running 'openmc-update-inputs --help':
|
||||
|
||||
usage: update_lattices.py [-h] IN [IN ...]
|
||||
usage: openmc-update-inputs [-h] IN [IN ...]
|
||||
|
||||
Update lattices in geometry.xml files to the latest format. This will remove
|
||||
'outside' attributes/elements and replace them with 'outer' attributes. Note
|
||||
that this script will not delete the given files; it will append '.original'
|
||||
to the given files and write new ones.
|
||||
Update geometry.xml files to the latest format. This will remove 'outside'
|
||||
attributes/elements from lattices and replace them with 'outer' attributes. For
|
||||
'cell' elements, any 'surfaces' attributes/elements will be renamed
|
||||
'region'. Note that this script will not delete the given files; it will append
|
||||
'.original' to the given files and write new ones.
|
||||
|
||||
positional arguments:
|
||||
IN Input geometry.xml file(s).
|
||||
|
|
@ -35,9 +36,10 @@ they will be moved to a new file with '.original' appended to their name.
|
|||
|
||||
Formatting changes that will be made:
|
||||
|
||||
geometry.xml: Lattices containing 'outside' attributes/tags will be replaced
|
||||
geometry.xml: Lattices containing 'outside' attributes/tags will be replaced
|
||||
with lattices containing 'outer' attributes, and the appropriate
|
||||
cells/universes will be added.
|
||||
cells/universes will be added. Any 'surfaces' attributes/elements on a cell
|
||||
will be renamed 'region'.
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -173,9 +175,6 @@ def update_geometry(geometry_root):
|
|||
root = geometry_root
|
||||
was_updated = False
|
||||
|
||||
# Ignore files that do not contain lattices.
|
||||
if all([child.tag != 'lattice' for child in root]): return False
|
||||
|
||||
# Get a set of already-used universe and cell ids.
|
||||
uids = get_universe_ids(root)
|
||||
cids = get_cell_ids(root)
|
||||
|
|
@ -233,6 +232,17 @@ def update_geometry(geometry_root):
|
|||
del lat.attrib['width']
|
||||
was_updated = True
|
||||
|
||||
# Change 'surfaces' to 'region' in cell definitions
|
||||
for cell in root.iter('cell'):
|
||||
elem = cell.find('surfaces')
|
||||
if elem is not None:
|
||||
elem.tag = 'region'
|
||||
was_updated = True
|
||||
if 'surfaces' in cell.attrib:
|
||||
cell.attrib['region'] = cell.attrib['surfaces']
|
||||
del cell.attrib['surfaces']
|
||||
was_updated = True
|
||||
|
||||
return was_updated
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -87,10 +87,11 @@ module constants
|
|||
|
||||
! Logical operators for cell definitions
|
||||
integer, parameter :: &
|
||||
OP_LEFT_PAREN = huge(0), & ! Left parentheses
|
||||
OP_RIGHT_PAREN = huge(0) - 1, & ! Right parentheses
|
||||
OP_UNION = huge(0) - 2, & ! Union operator
|
||||
OP_DIFFERENCE = huge(0) - 3 ! Difference operator
|
||||
OP_LEFT_PAREN = huge(0), & ! Left parentheses
|
||||
OP_RIGHT_PAREN = huge(0) - 1, & ! Right parentheses
|
||||
OP_COMPLEMENT = huge(0) - 2, & ! Complement operator (~)
|
||||
OP_INTERSECTION = huge(0) - 3, & ! Intersection operator
|
||||
OP_UNION = huge(0) - 4 ! Union operator (^)
|
||||
|
||||
! Cell types
|
||||
integer, parameter :: &
|
||||
|
|
@ -300,17 +301,20 @@ module constants
|
|||
integer, parameter :: NO_BIN_FOUND = -1
|
||||
|
||||
! Tally filter and map types
|
||||
integer, parameter :: N_FILTER_TYPES = 9
|
||||
integer, parameter :: N_FILTER_TYPES = 12
|
||||
integer, parameter :: &
|
||||
FILTER_UNIVERSE = 1, &
|
||||
FILTER_MATERIAL = 2, &
|
||||
FILTER_CELL = 3, &
|
||||
FILTER_CELLBORN = 4, &
|
||||
FILTER_SURFACE = 5, &
|
||||
FILTER_MESH = 6, &
|
||||
FILTER_ENERGYIN = 7, &
|
||||
FILTER_ENERGYOUT = 8, &
|
||||
FILTER_DISTRIBCELL = 9
|
||||
FILTER_UNIVERSE = 1, &
|
||||
FILTER_MATERIAL = 2, &
|
||||
FILTER_CELL = 3, &
|
||||
FILTER_CELLBORN = 4, &
|
||||
FILTER_SURFACE = 5, &
|
||||
FILTER_MESH = 6, &
|
||||
FILTER_ENERGYIN = 7, &
|
||||
FILTER_ENERGYOUT = 8, &
|
||||
FILTER_DISTRIBCELL = 9, &
|
||||
FILTER_MU = 10, &
|
||||
FILTER_POLAR = 11, &
|
||||
FILTER_AZIMUTHAL = 12
|
||||
|
||||
! Mesh types
|
||||
integer, parameter :: &
|
||||
|
|
|
|||
902
src/geometry.F90
902
src/geometry.F90
File diff suppressed because it is too large
Load diff
|
|
@ -113,22 +113,6 @@ module geometry_header
|
|||
class(Lattice), allocatable :: obj
|
||||
end type LatticeContainer
|
||||
|
||||
!===============================================================================
|
||||
! SURFACE type defines a first- or second-order surface that can be used to
|
||||
! construct closed volumes (cells)
|
||||
!===============================================================================
|
||||
|
||||
type Surface
|
||||
integer :: id ! Unique ID
|
||||
character(len=52) :: name = "" ! User-defined name
|
||||
integer :: type ! Type of surface
|
||||
real(8), allocatable :: coeffs(:) ! Definition of surface
|
||||
integer, allocatable :: &
|
||||
neighbor_pos(:), & ! List of cells on positive side
|
||||
neighbor_neg(:) ! List of cells on negative side
|
||||
integer :: bc ! Boundary condition
|
||||
end type Surface
|
||||
|
||||
!===============================================================================
|
||||
! CELL defines a closed volume by its bounding surfaces
|
||||
!===============================================================================
|
||||
|
|
@ -144,14 +128,13 @@ module geometry_header
|
|||
! the geom
|
||||
integer :: material ! Material within cell (0 for
|
||||
! universe)
|
||||
integer :: n_surfaces ! Number of surfaces within
|
||||
integer, allocatable :: offset (:) ! Distribcell offset for tally
|
||||
! counter
|
||||
integer, allocatable :: &
|
||||
& surfaces(:) ! List of surfaces bounding cell
|
||||
! -- note that parentheses, union,
|
||||
! etc operators will be listed here
|
||||
! too
|
||||
integer, allocatable :: region(:) ! Definition of spatial region as
|
||||
! Boolean expression of half-spaces
|
||||
integer, allocatable :: rpn(:) ! Reverse Polish notation for region
|
||||
! expression
|
||||
logical :: simple ! Is the region simple (intersections only)
|
||||
|
||||
! Rotation matrix and translation vector
|
||||
real(8), allocatable :: translation(:)
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@ module global
|
|||
use cmfd_header
|
||||
use constants
|
||||
use dict_header, only: DictCharInt, DictIntInt
|
||||
use geometry_header, only: Cell, Universe, Lattice, LatticeContainer, Surface
|
||||
use geometry_header, only: Cell, Universe, Lattice, LatticeContainer
|
||||
use material_header, only: Material
|
||||
use mesh_header, only: RegularMesh
|
||||
use plot_header, only: ObjectPlot
|
||||
use set_header, only: SetInt
|
||||
use surface_header, only: SurfaceContainer
|
||||
use source_header, only: ExtSource
|
||||
use tally_header, only: TallyObject, TallyMap, TallyResult
|
||||
use trigger_header, only: KTrigger
|
||||
|
|
@ -27,12 +28,12 @@ module global
|
|||
! GEOMETRY-RELATED VARIABLES
|
||||
|
||||
! Main arrays
|
||||
type(Cell), allocatable, target :: cells(:)
|
||||
type(Universe), allocatable, target :: universes(:)
|
||||
type(LatticeContainer), allocatable, target :: lattices(:)
|
||||
type(Surface), allocatable, target :: surfaces(:)
|
||||
type(Material), allocatable, target :: materials(:)
|
||||
type(ObjectPlot), allocatable, target :: plots(:)
|
||||
type(Cell), allocatable, target :: cells(:)
|
||||
type(Universe), allocatable, target :: universes(:)
|
||||
type(LatticeContainer), allocatable, target :: lattices(:)
|
||||
type(SurfaceContainer), allocatable, target :: surfaces(:)
|
||||
type(Material), allocatable, target :: materials(:)
|
||||
type(ObjectPlot), allocatable, target :: plots(:)
|
||||
|
||||
! Size of main arrays
|
||||
integer :: n_cells ! # of cells
|
||||
|
|
|
|||
|
|
@ -568,15 +568,18 @@ contains
|
|||
|
||||
do i = 1, n_cells
|
||||
! =======================================================================
|
||||
! ADJUST SURFACE LIST FOR EACH CELL
|
||||
! ADJUST REGION SPECIFICATION FOR EACH CELL
|
||||
|
||||
c => cells(i)
|
||||
do j = 1, c%n_surfaces
|
||||
id = c%surfaces(j)
|
||||
if (id < OP_DIFFERENCE) then
|
||||
do j = 1, size(c%region)
|
||||
id = c%region(j)
|
||||
! Make sure that only regions are checked. Since OP_UNION is the
|
||||
! operator with the lowest integer value, anything below it must denote
|
||||
! a half-space
|
||||
if (id < OP_UNION) then
|
||||
if (surface_dict%has_key(abs(id))) then
|
||||
i_array = surface_dict%get_key(abs(id))
|
||||
c%surfaces(j) = sign(i_array, id)
|
||||
c%region(j) = sign(i_array, id)
|
||||
else
|
||||
call fatal_error("Could not find surface " // trim(to_str(abs(id)))&
|
||||
&// " specified on cell " // trim(to_str(c%id)))
|
||||
|
|
@ -584,6 +587,16 @@ contains
|
|||
end if
|
||||
end do
|
||||
|
||||
! Also adjust the indices in the reverse Polish notation
|
||||
do j = 1, size(c%rpn)
|
||||
id = c%rpn(j)
|
||||
! Again, make sure that only regions are checked
|
||||
if (id < OP_UNION) then
|
||||
i_array = surface_dict%get_key(abs(id))
|
||||
c%rpn(j) = sign(i_array, id)
|
||||
end if
|
||||
end do
|
||||
|
||||
! =======================================================================
|
||||
! ADJUST UNIVERSE INDEX FOR EACH CELL
|
||||
|
||||
|
|
|
|||
|
|
@ -5,15 +5,17 @@ module input_xml
|
|||
use dict_header, only: DictIntInt, ElemKeyValueCI
|
||||
use energy_grid, only: grid_method, n_log_bins
|
||||
use error, only: fatal_error, warning
|
||||
use geometry_header, only: Cell, Surface, Lattice, RectLattice, HexLattice
|
||||
use geometry_header, only: Cell, Lattice, RectLattice, HexLattice
|
||||
use global
|
||||
use list_header, only: ListChar, ListReal
|
||||
use mesh_header, only: RegularMesh
|
||||
use output, only: write_message
|
||||
use plot_header
|
||||
use random_lcg, only: prn
|
||||
use surface_header
|
||||
use stl_vector, only: VectorInt
|
||||
use string, only: to_lower, to_str, str_to_int, str_to_real, &
|
||||
starts_with, ends_with
|
||||
starts_with, ends_with, tokenize
|
||||
use tally_header, only: TallyObject, TallyFilter
|
||||
use tally_initialize, only: add_tallies
|
||||
use xml_interface
|
||||
|
|
@ -987,13 +989,15 @@ contains
|
|||
integer :: coeffs_reqd
|
||||
integer, allocatable :: temp_int_array(:)
|
||||
real(8) :: phi, theta, psi
|
||||
real(8), allocatable :: coeffs(:)
|
||||
logical :: file_exists
|
||||
logical :: boundary_exists
|
||||
character(MAX_LINE_LEN) :: filename
|
||||
character(MAX_WORD_LEN) :: word
|
||||
type(Cell), pointer :: c => null()
|
||||
type(Surface), pointer :: s => null()
|
||||
class(Lattice), pointer :: lat => null()
|
||||
character(MAX_LINE_LEN) :: region_spec
|
||||
type(Cell), pointer :: c
|
||||
class(Surface), pointer :: s
|
||||
class(Lattice), pointer :: lat
|
||||
type(Node), pointer :: doc => null()
|
||||
type(Node), pointer :: node_cell => null()
|
||||
type(Node), pointer :: node_surf => null()
|
||||
|
|
@ -1002,6 +1006,8 @@ contains
|
|||
type(NodeList), pointer :: node_surf_list => null()
|
||||
type(NodeList), pointer :: node_rlat_list => null()
|
||||
type(NodeList), pointer :: node_hlat_list => null()
|
||||
type(VectorInt) :: tokens
|
||||
type(VectorInt) :: rpn
|
||||
|
||||
! Display output message
|
||||
call write_message("Reading geometry XML file...", 5)
|
||||
|
|
@ -1112,17 +1118,42 @@ contains
|
|||
call fatal_error("Cannot specify material and fill simultaneously")
|
||||
end if
|
||||
|
||||
! Allocate array for surfaces and copy
|
||||
! Check for region specification (also under deprecated name surfaces)
|
||||
region_spec = ''
|
||||
if (check_for_node(node_cell, "surfaces")) then
|
||||
n = get_arraysize_integer(node_cell, "surfaces")
|
||||
else
|
||||
n = 0
|
||||
call warning("The use of 'surfaces' is deprecated and will be &
|
||||
&disallowed in a future release. Use 'region' instead. The &
|
||||
&openmc-update-inputs utility can be used to automatically &
|
||||
&update geometry.xml files.")
|
||||
call get_node_value(node_cell, "surfaces", region_spec)
|
||||
elseif (check_for_node(node_cell, "region")) then
|
||||
call get_node_value(node_cell, "region", region_spec)
|
||||
end if
|
||||
c % n_surfaces = n
|
||||
|
||||
if (n > 0) then
|
||||
allocate(c % surfaces(n))
|
||||
call get_node_array(node_cell, "surfaces", c % surfaces)
|
||||
if (len_trim(region_spec) > 0) then
|
||||
! Create surfaces array from string
|
||||
call tokenize(region_spec, tokens)
|
||||
|
||||
! Use shunting-yard algorithm to determine RPN for surface algorithm
|
||||
call generate_rpn(c%id, tokens, rpn)
|
||||
|
||||
! Copy region spec and RPN form to cell arrays
|
||||
allocate(c % region(tokens%size()))
|
||||
allocate(c % rpn(rpn%size()))
|
||||
c % region(:) = tokens%data(1:tokens%size())
|
||||
c % rpn(:) = rpn%data(1:rpn%size())
|
||||
|
||||
call tokens%clear()
|
||||
call rpn%clear()
|
||||
end if
|
||||
if (.not. allocated(c%region)) allocate(c%region(0))
|
||||
if (.not. allocated(c%rpn)) allocate(c%rpn(0))
|
||||
|
||||
! Check if this is a simple cell
|
||||
if (any(c%rpn == OP_COMPLEMENT) .or. any(c%rpn == OP_UNION)) then
|
||||
c%simple = .false.
|
||||
else
|
||||
c%simple = .true.
|
||||
end if
|
||||
|
||||
! Rotation matrix
|
||||
|
|
@ -1222,71 +1253,71 @@ contains
|
|||
allocate(surfaces(n_surfaces))
|
||||
|
||||
do i = 1, n_surfaces
|
||||
s => surfaces(i)
|
||||
|
||||
! Get pointer to i-th surface node
|
||||
call get_list_item(node_surf_list, i, node_surf)
|
||||
|
||||
! Copy data into cells
|
||||
if (check_for_node(node_surf, "id")) then
|
||||
call get_node_value(node_surf, "id", s % id)
|
||||
else
|
||||
call fatal_error("Must specify id of surface in geometry XML file.")
|
||||
end if
|
||||
|
||||
! Check to make sure 'id' hasn't been used
|
||||
if (surface_dict % has_key(s % id)) then
|
||||
call fatal_error("Two or more surfaces use the same unique ID: " &
|
||||
&// to_str(s % id))
|
||||
end if
|
||||
|
||||
! Copy surface name
|
||||
if (check_for_node(node_surf, "name")) then
|
||||
call get_node_value(node_surf, "name", s % name)
|
||||
end if
|
||||
|
||||
! Copy and interpret surface type
|
||||
word = ''
|
||||
if (check_for_node(node_surf, "type")) &
|
||||
call get_node_value(node_surf, "type", word)
|
||||
select case(to_lower(word))
|
||||
case ('x-plane')
|
||||
s % type = SURF_PX
|
||||
coeffs_reqd = 1
|
||||
allocate(SurfaceXPlane :: surfaces(i)%obj)
|
||||
case ('y-plane')
|
||||
s % type = SURF_PY
|
||||
coeffs_reqd = 1
|
||||
allocate(SurfaceYPlane :: surfaces(i)%obj)
|
||||
case ('z-plane')
|
||||
s % type = SURF_PZ
|
||||
coeffs_reqd = 1
|
||||
allocate(SurfaceZPlane :: surfaces(i)%obj)
|
||||
case ('plane')
|
||||
s % type = SURF_PLANE
|
||||
coeffs_reqd = 4
|
||||
allocate(SurfacePlane :: surfaces(i)%obj)
|
||||
case ('x-cylinder')
|
||||
s % type = SURF_CYL_X
|
||||
coeffs_reqd = 3
|
||||
allocate(SurfaceXCylinder :: surfaces(i)%obj)
|
||||
case ('y-cylinder')
|
||||
s % type = SURF_CYL_Y
|
||||
coeffs_reqd = 3
|
||||
allocate(SurfaceYCylinder :: surfaces(i)%obj)
|
||||
case ('z-cylinder')
|
||||
s % type = SURF_CYL_Z
|
||||
coeffs_reqd = 3
|
||||
allocate(SurfaceZCylinder :: surfaces(i)%obj)
|
||||
case ('sphere')
|
||||
s % type = SURF_SPHERE
|
||||
coeffs_reqd = 4
|
||||
allocate(SurfaceSphere :: surfaces(i)%obj)
|
||||
case ('x-cone')
|
||||
s % type = SURF_CONE_X
|
||||
coeffs_reqd = 4
|
||||
allocate(SurfaceXCone :: surfaces(i)%obj)
|
||||
case ('y-cone')
|
||||
s % type = SURF_CONE_Y
|
||||
coeffs_reqd = 4
|
||||
allocate(SurfaceYCone :: surfaces(i)%obj)
|
||||
case ('z-cone')
|
||||
s % type = SURF_CONE_Z
|
||||
coeffs_reqd = 4
|
||||
allocate(SurfaceZCone :: surfaces(i)%obj)
|
||||
case default
|
||||
call fatal_error("Invalid surface type: " // trim(word))
|
||||
end select
|
||||
|
||||
s => surfaces(i)%obj
|
||||
|
||||
! Copy data into cells
|
||||
if (check_for_node(node_surf, "id")) then
|
||||
call get_node_value(node_surf, "id", s%id)
|
||||
else
|
||||
call fatal_error("Must specify id of surface in geometry XML file.")
|
||||
end if
|
||||
|
||||
! Check to make sure 'id' hasn't been used
|
||||
if (surface_dict % has_key(s%id)) then
|
||||
call fatal_error("Two or more surfaces use the same unique ID: " &
|
||||
&// to_str(s%id))
|
||||
end if
|
||||
|
||||
! Copy surface name
|
||||
if (check_for_node(node_surf, "name")) then
|
||||
call get_node_value(node_surf, "name", s%name)
|
||||
end if
|
||||
|
||||
! Check to make sure that the proper number of coefficients
|
||||
! have been specified for the given type of surface. Then copy
|
||||
! surface coordinates.
|
||||
|
|
@ -1294,36 +1325,84 @@ contains
|
|||
n = get_arraysize_double(node_surf, "coeffs")
|
||||
if (n < coeffs_reqd) then
|
||||
call fatal_error("Not enough coefficients specified for surface: " &
|
||||
&// trim(to_str(s % id)))
|
||||
&// trim(to_str(s%id)))
|
||||
elseif (n > coeffs_reqd) then
|
||||
call fatal_error("Too many coefficients specified for surface: " &
|
||||
&// trim(to_str(s % id)))
|
||||
else
|
||||
allocate(s % coeffs(n))
|
||||
call get_node_array(node_surf, "coeffs", s % coeffs)
|
||||
&// trim(to_str(s%id)))
|
||||
end if
|
||||
|
||||
allocate(coeffs(n))
|
||||
call get_node_array(node_surf, "coeffs", coeffs)
|
||||
|
||||
select type(s)
|
||||
type is (SurfaceXPlane)
|
||||
s%x0 = coeffs(1)
|
||||
type is (SurfaceYPlane)
|
||||
s%y0 = coeffs(1)
|
||||
type is (SurfaceZPlane)
|
||||
s%z0 = coeffs(1)
|
||||
type is (SurfacePlane)
|
||||
s%A = coeffs(1)
|
||||
s%B = coeffs(2)
|
||||
s%C = coeffs(3)
|
||||
s%D = coeffs(4)
|
||||
type is (SurfaceXCylinder)
|
||||
s%y0 = coeffs(1)
|
||||
s%z0 = coeffs(2)
|
||||
s%r = coeffs(3)
|
||||
type is (SurfaceYCylinder)
|
||||
s%x0 = coeffs(1)
|
||||
s%z0 = coeffs(2)
|
||||
s%r = coeffs(3)
|
||||
type is (SurfaceZCylinder)
|
||||
s%x0 = coeffs(1)
|
||||
s%y0 = coeffs(2)
|
||||
s%r = coeffs(3)
|
||||
type is (SurfaceSphere)
|
||||
s%x0 = coeffs(1)
|
||||
s%y0 = coeffs(2)
|
||||
s%z0 = coeffs(3)
|
||||
s%r = coeffs(4)
|
||||
type is (SurfaceXCone)
|
||||
s%x0 = coeffs(1)
|
||||
s%y0 = coeffs(2)
|
||||
s%z0 = coeffs(3)
|
||||
s%r2 = coeffs(4)
|
||||
type is (SurfaceYCone)
|
||||
s%x0 = coeffs(1)
|
||||
s%y0 = coeffs(2)
|
||||
s%z0 = coeffs(3)
|
||||
s%r2 = coeffs(4)
|
||||
type is (SurfaceZCone)
|
||||
s%x0 = coeffs(1)
|
||||
s%y0 = coeffs(2)
|
||||
s%z0 = coeffs(3)
|
||||
s%r2 = coeffs(4)
|
||||
end select
|
||||
|
||||
! No longer need coefficients
|
||||
deallocate(coeffs)
|
||||
|
||||
! Boundary conditions
|
||||
word = ''
|
||||
if (check_for_node(node_surf, "boundary")) &
|
||||
call get_node_value(node_surf, "boundary", word)
|
||||
select case (to_lower(word))
|
||||
case ('transmission', 'transmit', '')
|
||||
s % bc = BC_TRANSMIT
|
||||
s%bc = BC_TRANSMIT
|
||||
case ('vacuum')
|
||||
s % bc = BC_VACUUM
|
||||
s%bc = BC_VACUUM
|
||||
boundary_exists = .true.
|
||||
case ('reflective', 'reflect', 'reflecting')
|
||||
s % bc = BC_REFLECT
|
||||
s%bc = BC_REFLECT
|
||||
boundary_exists = .true.
|
||||
case default
|
||||
call fatal_error("Unknown boundary condition '" // trim(word) // &
|
||||
&"' specified on surface " // trim(to_str(s % id)))
|
||||
&"' specified on surface " // trim(to_str(s%id)))
|
||||
end select
|
||||
|
||||
! Add surface to dictionary
|
||||
call surface_dict % add_key(s % id, i)
|
||||
|
||||
call surface_dict % add_key(s%id, i)
|
||||
end do
|
||||
|
||||
! Check to make sure a boundary condition was applied to at least one
|
||||
|
|
@ -2085,6 +2164,9 @@ contains
|
|||
integer :: imomstr ! Index of MOMENT_STRS & MOMENT_N_STRS
|
||||
logical :: file_exists ! does tallies.xml file exist?
|
||||
real(8) :: rarray3(3) ! temporary double prec. array
|
||||
integer :: Nangle ! Number of angular bins
|
||||
real(8) :: dangle ! Mu spacing if using automatic allocation
|
||||
integer :: iangle ! Loop counter for building mu filter bins
|
||||
character(MAX_LINE_LEN) :: filename
|
||||
character(MAX_WORD_LEN) :: word
|
||||
character(MAX_WORD_LEN) :: score_name
|
||||
|
|
@ -2352,8 +2434,9 @@ contains
|
|||
|
||||
! Determine number of bins
|
||||
if (check_for_node(node_filt, "bins")) then
|
||||
if (trim(temp_str) == 'energy' .or. &
|
||||
trim(temp_str) == 'energyout') then
|
||||
if (temp_str == 'energy' .or. temp_str == 'energyout' .or. &
|
||||
temp_str == 'mu' .or. temp_str == 'polar' .or. &
|
||||
temp_str == 'azimuthal') then
|
||||
n_words = get_arraysize_double(node_filt, "bins")
|
||||
else
|
||||
n_words = get_arraysize_integer(node_filt, "bins")
|
||||
|
|
@ -2489,6 +2572,103 @@ contains
|
|||
! Set to analog estimator
|
||||
t % estimator = ESTIMATOR_ANALOG
|
||||
|
||||
case ('mu')
|
||||
! Set type of filter
|
||||
t % filters(j) % type = FILTER_MU
|
||||
|
||||
! Set number of bins
|
||||
t % filters(j) % n_bins = n_words - 1
|
||||
|
||||
! Allocate and store bins
|
||||
allocate(t % filters(j) % real_bins(n_words))
|
||||
call get_node_array(node_filt, "bins", t % filters(j) % real_bins)
|
||||
|
||||
! Allow a user to input a lone number which will mean that
|
||||
! you subivide [-1,1] evenly with the input being the number of bins
|
||||
if (n_words == 1) then
|
||||
Nangle = int(t % filters(j) % real_bins(1))
|
||||
if (Nangle > 1) then
|
||||
t % filters(j) % n_bins = Nangle
|
||||
dangle = TWO / real(Nangle,8)
|
||||
deallocate(t % filters(j) % real_bins)
|
||||
allocate(t % filters(j) % real_bins(Nangle + 1))
|
||||
do iangle = 1, Nangle
|
||||
t % filters(j) % real_bins(iangle) = -ONE + (iangle - 1) * dangle
|
||||
end do
|
||||
t % filters(j) % real_bins(Nangle + 1) = ONE
|
||||
else
|
||||
call fatal_error("Number of bins for mu filter must be&
|
||||
& greater than 1 on tally " // trim(to_str(t % id)) // ".")
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
! Set to analog estimator
|
||||
t % estimator = ESTIMATOR_ANALOG
|
||||
|
||||
case ('polar')
|
||||
! Set type of filter
|
||||
t % filters(j) % type = FILTER_POLAR
|
||||
|
||||
! Set number of bins
|
||||
t % filters(j) % n_bins = n_words - 1
|
||||
|
||||
! Allocate and store bins
|
||||
allocate(t % filters(j) % real_bins(n_words))
|
||||
call get_node_array(node_filt, "bins", t % filters(j) % real_bins)
|
||||
|
||||
! Allow a user to input a lone number which will mean that
|
||||
! you subivide [0,pi] evenly with the input being the number of bins
|
||||
if (n_words == 1) then
|
||||
Nangle = int(t % filters(j) % real_bins(1))
|
||||
if (Nangle > 1) then
|
||||
t % filters(j) % n_bins = Nangle
|
||||
dangle = PI / real(Nangle,8)
|
||||
deallocate(t % filters(j) % real_bins)
|
||||
allocate(t % filters(j) % real_bins(Nangle + 1))
|
||||
do iangle = 1, Nangle
|
||||
t % filters(j) % real_bins(iangle) = (iangle - 1) * dangle
|
||||
end do
|
||||
t % filters(j) % real_bins(Nangle + 1) = PI
|
||||
else
|
||||
call fatal_error("Number of bins for polar filter must be&
|
||||
& greater than 1 on tally " // trim(to_str(t % id)) // ".")
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
case ('azimuthal')
|
||||
! Set type of filter
|
||||
t % filters(j) % type = FILTER_AZIMUTHAL
|
||||
|
||||
! Set number of bins
|
||||
t % filters(j) % n_bins = n_words - 1
|
||||
|
||||
! Allocate and store bins
|
||||
allocate(t % filters(j) % real_bins(n_words))
|
||||
call get_node_array(node_filt, "bins", t % filters(j) % real_bins)
|
||||
|
||||
! Allow a user to input a lone number which will mean that
|
||||
! you sub-divide [-pi,pi) evenly with the input being the number of
|
||||
! bins
|
||||
if (n_words == 1) then
|
||||
Nangle = int(t % filters(j) % real_bins(1))
|
||||
if (Nangle > 1) then
|
||||
t % filters(j) % n_bins = Nangle
|
||||
dangle = TWO * PI / real(Nangle,8)
|
||||
deallocate(t % filters(j) % real_bins)
|
||||
allocate(t % filters(j) % real_bins(Nangle + 1))
|
||||
do iangle = 1, Nangle
|
||||
t % filters(j) % real_bins(iangle) = -PI + (iangle - 1) * dangle
|
||||
end do
|
||||
t % filters(j) % real_bins(Nangle + 1) = PI
|
||||
else
|
||||
call fatal_error("Number of bins for azimuthal filter must be&
|
||||
& greater than 1 on tally " // trim(to_str(t % id)) // ".")
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
case default
|
||||
! Specified tally filter is invalid, raise error
|
||||
call fatal_error("Unknown filter type '" &
|
||||
|
|
@ -2658,6 +2838,7 @@ contains
|
|||
! scores then strip off the n and store it as an integer to be used
|
||||
! later. Then perform the select case on this modified (number
|
||||
! removed) string
|
||||
n_order = -1
|
||||
score_name = sarray(l)
|
||||
do imomstr = 1, size(MOMENT_STRS)
|
||||
if (starts_with(score_name,trim(MOMENT_STRS(imomstr)))) then
|
||||
|
|
@ -2703,6 +2884,23 @@ contains
|
|||
end do
|
||||
end if
|
||||
|
||||
! Check to see if the mu filter is applied and if that makes sense.
|
||||
if ((.not. starts_with(score_name,'scatter')) .and. &
|
||||
(.not. starts_with(score_name,'nu-scatter'))) then
|
||||
if (t % find_filter(FILTER_MU) > 0) then
|
||||
call fatal_error("Cannot tally " // trim(score_name) //" with a &
|
||||
&change of angle (mu) filter.")
|
||||
end if
|
||||
! Also check to see if this is a legendre expansion or not.
|
||||
! If so, we can accept this score and filter combo for p0, but not
|
||||
! elsewhere.
|
||||
else if (n_order > 0) then
|
||||
if (t % find_filter(FILTER_MU) > 0) then
|
||||
call fatal_error("Cannot tally " // trim(score_name) //" with a &
|
||||
&change of angle (mu) filter unless order is 0.")
|
||||
end if
|
||||
end if
|
||||
|
||||
select case (trim(score_name))
|
||||
case ('flux')
|
||||
! Prohibit user from tallying flux for an individual nuclide
|
||||
|
|
@ -4716,4 +4914,91 @@ contains
|
|||
|
||||
end subroutine expand_natural_element
|
||||
|
||||
!===============================================================================
|
||||
! GENERATE_RPN implements the shunting-yard algorithm to generate a Reverse
|
||||
! Polish notation (RPN) expression for the region specification of a cell given
|
||||
! the infix notation.
|
||||
!===============================================================================
|
||||
|
||||
subroutine generate_rpn(cell_id, tokens, output)
|
||||
integer, intent(in) :: cell_id
|
||||
type(VectorInt), intent(in) :: tokens ! infix notation
|
||||
type(VectorInt), intent(inout) :: output ! RPN notation
|
||||
|
||||
integer :: i
|
||||
integer :: token
|
||||
integer :: op
|
||||
type(VectorInt) :: stack
|
||||
|
||||
do i = 1, tokens%size()
|
||||
token = tokens%data(i)
|
||||
|
||||
if (token < OP_UNION) then
|
||||
! If token is not an operator, add it to output
|
||||
call output%push_back(token)
|
||||
|
||||
elseif (token < OP_RIGHT_PAREN) then
|
||||
! Regular operators union, intersection, complement
|
||||
do while (stack%size() > 0)
|
||||
op = stack%data(stack%size())
|
||||
|
||||
if (op < OP_RIGHT_PAREN .and. &
|
||||
((token == OP_COMPLEMENT .and. token < op) .or. &
|
||||
(token /= OP_COMPLEMENT .and. token <= op))) then
|
||||
! While there is an operator, op, on top of the stack, if the token
|
||||
! is left-associative and its precedence is less than or equal to
|
||||
! that of op or if the token is right-associative and its precedence
|
||||
! is less than that of op, move op to the output queue and push the
|
||||
! token on to the stack. Note that only complement is
|
||||
! right-associative.
|
||||
call output%push_back(op)
|
||||
call stack%pop_back()
|
||||
else
|
||||
exit
|
||||
end if
|
||||
end do
|
||||
|
||||
call stack%push_back(token)
|
||||
|
||||
elseif (token == OP_LEFT_PAREN) then
|
||||
! If the token is a left parenthesis, push it onto the stack
|
||||
call stack%push_back(token)
|
||||
|
||||
else
|
||||
! If the token is a right parenthesis, move operators from the stack to
|
||||
! the output queue until reaching the left parenthesis.
|
||||
do
|
||||
! If we run out of operators without finding a left parenthesis, it
|
||||
! means there are mismatched parentheses.
|
||||
if (stack%size() == 0) then
|
||||
call fatal_error('Mimatched parentheses in region specification &
|
||||
&for cell ' // trim(to_str(cell_id)) // '.')
|
||||
end if
|
||||
|
||||
op = stack%data(stack%size())
|
||||
if (op == OP_LEFT_PAREN) exit
|
||||
call output%push_back(op)
|
||||
call stack%pop_back()
|
||||
end do
|
||||
|
||||
! Pop the left parenthesis.
|
||||
call stack%pop_back()
|
||||
end if
|
||||
end do
|
||||
|
||||
! While there are operators on the stack, move them to the output queue
|
||||
do while (stack%size() > 0)
|
||||
op = stack%data(stack%size())
|
||||
|
||||
! If the operator is a parenthesis, it is mismatched
|
||||
if (op >= OP_RIGHT_PAREN) then
|
||||
call fatal_error('Mimatched parentheses in region specification &
|
||||
&for cell ' // trim(to_str(cell_id)) // '.')
|
||||
end if
|
||||
|
||||
call output%push_back(op)
|
||||
call stack%pop_back()
|
||||
end do
|
||||
end subroutine generate_rpn
|
||||
|
||||
end module input_xml
|
||||
|
|
|
|||
239
src/math.F90
239
src/math.F90
|
|
@ -181,7 +181,6 @@ contains
|
|||
if (uvw(1) == ZERO) then
|
||||
phi = ZERO
|
||||
else
|
||||
! phi = atan(uvw(2) / uvw(1))
|
||||
phi = atan2(uvw(2), uvw(1))
|
||||
end if
|
||||
|
||||
|
|
@ -192,364 +191,364 @@ contains
|
|||
rn(1) = ONE
|
||||
case (1)
|
||||
! l = 1, m = -1
|
||||
rn(1) = ONE*sqrt(w2m1) * sin(phi)
|
||||
rn(1) = -(ONE*sqrt(w2m1) * sin(phi))
|
||||
! l = 1, m = 0
|
||||
rn(2) = ONE * w
|
||||
! l = 1, m = 1
|
||||
rn(3) = ONE*sqrt(w2m1) * cos(phi)
|
||||
rn(3) = -(ONE*sqrt(w2m1) * cos(phi))
|
||||
case (2)
|
||||
! l = 2, m = -2
|
||||
rn(1) = 0.288675134594813_8 * (-THREE * w**2 + THREE) * sin(TWO*phi)
|
||||
! l = 2, m = -1
|
||||
rn(2) = 1.73205080756888_8 * w*sqrt(w2m1) * sin(phi)
|
||||
rn(2) = -(1.73205080756888_8 * w*sqrt(w2m1) * sin(phi))
|
||||
! l = 2, m = 0
|
||||
rn(3) = 1.5_8 * w**2 - HALF
|
||||
! l = 2, m = 1
|
||||
rn(4) = 1.73205080756888_8 * w*sqrt(w2m1) * cos(phi)
|
||||
rn(4) = -(1.73205080756888_8 * w*sqrt(w2m1) * cos(phi))
|
||||
! l = 2, m = 2
|
||||
rn(5) = 0.288675134594813_8 * (-THREE * w**2 + THREE) * cos(TWO*phi)
|
||||
case (3)
|
||||
! l = 3, m = -3
|
||||
rn(1) = 0.790569415042095_8 * (w2m1)**(THREE/TWO) * sin(THREE * phi)
|
||||
rn(1) = -(0.790569415042095_8 * (w2m1)**(THREE/TWO) * sin(THREE * phi))
|
||||
! l = 3, m = -2
|
||||
rn(2) = 1.93649167310371_8 * w*(w2m1) * sin(TWO*phi)
|
||||
! l = 3, m = -1
|
||||
rn(3) = 0.408248290463863_8*sqrt(w2m1)*((15.0_8/TWO)*w**2 - THREE/TWO) * &
|
||||
sin(phi)
|
||||
rn(3) = -(0.408248290463863_8*sqrt(w2m1)*((15.0_8/TWO)*w**2 - THREE/TWO) * &
|
||||
sin(phi))
|
||||
! l = 3, m = 0
|
||||
rn(4) = 2.5_8 * w**3 - 1.5_8 * w
|
||||
! l = 3, m = 1
|
||||
rn(5) = 0.408248290463863_8*sqrt(w2m1)*((15.0_8/TWO)*w**2 - THREE/TWO) * &
|
||||
cos(phi)
|
||||
rn(5) = -(0.408248290463863_8*sqrt(w2m1)*((15.0_8/TWO)*w**2 - THREE/TWO) * &
|
||||
cos(phi))
|
||||
! l = 3, m = 2
|
||||
rn(6) = 1.93649167310371_8 * w*(w2m1) * cos(TWO*phi)
|
||||
! l = 3, m = 3
|
||||
rn(7) = 0.790569415042095_8 * (w2m1)**(THREE/TWO) * cos(THREE* phi)
|
||||
rn(7) = -(0.790569415042095_8 * (w2m1)**(THREE/TWO) * cos(THREE* phi))
|
||||
case (4)
|
||||
! l = 4, m = -4
|
||||
rn(1) = 0.739509972887452_8 * (w2m1)**2 * sin(4.0_8*phi)
|
||||
! l = 4, m = -3
|
||||
rn(2) = 2.09165006633519_8 * w*(w2m1)**(THREE/TWO) * sin(THREE* phi)
|
||||
rn(2) = -(2.09165006633519_8 * w*(w2m1)**(THREE/TWO) * sin(THREE* phi))
|
||||
! l = 4, m = -2
|
||||
rn(3) = 0.074535599249993_8 * (w2m1)*((105.0_8/TWO)*w**2 - 15.0_8/TWO) * &
|
||||
sin(TWO*phi)
|
||||
! l = 4, m = -1
|
||||
rn(4) = 0.316227766016838_8*sqrt(w2m1)*((35.0_8/TWO)*w**3 - 15.0_8/TWO*w)&
|
||||
* sin(phi)
|
||||
rn(4) = -(0.316227766016838_8*sqrt(w2m1)*((35.0_8/TWO)*w**3 - 15.0_8/TWO*w)&
|
||||
* sin(phi))
|
||||
! l = 4, m = 0
|
||||
rn(5) = 4.375_8 * w**4 - 3.75_8 * w**2 + 0.375_8
|
||||
! l = 4, m = 1
|
||||
rn(6) = 0.316227766016838_8*sqrt(w2m1)*((35.0_8/TWO)*w**3 - 15.0_8/TWO*w)&
|
||||
* cos(phi)
|
||||
rn(6) = -(0.316227766016838_8*sqrt(w2m1)*((35.0_8/TWO)*w**3 - 15.0_8/TWO*w)&
|
||||
* cos(phi))
|
||||
! l = 4, m = 2
|
||||
rn(7) = 0.074535599249993_8 * (w2m1)*((105.0_8/TWO)*w**2 - 15.0_8/TWO) * &
|
||||
cos(TWO*phi)
|
||||
! l = 4, m = 3
|
||||
rn(8) = 2.09165006633519_8 * w*(w2m1)**(THREE/TWO) * cos(THREE* phi)
|
||||
rn(8) = -(2.09165006633519_8 * w*(w2m1)**(THREE/TWO) * cos(THREE* phi))
|
||||
! l = 4, m = 4
|
||||
rn(9) = 0.739509972887452_8 * (w2m1)**2 * cos(4.0_8*phi)
|
||||
case (5)
|
||||
! l = 5, m = -5
|
||||
rn(1) = 0.701560760020114_8 * (w2m1)**(5.0_8/TWO) * sin(5.0_8*phi)
|
||||
rn(1) = -(0.701560760020114_8 * (w2m1)**(5.0_8/TWO) * sin(5.0_8*phi))
|
||||
! l = 5, m = -4
|
||||
rn(2) = 2.21852991866236_8 * w*(w2m1)**2 * sin(4.0_8*phi)
|
||||
! l = 5, m = -3
|
||||
rn(3) = 0.00996023841111995_8 * (w2m1)**(THREE/TWO)* &
|
||||
((945.0_8 /TWO)*w**2 - 105.0_8/TWO) * sin(THREE*phi)
|
||||
rn(3) = -(0.00996023841111995_8 * (w2m1)**(THREE/TWO)* &
|
||||
((945.0_8 /TWO)*w**2 - 105.0_8/TWO) * sin(THREE*phi))
|
||||
! l = 5, m = -2
|
||||
rn(4) = 0.0487950036474267_8 * (w2m1) &
|
||||
* ((315.0_8/TWO)*w**3 - 105.0_8/TWO*w) * sin(TWO*phi)
|
||||
! l = 5, m = -1
|
||||
rn(5) = 0.258198889747161_8*sqrt(w2m1)* &
|
||||
rn(5) = -(0.258198889747161_8*sqrt(w2m1)* &
|
||||
((315.0_8/8.0_8)*w**4 - 105.0_8/4.0_8 * w**2 + 15.0_8/8.0_8) &
|
||||
* sin(phi)
|
||||
* sin(phi))
|
||||
! l = 5, m = 0
|
||||
rn(6) = 7.875_8 * w**5 - 8.75_8 * w**3 + 1.875_8 * w
|
||||
! l = 5, m = 1
|
||||
rn(7) = 0.258198889747161_8*sqrt(w2m1)* &
|
||||
rn(7) = -(0.258198889747161_8*sqrt(w2m1)* &
|
||||
((315.0_8/8.0_8)*w**4 - 105.0_8/4.0_8 * w**2 + 15.0_8/8.0_8) &
|
||||
* cos(phi)
|
||||
* cos(phi))
|
||||
! l = 5, m = 2
|
||||
rn(8) = 0.0487950036474267_8 * (w2m1)* &
|
||||
((315.0_8/TWO)*w**3 - 105.0_8/TWO*w) * cos(TWO*phi)
|
||||
! l = 5, m = 3
|
||||
rn(9) = 0.00996023841111995_8 * (w2m1)**(THREE/TWO)* &
|
||||
((945.0_8 /TWO)*w**2 - 105.0_8/TWO) * cos(THREE*phi)
|
||||
rn(9) = -(0.00996023841111995_8 * (w2m1)**(THREE/TWO)* &
|
||||
((945.0_8 /TWO)*w**2 - 105.0_8/TWO) * cos(THREE*phi))
|
||||
! l = 5, m = 4
|
||||
rn(10) = 2.21852991866236_8 * w*(w2m1)**2 * cos(4.0_8*phi)
|
||||
! l = 5, m = 5
|
||||
rn(11) = 0.701560760020114_8 * (w2m1)**(5.0_8/TWO) * cos(5.0_8* phi)
|
||||
rn(11) = -(0.701560760020114_8 * (w2m1)**(5.0_8/TWO) * cos(5.0_8* phi))
|
||||
case (6)
|
||||
! l = 6, m = -6
|
||||
rn(1) = 0.671693289381396_8 * (w2m1)**3 * sin(6.0_8*phi)
|
||||
! l = 6, m = -5
|
||||
rn(2) = 2.32681380862329_8 * w*(w2m1)**(5.0_8/TWO) * sin(5.0_8*phi)
|
||||
rn(2) = -(2.32681380862329_8 * w*(w2m1)**(5.0_8/TWO) * sin(5.0_8*phi))
|
||||
! l = 6, m = -4
|
||||
rn(3) = 0.00104990131391452_8 * (w2m1)**2 * &
|
||||
((10395.0_8/TWO)*w**2 - 945.0_8/TWO) * sin(4.0_8*phi)
|
||||
! l = 6, m = -3
|
||||
rn(4) = 0.00575054632785295_8 * (w2m1)**(THREE/TWO) * &
|
||||
((3465.0_8/TWO)*w**3 - 945.0_8/TWO*w) * sin(THREE*phi)
|
||||
rn(4) = -(0.00575054632785295_8 * (w2m1)**(THREE/TWO) * &
|
||||
((3465.0_8/TWO)*w**3 - 945.0_8/TWO*w) * sin(THREE*phi))
|
||||
! l = 6, m = -2
|
||||
rn(5) = 0.0345032779671177_8 * (w2m1) * &
|
||||
((3465.0_8/8.0_8)*w**4 - 945.0_8/4.0_8 * w**2 + 105.0_8/8.0_8) &
|
||||
* sin(TWO*phi)
|
||||
! l = 6, m = -1
|
||||
rn(6) = 0.218217890235992_8*sqrt(w2m1) * &
|
||||
rn(6) = -(0.218217890235992_8*sqrt(w2m1) * &
|
||||
((693.0_8/8.0_8)*w**5- 315.0_8/4.0_8 * w**3 + (105.0_8/8.0_8)*w) &
|
||||
* sin(phi)
|
||||
* sin(phi))
|
||||
! l = 6, m = 0
|
||||
rn(7) = 14.4375_8 * w**6 - 19.6875_8 * w**4 + 6.5625_8 * w**2 - 0.3125_8
|
||||
! l = 6, m = 1
|
||||
rn(8) = 0.218217890235992_8*sqrt(w2m1) * &
|
||||
rn(8) = -(0.218217890235992_8*sqrt(w2m1) * &
|
||||
((693.0_8/8.0_8)*w**5- 315.0_8/4.0_8 * w**3 + (105.0_8/8.0_8)*w) &
|
||||
* cos(phi)
|
||||
* cos(phi))
|
||||
! l = 6, m = 2
|
||||
rn(9) = 0.0345032779671177_8 * (w2m1) * &
|
||||
((3465.0_8/8.0_8)*w**4 -945.0_8/4.0_8 * w**2 + 105.0_8/8.0_8) &
|
||||
* cos(TWO*phi)
|
||||
! l = 6, m = 3
|
||||
rn(10) = 0.00575054632785295_8 * (w2m1)**(THREE/TWO) * &
|
||||
((3465.0_8/TWO)*w**3 - 945.0_8/TWO*w) * cos(THREE*phi)
|
||||
rn(10) = -(0.00575054632785295_8 * (w2m1)**(THREE/TWO) * &
|
||||
((3465.0_8/TWO)*w**3 - 945.0_8/TWO*w) * cos(THREE*phi))
|
||||
! l = 6, m = 4
|
||||
rn(11) = 0.00104990131391452_8 * (w2m1)**2 * &
|
||||
((10395.0_8/TWO)*w**2 - 945.0_8/TWO) * cos(4.0_8*phi)
|
||||
! l = 6, m = 5
|
||||
rn(12) = 2.32681380862329_8 * w*(w2m1)**(5.0_8/TWO) * cos(5.0_8*phi)
|
||||
rn(12) = -(2.32681380862329_8 * w*(w2m1)**(5.0_8/TWO) * cos(5.0_8*phi))
|
||||
! l = 6, m = 6
|
||||
rn(13) = 0.671693289381396_8 * (w2m1)**3 * cos(6.0_8*phi)
|
||||
case (7)
|
||||
! l = 7, m = -7
|
||||
rn(1) = 0.647259849287749_8 * (w2m1)**(7.0_8/TWO) * sin(7.0_8*phi)
|
||||
rn(1) = -(0.647259849287749_8 * (w2m1)**(7.0_8/TWO) * sin(7.0_8*phi))
|
||||
! l = 7, m = -6
|
||||
rn(2) = 2.42182459624969_8 * w*(w2m1)**3 * sin(6.0_8*phi)
|
||||
! l = 7, m = -5
|
||||
rn(3) = 9.13821798555235d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((135135.0_8/TWO)*w**2 - 10395.0_8/TWO) * sin(5.0_8*phi)
|
||||
rn(3) = -(9.13821798555235d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((135135.0_8/TWO)*w**2 - 10395.0_8/TWO) * sin(5.0_8*phi))
|
||||
! l = 7, m = -4
|
||||
rn(4) = 0.000548293079133141_8 * (w2m1)**2* &
|
||||
((45045.0_8/TWO)*w**3 - 10395.0_8/TWO*w) * sin(4.0_8*phi)
|
||||
! l = 7, m = -3
|
||||
rn(5) = 0.00363696483726654_8 * (w2m1)**(THREE/TWO)* &
|
||||
((45045.0_8/8.0_8)*w**4 - 10395.0_8/4.0_8 * w**2 + 945.0_8/8.0_8)* &
|
||||
sin(THREE*phi)
|
||||
rn(5) = -(0.00363696483726654_8 * (w2m1)**(THREE/TWO)* &
|
||||
((45045.0_8/8.0_8)*w**4 - 10395.0_8/4.0_8 * w**2 + 945.0_8/8.0_8)* &
|
||||
sin(THREE*phi))
|
||||
! l = 7, m = -2
|
||||
rn(6) = 0.025717224993682_8 * (w2m1)* &
|
||||
((9009.0_8/8.0_8)*w**5 -3465.0_8/4.0_8 * w**3 + (945.0_8/8.0_8)*w)* &
|
||||
sin(TWO*phi)
|
||||
! l = 7, m = -1
|
||||
rn(7) = 0.188982236504614_8*sqrt(w2m1)* &
|
||||
((3003.0_8/16.0_8)*w**6 - 3465.0_8/16.0_8 * w**4 + &
|
||||
(945.0_8/16.0_8)*w**2 - 35.0_8/16.0_8) * sin(phi)
|
||||
rn(7) = -(0.188982236504614_8*sqrt(w2m1)* &
|
||||
((3003.0_8/16.0_8)*w**6 - 3465.0_8/16.0_8 * w**4 + &
|
||||
(945.0_8/16.0_8)*w**2 - 35.0_8/16.0_8) * sin(phi))
|
||||
! l = 7, m = 0
|
||||
rn(8) = 26.8125_8 * w**7 - 43.3125_8 * w**5 + 19.6875_8 * w**3 -2.1875_8 &
|
||||
* w
|
||||
! l = 7, m = 1
|
||||
rn(9) = 0.188982236504614_8*sqrt(w2m1)* &
|
||||
((3003.0_8/16.0_8)*w**6 - 3465.0_8/16.0_8 * w**4 + &
|
||||
(945.0_8/16.0_8)*w**2 - 35.0_8/16.0_8) * cos(phi)
|
||||
rn(9) = -(0.188982236504614_8*sqrt(w2m1)* &
|
||||
((3003.0_8/16.0_8)*w**6 - 3465.0_8/16.0_8 * w**4 + &
|
||||
(945.0_8/16.0_8)*w**2 - 35.0_8/16.0_8) * cos(phi))
|
||||
! l = 7, m = 2
|
||||
rn(10) = 0.025717224993682_8 * (w2m1)* &
|
||||
((9009.0_8/8.0_8)*w**5 -3465.0_8/4.0_8 * w**3 + (945.0_8/8.0_8)*w)* &
|
||||
cos(TWO*phi)
|
||||
! l = 7, m = 3
|
||||
rn(11) = 0.00363696483726654_8 * (w2m1)**(THREE/TWO)* &
|
||||
((45045.0_8/8.0_8)*w**4 - 10395.0_8/4.0_8 * w**2 + 945.0_8/8.0_8)* &
|
||||
cos(THREE*phi)
|
||||
rn(11) = -(0.00363696483726654_8 * (w2m1)**(THREE/TWO)* &
|
||||
((45045.0_8/8.0_8)*w**4 - 10395.0_8/4.0_8 * w**2 + 945.0_8/8.0_8)* &
|
||||
cos(THREE*phi))
|
||||
! l = 7, m = 4
|
||||
rn(12) = 0.000548293079133141_8 * (w2m1)**2 * &
|
||||
((45045.0_8/TWO)*w**3 - 10395.0_8/TWO*w) * cos(4.0_8*phi)
|
||||
! l = 7, m = 5
|
||||
rn(13) = 9.13821798555235d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((135135.0_8/TWO)*w**2 - 10395.0_8/TWO) * cos(5.0_8*phi)
|
||||
rn(13) = -(9.13821798555235d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((135135.0_8/TWO)*w**2 - 10395.0_8/TWO) * cos(5.0_8*phi))
|
||||
! l = 7, m = 6
|
||||
rn(14) = 2.42182459624969_8 * w*(w2m1)**3 * cos(6.0_8*phi)
|
||||
! l = 7, m = 7
|
||||
rn(15) = 0.647259849287749_8 * (w2m1)**(7.0_8/TWO) * cos(7.0_8*phi)
|
||||
rn(15) = -(0.647259849287749_8 * (w2m1)**(7.0_8/TWO) * cos(7.0_8*phi))
|
||||
case (8)
|
||||
! l = 8, m = -8
|
||||
rn(1) = 0.626706654240044_8 * (w2m1)**4 * sin(8.0_8*phi)
|
||||
! l = 8, m = -7
|
||||
rn(2) = 2.50682661696018_8 * w*(w2m1)**(7.0_8/TWO) * sin(7.0_8*phi)
|
||||
rn(2) = -(2.50682661696018_8 * w*(w2m1)**(7.0_8/TWO) * sin(7.0_8*phi))
|
||||
! l = 8, m = -6
|
||||
rn(3) = 6.77369783729086d-6*(w2m1)**3* &
|
||||
((2027025.0_8/TWO)*w**2 - 135135.0_8/TWO) * sin(6.0_8*phi)
|
||||
! l = 8, m = -5
|
||||
rn(4) = 4.38985792528482d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((675675.0_8/TWO)*w**3 - 135135.0_8/TWO*w) * sin(5.0_8*phi)
|
||||
rn(4) = -(4.38985792528482d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((675675.0_8/TWO)*w**3 - 135135.0_8/TWO*w) * sin(5.0_8*phi))
|
||||
! l = 8, m = -4
|
||||
rn(5) = 0.000316557156832328_8 * (w2m1)**2* &
|
||||
((675675.0_8/8.0_8)*w**4 - 135135.0_8/4.0_8 * w**2 &
|
||||
+ 10395.0_8/8.0_8) * sin(4.0_8*phi)
|
||||
! l = 8, m = -3
|
||||
rn(6) = 0.00245204119306875_8 * (w2m1)**(THREE/TWO)* &
|
||||
((135135.0_8/8.0_8)*w**5 - 45045.0_8/4.0_8 * w**3 &
|
||||
+ (10395.0_8/8.0_8)*w) * sin(THREE*phi)
|
||||
rn(6) = -(0.00245204119306875_8 * (w2m1)**(THREE/TWO)* &
|
||||
((135135.0_8/8.0_8)*w**5 - 45045.0_8/4.0_8 * w**3 &
|
||||
+ (10395.0_8/8.0_8)*w) * sin(THREE*phi))
|
||||
! l = 8, m = -2
|
||||
rn(7) = 0.0199204768222399_8 * (w2m1)* &
|
||||
((45045.0_8/16.0_8)*w**6- 45045.0_8/16.0_8 * w**4 + &
|
||||
(10395.0_8/16.0_8)*w**2 - 315.0_8/16.0_8) * sin(TWO*phi)
|
||||
! l = 8, m = -1
|
||||
rn(8) = 0.166666666666667_8*sqrt(w2m1)* &
|
||||
((6435.0_8/16.0_8)*w**7 - 9009.0_8/16.0_8 * w**5 + &
|
||||
(3465.0_8/16.0_8)*w**3 - 315.0_8/16.0_8 * w) * sin(phi)
|
||||
rn(8) = -(0.166666666666667_8*sqrt(w2m1)* &
|
||||
((6435.0_8/16.0_8)*w**7 - 9009.0_8/16.0_8 * w**5 + &
|
||||
(3465.0_8/16.0_8)*w**3 - 315.0_8/16.0_8 * w) * sin(phi))
|
||||
! l = 8, m = 0
|
||||
rn(9) = 50.2734375_8 * w**8 - 93.84375_8 * w**6 + 54.140625_8 * w**4 -&
|
||||
9.84375_8 * w**2 + 0.2734375_8
|
||||
! l = 8, m = 1
|
||||
rn(10) = 0.166666666666667_8*sqrt(w2m1)* &
|
||||
((6435.0_8/16.0_8)*w**7 - 9009.0_8/16.0_8 * w**5 + &
|
||||
(3465.0_8/16.0_8)*w**3 - 315.0_8/16.0_8 * w) * cos(phi)
|
||||
rn(10) = -(0.166666666666667_8*sqrt(w2m1)* &
|
||||
((6435.0_8/16.0_8)*w**7 - 9009.0_8/16.0_8 * w**5 + &
|
||||
(3465.0_8/16.0_8)*w**3 - 315.0_8/16.0_8 * w) * cos(phi))
|
||||
! l = 8, m = 2
|
||||
rn(11) = 0.0199204768222399_8 * (w2m1)*((45045.0_8/16.0_8)*w**6- &
|
||||
45045.0_8/16.0_8 * w**4 + (10395.0_8/16.0_8)*w**2 - &
|
||||
315.0_8/16.0_8) * cos(TWO*phi)
|
||||
! l = 8, m = 3
|
||||
rn(12) = 0.00245204119306875_8 * (w2m1)**(THREE/TWO)* &
|
||||
((135135.0_8/8.0_8)*w**5 - 45045.0_8/4.0_8 * w**3 + &
|
||||
(10395.0_8/8.0_8)*w) * cos(THREE*phi)
|
||||
rn(12) = -(0.00245204119306875_8 * (w2m1)**(THREE/TWO)* &
|
||||
((135135.0_8/8.0_8)*w**5 - 45045.0_8/4.0_8 * w**3 + &
|
||||
(10395.0_8/8.0_8)*w) * cos(THREE*phi))
|
||||
! l = 8, m = 4
|
||||
rn(13) = 0.000316557156832328_8 * (w2m1)**2*((675675.0_8/8.0_8)*w**4 - &
|
||||
135135.0_8/4.0_8 * w**2 + 10395.0_8/8.0_8) * cos(4.0_8*phi)
|
||||
! l = 8, m = 5
|
||||
rn(14) = 4.38985792528482d-5*(w2m1)**(5.0_8/TWO)*((675675.0_8/TWO)*w**3 -&
|
||||
135135.0_8/TWO*w) * cos(5.0_8*phi)
|
||||
rn(14) = -(4.38985792528482d-5*(w2m1)**(5.0_8/TWO)*((675675.0_8/TWO)*w**3 -&
|
||||
135135.0_8/TWO*w) * cos(5.0_8*phi))
|
||||
! l = 8, m = 6
|
||||
rn(15) = 6.77369783729086d-6*(w2m1)**3*((2027025.0_8/TWO)*w**2 - &
|
||||
135135.0_8/TWO) * cos(6.0_8*phi)
|
||||
! l = 8, m = 7
|
||||
rn(16) = 2.50682661696018_8 * w*(w2m1)**(7.0_8/TWO) * cos(7.0_8*phi)
|
||||
rn(16) = -(2.50682661696018_8 * w*(w2m1)**(7.0_8/TWO) * cos(7.0_8*phi))
|
||||
! l = 8, m = 8
|
||||
rn(17) = 0.626706654240044_8 * (w2m1)**4 * cos(8.0_8*phi)
|
||||
case (9)
|
||||
! l = 9, m = -9
|
||||
rn(1) = 0.609049392175524_8 * (w2m1)**(9.0_8/TWO) * sin(9.0_8*phi)
|
||||
rn(1) = -(0.609049392175524_8 * (w2m1)**(9.0_8/TWO) * sin(9.0_8*phi))
|
||||
! l = 9, m = -8
|
||||
rn(2) = 2.58397773170915_8 * w*(w2m1)**4 * sin(8.0_8*phi)
|
||||
! l = 9, m = -7
|
||||
rn(3) = 4.37240315267812d-7*(w2m1)**(7.0_8/TWO)* &
|
||||
((34459425.0_8/TWO)*w**2 - 2027025.0_8/TWO) * sin(7.0_8*phi)
|
||||
rn(3) = -(4.37240315267812d-7*(w2m1)**(7.0_8/TWO)* &
|
||||
((34459425.0_8/TWO)*w**2 - 2027025.0_8/TWO) * sin(7.0_8*phi))
|
||||
! l = 9, m = -6
|
||||
rn(4) = 3.02928976464514d-6*(w2m1)**3* &
|
||||
((11486475.0_8/TWO)*w**3 - 2027025.0_8/TWO*w) * sin(6.0_8*phi)
|
||||
! l = 9, m = -5
|
||||
rn(5) = 2.34647776186144d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((11486475.0_8/8.0_8)*w**4 - 2027025.0_8/4.0_8 * w**2 + &
|
||||
135135.0_8/8.0_8) * sin(5.0_8*phi)
|
||||
rn(5) = -(2.34647776186144d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((11486475.0_8/8.0_8)*w**4 - 2027025.0_8/4.0_8 * w**2 + &
|
||||
135135.0_8/8.0_8) * sin(5.0_8*phi))
|
||||
! l = 9, m = -4
|
||||
rn(6) = 0.000196320414650061_8 * (w2m1)**2*((2297295.0_8/8.0_8)*w**5 - &
|
||||
675675.0_8/4.0_8 * w**3 + (135135.0_8/8.0_8)*w) * sin(4.0_8*phi)
|
||||
! l = 9, m = -3
|
||||
rn(7) = 0.00173385495536766_8 * (w2m1)**(THREE/TWO)* &
|
||||
((765765.0_8/16.0_8)*w**6 - 675675.0_8/16.0_8 * w**4 + &
|
||||
(135135.0_8/16.0_8)*w**2 - 3465.0_8/16.0_8) * sin(THREE*phi)
|
||||
rn(7) = -(0.00173385495536766_8 * (w2m1)**(THREE/TWO)* &
|
||||
((765765.0_8/16.0_8)*w**6 - 675675.0_8/16.0_8 * w**4 + &
|
||||
(135135.0_8/16.0_8)*w**2 - 3465.0_8/16.0_8) * sin(THREE*phi))
|
||||
! l = 9, m = -2
|
||||
rn(8) = 0.0158910431540932_8 * (w2m1)*((109395.0_8/16.0_8)*w**7- &
|
||||
135135.0_8/16.0_8 * w**5 + (45045.0_8/16.0_8)*w**3 &
|
||||
- 3465.0_8/16.0_8 * w) * sin(TWO*phi)
|
||||
! l = 9, m = -1
|
||||
rn(9) = 0.149071198499986_8*sqrt(w2m1)*((109395.0_8/128.0_8)*w**8 - &
|
||||
45045.0_8/32.0_8 * w**6 + (45045.0_8/64.0_8)*w**4 - 3465.0_8/32.0_8 &
|
||||
* w**2 + 315.0_8/128.0_8) * sin(phi)
|
||||
rn(9) = -(0.149071198499986_8*sqrt(w2m1)*((109395.0_8/128.0_8)*w**8 - &
|
||||
45045.0_8/32.0_8 * w**6 + (45045.0_8/64.0_8)*w**4 - 3465.0_8/32.0_8 &
|
||||
* w**2 + 315.0_8/128.0_8) * sin(phi))
|
||||
! l = 9, m = 0
|
||||
rn(10) = 94.9609375_8 * w**9 - 201.09375_8 * w**7 + 140.765625_8 * w**5- &
|
||||
36.09375_8 * w**3 + 2.4609375_8 * w
|
||||
! l = 9, m = 1
|
||||
rn(11) = 0.149071198499986_8*sqrt(w2m1)*((109395.0_8/128.0_8)*w**8 - &
|
||||
45045.0_8/32.0_8 * w**6 + (45045.0_8/64.0_8)*w**4 -3465.0_8/32.0_8 &
|
||||
* w**2 + 315.0_8/128.0_8) * cos(phi)
|
||||
rn(11) = -(0.149071198499986_8*sqrt(w2m1)*((109395.0_8/128.0_8)*w**8 - &
|
||||
45045.0_8/32.0_8 * w**6 + (45045.0_8/64.0_8)*w**4 -3465.0_8/32.0_8 &
|
||||
* w**2 + 315.0_8/128.0_8) * cos(phi))
|
||||
! l = 9, m = 2
|
||||
rn(12) = 0.0158910431540932_8 * (w2m1)*((109395.0_8/16.0_8)*w**7 - &
|
||||
135135.0_8/16.0_8 * w**5 + (45045.0_8/16.0_8)*w**3 &
|
||||
- 3465.0_8/ 16.0_8 * w) * cos(TWO*phi)
|
||||
! l = 9, m = 3
|
||||
rn(13) = 0.00173385495536766_8 * (w2m1)**(THREE/TWO)*((765765.0_8/16.0_8)&
|
||||
*w**6 - 675675.0_8/16.0_8 * w**4 + (135135.0_8/16.0_8)*w**2 &
|
||||
- 3465.0_8/16.0_8)* cos(THREE*phi)
|
||||
rn(13) = -(0.00173385495536766_8 * (w2m1)**(THREE/TWO)*((765765.0_8/16.0_8)&
|
||||
*w**6 - 675675.0_8/16.0_8 * w**4 + (135135.0_8/16.0_8)*w**2 &
|
||||
- 3465.0_8/16.0_8)* cos(THREE*phi))
|
||||
! l = 9, m = 4
|
||||
rn(14) = 0.000196320414650061_8 * (w2m1)**2*((2297295.0_8/8.0_8)*w**5 - &
|
||||
675675.0_8/4.0_8 * w**3 + (135135.0_8/8.0_8)*w) * cos(4.0_8*phi)
|
||||
! l = 9, m = 5
|
||||
rn(15) = 2.34647776186144d-5*(w2m1)**(5.0_8/TWO)*((11486475.0_8/8.0_8)* &
|
||||
w**4 - 2027025.0_8/4.0_8 * w**2 + 135135.0_8/8.0_8) * cos(5.0_8*phi)
|
||||
rn(15) = -(2.34647776186144d-5*(w2m1)**(5.0_8/TWO)*((11486475.0_8/8.0_8)* &
|
||||
w**4 - 2027025.0_8/4.0_8 * w**2 + 135135.0_8/8.0_8) * cos(5.0_8*phi))
|
||||
! l = 9, m = 6
|
||||
rn(16) = 3.02928976464514d-6*(w2m1)**3*((11486475.0_8/TWO)*w**3 - &
|
||||
2027025.0_8/TWO*w) * cos(6.0_8*phi)
|
||||
! l = 9, m = 7
|
||||
rn(17) = 4.37240315267812d-7*(w2m1)**(7.0_8/TWO)* &
|
||||
((34459425.0_8/TWO)*w**2 - 2027025.0_8/TWO) * cos(7.0_8*phi)
|
||||
rn(17) = -(4.37240315267812d-7*(w2m1)**(7.0_8/TWO)* &
|
||||
((34459425.0_8/TWO)*w**2 - 2027025.0_8/TWO) * cos(7.0_8*phi))
|
||||
! l = 9, m = 8
|
||||
rn(18) = 2.58397773170915_8 * w*(w2m1)**4 * cos(8.0_8*phi)
|
||||
! l = 9, m = 9
|
||||
rn(19) = 0.609049392175524_8 * (w2m1)**(9.0_8/TWO) * cos(9.0_8*phi)
|
||||
rn(19) = -(0.609049392175524_8 * (w2m1)**(9.0_8/TWO) * cos(9.0_8*phi))
|
||||
case (10)
|
||||
! l = 10, m = -10
|
||||
rn(1) = 0.593627917136573_8 * (w2m1)**5 * sin(10.0_8*phi)
|
||||
! l = 10, m = -9
|
||||
rn(2) = 2.65478475211798_8 * w*(w2m1)**(9.0_8/TWO) * sin(9.0_8*phi)
|
||||
rn(2) = -(2.65478475211798_8 * w*(w2m1)**(9.0_8/TWO) * sin(9.0_8*phi))
|
||||
! l = 10, m = -8
|
||||
rn(3) = 2.49953651452314d-8*(w2m1)**4*((654729075.0_8/TWO)*w**2 - &
|
||||
34459425.0_8/TWO) * sin(8.0_8*phi)
|
||||
! l = 10, m = -7
|
||||
rn(4) = 1.83677671621093d-7*(w2m1)**(7.0_8/TWO)* &
|
||||
((218243025.0_8/TWO)*w**3 - 34459425.0_8/TWO*w) * sin(7.0_8*phi)
|
||||
rn(4) = -(1.83677671621093d-7*(w2m1)**(7.0_8/TWO)* &
|
||||
((218243025.0_8/TWO)*w**3 - 34459425.0_8/TWO*w) * sin(7.0_8*phi))
|
||||
! l = 10, m = -6
|
||||
rn(5) = 1.51464488232257d-6*(w2m1)**3*((218243025.0_8/8.0_8)*w**4 - &
|
||||
34459425.0_8/4.0_8 * w**2 + 2027025.0_8/8.0_8) * sin(6.0_8*phi)
|
||||
! l = 10, m = -5
|
||||
rn(6) = 1.35473956745817d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((43648605.0_8/8.0_8)*w**5 - 11486475.0_8/4.0_8 * w**3 + &
|
||||
(2027025.0_8/8.0_8)*w) * sin(5.0_8*phi)
|
||||
rn(6) = -(1.35473956745817d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((43648605.0_8/8.0_8)*w**5 - 11486475.0_8/4.0_8 * w**3 + &
|
||||
(2027025.0_8/8.0_8)*w) * sin(5.0_8*phi))
|
||||
! l = 10, m = -4
|
||||
rn(7) = 0.000128521880085575_8 * (w2m1)**2*((14549535.0_8/16.0_8)*w**6 - &
|
||||
11486475.0_8/16.0_8 * w**4 + (2027025.0_8/16.0_8)*w**2 - &
|
||||
45045.0_8/16.0_8) * sin(4.0_8*phi)
|
||||
! l = 10, m = -3
|
||||
rn(8) = 0.00127230170115096_8 * (w2m1)**(THREE/TWO)* &
|
||||
((2078505.0_8/16.0_8)*w**7 - 2297295.0_8/16.0_8 * w**5 + &
|
||||
(675675.0_8/16.0_8)*w**3 - 45045.0_8/16.0_8 * w) * sin(THREE*phi)
|
||||
rn(8) = -(0.00127230170115096_8 * (w2m1)**(THREE/TWO)* &
|
||||
((2078505.0_8/16.0_8)*w**7 - 2297295.0_8/16.0_8 * w**5 + &
|
||||
(675675.0_8/16.0_8)*w**3 - 45045.0_8/16.0_8 * w) * sin(THREE*phi))
|
||||
! l = 10, m = -2
|
||||
rn(9) = 0.012974982402692_8 * (w2m1)*((2078505.0_8/128.0_8)*w**8 - &
|
||||
765765.0_8/32.0_8 * w**6 + (675675.0_8/64.0_8)*w**4 - &
|
||||
45045.0_8/32.0_8 * w**2 + 3465.0_8/128.0_8) * sin(TWO*phi)
|
||||
! l = 10, m = -1
|
||||
rn(10) = 0.134839972492648_8*sqrt(w2m1)*((230945.0_8/128.0_8)*w**9 - &
|
||||
109395.0_8/32.0_8 * w**7 + (135135.0_8/64.0_8)*w**5 - &
|
||||
15015.0_8/32.0_8 * w**3 + (3465.0_8/128.0_8)*w) * sin(phi)
|
||||
rn(10) = -(0.134839972492648_8*sqrt(w2m1)*((230945.0_8/128.0_8)*w**9 - &
|
||||
109395.0_8/32.0_8 * w**7 + (135135.0_8/64.0_8)*w**5 - &
|
||||
15015.0_8/32.0_8 * w**3 + (3465.0_8/128.0_8)*w) * sin(phi))
|
||||
! l = 10, m = 0
|
||||
rn(11) = 180.42578125_8 * w**10 - 427.32421875_8 * w**8 +351.9140625_8 &
|
||||
* w**6 - 117.3046875_8 * w**4 + 13.53515625_8 * w**2 -0.24609375_8
|
||||
! l = 10, m = 1
|
||||
rn(12) = 0.134839972492648_8*sqrt(w2m1)*((230945.0_8/128.0_8)*w**9 - &
|
||||
109395.0_8/32.0_8 * w**7 + (135135.0_8/64.0_8)*w**5 -15015.0_8/ &
|
||||
32.0_8 * w**3 + (3465.0_8/128.0_8)*w) * cos(phi)
|
||||
rn(12) = -(0.134839972492648_8*sqrt(w2m1)*((230945.0_8/128.0_8)*w**9 - &
|
||||
109395.0_8/32.0_8 * w**7 + (135135.0_8/64.0_8)*w**5 -15015.0_8/ &
|
||||
32.0_8 * w**3 + (3465.0_8/128.0_8)*w) * cos(phi))
|
||||
! l = 10, m = 2
|
||||
rn(13) = 0.012974982402692_8 * (w2m1)*((2078505.0_8/128.0_8)*w**8 - &
|
||||
765765.0_8/32.0_8 * w**6 + (675675.0_8/64.0_8)*w**4 -&
|
||||
45045.0_8/32.0_8 * w**2 + 3465.0_8/128.0_8) * cos(TWO*phi)
|
||||
! l = 10, m = 3
|
||||
rn(14) = 0.00127230170115096_8 * (w2m1)**(THREE/TWO)* &
|
||||
((2078505.0_8/16.0_8)*w**7 - 2297295.0_8/16.0_8 * w**5 + &
|
||||
(675675.0_8/16.0_8)*w**3 - 45045.0_8/16.0_8 * w) * cos(THREE*phi)
|
||||
rn(14) = -(0.00127230170115096_8 * (w2m1)**(THREE/TWO)* &
|
||||
((2078505.0_8/16.0_8)*w**7 - 2297295.0_8/16.0_8 * w**5 + &
|
||||
(675675.0_8/16.0_8)*w**3 - 45045.0_8/16.0_8 * w) * cos(THREE*phi))
|
||||
! l = 10, m = 4
|
||||
rn(15) = 0.000128521880085575_8 * (w2m1)**2*((14549535.0_8/16.0_8)*w**6 -&
|
||||
11486475.0_8/16.0_8 * w**4 + (2027025.0_8/16.0_8)*w**2 - &
|
||||
45045.0_8/16.0_8) * cos(4.0_8*phi)
|
||||
! l = 10, m = 5
|
||||
rn(16) = 1.35473956745817d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((43648605.0_8/8.0_8)*w**5 - 11486475.0_8/4.0_8 * w**3 + &
|
||||
(2027025.0_8/8.0_8)*w) * cos(5.0_8*phi)
|
||||
rn(16) = -(1.35473956745817d-5*(w2m1)**(5.0_8/TWO)* &
|
||||
((43648605.0_8/8.0_8)*w**5 - 11486475.0_8/4.0_8 * w**3 + &
|
||||
(2027025.0_8/8.0_8)*w) * cos(5.0_8*phi))
|
||||
! l = 10, m = 6
|
||||
rn(17) = 1.51464488232257d-6*(w2m1)**3*((218243025.0_8/8.0_8)*w**4 - &
|
||||
34459425.0_8/4.0_8 * w**2 + 2027025.0_8/8.0_8) * cos(6.0_8*phi)
|
||||
! l = 10, m = 7
|
||||
rn(18) = 1.83677671621093d-7*(w2m1)**(7.0_8/TWO)* &
|
||||
((218243025.0_8/TWO)*w**3 - 34459425.0_8/TWO*w) * cos(7.0_8*phi)
|
||||
rn(18) = -(1.83677671621093d-7*(w2m1)**(7.0_8/TWO)* &
|
||||
((218243025.0_8/TWO)*w**3 - 34459425.0_8/TWO*w) * cos(7.0_8*phi))
|
||||
! l = 10, m = 8
|
||||
rn(19) = 2.49953651452314d-8*(w2m1)**4* &
|
||||
((654729075.0_8/TWO)*w**2 - 34459425.0_8/TWO) * cos(8.0_8*phi)
|
||||
! l = 10, m = 9
|
||||
rn(20) = 2.65478475211798_8 * w*(w2m1)**(9.0_8/TWO) * cos(9.0_8*phi)
|
||||
rn(20) = -(2.65478475211798_8 * w*(w2m1)**(9.0_8/TWO) * cos(9.0_8*phi))
|
||||
! l = 10, m = 10
|
||||
rn(21) = 0.593627917136573_8 * (w2m1)**5 * cos(10.0_8*phi)
|
||||
case default
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ module output
|
|||
use constants
|
||||
use endf, only: reaction_name
|
||||
use error, only: fatal_error, warning
|
||||
use geometry_header, only: Cell, Universe, Surface, Lattice, RectLattice, &
|
||||
use geometry_header, only: Cell, Universe, Lattice, RectLattice, &
|
||||
HexLattice, BASE_UNIVERSE
|
||||
use global
|
||||
use math, only: t_percentile
|
||||
|
|
@ -254,10 +254,9 @@ contains
|
|||
type(Particle), intent(in) :: p
|
||||
|
||||
integer :: i ! index for coordinate levels
|
||||
type(Cell), pointer :: c => null()
|
||||
type(Surface), pointer :: s => null()
|
||||
type(Universe), pointer :: u => null()
|
||||
class(Lattice), pointer :: l => null()
|
||||
type(Cell), pointer :: c
|
||||
type(Universe), pointer :: u
|
||||
class(Lattice), pointer :: l
|
||||
|
||||
! display type of particle
|
||||
select case (p % type)
|
||||
|
|
@ -304,8 +303,7 @@ contains
|
|||
|
||||
! Print surface
|
||||
if (p % surface /= NONE) then
|
||||
s => surfaces(abs(p % surface))
|
||||
write(ou,*) ' Surface = ' // to_str(sign(s % id, p % surface))
|
||||
write(ou,*) ' Surface = ' // to_str(sign(surfaces(i)%obj%id, p % surface))
|
||||
end if
|
||||
|
||||
! Display weight, energy, grid index, and interpolation factor
|
||||
|
|
@ -960,6 +958,9 @@ contains
|
|||
filter_name(FILTER_MESH) = "Mesh"
|
||||
filter_name(FILTER_ENERGYIN) = "Incoming Energy"
|
||||
filter_name(FILTER_ENERGYOUT) = "Outgoing Energy"
|
||||
filter_name(FILTER_MU) = "Change-in-Angle"
|
||||
filter_name(FILTER_POLAR) = "Polar Angle"
|
||||
filter_name(FILTER_AZIMUTHAL) = "Azimuthal Angle"
|
||||
|
||||
! Initialize names for scores
|
||||
score_names(abs(SCORE_FLUX)) = "Flux"
|
||||
|
|
@ -1385,7 +1386,7 @@ contains
|
|||
univ, bin-1, offset, label)
|
||||
case (FILTER_SURFACE)
|
||||
i = t % filters(i_filter) % int_bins(bin)
|
||||
label = to_str(surfaces(i) % id)
|
||||
label = to_str(surfaces(i)%obj%id)
|
||||
case (FILTER_MESH)
|
||||
m => meshes(t % filters(i_filter) % int_bins(1))
|
||||
allocate(ijk(m % n_dimension))
|
||||
|
|
@ -1397,7 +1398,8 @@ contains
|
|||
label = "Index (" // trim(to_str(ijk(1))) // ", " // &
|
||||
trim(to_str(ijk(2))) // ", " // trim(to_str(ijk(3))) // ")"
|
||||
end if
|
||||
case (FILTER_ENERGYIN, FILTER_ENERGYOUT)
|
||||
case (FILTER_ENERGYIN, FILTER_ENERGYOUT, FILTER_MU, FILTER_POLAR, &
|
||||
FILTER_AZIMUTHAL)
|
||||
E0 = t % filters(i_filter) % real_bins(bin)
|
||||
E1 = t % filters(i_filter) % real_bins(bin + 1)
|
||||
label = "[" // trim(to_str(E0)) // ", " // trim(to_str(E1)) // ")"
|
||||
|
|
|
|||
|
|
@ -465,6 +465,12 @@ contains
|
|||
! Set energy and direction of particle in LAB frame
|
||||
uvw = v_n / vel
|
||||
|
||||
! Because of floating-point roundoff, it may be possible for mu_lab to be
|
||||
! outside of the range [-1,1). In these cases, we just set mu_lab to exactly
|
||||
! -1 or 1
|
||||
|
||||
if (abs(mu_lab) > ONE) mu_lab = sign(ONE,mu_lab)
|
||||
|
||||
end subroutine elastic_scatter
|
||||
|
||||
!===============================================================================
|
||||
|
|
@ -711,6 +717,12 @@ contains
|
|||
end if ! (inelastic secondary energy treatment)
|
||||
end if ! (elastic or inelastic)
|
||||
|
||||
! Because of floating-point roundoff, it may be possible for mu to be
|
||||
! outside of the range [-1,1). In these cases, we just set mu to exactly
|
||||
! -1 or 1
|
||||
|
||||
if (abs(mu) > ONE) mu = sign(ONE,mu)
|
||||
|
||||
! change direction of particle
|
||||
uvw = rotate_angle(uvw, mu)
|
||||
|
||||
|
|
@ -1298,6 +1310,11 @@ contains
|
|||
! sample outgoing energy
|
||||
if (law == 44 .or. law == 61) then
|
||||
call sample_energy(rxn%edist, E_in, E, mu)
|
||||
! Because of floating-point roundoff, it may be possible for mu to be
|
||||
! outside of the range [-1,1). In these cases, we just set mu to exactly
|
||||
! -1 or 1
|
||||
|
||||
if (abs(mu) > ONE) mu = sign(ONE,mu)
|
||||
elseif (law == 66) then
|
||||
call sample_energy(rxn%edist, E_in, E, A=A, Q=Q)
|
||||
else
|
||||
|
|
@ -1315,6 +1332,12 @@ contains
|
|||
|
||||
! determine outgoing angle in lab
|
||||
mu = mu * sqrt(E_cm/E) + ONE/(A+ONE) * sqrt(E_in/E)
|
||||
|
||||
! Because of floating-point roundoff, it may be possible for mu to be
|
||||
! outside of the range [-1,1). In these cases, we just set mu to exactly
|
||||
! -1 or 1
|
||||
|
||||
if (abs(mu) > ONE) mu = sign(ONE,mu)
|
||||
end if
|
||||
|
||||
! Set outgoing energy and scattering angle
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ element geometry {
|
|||
(element material { ( xsd:int | "void" ) } |
|
||||
attribute material { ( xsd:int | "void" ) })
|
||||
) &
|
||||
(element surfaces { list { xsd:int* } } | attribute surfaces { list { xsd:int* } })? &
|
||||
(element region { xsd:string } | attribute region { xsd:string })? &
|
||||
(element rotation { list { xsd:double+ } } | attribute rotation { list { xsd:double+ } })? &
|
||||
(element translation { list { xsd:double+ } } | attribute translation { list { xsd:double+ } })?
|
||||
}*
|
||||
|
|
|
|||
|
|
@ -62,19 +62,11 @@
|
|||
</choice>
|
||||
<optional>
|
||||
<choice>
|
||||
<element name="surfaces">
|
||||
<list>
|
||||
<zeroOrMore>
|
||||
<data type="int"/>
|
||||
</zeroOrMore>
|
||||
</list>
|
||||
<element name="region">
|
||||
<data type="string"/>
|
||||
</element>
|
||||
<attribute name="surfaces">
|
||||
<list>
|
||||
<zeroOrMore>
|
||||
<data type="int"/>
|
||||
</zeroOrMore>
|
||||
</list>
|
||||
<attribute name="region">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</choice>
|
||||
</optional>
|
||||
|
|
|
|||
|
|
@ -23,9 +23,11 @@ element tallies {
|
|||
attribute estimator { ( "analog" | "tracklength" ) })? &
|
||||
element filter {
|
||||
(element type { ( "cell" | "cellborn" | "material" | "universe" |
|
||||
"surface" | "distribcell" | "mesh" | "energy" | "energyout" ) } |
|
||||
"surface" | "distribcell" | "mesh" | "energy" | "energyout" | "mu" |
|
||||
"polar" | "azimuthal") } |
|
||||
attribute type { ( "cell" | "cellborn" | "material" | "universe" |
|
||||
"surface" | "distribcell" | "mesh" | "energy" | "energyout" ) }) &
|
||||
"surface" | "distribcell" | "mesh" | "energy" | "energyout" | "mu" |
|
||||
"polar" | "azimuthal") }) &
|
||||
(element bins { list { xsd:double+ } } |
|
||||
attribute bins { list { xsd:double+ } })
|
||||
}* &
|
||||
|
|
|
|||
|
|
@ -145,6 +145,9 @@
|
|||
<value>mesh</value>
|
||||
<value>energy</value>
|
||||
<value>energyout</value>
|
||||
<value>mu</value>
|
||||
<value>polar</value>
|
||||
<value>azimuthal</value>
|
||||
</choice>
|
||||
</element>
|
||||
<attribute name="type">
|
||||
|
|
@ -158,6 +161,9 @@
|
|||
<value>mesh</value>
|
||||
<value>energy</value>
|
||||
<value>energyout</value>
|
||||
<value>mu</value>
|
||||
<value>polar</value>
|
||||
<value>azimuthal</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</choice>
|
||||
|
|
|
|||
|
|
@ -256,14 +256,23 @@ contains
|
|||
call write_dataset(filter_group, "type", "energy")
|
||||
case(FILTER_ENERGYOUT)
|
||||
call write_dataset(filter_group, "type", "energyout")
|
||||
case(FILTER_MU)
|
||||
call write_dataset(filter_group, "type", "mu")
|
||||
case(FILTER_POLAR)
|
||||
call write_dataset(filter_group, "type", "polar")
|
||||
case(FILTER_AZIMUTHAL)
|
||||
call write_dataset(filter_group, "type", "azimuthal")
|
||||
case(FILTER_DISTRIBCELL)
|
||||
call write_dataset(filter_group, "type", "distribcell")
|
||||
end select
|
||||
|
||||
call write_dataset(filter_group, "offset", tally%filters(j)%offset)
|
||||
call write_dataset(filter_group, "n_bins", tally%filters(j)%n_bins)
|
||||
if (tally%filters(j)%type == FILTER_ENERGYIN .or. &
|
||||
tally%filters(j)%type == FILTER_ENERGYOUT) then
|
||||
if (tally % filters(j) % type == FILTER_ENERGYIN .or. &
|
||||
tally % filters(j) % type == FILTER_ENERGYOUT .or. &
|
||||
tally % filters(j) % type == FILTER_MU .or. &
|
||||
tally % filters(j) % type == FILTER_POLAR .or. &
|
||||
tally % filters(j) % type == FILTER_AZIMUTHAL) then
|
||||
call write_dataset(filter_group, "bins", &
|
||||
tally%filters(j)%real_bins)
|
||||
else
|
||||
|
|
|
|||
351
src/stl_vector.F90
Normal file
351
src/stl_vector.F90
Normal file
|
|
@ -0,0 +1,351 @@
|
|||
module stl_vector
|
||||
|
||||
! This module provides derived types that are meant to mimic the
|
||||
! std::vector<T> type in C++. The vector type has numerous advantages over
|
||||
! simple arrays and linked lists in that storage can grow and shrink
|
||||
! dynamically, yet it is still contiguous in memory. Vectors can be filled
|
||||
! element-by-element with automatic memory allocation in amortized constant
|
||||
! time. In the implementation here, we grow the vector by a factor of 1.5 each
|
||||
! time the capacity is exceed.
|
||||
!
|
||||
! The member functions which have been implemented here are:
|
||||
!
|
||||
! capacity -- Returns the size of the storage space currently allocated for
|
||||
! the vector
|
||||
!
|
||||
! clear -- Remove all elements from the vector, leaving it with a size of
|
||||
! 0. Note that this doesn't imply that storage is deallocated.
|
||||
!
|
||||
! initialize -- Set the storage size of the vector and optionally fill it with
|
||||
! a particular value.
|
||||
!
|
||||
! pop_back -- Remove the last element of the vector, reducing the size by one.
|
||||
!
|
||||
! push_back -- Add a new element at the end of the vector. This increases the
|
||||
! size of the vector by one. Note that the underlying storage is
|
||||
! reallocated only if the size exceeds the capacity.
|
||||
!
|
||||
! reserve -- Requests that the capacity of the vector be a certain size.
|
||||
!
|
||||
! resize -- Resize the vector so it contains n elements. If n is larger than
|
||||
! the current size, an optional fill value can be used to set the
|
||||
! extra elements.
|
||||
!
|
||||
! shrink_to_fit -- Request that the capacity be reduced to fit the size.
|
||||
!
|
||||
! size -- Returns the number of elements in the vector.
|
||||
|
||||
implicit none
|
||||
private
|
||||
|
||||
real(8), parameter :: GROWTH_FACTOR = 1.5
|
||||
|
||||
type, public :: VectorInt
|
||||
integer, private :: size_ = 0
|
||||
integer, private :: capacity_ = 0
|
||||
integer, allocatable :: data(:)
|
||||
contains
|
||||
procedure :: capacity => capacity_int
|
||||
procedure :: clear => clear_int
|
||||
generic :: initialize => &
|
||||
initialize_fill_int
|
||||
procedure, private :: initialize_fill_int
|
||||
procedure :: pop_back => pop_back_int
|
||||
procedure :: push_back => push_back_int
|
||||
procedure :: reserve => reserve_int
|
||||
procedure :: resize => resize_int
|
||||
procedure :: shrink_to_fit => shrink_to_fit_int
|
||||
procedure :: size => size_int
|
||||
end type VectorInt
|
||||
|
||||
type, public :: VectorReal
|
||||
integer, private :: size_ = 0
|
||||
integer, private :: capacity_ = 0
|
||||
real(8), allocatable :: data(:)
|
||||
contains
|
||||
procedure :: capacity => capacity_real
|
||||
procedure :: clear => clear_real
|
||||
generic :: initialize => &
|
||||
initialize_fill_real
|
||||
procedure, private :: initialize_fill_real
|
||||
procedure :: pop_back => pop_back_real
|
||||
procedure :: push_back => push_back_real
|
||||
procedure :: reserve => reserve_real
|
||||
procedure :: resize => resize_real
|
||||
procedure :: shrink_to_fit => shrink_to_fit_real
|
||||
procedure :: size => size_real
|
||||
end type VectorReal
|
||||
|
||||
contains
|
||||
|
||||
!===============================================================================
|
||||
! Implementation of VectorInt
|
||||
!===============================================================================
|
||||
|
||||
pure function capacity_int(this) result(capacity)
|
||||
class(VectorInt), intent(in) :: this
|
||||
integer :: capacity
|
||||
|
||||
capacity = this%capacity_
|
||||
end function capacity_int
|
||||
|
||||
subroutine clear_int(this)
|
||||
class(VectorInt), intent(inout) :: this
|
||||
|
||||
! Since integer is trivially destructible, we only need to set size to zero
|
||||
! and can leave capacity as is
|
||||
this%size_ = 0
|
||||
end subroutine clear_int
|
||||
|
||||
subroutine initialize_fill_int(this, n, val)
|
||||
class(VectorInt), intent(inout) :: this
|
||||
integer, intent(in) :: n
|
||||
integer, optional, intent(in) :: val
|
||||
|
||||
integer :: val_
|
||||
|
||||
! If no value given, fill the vector with zeros
|
||||
if (present(val)) then
|
||||
val_ = val
|
||||
else
|
||||
val_ = 0
|
||||
end if
|
||||
|
||||
if (allocated(this%data)) deallocate(this%data)
|
||||
|
||||
allocate(this%data(n), SOURCE=val_)
|
||||
this%size_ = n
|
||||
this%capacity_ = n
|
||||
end subroutine initialize_fill_int
|
||||
|
||||
subroutine pop_back_int(this)
|
||||
class(VectorInt), intent(inout) :: this
|
||||
if (this%size_ > 0) this%size_ = this%size_ - 1
|
||||
end subroutine pop_back_int
|
||||
|
||||
subroutine push_back_int(this, val)
|
||||
class(VectorInt), intent(inout) :: this
|
||||
integer, intent(in) :: val
|
||||
|
||||
integer :: capacity
|
||||
integer, allocatable :: data(:)
|
||||
|
||||
if (this%capacity_ == this%size_) then
|
||||
! Create new data array that is GROWTH_FACTOR larger. Note that
|
||||
if (this%capacity_ == 0) then
|
||||
capacity = 8
|
||||
else
|
||||
capacity = int(GROWTH_FACTOR*this%capacity_)
|
||||
end if
|
||||
allocate(data(capacity))
|
||||
|
||||
! Copy existing elements
|
||||
if (this%size_ > 0) data(1:this%size_) = this%data
|
||||
|
||||
! Move allocation
|
||||
call move_alloc(FROM=data, TO=this%data)
|
||||
this%capacity_ = capacity
|
||||
end if
|
||||
|
||||
! Increase size of vector by one and set new element
|
||||
this%size_ = this%size_ + 1
|
||||
this%data(this%size_) = val
|
||||
end subroutine push_back_int
|
||||
|
||||
subroutine reserve_int(this, n)
|
||||
class(VectorInt), intent(inout) :: this
|
||||
integer, intent(in) :: n
|
||||
|
||||
integer, allocatable :: data(:)
|
||||
|
||||
if (n > this%capacity_) then
|
||||
allocate(data(n))
|
||||
|
||||
! Copy existing elements
|
||||
if (this%size_ > 0) data(1:this%size_) = this%data(1:this%size_)
|
||||
|
||||
! Move allocation
|
||||
call move_alloc(FROM=data, TO=this%data)
|
||||
this%capacity_ = n
|
||||
end if
|
||||
end subroutine reserve_int
|
||||
|
||||
subroutine resize_int(this, n, val)
|
||||
class(VectorInt), intent(inout) :: this
|
||||
integer, intent(in) :: n
|
||||
integer, intent(in), optional :: val
|
||||
|
||||
if (n < this%size_) then
|
||||
this%size_ = n
|
||||
elseif (n > this%size_) then
|
||||
! If requested size is greater than capacity, first reserve that many
|
||||
! elements
|
||||
if (n > this%capacity_) call this%reserve(n)
|
||||
|
||||
! Fill added elements with specified value and increase size
|
||||
if (present(val)) this%data(this%size_ + 1 : n) = val
|
||||
this%size_ = n
|
||||
end if
|
||||
|
||||
end subroutine resize_int
|
||||
|
||||
subroutine shrink_to_fit_int(this)
|
||||
class(VectorInt), intent(inout) :: this
|
||||
|
||||
integer, allocatable :: data(:)
|
||||
|
||||
if (this%capacity_ > this%size_) then
|
||||
if (this%size_ > 0) then
|
||||
allocate(data(this%size_))
|
||||
data(:) = this%data(1:this%size_)
|
||||
call move_alloc(FROM=data, TO=this%data)
|
||||
this%capacity_ = this%size_
|
||||
else
|
||||
if (allocated(this%data)) deallocate(this%data)
|
||||
end if
|
||||
end if
|
||||
end subroutine shrink_to_fit_int
|
||||
|
||||
pure function size_int(this) result(size)
|
||||
class(VectorInt), intent(in) :: this
|
||||
integer :: size
|
||||
|
||||
size = this%size_
|
||||
end function size_int
|
||||
|
||||
!===============================================================================
|
||||
! Implementation of VectorReal
|
||||
!===============================================================================
|
||||
|
||||
pure function capacity_real(this) result(capacity)
|
||||
class(VectorReal), intent(in) :: this
|
||||
integer :: capacity
|
||||
|
||||
capacity = this%capacity_
|
||||
end function capacity_real
|
||||
|
||||
subroutine clear_real(this)
|
||||
class(VectorReal), intent(inout) :: this
|
||||
|
||||
! Since real is trivially destructible, we only need to set size to zero and
|
||||
! can leave capacity as is
|
||||
this%size_ = 0
|
||||
end subroutine clear_real
|
||||
|
||||
subroutine initialize_fill_real(this, n, val)
|
||||
class(VectorReal), intent(inout) :: this
|
||||
integer, intent(in) :: n
|
||||
real(8), optional, intent(in) :: val
|
||||
|
||||
real(8) :: val_
|
||||
|
||||
! If no value given, fill the vector with zeros
|
||||
if (present(val)) then
|
||||
val_ = val
|
||||
else
|
||||
val_ = 0
|
||||
end if
|
||||
|
||||
if (allocated(this%data)) deallocate(this%data)
|
||||
|
||||
allocate(this%data(n), SOURCE=val_)
|
||||
this%size_ = n
|
||||
this%capacity_ = n
|
||||
end subroutine initialize_fill_real
|
||||
|
||||
subroutine pop_back_real(this)
|
||||
class(VectorReal), intent(inout) :: this
|
||||
if (this%size_ > 0) this%size_ = this%size_ - 1
|
||||
end subroutine pop_back_real
|
||||
|
||||
subroutine push_back_real(this, val)
|
||||
class(VectorReal), intent(inout) :: this
|
||||
real(8), intent(in) :: val
|
||||
|
||||
integer :: capacity
|
||||
real(8), allocatable :: data(:)
|
||||
|
||||
if (this%capacity_ == this%size_) then
|
||||
! Create new data array that is GROWTH_FACTOR larger. Note that
|
||||
if (this%capacity_ == 0) then
|
||||
capacity = 8
|
||||
else
|
||||
capacity = int(GROWTH_FACTOR*this%capacity_)
|
||||
end if
|
||||
allocate(data(capacity))
|
||||
|
||||
! Copy existing elements
|
||||
if (this%size_ > 0) data(1:this%size_) = this%data
|
||||
|
||||
! Move allocation
|
||||
call move_alloc(FROM=data, TO=this%data)
|
||||
this%capacity_ = capacity
|
||||
end if
|
||||
|
||||
! Increase size of vector by one and set new element
|
||||
this%size_ = this%size_ + 1
|
||||
this%data(this%size_) = val
|
||||
end subroutine push_back_real
|
||||
|
||||
subroutine reserve_real(this, n)
|
||||
class(VectorReal), intent(inout) :: this
|
||||
integer, intent(in) :: n
|
||||
|
||||
real(8), allocatable :: data(:)
|
||||
|
||||
if (n > this%capacity_) then
|
||||
allocate(data(n))
|
||||
|
||||
! Copy existing elements
|
||||
if (this%size_ > 0) data(1:this%size_) = this%data(1:this%size_)
|
||||
|
||||
! Move allocation
|
||||
call move_alloc(FROM=data, TO=this%data)
|
||||
this%capacity_ = n
|
||||
end if
|
||||
end subroutine reserve_real
|
||||
|
||||
subroutine resize_real(this, n, val)
|
||||
class(VectorReal), intent(inout) :: this
|
||||
integer, intent(in) :: n
|
||||
real(8), intent(in), optional :: val
|
||||
|
||||
if (n < this%size_) then
|
||||
this%size_ = n
|
||||
elseif (n > this%size_) then
|
||||
! If requested size is greater than capacity, first reserve that many
|
||||
! elements
|
||||
if (n > this%capacity_) call this%reserve(n)
|
||||
|
||||
! Fill added elements with specified value and increase size
|
||||
if (present(val)) this%data(this%size_ + 1 : n) = val
|
||||
this%size_ = n
|
||||
end if
|
||||
|
||||
end subroutine resize_real
|
||||
|
||||
subroutine shrink_to_fit_real(this)
|
||||
class(VectorReal), intent(inout) :: this
|
||||
|
||||
real(8), allocatable :: data(:)
|
||||
|
||||
if (this%capacity_ > this%size_) then
|
||||
if (this%size_ > 0) then
|
||||
allocate(data(this%size_))
|
||||
data(:) = this%data(1:this%size_)
|
||||
call move_alloc(FROM=data, TO=this%data)
|
||||
this%capacity_ = this%size_
|
||||
else
|
||||
if (allocated(this%data)) deallocate(this%data)
|
||||
end if
|
||||
end if
|
||||
end subroutine shrink_to_fit_real
|
||||
|
||||
pure function size_real(this) result(size)
|
||||
class(VectorReal), intent(in) :: this
|
||||
integer :: size
|
||||
|
||||
size = this%size_
|
||||
end function size_real
|
||||
|
||||
end module stl_vector
|
||||
125
src/string.F90
125
src/string.F90
|
|
@ -1,8 +1,10 @@
|
|||
module string
|
||||
|
||||
use constants, only: MAX_WORDS, MAX_LINE_LEN, ERROR_INT, ERROR_REAL
|
||||
use constants, only: MAX_WORDS, MAX_LINE_LEN, ERROR_INT, ERROR_REAL, &
|
||||
OP_LEFT_PAREN, OP_RIGHT_PAREN, OP_COMPLEMENT, OP_INTERSECTION, OP_UNION
|
||||
use error, only: fatal_error, warning
|
||||
use global, only: master
|
||||
use stl_vector, only: VectorInt
|
||||
|
||||
implicit none
|
||||
|
||||
|
|
@ -63,63 +65,96 @@ contains
|
|||
end subroutine split_string
|
||||
|
||||
!===============================================================================
|
||||
! SPLIT_STRING_WL takes a string that includes logical expressions for a list of
|
||||
! bounding surfaces in a cell and splits it into separate words. The characters
|
||||
! (, ), :, and # count as separate words since they represent operators.
|
||||
!
|
||||
! Arguments:
|
||||
! string = input line
|
||||
! words = array of words
|
||||
! n = number of words
|
||||
! TOKENIZE takes a string that includes logical expressions for a list of
|
||||
! bounding surfaces in a cell and splits it into separate tokens. The characters
|
||||
! (, ), |, and ~ count as separate tokens since they represent operators.
|
||||
!===============================================================================
|
||||
|
||||
subroutine split_string_wl(string, words, n)
|
||||
subroutine tokenize(string, tokens)
|
||||
character(*), intent(in) :: string
|
||||
type(VectorInt), intent(inout) :: tokens
|
||||
|
||||
character(*), intent(in) :: string
|
||||
character(*), intent(out) :: words(MAX_WORDS)
|
||||
integer, intent(out) :: n
|
||||
integer :: i ! current index
|
||||
integer :: i_start ! starting index of word
|
||||
integer :: token
|
||||
character(len=len_trim(string)) :: string_
|
||||
|
||||
character(1) :: chr ! current character
|
||||
integer :: i ! current index
|
||||
integer :: i_start ! starting index of word
|
||||
integer :: i_end ! ending index of word
|
||||
! Remove leading blanks
|
||||
string_ = adjustl(string)
|
||||
|
||||
i_start = 0
|
||||
i_end = 0
|
||||
n = 0
|
||||
do i = 1, len_trim(string)
|
||||
chr = string(i:i)
|
||||
|
||||
i = 1
|
||||
do while (i <= len_trim(string_))
|
||||
! Check for special characters
|
||||
if (index('():#', chr) > 0) then
|
||||
if (index('()|~ ', string_(i:i)) > 0) then
|
||||
! If the special character appears immediately after a non-operator,
|
||||
! create a token with the surface half-space
|
||||
if (i_start > 0) then
|
||||
i_end = i - 1
|
||||
n = n + 1
|
||||
words(n) = string(i_start:i_end)
|
||||
call tokens%push_back(int(str_to_int(&
|
||||
string_(i_start:i - 1)), 4))
|
||||
end if
|
||||
n = n + 1
|
||||
words(n) = chr
|
||||
|
||||
select case (string_(i:i))
|
||||
case ('(')
|
||||
call tokens%push_back(OP_LEFT_PAREN)
|
||||
case (')')
|
||||
if (tokens%size() > 0) then
|
||||
token = tokens%data(tokens%size())
|
||||
if (token >= OP_UNION .and. token < OP_RIGHT_PAREN) then
|
||||
call fatal_error("Right parentheses cannot follow an operator in &
|
||||
®ion specification: " // trim(string))
|
||||
end if
|
||||
end if
|
||||
call tokens%push_back(OP_RIGHT_PAREN)
|
||||
case ('|')
|
||||
if (tokens%size() > 0) then
|
||||
token = tokens%data(tokens%size())
|
||||
if (.not. (token < OP_UNION .or. token == OP_RIGHT_PAREN)) then
|
||||
call fatal_error("Union cannot follow an operator in region &
|
||||
&specification: " // trim(string))
|
||||
end if
|
||||
end if
|
||||
call tokens%push_back(OP_UNION)
|
||||
case ('~')
|
||||
call tokens%push_back(OP_COMPLEMENT)
|
||||
case (' ')
|
||||
! Find next non-space character
|
||||
do while (string_(i+1:i+1) == ' ')
|
||||
i = i + 1
|
||||
end do
|
||||
|
||||
! If previous token is a halfspace or right parenthesis and next token
|
||||
! is not a left parenthese or union operator, that implies that the
|
||||
! whitespace is to be interpreted as an intersection operator
|
||||
if (i_start > 0 .or. tokens%data(tokens%size()) == OP_RIGHT_PAREN) then
|
||||
if (index(')|', string_(i+1:i+1)) == 0) then
|
||||
call tokens%push_back(OP_INTERSECTION)
|
||||
end if
|
||||
end if
|
||||
end select
|
||||
|
||||
i_start = 0
|
||||
i_end = 0
|
||||
cycle
|
||||
else
|
||||
! Check for invalid characters
|
||||
if (index('-0123456789', string_(i:i)) == 0) then
|
||||
call fatal_error("Invalid character '" // string_(i:i) // "' in &
|
||||
®ion specification.")
|
||||
end if
|
||||
|
||||
! If we haven't yet reached the start of a word, start a new word
|
||||
if (i_start == 0) i_start = i
|
||||
end if
|
||||
|
||||
if ((i_start == 0) .and. (chr /= ' ')) then
|
||||
i_start = i
|
||||
end if
|
||||
if (i_start > 0) then
|
||||
if (chr == ' ') i_end = i - 1
|
||||
if (i == len_trim(string)) i_end = i
|
||||
if (i_end > 0) then
|
||||
n = n + 1
|
||||
words(n) = string(i_start:i_end)
|
||||
! reset indices
|
||||
i_start = 0
|
||||
i_end = 0
|
||||
end if
|
||||
end if
|
||||
i = i + 1
|
||||
end do
|
||||
end subroutine split_string_wl
|
||||
|
||||
! If we've reached the end and we're still in a word, create a token from it
|
||||
! and add it to the list
|
||||
if (i_start > 0) then
|
||||
call tokens%push_back(int(str_to_int(&
|
||||
string_(i_start:len_trim(string_))), 4))
|
||||
end if
|
||||
end subroutine tokenize
|
||||
|
||||
!===============================================================================
|
||||
! CONCATENATE takes an array of words and concatenates them together in one
|
||||
|
|
|
|||
131
src/summary.F90
131
src/summary.F90
|
|
@ -3,13 +3,14 @@ module summary
|
|||
use ace_header, only: Reaction, UrrData, Nuclide
|
||||
use constants
|
||||
use endf, only: reaction_name
|
||||
use geometry_header, only: Cell, Surface, Universe, Lattice, RectLattice, &
|
||||
use geometry_header, only: Cell, Universe, Lattice, RectLattice, &
|
||||
&HexLattice
|
||||
use global
|
||||
use hdf5_interface
|
||||
use material_header, only: Material
|
||||
use mesh_header, only: RegularMesh
|
||||
use output, only: time_stamp
|
||||
use surface_header
|
||||
use string, only: to_str
|
||||
use tally_header, only: TallyObject
|
||||
|
||||
|
|
@ -106,14 +107,15 @@ contains
|
|||
|
||||
integer :: i, j, k, m
|
||||
integer, allocatable :: lattice_universes(:,:,:)
|
||||
integer, allocatable :: surface_ids(:)
|
||||
integer(HID_T) :: geom_group
|
||||
integer(HID_T) :: cells_group, cell_group
|
||||
integer(HID_T) :: surfaces_group, surface_group
|
||||
integer(HID_T) :: universes_group, univ_group
|
||||
integer(HID_T) :: lattices_group, lattice_group
|
||||
real(8), allocatable :: coeffs(:)
|
||||
character(MAX_LINE_LEN) :: region_spec
|
||||
type(Cell), pointer :: c
|
||||
type(Surface), pointer :: s
|
||||
class(Surface), pointer :: s
|
||||
type(Universe), pointer :: u
|
||||
class(Lattice), pointer :: lat
|
||||
|
||||
|
|
@ -174,15 +176,25 @@ contains
|
|||
end select
|
||||
|
||||
! Write list of bounding surfaces
|
||||
if (c%n_surfaces > 0) then
|
||||
allocate(surface_ids(c%n_surfaces))
|
||||
do j = 1, c%n_surfaces
|
||||
k = c%surfaces(j)
|
||||
surface_ids(j) = sign(surfaces(abs(k))%id, k)
|
||||
end do
|
||||
call write_dataset(cell_group, "surfaces", surface_ids)
|
||||
deallocate(surface_ids)
|
||||
end if
|
||||
region_spec = ""
|
||||
do j = 1, size(c%region)
|
||||
k = c%region(j)
|
||||
select case(k)
|
||||
case (OP_LEFT_PAREN)
|
||||
region_spec = trim(region_spec) // " ("
|
||||
case (OP_RIGHT_PAREN)
|
||||
region_spec = trim(region_spec) // " )"
|
||||
case (OP_COMPLEMENT)
|
||||
region_spec = trim(region_spec) // " ~"
|
||||
case (OP_INTERSECTION)
|
||||
case (OP_UNION)
|
||||
region_spec = trim(region_spec) // " |"
|
||||
case default
|
||||
region_spec = trim(region_spec) // " " // to_str(&
|
||||
sign(surfaces(abs(k))%obj%id, k))
|
||||
end select
|
||||
end do
|
||||
call write_dataset(cell_group, "region", adjustl(region_spec))
|
||||
|
||||
call close_group(cell_group)
|
||||
end do CELL_LOOP
|
||||
|
|
@ -197,7 +209,7 @@ contains
|
|||
|
||||
! Write information on each surface
|
||||
SURFACE_LOOP: do i = 1, n_surfaces
|
||||
s => surfaces(i)
|
||||
s => surfaces(i)%obj
|
||||
surface_group = create_group(surfaces_group, "surface " // &
|
||||
trim(to_str(s%id)))
|
||||
|
||||
|
|
@ -208,33 +220,65 @@ contains
|
|||
call write_dataset(surface_group, "name", s%name)
|
||||
|
||||
! Write surface type
|
||||
select case (s%type)
|
||||
case (SURF_PX)
|
||||
select type (s)
|
||||
type is (SurfaceXPlane)
|
||||
call write_dataset(surface_group, "type", "x-plane")
|
||||
case (SURF_PY)
|
||||
call write_dataset(surface_group, "type", "y-plane")
|
||||
case (SURF_PZ)
|
||||
call write_dataset(surface_group, "type", "z-plane")
|
||||
case (SURF_PLANE)
|
||||
call write_dataset(surface_group, "type", "plane")
|
||||
case (SURF_CYL_X)
|
||||
call write_dataset(surface_group, "type", "x-cylinder")
|
||||
case (SURF_CYL_Y)
|
||||
call write_dataset(surface_group, "type", "y-cylinder")
|
||||
case (SURF_CYL_Z)
|
||||
call write_dataset(surface_group, "type", "z-cylinder")
|
||||
case (SURF_SPHERE)
|
||||
call write_dataset(surface_group, "type", "sphere")
|
||||
case (SURF_CONE_X)
|
||||
call write_dataset(surface_group, "type", "x-cone")
|
||||
case (SURF_CONE_Y)
|
||||
call write_dataset(surface_group, "type", "y-cone")
|
||||
case (SURF_CONE_Z)
|
||||
call write_dataset(surface_group, "type", "z-cone")
|
||||
end select
|
||||
allocate(coeffs(1))
|
||||
coeffs(1) = s%x0
|
||||
|
||||
! Write coefficients for surface
|
||||
call write_dataset(surface_group, "coefficients", s%coeffs)
|
||||
type is (SurfaceYPlane)
|
||||
call write_dataset(surface_group, "type", "y-plane")
|
||||
allocate(coeffs(1))
|
||||
coeffs(1) = s%y0
|
||||
|
||||
type is (SurfaceZPlane)
|
||||
call write_dataset(surface_group, "type", "z-plane")
|
||||
allocate(coeffs(1))
|
||||
coeffs(1) = s%z0
|
||||
|
||||
type is (SurfacePlane)
|
||||
call write_dataset(surface_group, "type", "plane")
|
||||
allocate(coeffs(4))
|
||||
coeffs(:) = [s%A, s%B, s%C, s%D]
|
||||
|
||||
type is (SurfaceXCylinder)
|
||||
call write_dataset(surface_group, "type", "x-cylinder")
|
||||
allocate(coeffs(3))
|
||||
coeffs(:) = [s%y0, s%z0, s%r]
|
||||
|
||||
type is (SurfaceYCylinder)
|
||||
call write_dataset(surface_group, "type", "y-cylinder")
|
||||
allocate(coeffs(3))
|
||||
coeffs(:) = [s%x0, s%z0, s%r]
|
||||
|
||||
type is (SurfaceZCylinder)
|
||||
call write_dataset(surface_group, "type", "z-cylinder")
|
||||
allocate(coeffs(3))
|
||||
coeffs(:) = [s%x0, s%y0, s%r]
|
||||
|
||||
type is (SurfaceSphere)
|
||||
call write_dataset(surface_group, "type", "sphere")
|
||||
allocate(coeffs(4))
|
||||
coeffs(:) = [s%x0, s%y0, s%z0, s%r]
|
||||
|
||||
type is (SurfaceXCone)
|
||||
call write_dataset(surface_group, "type", "x-cone")
|
||||
allocate(coeffs(4))
|
||||
coeffs(:) = [s%x0, s%y0, s%z0, s%r2]
|
||||
|
||||
type is (SurfaceYCone)
|
||||
call write_dataset(surface_group, "type", "y-cone")
|
||||
allocate(coeffs(4))
|
||||
coeffs(:) = [s%x0, s%y0, s%z0, s%r2]
|
||||
|
||||
type is (SurfaceZCone)
|
||||
call write_dataset(surface_group, "type", "z-cone")
|
||||
allocate(coeffs(4))
|
||||
coeffs(:) = [s%x0, s%y0, s%z0, s%r2]
|
||||
|
||||
end select
|
||||
call write_dataset(surface_group, "coefficients", coeffs)
|
||||
deallocate(coeffs)
|
||||
|
||||
! Write boundary condition
|
||||
select case (s%bc)
|
||||
|
|
@ -496,7 +540,10 @@ contains
|
|||
|
||||
! Write filter bins
|
||||
if (t%filters(j)%type == FILTER_ENERGYIN .or. &
|
||||
t%filters(j)%type == FILTER_ENERGYOUT) then
|
||||
t%filters(j)%type == FILTER_ENERGYOUT .or. &
|
||||
t%filters(j)%type == FILTER_MU .or. &
|
||||
t%filters(j)%type == FILTER_POLAR .or. &
|
||||
t%filters(j)%type == FILTER_AZIMUTHAL) then
|
||||
call write_dataset(filter_group, "bins", t%filters(j)%real_bins)
|
||||
else
|
||||
call write_dataset(filter_group, "bins", t%filters(j)%int_bins)
|
||||
|
|
@ -522,6 +569,12 @@ contains
|
|||
call write_dataset(filter_group, "type", "energyout")
|
||||
case(FILTER_DISTRIBCELL)
|
||||
call write_dataset(filter_group, "type", "distribcell")
|
||||
case(FILTER_MU)
|
||||
call write_dataset(filter_group, "type", "mu")
|
||||
case(FILTER_POLAR)
|
||||
call write_dataset(filter_group, "type", "polar")
|
||||
case(FILTER_AZIMUTHAL)
|
||||
call write_dataset(filter_group, "type", "azimuthal")
|
||||
end select
|
||||
|
||||
call close_group(filter_group)
|
||||
|
|
|
|||
956
src/surface_header.F90
Normal file
956
src/surface_header.F90
Normal file
|
|
@ -0,0 +1,956 @@
|
|||
module surface_header
|
||||
|
||||
use constants, only: ONE, TWO, ZERO, INFINITY, FP_COINCIDENT
|
||||
|
||||
implicit none
|
||||
|
||||
!===============================================================================
|
||||
! SURFACE type defines a first- or second-order surface that can be used to
|
||||
! construct closed volumes (cells)
|
||||
!===============================================================================
|
||||
|
||||
type, abstract :: Surface
|
||||
integer :: id ! Unique ID
|
||||
integer, allocatable :: &
|
||||
neighbor_pos(:), & ! List of cells on positive side
|
||||
neighbor_neg(:) ! List of cells on negative side
|
||||
integer :: bc ! Boundary condition
|
||||
character(len=52) :: name = "" ! User-defined name
|
||||
contains
|
||||
procedure :: sense
|
||||
procedure :: reflect
|
||||
procedure(iEvaluate), deferred :: evaluate
|
||||
procedure(iDistance), deferred :: distance
|
||||
procedure(iNormal), deferred :: normal
|
||||
end type Surface
|
||||
|
||||
abstract interface
|
||||
pure function iEvaluate(this, xyz) result(f)
|
||||
import Surface
|
||||
class(Surface), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
end function iEvaluate
|
||||
|
||||
pure function iDistance(this, xyz, uvw, coincident) result(d)
|
||||
import Surface
|
||||
class(Surface), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
end function iDistance
|
||||
|
||||
pure function iNormal(this, xyz) result(uvw)
|
||||
import Surface
|
||||
class(Surface), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
end function iNormal
|
||||
end interface
|
||||
|
||||
!===============================================================================
|
||||
! SURFACECONTAINER allows us to store an array of different types of surfaces
|
||||
!===============================================================================
|
||||
|
||||
type :: SurfaceContainer
|
||||
class(Surface), allocatable :: obj
|
||||
end type SurfaceContainer
|
||||
|
||||
!===============================================================================
|
||||
! All the derived types below are extensions of the abstract Surface type. They
|
||||
! inherent the reflect() and sense() type-bound procedures and must implement
|
||||
! evaluate(), distance(), and normal()
|
||||
!===============================================================================
|
||||
|
||||
type, extends(Surface) :: SurfaceXPlane
|
||||
! x = x0
|
||||
real(8) :: x0
|
||||
contains
|
||||
procedure :: evaluate => x_plane_evaluate
|
||||
procedure :: distance => x_plane_distance
|
||||
procedure :: normal => x_plane_normal
|
||||
end type SurfaceXPlane
|
||||
|
||||
type, extends(Surface) :: SurfaceYPlane
|
||||
! y = y0
|
||||
real(8) :: y0
|
||||
contains
|
||||
procedure :: evaluate => y_plane_evaluate
|
||||
procedure :: distance => y_plane_distance
|
||||
procedure :: normal => y_plane_normal
|
||||
end type SurfaceYPlane
|
||||
|
||||
type, extends(Surface) :: SurfaceZPlane
|
||||
! z = z0
|
||||
real(8) :: z0
|
||||
contains
|
||||
procedure :: evaluate => z_plane_evaluate
|
||||
procedure :: distance => z_plane_distance
|
||||
procedure :: normal => z_plane_normal
|
||||
end type SurfaceZPlane
|
||||
|
||||
type, extends(Surface) :: SurfacePlane
|
||||
! Ax + By + Cz = D
|
||||
real(8) :: A
|
||||
real(8) :: B
|
||||
real(8) :: C
|
||||
real(8) :: D
|
||||
contains
|
||||
procedure :: evaluate => plane_evaluate
|
||||
procedure :: distance => plane_distance
|
||||
procedure :: normal => plane_normal
|
||||
end type SurfacePlane
|
||||
|
||||
type, extends(Surface) :: SurfaceXCylinder
|
||||
! (y - y0)^2 + (z - z0)^2 = R^2
|
||||
real(8) :: y0
|
||||
real(8) :: z0
|
||||
real(8) :: r
|
||||
contains
|
||||
procedure :: evaluate => x_cylinder_evaluate
|
||||
procedure :: distance => x_cylinder_distance
|
||||
procedure :: normal => x_cylinder_normal
|
||||
end type SurfaceXCylinder
|
||||
|
||||
type, extends(Surface) :: SurfaceYCylinder
|
||||
! (x - x0)^2 + (z - z0)^2 = R^2
|
||||
real(8) :: x0
|
||||
real(8) :: z0
|
||||
real(8) :: r
|
||||
contains
|
||||
procedure :: evaluate => y_cylinder_evaluate
|
||||
procedure :: distance => y_cylinder_distance
|
||||
procedure :: normal => y_cylinder_normal
|
||||
end type SurfaceYCylinder
|
||||
|
||||
type, extends(Surface) :: SurfaceZCylinder
|
||||
! (x - x0)^2 + (y - y0)^2 = R^2
|
||||
real(8) :: x0
|
||||
real(8) :: y0
|
||||
real(8) :: r
|
||||
contains
|
||||
procedure :: evaluate => z_cylinder_evaluate
|
||||
procedure :: distance => z_cylinder_distance
|
||||
procedure :: normal => z_cylinder_normal
|
||||
end type SurfaceZCylinder
|
||||
|
||||
type, extends(Surface) :: SurfaceSphere
|
||||
! (x - x0)^2 + (y - y0)^2 + (z - z0)^2 = R^2
|
||||
real(8) :: x0
|
||||
real(8) :: y0
|
||||
real(8) :: z0
|
||||
real(8) :: r
|
||||
contains
|
||||
procedure :: evaluate => sphere_evaluate
|
||||
procedure :: distance => sphere_distance
|
||||
procedure :: normal => sphere_normal
|
||||
end type SurfaceSphere
|
||||
|
||||
type, extends(Surface) :: SurfaceXCone
|
||||
! (y - y0)^2 + (z - z0)^2 = R^2*(x - x0)^2
|
||||
real(8) :: x0
|
||||
real(8) :: y0
|
||||
real(8) :: z0
|
||||
real(8) :: r2
|
||||
contains
|
||||
procedure :: evaluate => x_cone_evaluate
|
||||
procedure :: distance => x_cone_distance
|
||||
procedure :: normal => x_cone_normal
|
||||
end type SurfaceXCone
|
||||
|
||||
type, extends(Surface) :: SurfaceYCone
|
||||
! (x - x0)^2 + (z - z0)^2 = R^2*(y - y0)^2
|
||||
real(8) :: x0
|
||||
real(8) :: y0
|
||||
real(8) :: z0
|
||||
real(8) :: r2
|
||||
contains
|
||||
procedure :: evaluate => y_cone_evaluate
|
||||
procedure :: distance => y_cone_distance
|
||||
procedure :: normal => y_cone_normal
|
||||
end type SurfaceYCone
|
||||
|
||||
type, extends(Surface) :: SurfaceZCone
|
||||
! (x - x0)^2 + (y - y0)^2 = R^2*(z - z0)^2
|
||||
real(8) :: x0
|
||||
real(8) :: y0
|
||||
real(8) :: z0
|
||||
real(8) :: r2
|
||||
contains
|
||||
procedure :: evaluate => z_cone_evaluate
|
||||
procedure :: distance => z_cone_distance
|
||||
procedure :: normal => z_cone_normal
|
||||
end type SurfaceZCone
|
||||
|
||||
contains
|
||||
|
||||
!===============================================================================
|
||||
! SENSE determines whether a point is on the 'positive' or 'negative' side of a
|
||||
! surface. This routine is crucial for determining what cell a particular point
|
||||
! is in. The positive side is indicated by a returned value of .true. and the
|
||||
! negative side is indicated by a returned value of .false.
|
||||
!===============================================================================
|
||||
|
||||
pure function sense(this, xyz, uvw) result(s)
|
||||
class(Surface), intent(in) :: this ! surface
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical :: s ! sense of particle
|
||||
|
||||
real(8) :: f ! surface function evaluated at point
|
||||
|
||||
! Evaluate the surface equation at the particle's coordinates to determine
|
||||
! which side the particle is on
|
||||
f = this%evaluate(xyz)
|
||||
|
||||
! Check which side of surface the point is on
|
||||
if (abs(f) < FP_COINCIDENT) then
|
||||
! Particle may be coincident with this surface. To determine the sense, we
|
||||
! look at the direction of the particle relative to the surface normal (by
|
||||
! default in the positive direction) via their dot product.
|
||||
s = (dot_product(uvw, this%normal(xyz)) > ZERO)
|
||||
else
|
||||
s = (f > ZERO)
|
||||
end if
|
||||
end function sense
|
||||
|
||||
!===============================================================================
|
||||
! REFLECT determines the direction a particle will travel if it is specularly
|
||||
! reflected from the surface at a given position and direction. The position is
|
||||
! needed because the reflection is performed using the surface normal, which
|
||||
! depends on the position for second-order surfaces.
|
||||
!===============================================================================
|
||||
|
||||
pure subroutine reflect(this, xyz, uvw)
|
||||
class(Surface), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(inout) :: uvw(3)
|
||||
|
||||
real(8) :: projection
|
||||
real(8) :: magnitude
|
||||
real(8) :: n(3)
|
||||
|
||||
! Construct normal vector
|
||||
n(:) = this%normal(xyz)
|
||||
|
||||
! Determine projection of direction onto normal and squared magnitude of
|
||||
! normal
|
||||
projection = n(1)*uvw(1) + n(2)*uvw(2) + n(3)*uvw(3)
|
||||
magnitude = n(1)*n(1) + n(2)*n(2) + n(3)*n(3)
|
||||
|
||||
! Reflect direction according to normal
|
||||
uvw(:) = uvw - TWO*projection/magnitude * n
|
||||
end subroutine reflect
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceXPlane Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function x_plane_evaluate(this, xyz) result(f)
|
||||
class(SurfaceXPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
f = xyz(1) - this%x0
|
||||
end function x_plane_evaluate
|
||||
|
||||
pure function x_plane_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceXPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: f
|
||||
|
||||
f = this%x0 - xyz(1)
|
||||
if (coincident .or. abs(f) < FP_COINCIDENT .or. uvw(1) == ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
d = f/uvw(1)
|
||||
if (d < ZERO) d = INFINITY
|
||||
end if
|
||||
end function x_plane_distance
|
||||
|
||||
pure function x_plane_normal(this, xyz) result(uvw)
|
||||
class(SurfaceXPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(:) = [ONE, ZERO, ZERO]
|
||||
end function x_plane_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceYPlane Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function y_plane_evaluate(this, xyz) result(f)
|
||||
class(SurfaceYPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
f = xyz(2) - this%y0
|
||||
end function y_plane_evaluate
|
||||
|
||||
pure function y_plane_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceYPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: f
|
||||
|
||||
f = this%y0 - xyz(2)
|
||||
if (coincident .or. abs(f) < FP_COINCIDENT .or. uvw(2) == ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
d = f/uvw(2)
|
||||
if (d < ZERO) d = INFINITY
|
||||
end if
|
||||
end function y_plane_distance
|
||||
|
||||
pure function y_plane_normal(this, xyz) result(uvw)
|
||||
class(SurfaceYPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(:) = [ZERO, ONE, ZERO]
|
||||
end function y_plane_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceZPlane Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function z_plane_evaluate(this, xyz) result(f)
|
||||
|
||||
class(SurfaceZPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
f = xyz(3) - this%z0
|
||||
|
||||
end function z_plane_evaluate
|
||||
|
||||
pure function z_plane_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceZPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: f
|
||||
|
||||
f = this%z0 - xyz(3)
|
||||
if (coincident .or. abs(f) < FP_COINCIDENT .or. uvw(3) == ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
d = f/uvw(3)
|
||||
if (d < ZERO) d = INFINITY
|
||||
end if
|
||||
end function z_plane_distance
|
||||
|
||||
pure function z_plane_normal(this, xyz) result(uvw)
|
||||
class(SurfaceZPlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(:) = [ZERO, ZERO, ONE]
|
||||
end function z_plane_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfacePlane Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function plane_evaluate(this, xyz) result(f)
|
||||
class(SurfacePlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
f = this%A*xyz(1) + this%B*xyz(2) + this%C*xyz(3) - this%D
|
||||
end function plane_evaluate
|
||||
|
||||
pure function plane_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfacePlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: f
|
||||
real(8) :: projection
|
||||
|
||||
f = this%A*xyz(1) + this%B*xyz(2) + this%C*xyz(3) - this%D
|
||||
projection = this%A*uvw(1) + this%B*uvw(2) + this%C*uvw(3)
|
||||
if (coincident .or. abs(f) < FP_COINCIDENT .or. projection == ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
d = -f/projection
|
||||
if (d < ZERO) d = INFINITY
|
||||
end if
|
||||
end function plane_distance
|
||||
|
||||
pure function plane_normal(this, xyz) result(uvw)
|
||||
class(SurfacePlane), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(:) = [this%A, this%B, this%C]
|
||||
end function plane_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceXCylinder Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function x_cylinder_evaluate(this, xyz) result(f)
|
||||
class(SurfaceXCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
real(8) :: y, z
|
||||
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
f = y*y + z*z - this%r*this%r
|
||||
end function x_cylinder_evaluate
|
||||
|
||||
pure function x_cylinder_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceXCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: y, z, k, a, c, quad
|
||||
|
||||
a = ONE - uvw(1)*uvw(1) ! v^2 + w^2
|
||||
if (a == ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
k = y*uvw(2) + z*uvw(3)
|
||||
c = y*y + z*z - this%r*this%r
|
||||
quad = k*k - a*c
|
||||
|
||||
if (quad < ZERO) then
|
||||
! no intersection with cylinder
|
||||
|
||||
d = INFINITY
|
||||
|
||||
elseif (coincident .or. abs(c) < FP_COINCIDENT) then
|
||||
! particle is on the cylinder, thus one distance is positive/negative
|
||||
! and the other is zero. The sign of k determines if we are facing in or
|
||||
! out
|
||||
|
||||
if (k >= ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
d = (-k + sqrt(quad))/a
|
||||
end if
|
||||
|
||||
elseif (c < ZERO) then
|
||||
! particle is inside the cylinder, thus one distance must be negative
|
||||
! and one must be positive. The positive distance will be the one with
|
||||
! negative sign on sqrt(quad)
|
||||
|
||||
d = (-k + sqrt(quad))/a
|
||||
|
||||
else
|
||||
! particle is outside the cylinder, thus both distances are either
|
||||
! positive or negative. If positive, the smaller distance is the one
|
||||
! with positive sign on sqrt(quad)
|
||||
|
||||
d = (-k - sqrt(quad))/a
|
||||
if (d < ZERO) d = INFINITY
|
||||
|
||||
end if
|
||||
end if
|
||||
end function x_cylinder_distance
|
||||
|
||||
pure function x_cylinder_normal(this, xyz) result(uvw)
|
||||
class(SurfaceXCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(1) = ZERO
|
||||
uvw(2) = TWO*(xyz(2) - this%y0)
|
||||
uvw(3) = TWO*(xyz(3) - this%z0)
|
||||
end function x_cylinder_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceYCylinder Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function y_cylinder_evaluate(this, xyz) result(f)
|
||||
class(SurfaceYCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
real(8) :: x, z
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
z = xyz(3) - this%z0
|
||||
f = x*x + z*z - this%r*this%r
|
||||
end function y_cylinder_evaluate
|
||||
|
||||
pure function y_cylinder_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceYCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: x, z, k, a, c, quad
|
||||
|
||||
a = ONE - uvw(2)*uvw(2) ! u^2 + w^2
|
||||
if (a == ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
x = xyz(1) - this%x0
|
||||
z = xyz(3) - this%z0
|
||||
k = x*uvw(1) + z*uvw(3)
|
||||
c = x*x + z*z - this%r*this%r
|
||||
quad = k*k - a*c
|
||||
|
||||
if (quad < ZERO) then
|
||||
! no intersection with cylinder
|
||||
|
||||
d = INFINITY
|
||||
|
||||
elseif (coincident .or. abs(c) < FP_COINCIDENT) then
|
||||
! particle is on the cylinder, thus one distance is positive/negative
|
||||
! and the other is zero. The sign of k determines if we are facing in or
|
||||
! out
|
||||
|
||||
if (k >= ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
d = (-k + sqrt(quad))/a
|
||||
end if
|
||||
|
||||
elseif (c < ZERO) then
|
||||
! particle is inside the cylinder, thus one distance must be negative
|
||||
! and one must be positive. The positive distance will be the one with
|
||||
! negative sign on sqrt(quad)
|
||||
|
||||
d = (-k + sqrt(quad))/a
|
||||
|
||||
else
|
||||
! particle is outside the cylinder, thus both distances are either
|
||||
! positive or negative. If positive, the smaller distance is the one
|
||||
! with positive sign on sqrt(quad)
|
||||
|
||||
d = (-k - sqrt(quad))/a
|
||||
if (d < ZERO) d = INFINITY
|
||||
|
||||
end if
|
||||
end if
|
||||
end function y_cylinder_distance
|
||||
|
||||
pure function y_cylinder_normal(this, xyz) result(uvw)
|
||||
class(SurfaceYCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(1) = TWO*(xyz(1) - this%x0)
|
||||
uvw(2) = ZERO
|
||||
uvw(3) = TWO*(xyz(3) - this%z0)
|
||||
end function y_cylinder_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceZCylinder Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function z_cylinder_evaluate(this, xyz) result(f)
|
||||
class(SurfaceZCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
real(8) :: x, y
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
f = x*x + y*y - this%r*this%r
|
||||
end function z_cylinder_evaluate
|
||||
|
||||
pure function z_cylinder_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceZCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: x, y, k, a, c, quad
|
||||
|
||||
a = ONE - uvw(3)*uvw(3) ! u^2 + v^2
|
||||
if (a == ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
k = x*uvw(1) + y*uvw(2)
|
||||
c = x*x + y*y - this%r*this%r
|
||||
quad = k*k - a*c
|
||||
|
||||
if (quad < ZERO) then
|
||||
! no intersection with cylinder
|
||||
|
||||
d = INFINITY
|
||||
|
||||
elseif (coincident .or. abs(c) < FP_COINCIDENT) then
|
||||
! particle is on the cylinder, thus one distance is positive/negative
|
||||
! and the other is zero. The sign of k determines if we are facing in or
|
||||
! out
|
||||
|
||||
if (k >= ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
d = (-k + sqrt(quad))/a
|
||||
end if
|
||||
|
||||
elseif (c < ZERO) then
|
||||
! particle is inside the cylinder, thus one distance must be negative
|
||||
! and one must be positive. The positive distance will be the one with
|
||||
! negative sign on sqrt(quad)
|
||||
|
||||
d = (-k + sqrt(quad))/a
|
||||
|
||||
else
|
||||
! particle is outside the cylinder, thus both distances are either
|
||||
! positive or negative. If positive, the smaller distance is the one
|
||||
! with positive sign on sqrt(quad)
|
||||
|
||||
d = (-k - sqrt(quad))/a
|
||||
if (d < ZERO) d = INFINITY
|
||||
|
||||
end if
|
||||
end if
|
||||
end function z_cylinder_distance
|
||||
|
||||
pure function z_cylinder_normal(this, xyz) result(uvw)
|
||||
class(SurfaceZCylinder), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(1) = TWO*(xyz(1) - this%x0)
|
||||
uvw(2) = TWO*(xyz(2) - this%y0)
|
||||
uvw(3) = ZERO
|
||||
end function z_cylinder_normal
|
||||
|
||||
!===============================================================================
|
||||
! SphereImplementation
|
||||
!===============================================================================
|
||||
|
||||
pure function sphere_evaluate(this, xyz) result(f)
|
||||
class(SurfaceSphere), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
real(8) :: x, y, z
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
f = x*x + y*y + z*z - this%r*this%r
|
||||
end function sphere_evaluate
|
||||
|
||||
pure function sphere_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceSphere), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: x, y, z, k, c, quad
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
k = x*uvw(1) + y*uvw(2) + z*uvw(3)
|
||||
c = x*x + y*y + z*z - this%r*this%r
|
||||
quad = k*k - c
|
||||
|
||||
if (quad < ZERO) then
|
||||
! no intersection with sphere
|
||||
|
||||
d = INFINITY
|
||||
|
||||
elseif (coincident .or. abs(c) < FP_COINCIDENT) then
|
||||
! particle is on the sphere, thus one distance is positive/negative and
|
||||
! the other is zero. The sign of k determines if we are facing in or out
|
||||
|
||||
if (k >= ZERO) then
|
||||
d = INFINITY
|
||||
else
|
||||
d = -k + sqrt(quad)
|
||||
end if
|
||||
|
||||
elseif (c < ZERO) then
|
||||
! particle is inside the sphere, thus one distance must be negative and
|
||||
! one must be positive. The positive distance will be the one with
|
||||
! negative sign on sqrt(quad)
|
||||
|
||||
d = -k + sqrt(quad)
|
||||
|
||||
else
|
||||
! particle is outside the sphere, thus both distances are either positive
|
||||
! or negative. If positive, the smaller distance is the one with positive
|
||||
! sign on sqrt(quad)
|
||||
|
||||
d = -k - sqrt(quad)
|
||||
if (d < ZERO) d = INFINITY
|
||||
|
||||
end if
|
||||
end function sphere_distance
|
||||
|
||||
pure function sphere_normal(this, xyz) result(uvw)
|
||||
class(SurfaceSphere), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(:) = TWO*(xyz - [this%x0, this%y0, this%z0])
|
||||
end function sphere_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceXCone Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function x_cone_evaluate(this, xyz) result(f)
|
||||
class(SurfaceXCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
real(8) :: x, y, z
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
f = y*y + z*z - this%r2*x*x
|
||||
end function x_cone_evaluate
|
||||
|
||||
pure function x_cone_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceXCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: x, y, z, k, a, b, c, quad
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
a = uvw(2)*uvw(2) + uvw(3)*uvw(3) - this%r2*uvw(1)*uvw(1)
|
||||
k = y*uvw(2) + z*uvw(3) - this%r2*x*uvw(1)
|
||||
c = y*y + z*z - this%r2*x*x
|
||||
quad = k*k - a*c
|
||||
|
||||
if (quad < ZERO) then
|
||||
! no intersection with cone
|
||||
|
||||
d = INFINITY
|
||||
|
||||
elseif (coincident .or. abs(c) < FP_COINCIDENT) then
|
||||
! particle is on the cone, thus one distance is positive/negative and the
|
||||
! other is zero. The sign of k determines which distance is zero and which
|
||||
! is not.
|
||||
|
||||
if (k >= ZERO) then
|
||||
d = (-k - sqrt(quad))/a
|
||||
else
|
||||
d = (-k + sqrt(quad))/a
|
||||
end if
|
||||
|
||||
else
|
||||
! calculate both solutions to the quadratic
|
||||
quad = sqrt(quad)
|
||||
d = (-k - quad)/a
|
||||
b = (-k + quad)/a
|
||||
|
||||
! determine the smallest positive solution
|
||||
if (d < ZERO) then
|
||||
if (b > ZERO) then
|
||||
d = b
|
||||
end if
|
||||
else
|
||||
if (b > ZERO) d = min(d, b)
|
||||
end if
|
||||
end if
|
||||
|
||||
! If the distance was negative, set boundary distance to infinity
|
||||
if (d <= ZERO) d = INFINITY
|
||||
end function x_cone_distance
|
||||
|
||||
pure function x_cone_normal(this, xyz) result(uvw)
|
||||
class(SurfaceXCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(1) = -TWO*this%r2*(xyz(1) - this%x0)
|
||||
uvw(2) = TWO*(xyz(2) - this%y0)
|
||||
uvw(3) = TWO*(xyz(3) - this%z0)
|
||||
end function x_cone_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceYCone Implementation
|
||||
!===============================================================================
|
||||
|
||||
pure function y_cone_evaluate(this, xyz) result(f)
|
||||
class(SurfaceYCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
real(8) :: x, y, z
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
f = x*x + z*z - this%r2*y*y
|
||||
end function y_cone_evaluate
|
||||
|
||||
pure function y_cone_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceYCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: x, y, z, k, a, b, c, quad
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
a = uvw(1)*uvw(1) + uvw(3)*uvw(3) - this%r2*uvw(2)*uvw(2)
|
||||
k = x*uvw(1) + z*uvw(3) - this%r2*y*uvw(2)
|
||||
c = x*x + z*z - this%r2*y*y
|
||||
quad = k*k - a*c
|
||||
|
||||
if (quad < ZERO) then
|
||||
! no intersection with cone
|
||||
|
||||
d = INFINITY
|
||||
|
||||
elseif (coincident .or. abs(c) < FP_COINCIDENT) then
|
||||
! particle is on the cone, thus one distance is positive/negative and the
|
||||
! other is zero. The sign of k determines which distance is zero and which
|
||||
! is not.
|
||||
|
||||
if (k >= ZERO) then
|
||||
d = (-k - sqrt(quad))/a
|
||||
else
|
||||
d = (-k + sqrt(quad))/a
|
||||
end if
|
||||
|
||||
else
|
||||
! calculate both solutions to the quadratic
|
||||
quad = sqrt(quad)
|
||||
d = (-k - quad)/a
|
||||
b = (-k + quad)/a
|
||||
|
||||
! determine the smallest positive solution
|
||||
if (d < ZERO) then
|
||||
if (b > ZERO) then
|
||||
d = b
|
||||
end if
|
||||
else
|
||||
if (b > ZERO) d = min(d, b)
|
||||
end if
|
||||
end if
|
||||
|
||||
! If the distance was negative, set boundary distance to infinity
|
||||
if (d <= ZERO) d = INFINITY
|
||||
end function y_cone_distance
|
||||
|
||||
pure function y_cone_normal(this, xyz) result(uvw)
|
||||
class(SurfaceYCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(1) = TWO*(xyz(1) - this%x0)
|
||||
uvw(2) = -TWO*this%r2*(xyz(2) - this%y0)
|
||||
uvw(3) = TWO*(xyz(3) - this%z0)
|
||||
end function y_cone_normal
|
||||
|
||||
!===============================================================================
|
||||
! SurfaceZConeImplementation
|
||||
!===============================================================================
|
||||
|
||||
pure function z_cone_evaluate(this, xyz) result(f)
|
||||
class(SurfaceZCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: f
|
||||
|
||||
real(8) :: x, y, z
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
f = x*x + y*y - this%r2*z*z
|
||||
end function z_cone_evaluate
|
||||
|
||||
pure function z_cone_distance(this, xyz, uvw, coincident) result(d)
|
||||
class(SurfaceZCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8), intent(in) :: uvw(3)
|
||||
logical, intent(in) :: coincident
|
||||
real(8) :: d
|
||||
|
||||
real(8) :: x, y, z, k, a, b, c, quad
|
||||
|
||||
x = xyz(1) - this%x0
|
||||
y = xyz(2) - this%y0
|
||||
z = xyz(3) - this%z0
|
||||
a = uvw(1)*uvw(1) + uvw(2)*uvw(2) - this%r2*uvw(3)*uvw(3)
|
||||
k = x*uvw(1) + y*uvw(2) - this%r2*z*uvw(3)
|
||||
c = x*x + y*y - this%r2*z*z
|
||||
quad = k*k - a*c
|
||||
|
||||
if (quad < ZERO) then
|
||||
! no intersection with cone
|
||||
|
||||
d = INFINITY
|
||||
|
||||
elseif (coincident .or. abs(c) < FP_COINCIDENT) then
|
||||
! particle is on the cone, thus one distance is positive/negative and the
|
||||
! other is zero. The sign of k determines which distance is zero and which
|
||||
! is not.
|
||||
|
||||
if (k >= ZERO) then
|
||||
d = (-k - sqrt(quad))/a
|
||||
else
|
||||
d = (-k + sqrt(quad))/a
|
||||
end if
|
||||
|
||||
else
|
||||
! calculate both solutions to the quadratic
|
||||
quad = sqrt(quad)
|
||||
d = (-k - quad)/a
|
||||
b = (-k + quad)/a
|
||||
|
||||
! determine the smallest positive solution
|
||||
if (d < ZERO) then
|
||||
if (b > ZERO) then
|
||||
d = b
|
||||
end if
|
||||
else
|
||||
if (b > ZERO) d = min(d, b)
|
||||
end if
|
||||
end if
|
||||
|
||||
! If the distance was negative, set boundary distance to infinity
|
||||
if (d <= ZERO) d = INFINITY
|
||||
end function z_cone_distance
|
||||
|
||||
pure function z_cone_normal(this, xyz) result(uvw)
|
||||
class(SurfaceZCone), intent(in) :: this
|
||||
real(8), intent(in) :: xyz(3)
|
||||
real(8) :: uvw(3)
|
||||
|
||||
uvw(1) = TWO*(xyz(1) - this%x0)
|
||||
uvw(2) = TWO*(xyz(2) - this%y0)
|
||||
uvw(3) = -TWO*this%r2*(xyz(3) - this%z0)
|
||||
end function z_cone_normal
|
||||
|
||||
end module surface_header
|
||||
|
|
@ -992,6 +992,8 @@ contains
|
|||
logical :: found_bin ! was a scoring bin found?
|
||||
logical :: start_in_mesh ! starting coordinates inside mesh?
|
||||
logical :: end_in_mesh ! ending coordinates inside mesh?
|
||||
real(8) :: theta
|
||||
real(8) :: phi
|
||||
type(TallyObject), pointer :: t
|
||||
type(RegularMesh), pointer :: m
|
||||
type(Material), pointer :: mat
|
||||
|
|
@ -1077,6 +1079,40 @@ contains
|
|||
k + 1, p % E)
|
||||
end if
|
||||
|
||||
case (FILTER_POLAR)
|
||||
! Get theta value
|
||||
theta = acos(p % coord(1) % uvw(3))
|
||||
|
||||
! determine polar angle bin
|
||||
k = t % filters(i) % n_bins
|
||||
|
||||
! check if particle is within polar angle bins
|
||||
if (theta < t % filters(i) % real_bins(1) .or. &
|
||||
theta > t % filters(i) % real_bins(k + 1)) then
|
||||
matching_bins(i) = NO_BIN_FOUND
|
||||
else
|
||||
! search to find polar angle bin
|
||||
matching_bins(i) = binary_search(t % filters(i) % real_bins, &
|
||||
k + 1, theta)
|
||||
end if
|
||||
|
||||
case (FILTER_AZIMUTHAL)
|
||||
! make sure the correct direction vector is used
|
||||
phi = atan2(p % coord(1) % uvw(2), p % coord(1) % uvw(1))
|
||||
|
||||
! determine mu bin
|
||||
k = t % filters(i) % n_bins
|
||||
|
||||
! check if particle is within azimuthal angle bins
|
||||
if (phi < t % filters(i) % real_bins(1) .or. &
|
||||
phi > t % filters(i) % real_bins(k + 1)) then
|
||||
matching_bins(i) = NO_BIN_FOUND
|
||||
else
|
||||
! search to find azimuthal angle bin
|
||||
matching_bins(i) = binary_search(t % filters(i) % real_bins, &
|
||||
k + 1, phi)
|
||||
end if
|
||||
|
||||
end select
|
||||
|
||||
! Check if no matching bin was found
|
||||
|
|
@ -1333,6 +1369,7 @@ contains
|
|||
integer :: n ! number of bins for single filter
|
||||
integer :: offset ! offset for distribcell
|
||||
real(8) :: E ! particle energy
|
||||
real(8) :: theta, phi ! Polar and Azimuthal Angles, respectively
|
||||
type(TallyObject), pointer :: t
|
||||
type(RegularMesh), pointer :: m
|
||||
|
||||
|
|
@ -1443,6 +1480,61 @@ contains
|
|||
n + 1, p % E)
|
||||
end if
|
||||
|
||||
case (FILTER_MU)
|
||||
! determine mu bin
|
||||
n = t % filters(i) % n_bins
|
||||
|
||||
! check if particle is within mu bins
|
||||
if (p % mu < t % filters(i) % real_bins(1) .or. &
|
||||
p % mu > t % filters(i) % real_bins(n + 1)) then
|
||||
matching_bins(i) = NO_BIN_FOUND
|
||||
else
|
||||
! search to find mu bin
|
||||
matching_bins(i) = binary_search(t % filters(i) % real_bins, &
|
||||
n + 1, p % mu)
|
||||
end if
|
||||
|
||||
case (FILTER_POLAR)
|
||||
! make sure the correct direction vector is used
|
||||
if (t % estimator == ESTIMATOR_TRACKLENGTH) then
|
||||
theta = acos(p % coord(1) % uvw(3))
|
||||
else
|
||||
theta = acos(p % last_uvw(3))
|
||||
end if
|
||||
|
||||
! determine polar angle bin
|
||||
n = t % filters(i) % n_bins
|
||||
|
||||
! check if particle is within polar angle bins
|
||||
if (theta < t % filters(i) % real_bins(1) .or. &
|
||||
theta > t % filters(i) % real_bins(n + 1)) then
|
||||
matching_bins(i) = NO_BIN_FOUND
|
||||
else
|
||||
! search to find polar angle bin
|
||||
matching_bins(i) = binary_search(t % filters(i) % real_bins, &
|
||||
n + 1, theta)
|
||||
end if
|
||||
|
||||
case (FILTER_AZIMUTHAL)
|
||||
! make sure the correct direction vector is used
|
||||
if (t % estimator == ESTIMATOR_TRACKLENGTH) then
|
||||
phi = atan2(p % coord(1) % uvw(2), p % coord(1) % uvw(1))
|
||||
else
|
||||
phi = atan2(p % last_uvw(2), p % last_uvw(1))
|
||||
end if
|
||||
! determine mu bin
|
||||
n = t % filters(i) % n_bins
|
||||
|
||||
! check if particle is within azimuthal angle bins
|
||||
if (phi < t % filters(i) % real_bins(1) .or. &
|
||||
phi > t % filters(i) % real_bins(n + 1)) then
|
||||
matching_bins(i) = NO_BIN_FOUND
|
||||
else
|
||||
! search to find azimuthal angle bin
|
||||
matching_bins(i) = binary_search(t % filters(i) % real_bins, &
|
||||
n + 1, phi)
|
||||
end if
|
||||
|
||||
end select
|
||||
|
||||
! If the current filter didn't match, exit this subroutine
|
||||
|
|
|
|||
571
tests/input_set.py
Normal file
571
tests/input_set.py
Normal file
|
|
@ -0,0 +1,571 @@
|
|||
import openmc
|
||||
|
||||
|
||||
class InputSet(object):
|
||||
def __init__(self):
|
||||
self.settings = openmc.SettingsFile()
|
||||
self.materials = openmc.MaterialsFile()
|
||||
self.geometry = openmc.GeometryFile()
|
||||
self.tallies = None
|
||||
self.plots = None
|
||||
|
||||
def export(self):
|
||||
self.settings.export_to_xml()
|
||||
self.materials.export_to_xml()
|
||||
self.geometry.export_to_xml()
|
||||
if self.tallies is not None: self.tallies.export_to_xml()
|
||||
if self.plots is not None: self.plots.export_to_xml()
|
||||
|
||||
def build_default_materials_and_geometry(self):
|
||||
# Define materials.
|
||||
fuel = openmc.Material(name='Fuel', material_id=1)
|
||||
fuel.set_density('g/cm3', 10.062)
|
||||
fuel.add_nuclide("U-234", 4.9476e-6)
|
||||
fuel.add_nuclide("U-235", 4.8218e-4)
|
||||
fuel.add_nuclide("U-236", 9.0402e-5)
|
||||
fuel.add_nuclide("U-238", 2.1504e-2)
|
||||
fuel.add_nuclide("Np-237", 7.3733e-6)
|
||||
fuel.add_nuclide("Pu-238", 1.5148e-6)
|
||||
fuel.add_nuclide("Pu-239", 1.3955e-4)
|
||||
fuel.add_nuclide("Pu-240", 3.4405e-5)
|
||||
fuel.add_nuclide("Pu-241", 2.1439e-5)
|
||||
fuel.add_nuclide("Pu-242", 3.7422e-6)
|
||||
fuel.add_nuclide("Am-241", 4.5041e-7)
|
||||
fuel.add_nuclide("Am-242m", 9.2301e-9)
|
||||
fuel.add_nuclide("Am-243", 4.7878e-7)
|
||||
fuel.add_nuclide("Cm-242", 1.0485e-7)
|
||||
fuel.add_nuclide("Cm-243", 1.4268e-9)
|
||||
fuel.add_nuclide("Cm-244", 8.8756e-8)
|
||||
fuel.add_nuclide("Cm-245", 3.5285e-9)
|
||||
fuel.add_nuclide("Mo-95", 2.6497e-5)
|
||||
fuel.add_nuclide("Tc-99", 3.2772e-5)
|
||||
fuel.add_nuclide("Ru-101", 3.0742e-5)
|
||||
fuel.add_nuclide("Ru-103", 2.3505e-6)
|
||||
fuel.add_nuclide("Ag-109", 2.0009e-6)
|
||||
fuel.add_nuclide("Xe-135", 1.0801e-8)
|
||||
fuel.add_nuclide("Cs-133", 3.4612e-5)
|
||||
fuel.add_nuclide("Nd-143", 2.6078e-5)
|
||||
fuel.add_nuclide("Nd-145", 1.9898e-5)
|
||||
fuel.add_nuclide("Sm-147", 1.6128e-6)
|
||||
fuel.add_nuclide("Sm-149", 1.1627e-7)
|
||||
fuel.add_nuclide("Sm-150", 7.1727e-6)
|
||||
fuel.add_nuclide("Sm-151", 5.4947e-7)
|
||||
fuel.add_nuclide("Sm-152", 3.0221e-6)
|
||||
fuel.add_nuclide("Eu-153", 2.6209e-6)
|
||||
fuel.add_nuclide("Gd-155", 1.5369e-9)
|
||||
fuel.add_nuclide("O-16", 4.5737e-2)
|
||||
|
||||
clad = openmc.Material(name='Cladding', material_id=2)
|
||||
clad.set_density('g/cm3', 5.77)
|
||||
clad.add_nuclide("Zr-90", 0.5145)
|
||||
clad.add_nuclide("Zr-91", 0.1122)
|
||||
clad.add_nuclide("Zr-92", 0.1715)
|
||||
clad.add_nuclide("Zr-94", 0.1738)
|
||||
clad.add_nuclide("Zr-96", 0.0280)
|
||||
|
||||
cold_water = openmc.Material(name='Cold borated water', material_id=3)
|
||||
cold_water.set_density('atom/b-cm', 0.07416)
|
||||
cold_water.add_nuclide("H-1", 2.0)
|
||||
cold_water.add_nuclide("O-16", 1.0)
|
||||
cold_water.add_nuclide("B-10", 6.490e-4)
|
||||
cold_water.add_nuclide("B-11", 2.689e-3)
|
||||
cold_water.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
hot_water = openmc.Material(name='Hot borated water', material_id=4)
|
||||
hot_water.set_density('atom/b-cm', 0.06614)
|
||||
hot_water.add_nuclide("H-1", 2.0)
|
||||
hot_water.add_nuclide("O-16", 1.0)
|
||||
hot_water.add_nuclide("B-10", 6.490e-4)
|
||||
hot_water.add_nuclide("B-11", 2.689e-3)
|
||||
hot_water.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
rpv_steel = openmc.Material(name='Reactor pressure vessel steel',
|
||||
material_id=5)
|
||||
rpv_steel.set_density('g/cm3', 7.9)
|
||||
rpv_steel.add_nuclide("Fe-54", 0.05437098, 'wo')
|
||||
rpv_steel.add_nuclide("Fe-56", 0.88500663, 'wo')
|
||||
rpv_steel.add_nuclide("Fe-57", 0.0208008, 'wo')
|
||||
rpv_steel.add_nuclide("Fe-58", 0.00282159, 'wo')
|
||||
rpv_steel.add_nuclide("Ni-58", 0.0067198, 'wo')
|
||||
rpv_steel.add_nuclide("Ni-60", 0.0026776, 'wo')
|
||||
rpv_steel.add_nuclide("Ni-61", 0.0001183, 'wo')
|
||||
rpv_steel.add_nuclide("Ni-62", 0.0003835, 'wo')
|
||||
rpv_steel.add_nuclide("Ni-64", 0.0001008, 'wo')
|
||||
rpv_steel.add_nuclide("Mn-55", 0.01, 'wo')
|
||||
rpv_steel.add_nuclide("Mo-92", 0.000849, 'wo')
|
||||
rpv_steel.add_nuclide("Mo-94", 0.0005418, 'wo')
|
||||
rpv_steel.add_nuclide("Mo-95", 0.0009438, 'wo')
|
||||
rpv_steel.add_nuclide("Mo-96", 0.0010002, 'wo')
|
||||
rpv_steel.add_nuclide("Mo-97", 0.0005796, 'wo')
|
||||
rpv_steel.add_nuclide("Mo-98", 0.0014814, 'wo')
|
||||
rpv_steel.add_nuclide("Mo-100", 0.0006042, 'wo')
|
||||
rpv_steel.add_nuclide("Si-28", 0.00367464, 'wo')
|
||||
rpv_steel.add_nuclide("Si-29", 0.00019336, 'wo')
|
||||
rpv_steel.add_nuclide("Si-30", 0.000132, 'wo')
|
||||
rpv_steel.add_nuclide("Cr-50", 0.00010435, 'wo')
|
||||
rpv_steel.add_nuclide("Cr-52", 0.002092475, 'wo')
|
||||
rpv_steel.add_nuclide("Cr-53", 0.00024185, 'wo')
|
||||
rpv_steel.add_nuclide("Cr-54", 6.1325e-05, 'wo')
|
||||
rpv_steel.add_nuclide("C-Nat", 0.0025, 'wo')
|
||||
rpv_steel.add_nuclide("Cu-63", 0.0013696, 'wo')
|
||||
rpv_steel.add_nuclide("Cu-65", 0.0006304, 'wo')
|
||||
|
||||
lower_rad_ref = openmc.Material(name='Lower radial reflector',
|
||||
material_id=6)
|
||||
lower_rad_ref.set_density('g/cm3', 4.32)
|
||||
lower_rad_ref.add_nuclide("H-1", 0.0095661, 'wo')
|
||||
lower_rad_ref.add_nuclide("O-16", 0.0759107, 'wo')
|
||||
lower_rad_ref.add_nuclide("B-10", 3.08409e-5, 'wo')
|
||||
lower_rad_ref.add_nuclide("B-11", 1.40499e-4, 'wo')
|
||||
lower_rad_ref.add_nuclide("Fe-54", 0.035620772088, 'wo')
|
||||
lower_rad_ref.add_nuclide("Fe-56", 0.579805982228, 'wo')
|
||||
lower_rad_ref.add_nuclide("Fe-57", 0.01362750048, 'wo')
|
||||
lower_rad_ref.add_nuclide("Fe-58", 0.001848545204, 'wo')
|
||||
lower_rad_ref.add_nuclide("Ni-58", 0.055298376566, 'wo')
|
||||
lower_rad_ref.add_nuclide("Ni-60", 0.022034425592, 'wo')
|
||||
lower_rad_ref.add_nuclide("Ni-61", 0.000973510811, 'wo')
|
||||
lower_rad_ref.add_nuclide("Ni-62", 0.003155886695, 'wo')
|
||||
lower_rad_ref.add_nuclide("Ni-64", 0.000829500336, 'wo')
|
||||
lower_rad_ref.add_nuclide("Mn-55", 0.0182870, 'wo')
|
||||
lower_rad_ref.add_nuclide("Si-28", 0.00839976771, 'wo')
|
||||
lower_rad_ref.add_nuclide("Si-29", 0.00044199679, 'wo')
|
||||
lower_rad_ref.add_nuclide("Si-30", 0.0003017355, 'wo')
|
||||
lower_rad_ref.add_nuclide("Cr-50", 0.007251360806, 'wo')
|
||||
lower_rad_ref.add_nuclide("Cr-52", 0.145407678031, 'wo')
|
||||
lower_rad_ref.add_nuclide("Cr-53", 0.016806340306, 'wo')
|
||||
lower_rad_ref.add_nuclide("Cr-54", 0.004261520857, 'wo')
|
||||
lower_rad_ref.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
upper_rad_ref = openmc.Material(name='Upper radial reflector /'
|
||||
'Top plate region', material_id=7)
|
||||
upper_rad_ref.set_density('g/cm3', 4.28)
|
||||
upper_rad_ref.add_nuclide("H-1", 0.0086117, 'wo')
|
||||
upper_rad_ref.add_nuclide("O-16", 0.0683369, 'wo')
|
||||
upper_rad_ref.add_nuclide("B-10", 2.77638e-5, 'wo')
|
||||
upper_rad_ref.add_nuclide("B-11", 1.26481e-4, 'wo')
|
||||
upper_rad_ref.add_nuclide("Fe-54", 0.035953677186, 'wo')
|
||||
upper_rad_ref.add_nuclide("Fe-56", 0.585224740891, 'wo')
|
||||
upper_rad_ref.add_nuclide("Fe-57", 0.01375486056, 'wo')
|
||||
upper_rad_ref.add_nuclide("Fe-58", 0.001865821363, 'wo')
|
||||
upper_rad_ref.add_nuclide("Ni-58", 0.055815129186, 'wo')
|
||||
upper_rad_ref.add_nuclide("Ni-60", 0.022240333032, 'wo')
|
||||
upper_rad_ref.add_nuclide("Ni-61", 0.000982608081, 'wo')
|
||||
upper_rad_ref.add_nuclide("Ni-62", 0.003185377845, 'wo')
|
||||
upper_rad_ref.add_nuclide("Ni-64", 0.000837251856, 'wo')
|
||||
upper_rad_ref.add_nuclide("Mn-55", 0.0184579, 'wo')
|
||||
upper_rad_ref.add_nuclide("Si-28", 0.00847831314, 'wo')
|
||||
upper_rad_ref.add_nuclide("Si-29", 0.00044612986, 'wo')
|
||||
upper_rad_ref.add_nuclide("Si-30", 0.000304557, 'wo')
|
||||
upper_rad_ref.add_nuclide("Cr-50", 0.00731912987, 'wo')
|
||||
upper_rad_ref.add_nuclide("Cr-52", 0.146766614995, 'wo')
|
||||
upper_rad_ref.add_nuclide("Cr-53", 0.01696340737, 'wo')
|
||||
upper_rad_ref.add_nuclide("Cr-54", 0.004301347765, 'wo')
|
||||
upper_rad_ref.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
bot_plate = openmc.Material(name='Bottom plate region', material_id=8)
|
||||
bot_plate.set_density('g/cm3', 7.184)
|
||||
bot_plate.add_nuclide("H-1", 0.0011505, 'wo')
|
||||
bot_plate.add_nuclide("O-16", 0.0091296, 'wo')
|
||||
bot_plate.add_nuclide("B-10", 3.70915e-6, 'wo')
|
||||
bot_plate.add_nuclide("B-11", 1.68974e-5, 'wo')
|
||||
bot_plate.add_nuclide("Fe-54", 0.03855611055, 'wo')
|
||||
bot_plate.add_nuclide("Fe-56", 0.627585036425, 'wo')
|
||||
bot_plate.add_nuclide("Fe-57", 0.014750478, 'wo')
|
||||
bot_plate.add_nuclide("Fe-58", 0.002000875025, 'wo')
|
||||
bot_plate.add_nuclide("Ni-58", 0.059855207342, 'wo')
|
||||
bot_plate.add_nuclide("Ni-60", 0.023850159704, 'wo')
|
||||
bot_plate.add_nuclide("Ni-61", 0.001053732407, 'wo')
|
||||
bot_plate.add_nuclide("Ni-62", 0.003415945715, 'wo')
|
||||
bot_plate.add_nuclide("Ni-64", 0.000897854832, 'wo')
|
||||
bot_plate.add_nuclide("Mn-55", 0.0197940, 'wo')
|
||||
bot_plate.add_nuclide("Si-28", 0.00909197802, 'wo')
|
||||
bot_plate.add_nuclide("Si-29", 0.00047842098, 'wo')
|
||||
bot_plate.add_nuclide("Si-30", 0.000326601, 'wo')
|
||||
bot_plate.add_nuclide("Cr-50", 0.007848910646, 'wo')
|
||||
bot_plate.add_nuclide("Cr-52", 0.157390026871, 'wo')
|
||||
bot_plate.add_nuclide("Cr-53", 0.018191270146, 'wo')
|
||||
bot_plate.add_nuclide("Cr-54", 0.004612692337, 'wo')
|
||||
bot_plate.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
bot_nozzle = openmc.Material(name='Bottom nozzle region', material_id=9)
|
||||
bot_nozzle.set_density('g/cm3', 2.53)
|
||||
bot_nozzle.add_nuclide("H-1", 0.0245014, 'wo')
|
||||
bot_nozzle.add_nuclide("O-16", 0.1944274, 'wo')
|
||||
bot_nozzle.add_nuclide("B-10", 7.89917e-5, 'wo')
|
||||
bot_nozzle.add_nuclide("B-11", 3.59854e-4, 'wo')
|
||||
bot_nozzle.add_nuclide("Fe-54", 0.030411411144, 'wo')
|
||||
bot_nozzle.add_nuclide("Fe-56", 0.495012237964, 'wo')
|
||||
bot_nozzle.add_nuclide("Fe-57", 0.01163454624, 'wo')
|
||||
bot_nozzle.add_nuclide("Fe-58", 0.001578204652, 'wo')
|
||||
bot_nozzle.add_nuclide("Ni-58", 0.047211231662, 'wo')
|
||||
bot_nozzle.add_nuclide("Ni-60", 0.018811987544, 'wo')
|
||||
bot_nozzle.add_nuclide("Ni-61", 0.000831139127, 'wo')
|
||||
bot_nozzle.add_nuclide("Ni-62", 0.002694352115, 'wo')
|
||||
bot_nozzle.add_nuclide("Ni-64", 0.000708189552, 'wo')
|
||||
bot_nozzle.add_nuclide("Mn-55", 0.0156126, 'wo')
|
||||
bot_nozzle.add_nuclide("Si-28", 0.007171335558, 'wo')
|
||||
bot_nozzle.add_nuclide("Si-29", 0.000377356542, 'wo')
|
||||
bot_nozzle.add_nuclide("Si-30", 0.0002576079, 'wo')
|
||||
bot_nozzle.add_nuclide("Cr-50", 0.006190885148, 'wo')
|
||||
bot_nozzle.add_nuclide("Cr-52", 0.124142524198, 'wo')
|
||||
bot_nozzle.add_nuclide("Cr-53", 0.014348496148, 'wo')
|
||||
bot_nozzle.add_nuclide("Cr-54", 0.003638294506, 'wo')
|
||||
bot_nozzle.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
top_nozzle = openmc.Material(name='Top nozzle region', material_id=10)
|
||||
top_nozzle.set_density('g/cm3', 1.746)
|
||||
top_nozzle.add_nuclide("H-1", 0.0358870, 'wo')
|
||||
top_nozzle.add_nuclide("O-16", 0.2847761, 'wo')
|
||||
top_nozzle.add_nuclide("B-10", 1.15699e-4, 'wo')
|
||||
top_nozzle.add_nuclide("B-11", 5.27075e-4, 'wo')
|
||||
top_nozzle.add_nuclide("Fe-54", 0.02644016154, 'wo')
|
||||
top_nozzle.add_nuclide("Fe-56", 0.43037146399, 'wo')
|
||||
top_nozzle.add_nuclide("Fe-57", 0.0101152584, 'wo')
|
||||
top_nozzle.add_nuclide("Fe-58", 0.00137211607, 'wo')
|
||||
top_nozzle.add_nuclide("Ni-58", 0.04104621835, 'wo')
|
||||
top_nozzle.add_nuclide("Ni-60", 0.0163554502, 'wo')
|
||||
top_nozzle.add_nuclide("Ni-61", 0.000722605975, 'wo')
|
||||
top_nozzle.add_nuclide("Ni-62", 0.002342513875, 'wo')
|
||||
top_nozzle.add_nuclide("Ni-64", 0.0006157116, 'wo')
|
||||
top_nozzle.add_nuclide("Mn-55", 0.0135739, 'wo')
|
||||
top_nozzle.add_nuclide("Si-28", 0.006234853554, 'wo')
|
||||
top_nozzle.add_nuclide("Si-29", 0.000328078746, 'wo')
|
||||
top_nozzle.add_nuclide("Si-30", 0.0002239677, 'wo')
|
||||
top_nozzle.add_nuclide("Cr-50", 0.005382452306, 'wo')
|
||||
top_nozzle.add_nuclide("Cr-52", 0.107931450781, 'wo')
|
||||
top_nozzle.add_nuclide("Cr-53", 0.012474806806, 'wo')
|
||||
top_nozzle.add_nuclide("Cr-54", 0.003163190107, 'wo')
|
||||
top_nozzle.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
top_fa = openmc.Material(name='Top of fuel assemblies', material_id=11)
|
||||
top_fa.set_density('g/cm3', 3.044)
|
||||
top_fa.add_nuclide("H-1", 0.0162913, 'wo')
|
||||
top_fa.add_nuclide("O-16", 0.1292776, 'wo')
|
||||
top_fa.add_nuclide("B-10", 5.25228e-5, 'wo')
|
||||
top_fa.add_nuclide("B-11", 2.39272e-4, 'wo')
|
||||
top_fa.add_nuclide("Zr-90", 0.43313403903, 'wo')
|
||||
top_fa.add_nuclide("Zr-91", 0.09549277374, 'wo')
|
||||
top_fa.add_nuclide("Zr-92", 0.14759527104, 'wo')
|
||||
top_fa.add_nuclide("Zr-94", 0.15280552077, 'wo')
|
||||
top_fa.add_nuclide("Zr-96", 0.02511169542, 'wo')
|
||||
top_fa.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
bot_fa = openmc.Material(name='Bottom of fuel assemblies', material_id=12)
|
||||
bot_fa.set_density('g/cm3', 1.762)
|
||||
bot_fa.add_nuclide("H-1", 0.0292856, 'wo')
|
||||
bot_fa.add_nuclide("O-16", 0.2323919, 'wo')
|
||||
bot_fa.add_nuclide("B-10", 9.44159e-5, 'wo')
|
||||
bot_fa.add_nuclide("B-11", 4.30120e-4, 'wo')
|
||||
bot_fa.add_nuclide("Zr-90", 0.3741373658, 'wo')
|
||||
bot_fa.add_nuclide("Zr-91", 0.0824858164, 'wo')
|
||||
bot_fa.add_nuclide("Zr-92", 0.1274914944, 'wo')
|
||||
bot_fa.add_nuclide("Zr-94", 0.1319920622, 'wo')
|
||||
bot_fa.add_nuclide("Zr-96", 0.0216912612, 'wo')
|
||||
bot_fa.add_s_alpha_beta('HH2O', '71t')
|
||||
|
||||
# Define the materials file.
|
||||
self.materials.default_xs = '71c'
|
||||
self.materials.add_materials((fuel, clad, cold_water, hot_water,
|
||||
rpv_steel, lower_rad_ref, upper_rad_ref, bot_plate, bot_nozzle,
|
||||
top_nozzle, top_fa, bot_fa))
|
||||
|
||||
# Define surfaces.
|
||||
s1 = openmc.ZCylinder(R=0.41, surface_id=1)
|
||||
s2 = openmc.ZCylinder(R=0.475, surface_id=2)
|
||||
s3 = openmc.ZCylinder(R=0.56, surface_id=3)
|
||||
s4 = openmc.ZCylinder(R=0.62, surface_id=4)
|
||||
s5 = openmc.ZCylinder(R=187.6, surface_id=5)
|
||||
s6 = openmc.ZCylinder(R=209.0, surface_id=6)
|
||||
s7 = openmc.ZCylinder(R=229.0, surface_id=7)
|
||||
s8 = openmc.ZCylinder(R=249.0, surface_id=8)
|
||||
s8.boundary_type = 'vacuum'
|
||||
|
||||
s31 = openmc.ZPlane(z0=-229.0, surface_id=31)
|
||||
s31.boundary_type = 'vacuum'
|
||||
s32 = openmc.ZPlane(z0=-199.0, surface_id=32)
|
||||
s33 = openmc.ZPlane(z0=-193.0, surface_id=33)
|
||||
s34 = openmc.ZPlane(z0=-183.0, surface_id=34)
|
||||
s35 = openmc.ZPlane(z0=0.0, surface_id=35)
|
||||
s36 = openmc.ZPlane(z0=183.0, surface_id=36)
|
||||
s37 = openmc.ZPlane(z0=203.0, surface_id=37)
|
||||
s38 = openmc.ZPlane(z0=215.0, surface_id=38)
|
||||
s39 = openmc.ZPlane(z0=223.0, surface_id=39)
|
||||
s39.boundary_type = 'vacuum'
|
||||
|
||||
# Define pin cells.
|
||||
fuel_cold = openmc.Universe(name='Fuel pin, cladding, cold water',
|
||||
universe_id=1)
|
||||
c21 = openmc.Cell(cell_id=21)
|
||||
c21.region = -s1
|
||||
c21.fill = fuel
|
||||
c22 = openmc.Cell(cell_id=22)
|
||||
c22.region = +s1 & -s2
|
||||
c22.fill = clad
|
||||
c23 = openmc.Cell(cell_id=23)
|
||||
c23.region = +s2
|
||||
c23.fill = cold_water
|
||||
fuel_cold.add_cells((c21, c22, c23))
|
||||
|
||||
tube_cold = openmc.Universe(name='Instrumentation guide tube, '
|
||||
'cold water', universe_id=2)
|
||||
c24 = openmc.Cell(cell_id=24)
|
||||
c24.region = -s3
|
||||
c24.fill = cold_water
|
||||
c25 = openmc.Cell(cell_id=25)
|
||||
c25.region = +s3 & -s4
|
||||
c25.fill = clad
|
||||
c26 = openmc.Cell(cell_id=26)
|
||||
c26.region = +s4
|
||||
c26.fill = cold_water
|
||||
tube_cold.add_cells((c24, c25, c26))
|
||||
|
||||
fuel_hot = openmc.Universe(name='Fuel pin, cladding, hot water',
|
||||
universe_id=3)
|
||||
c27 = openmc.Cell(cell_id=27)
|
||||
c27.region = -s1
|
||||
c27.fill = fuel
|
||||
c28 = openmc.Cell(cell_id=28)
|
||||
c28.region = +s1 & -s2
|
||||
c28.fill = clad
|
||||
c29 = openmc.Cell(cell_id=29)
|
||||
c29.region = +s2
|
||||
c29.fill = hot_water
|
||||
fuel_hot.add_cells((c27, c28, c29))
|
||||
|
||||
tube_hot = openmc.Universe(name='Instrumentation guide tube, hot water',
|
||||
universe_id=4)
|
||||
c30 = openmc.Cell(cell_id=30)
|
||||
c30.region = -s3
|
||||
c30.fill = hot_water
|
||||
c31 = openmc.Cell(cell_id=31)
|
||||
c31.region = +s3 & -s4
|
||||
c31.fill = clad
|
||||
c32 = openmc.Cell(cell_id=32)
|
||||
c32.region = +s4
|
||||
c32.fill = hot_water
|
||||
tube_hot.add_cells((c30, c31, c32))
|
||||
|
||||
# Define fuel lattices.
|
||||
l100 = openmc.RectLattice(name='Fuel assembly (lower half)',
|
||||
lattice_id=100)
|
||||
l100.dimension = (17, 17)
|
||||
l100.lower_left = (-10.71, -10.71)
|
||||
l100.pitch = (1.26, 1.26)
|
||||
l100.universes = [
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*5 + [tube_cold] + [fuel_cold]*2 + [tube_cold]
|
||||
+ [fuel_cold]*2 + [tube_cold] + [fuel_cold]*5,
|
||||
[fuel_cold]*3 + [tube_cold] + [fuel_cold]*9 + [tube_cold]
|
||||
+ [fuel_cold]*3,
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*2 + [tube_cold] + [fuel_cold]*2 + [tube_cold]
|
||||
+ [fuel_cold]*2 + [tube_cold] + [fuel_cold]*2 + [tube_cold]
|
||||
+ [fuel_cold]*2 + [tube_cold] + [fuel_cold]*2,
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*2 + [tube_cold] + [fuel_cold]*2 + [tube_cold]
|
||||
+ [fuel_cold]*2 + [tube_cold] + [fuel_cold]*2 + [tube_cold]
|
||||
+ [fuel_cold]*2 + [tube_cold] + [fuel_cold]*2,
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*2 + [tube_cold] + [fuel_cold]*2 + [tube_cold]
|
||||
+ [fuel_cold]*2 + [tube_cold] + [fuel_cold]*2 + [tube_cold]
|
||||
+ [fuel_cold]*2 + [tube_cold] + [fuel_cold]*2,
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*3 + [tube_cold] + [fuel_cold]*9 + [tube_cold]
|
||||
+ [fuel_cold]*3,
|
||||
[fuel_cold]*5 + [tube_cold] + [fuel_cold]*2 + [tube_cold]
|
||||
+ [fuel_cold]*2 + [tube_cold] + [fuel_cold]*5,
|
||||
[fuel_cold]*17,
|
||||
[fuel_cold]*17 ]
|
||||
|
||||
l101 = openmc.RectLattice(name='Fuel assembly (upper half)',
|
||||
lattice_id=101)
|
||||
l101.dimension = (17, 17)
|
||||
l101.lower_left = (-10.71, -10.71)
|
||||
l101.pitch = (1.26, 1.26)
|
||||
l101.universes = [
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*5 + [tube_hot] + [fuel_hot]*2 + [tube_hot]
|
||||
+ [fuel_hot]*2 + [tube_hot] + [fuel_hot]*5,
|
||||
[fuel_hot]*3 + [tube_hot] + [fuel_hot]*9 + [tube_hot]
|
||||
+ [fuel_hot]*3,
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*2 + [tube_hot] + [fuel_hot]*2 + [tube_hot]
|
||||
+ [fuel_hot]*2 + [tube_hot] + [fuel_hot]*2 + [tube_hot]
|
||||
+ [fuel_hot]*2 + [tube_hot] + [fuel_hot]*2,
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*2 + [tube_hot] + [fuel_hot]*2 + [tube_hot]
|
||||
+ [fuel_hot]*2 + [tube_hot] + [fuel_hot]*2 + [tube_hot]
|
||||
+ [fuel_hot]*2 + [tube_hot] + [fuel_hot]*2,
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*2 + [tube_hot] + [fuel_hot]*2 + [tube_hot]
|
||||
+ [fuel_hot]*2 + [tube_hot] + [fuel_hot]*2 + [tube_hot]
|
||||
+ [fuel_hot]*2 + [tube_hot] + [fuel_hot]*2,
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*3 + [tube_hot] + [fuel_hot]*9 + [tube_hot]
|
||||
+ [fuel_hot]*3,
|
||||
[fuel_hot]*5 + [tube_hot] + [fuel_hot]*2 + [tube_hot]
|
||||
+ [fuel_hot]*2 + [tube_hot] + [fuel_hot]*5,
|
||||
[fuel_hot]*17,
|
||||
[fuel_hot]*17 ]
|
||||
|
||||
# Define assemblies.
|
||||
fa_cw = openmc.Universe(name='Water assembly (cold)', universe_id=5)
|
||||
c50 = openmc.Cell(cell_id=50)
|
||||
c50.region = +s34 & -s35
|
||||
c50.fill = cold_water
|
||||
fa_cw.add_cells((c50, ))
|
||||
|
||||
fa_hw = openmc.Universe(name='Water assembly (hot)', universe_id=7)
|
||||
c70 = openmc.Cell(cell_id=70)
|
||||
c70.region = +s35 & -s36
|
||||
c70.fill = hot_water
|
||||
fa_hw.add_cells((c70, ))
|
||||
|
||||
fa_cold = openmc.Universe(name='Fuel assembly (cold)', universe_id=6)
|
||||
c60 = openmc.Cell(cell_id=60)
|
||||
c60.region = +s34 & -s35
|
||||
c60.fill = l100
|
||||
fa_cold.add_cells((c60, ))
|
||||
|
||||
fa_hot = openmc.Universe(name='Fuel assembly (hot)', universe_id=8)
|
||||
c80 = openmc.Cell(cell_id=80)
|
||||
c80.region = +s35 & -s36
|
||||
c80.fill = l101
|
||||
fa_hot.add_cells((c80, ))
|
||||
|
||||
# Define core lattices
|
||||
l200 = openmc.RectLattice(name='Core lattice (lower half)',
|
||||
lattice_id=200)
|
||||
l200.dimension = (21, 21)
|
||||
l200.lower_left = (-224.91, -224.91)
|
||||
l200.pitch = (21.42, 21.42)
|
||||
l200.universes = [
|
||||
[fa_cw]*21,
|
||||
[fa_cw]*21,
|
||||
[fa_cw]*7 + [fa_cold]*7 + [fa_cw]*7,
|
||||
[fa_cw]*5 + [fa_cold]*11 + [fa_cw]*5,
|
||||
[fa_cw]*4 + [fa_cold]*13 + [fa_cw]*4,
|
||||
[fa_cw]*3 + [fa_cold]*15 + [fa_cw]*3,
|
||||
[fa_cw]*3 + [fa_cold]*15 + [fa_cw]*3,
|
||||
[fa_cw]*2 + [fa_cold]*17 + [fa_cw]*2,
|
||||
[fa_cw]*2 + [fa_cold]*17 + [fa_cw]*2,
|
||||
[fa_cw]*2 + [fa_cold]*17 + [fa_cw]*2,
|
||||
[fa_cw]*2 + [fa_cold]*17 + [fa_cw]*2,
|
||||
[fa_cw]*2 + [fa_cold]*17 + [fa_cw]*2,
|
||||
[fa_cw]*2 + [fa_cold]*17 + [fa_cw]*2,
|
||||
[fa_cw]*2 + [fa_cold]*17 + [fa_cw]*2,
|
||||
[fa_cw]*3 + [fa_cold]*15 + [fa_cw]*3,
|
||||
[fa_cw]*3 + [fa_cold]*15 + [fa_cw]*3,
|
||||
[fa_cw]*4 + [fa_cold]*13 + [fa_cw]*4,
|
||||
[fa_cw]*5 + [fa_cold]*11 + [fa_cw]*5,
|
||||
[fa_cw]*7 + [fa_cold]*7 + [fa_cw]*7,
|
||||
[fa_cw]*21,
|
||||
[fa_cw]*21]
|
||||
|
||||
l201 = openmc.RectLattice(name='Core lattice (lower half)',
|
||||
lattice_id=201)
|
||||
l201.dimension = (21, 21)
|
||||
l201.lower_left = (-224.91, -224.91)
|
||||
l201.pitch = (21.42, 21.42)
|
||||
l201.universes = [
|
||||
[fa_hw]*21,
|
||||
[fa_hw]*21,
|
||||
[fa_hw]*7 + [fa_hot]*7 + [fa_hw]*7,
|
||||
[fa_hw]*5 + [fa_hot]*11 + [fa_hw]*5,
|
||||
[fa_hw]*4 + [fa_hot]*13 + [fa_hw]*4,
|
||||
[fa_hw]*3 + [fa_hot]*15 + [fa_hw]*3,
|
||||
[fa_hw]*3 + [fa_hot]*15 + [fa_hw]*3,
|
||||
[fa_hw]*2 + [fa_hot]*17 + [fa_hw]*2,
|
||||
[fa_hw]*2 + [fa_hot]*17 + [fa_hw]*2,
|
||||
[fa_hw]*2 + [fa_hot]*17 + [fa_hw]*2,
|
||||
[fa_hw]*2 + [fa_hot]*17 + [fa_hw]*2,
|
||||
[fa_hw]*2 + [fa_hot]*17 + [fa_hw]*2,
|
||||
[fa_hw]*2 + [fa_hot]*17 + [fa_hw]*2,
|
||||
[fa_hw]*2 + [fa_hot]*17 + [fa_hw]*2,
|
||||
[fa_hw]*3 + [fa_hot]*15 + [fa_hw]*3,
|
||||
[fa_hw]*3 + [fa_hot]*15 + [fa_hw]*3,
|
||||
[fa_hw]*4 + [fa_hot]*13 + [fa_hw]*4,
|
||||
[fa_hw]*5 + [fa_hot]*11 + [fa_hw]*5,
|
||||
[fa_hw]*7 + [fa_hot]*7 + [fa_hw]*7,
|
||||
[fa_hw]*21,
|
||||
[fa_hw]*21]
|
||||
|
||||
# Define root universe.
|
||||
root = openmc.Universe(universe_id=0, name='root universe')
|
||||
c1 = openmc.Cell(cell_id=1)
|
||||
c1.region = -s6 & +s34 & -s35
|
||||
c1.fill = l200
|
||||
|
||||
c2 = openmc.Cell(cell_id=2)
|
||||
c2.region = -s6 & +s35 & -s36
|
||||
c2.fill = l201
|
||||
|
||||
c3 = openmc.Cell(cell_id=3)
|
||||
c3.region = -s7 & +s31 & -s32
|
||||
c3.fill = bot_plate
|
||||
|
||||
c4 = openmc.Cell(cell_id=4)
|
||||
c4.region = -s5 & +s32 & -s33
|
||||
c4.fill = bot_nozzle
|
||||
|
||||
c5 = openmc.Cell(cell_id=5)
|
||||
c5.region = -s5 & +s33 & -s34
|
||||
c5.fill = bot_fa
|
||||
|
||||
c6 = openmc.Cell(cell_id=6)
|
||||
c6.region = -s5 & +s36 & -s37
|
||||
c6.fill = top_fa
|
||||
|
||||
c7 = openmc.Cell(cell_id=7)
|
||||
c7.region = -s5 & +s37 & -s38
|
||||
c7.fill = top_nozzle
|
||||
|
||||
c8 = openmc.Cell(cell_id=8)
|
||||
c8.region = -s7 & +s38 & -s39
|
||||
c8.fill = upper_rad_ref
|
||||
|
||||
c9 = openmc.Cell(cell_id=9)
|
||||
c9.region = +s6 & -s7 & +s32 & -s38
|
||||
c9.fill = bot_nozzle
|
||||
|
||||
c10 = openmc.Cell(cell_id=10)
|
||||
c10.region = +s7 & -s8 & +s31 & -s39
|
||||
c10.fill = rpv_steel
|
||||
|
||||
c11 = openmc.Cell(cell_id=11)
|
||||
c11.region = +s5 & -s6 & +s32 & -s34
|
||||
c11.fill = lower_rad_ref
|
||||
|
||||
c12 = openmc.Cell(cell_id=12)
|
||||
c12.region = +s5 & -s6 & +s36 & -s38
|
||||
c12.fill = upper_rad_ref
|
||||
|
||||
root.add_cells((c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12))
|
||||
|
||||
# Define the geometry file.
|
||||
geometry = openmc.Geometry()
|
||||
geometry.root_universe = root
|
||||
|
||||
self.geometry.geometry = geometry
|
||||
|
||||
def build_default_settings(self):
|
||||
self.settings.batches = 10
|
||||
self.settings.inactive = 5
|
||||
self.settings.particles = 100
|
||||
self.settings.set_source_space('box', (-160, -160, -183, 160, 160, 183))
|
||||
|
||||
def build_defualt_plots(self):
|
||||
plot = openmc.Plot()
|
||||
plot.filename = 'mat'
|
||||
plot.origin = (125, 125, 0)
|
||||
plot.width = (250, 250)
|
||||
plot.pixels = (3000, 3000)
|
||||
plot.color = 'mat'
|
||||
|
||||
self.plots.add_plot(plot)
|
||||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<!-- Definition of Cells -->
|
||||
<cell id="1">
|
||||
<universe>0</universe>
|
||||
<surfaces>-1 2 -3 4 -5 6</surfaces>
|
||||
<region>-1 2 -3 4 -5 6</region>
|
||||
<material>1</material>
|
||||
</cell>
|
||||
|
||||
|
|
@ -39,5 +39,5 @@
|
|||
<coeffs>-1</coeffs>
|
||||
<boundary>reflective</boundary>
|
||||
</surface>
|
||||
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import CMFDTestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<!-- Definition of Cells -->
|
||||
<cell id="1">
|
||||
<universe>0</universe>
|
||||
<surfaces>-1 2 -3 4 -5 6</surfaces>
|
||||
<region>-1 2 -3 4 -5 6</region>
|
||||
<material>1</material>
|
||||
</cell>
|
||||
|
||||
|
|
@ -39,5 +39,5 @@
|
|||
<coeffs>-1</coeffs>
|
||||
<boundary>reflective</boundary>
|
||||
</surface>
|
||||
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import CMFDTestHarness
|
||||
|
||||
|
||||
|
|
|
|||
24
tests/test_complex_cell/geometry.xml
Normal file
24
tests/test_complex_cell/geometry.xml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<surface id="1" type="x-plane" coeffs="-10" boundary="vacuum" />
|
||||
<surface id="2" type="x-plane" coeffs="-7" />
|
||||
<surface id="3" type="x-plane" coeffs="-4" />
|
||||
<surface id="4" type="x-plane" coeffs="4" />
|
||||
<surface id="5" type="x-plane" coeffs="7" />
|
||||
<surface id="6" type="x-plane" coeffs="10" boundary="vacuum" />
|
||||
<surface id="7" type="x-plane" coeffs="0" />
|
||||
|
||||
<surface id="11" type="y-plane" coeffs="-10" boundary="vacuum" />
|
||||
<surface id="12" type="y-plane" coeffs="-7" />
|
||||
<surface id="13" type="y-plane" coeffs="-4" />
|
||||
<surface id="14" type="y-plane" coeffs="4" />
|
||||
<surface id="15" type="y-plane" coeffs="7" />
|
||||
<surface id="16" type="y-plane" coeffs="10" boundary="vacuum" />
|
||||
|
||||
<cell id="1" material="1" region="3 -4 13 -14" />
|
||||
<cell id="2" material="2" region="2 -5 12 -15 ~(3 -4 13 -14)" />
|
||||
<cell id="3" material="3" region="7 -6 11 -16 (-2 | 5 | -12 | 15)" />
|
||||
<cell id="4" material="4" region="((1 -7) 11 -16) ~(2 -5 (12 -15))" />
|
||||
|
||||
</geometry>
|
||||
23
tests/test_complex_cell/materials.xml
Normal file
23
tests/test_complex_cell/materials.xml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<default_xs>71c</default_xs>
|
||||
|
||||
<material id="1">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-235" ao="1.0" />
|
||||
</material>
|
||||
<material id="2">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-238" ao="1.0" />
|
||||
</material>
|
||||
<material id="3">
|
||||
<density value="2.0" units="g/cc" />
|
||||
<element name="Zr" ao="1.0" />
|
||||
</material>
|
||||
<material id="4">
|
||||
<density value="0.1" units="g/cc" />
|
||||
<element name="N" ao="1.0" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
11
tests/test_complex_cell/results_true.dat
Normal file
11
tests/test_complex_cell/results_true.dat
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
k-combined:
|
||||
2.651570E-01 2.116381E-03
|
||||
tally 1:
|
||||
2.639097E+00
|
||||
1.394398E+00
|
||||
2.743740E+00
|
||||
1.506124E+00
|
||||
1.041248E+00
|
||||
2.177204E-01
|
||||
1.087210E-01
|
||||
2.365126E-03
|
||||
|
|
@ -4,15 +4,12 @@
|
|||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>100</particles>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>
|
||||
-160 -160 -183
|
||||
160 160 183
|
||||
</parameters>
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<tallies>
|
||||
|
||||
<tally id="1">
|
||||
<filter type="universe" bins="1 2 3 4" />
|
||||
<filter type="cell" bins="1 2 3 4" />
|
||||
<scores>total</scores>
|
||||
</tally>
|
||||
|
||||
</tallies>
|
||||
</tallies>
|
||||
10
tests/test_complex_cell/test_complex_cell.py
Executable file
10
tests/test_complex_cell/test_complex_cell.py
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
harness = TestHarness('statepoint.10.*', True)
|
||||
harness.main()
|
||||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
import glob
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, '..')
|
||||
from testing_harness import *
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness
|
||||
from openmc.statepoint import StatePoint
|
||||
|
||||
|
||||
class EntropyTestHarness(TestHarness):
|
||||
|
|
|
|||
1
tests/test_filter_azimuthal/inputs_true.dat
Normal file
1
tests/test_filter_azimuthal/inputs_true.dat
Normal file
|
|
@ -0,0 +1 @@
|
|||
1d5f81d12f607f4a8436dfb65167e2a2be55dbf86fbc2cc465cec274671be5eaff517d781a4d40e264bb695e3c66c7ff61a650217c99de2ca8c15ca747fe6b80
|
||||
76
tests/test_filter_azimuthal/results_true.dat
Normal file
76
tests/test_filter_azimuthal/results_true.dat
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
k-combined:
|
||||
9.903196E-01 4.279617E-02
|
||||
tally 1:
|
||||
4.215917E+01
|
||||
3.561920E+02
|
||||
4.174788E+01
|
||||
3.505184E+02
|
||||
4.603223E+01
|
||||
4.242918E+02
|
||||
4.496760E+01
|
||||
4.075599E+02
|
||||
4.088099E+01
|
||||
3.376516E+02
|
||||
tally 2:
|
||||
4.157239E+01
|
||||
3.482158E+02
|
||||
4.227810E+01
|
||||
3.613293E+02
|
||||
4.376107E+01
|
||||
3.835007E+02
|
||||
4.644205E+01
|
||||
4.327195E+02
|
||||
4.191554E+01
|
||||
3.522147E+02
|
||||
tally 3:
|
||||
4.215917E+01
|
||||
3.561920E+02
|
||||
4.174788E+01
|
||||
3.505184E+02
|
||||
4.603223E+01
|
||||
4.242918E+02
|
||||
4.496402E+01
|
||||
4.075053E+02
|
||||
4.088458E+01
|
||||
3.377000E+02
|
||||
tally 4:
|
||||
1.531988E+01
|
||||
4.816326E+01
|
||||
9.274393E+00
|
||||
1.821174E+01
|
||||
1.595868E+01
|
||||
5.124238E+01
|
||||
1.299895E+00
|
||||
6.417145E-01
|
||||
1.510024E+01
|
||||
4.604170E+01
|
||||
8.533361E+00
|
||||
1.462765E+01
|
||||
1.658141E+01
|
||||
5.595629E+01
|
||||
1.427417E+00
|
||||
6.621807E-01
|
||||
1.683102E+01
|
||||
5.741400E+01
|
||||
9.845257E+00
|
||||
2.028406E+01
|
||||
1.773179E+01
|
||||
6.477077E+01
|
||||
1.536972E+00
|
||||
6.111079E-01
|
||||
1.586070E+01
|
||||
5.360975E+01
|
||||
9.928220E+00
|
||||
2.089005E+01
|
||||
1.737609E+01
|
||||
6.161847E+01
|
||||
1.700608E+00
|
||||
8.439708E-01
|
||||
1.607027E+01
|
||||
5.490113E+01
|
||||
7.569336E+00
|
||||
1.280955E+01
|
||||
1.606086E+01
|
||||
5.308665E+01
|
||||
9.898901E-01
|
||||
3.143027E-01
|
||||
59
tests/test_filter_azimuthal/test_filter_azimuthal.py
Normal file
59
tests/test_filter_azimuthal/test_filter_azimuthal.py
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness, PyAPITestHarness
|
||||
import openmc
|
||||
|
||||
class FilterAzimuthalTestHarness(PyAPITestHarness):
|
||||
def _build_inputs(self):
|
||||
filt1 = openmc.Filter(type='azimuthal',
|
||||
bins=(-3.1416, -1.8850, -0.6283, 0.6283, 1.8850,
|
||||
3.1416))
|
||||
tally1 = openmc.Tally(tally_id=1)
|
||||
tally1.add_filter(filt1)
|
||||
tally1.add_score('flux')
|
||||
tally1.estimator = 'tracklength'
|
||||
|
||||
tally2 = openmc.Tally(tally_id=2)
|
||||
tally2.add_filter(filt1)
|
||||
tally2.add_score('flux')
|
||||
tally2.estimator = 'analog'
|
||||
|
||||
filt3 = openmc.Filter(type='azimuthal', bins=(5,))
|
||||
tally3 = openmc.Tally(tally_id=3)
|
||||
tally3.add_filter(filt3)
|
||||
tally3.add_score('flux')
|
||||
tally3.estimator = 'tracklength'
|
||||
|
||||
mesh = openmc.Mesh(mesh_id=1)
|
||||
mesh.lower_left = [-182.07, -182.07]
|
||||
mesh.upper_right = [182.07, 182.07]
|
||||
mesh.dimension = [2, 2]
|
||||
filt_mesh = openmc.Filter(type='mesh', bins=(1,))
|
||||
tally4 = openmc.Tally(tally_id=4)
|
||||
tally4.add_filter(filt3)
|
||||
tally4.add_filter(filt_mesh)
|
||||
tally4.add_score('flux')
|
||||
tally4.estimator = 'tracklength'
|
||||
|
||||
|
||||
self._input_set.tallies = openmc.TalliesFile()
|
||||
self._input_set.tallies.add_tally(tally1)
|
||||
self._input_set.tallies.add_tally(tally2)
|
||||
self._input_set.tallies.add_tally(tally3)
|
||||
self._input_set.tallies.add_tally(tally4)
|
||||
self._input_set.tallies.add_mesh(mesh)
|
||||
|
||||
super(FilterAzimuthalTestHarness, self)._build_inputs()
|
||||
|
||||
def _cleanup(self):
|
||||
super(FilterAzimuthalTestHarness, self)._cleanup()
|
||||
f = os.path.join(os.getcwd(), 'tallies.xml')
|
||||
if os.path.exists(f): os.remove(f)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
harness = FilterAzimuthalTestHarness('statepoint.10.*', True)
|
||||
harness.main()
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<surface id="1" type="z-cylinder" coeffs="0. 0. 0.41" />
|
||||
<surface id="2" type="z-cylinder" coeffs="0. 0. 0.475" />
|
||||
<surface id="3" type="z-cylinder" coeffs="0. 0. 0.56" />
|
||||
<surface id="4" type="z-cylinder" coeffs="0. 0. 0.62" />
|
||||
<surface id="5" type="z-cylinder" coeffs="0. 0. 187.6" />
|
||||
<surface id="6" type="z-cylinder" coeffs="0. 0. 209.0" />
|
||||
<surface id="7" type="z-cylinder" coeffs="0. 0. 229.0" />
|
||||
<surface id="8" type="z-cylinder" coeffs="0. 0. 249.0" boundary="vacuum" />
|
||||
|
||||
<surface id="31" type="z-plane" coeffs="-229.0" boundary="vacuum" />
|
||||
<surface id="32" type="z-plane" coeffs="-199.0" />
|
||||
<surface id="33" type="z-plane" coeffs="-193.0" />
|
||||
<surface id="34" type="z-plane" coeffs="-183.0" />
|
||||
<surface id="35" type="z-plane" coeffs="0.0" />
|
||||
<surface id="36" type="z-plane" coeffs="183.0" />
|
||||
<surface id="37" type="z-plane" coeffs="203.0" />
|
||||
<surface id="38" type="z-plane" coeffs="215.0" />
|
||||
<surface id="39" type="z-plane" coeffs="223.0" boundary="vacuum" />
|
||||
|
||||
<!-- All geometry on base universe -->
|
||||
<cell id="1" fill="200" surfaces=" -6 34 -35" /> <!-- Lower core -->
|
||||
<cell id="2" fill="201" surfaces=" -6 35 -36" /> <!-- Upper core -->
|
||||
<cell id="3" material="8" surfaces=" -7 31 -32" /> <!-- Lower core plate region -->
|
||||
<cell id="4" material="9" surfaces=" -5 32 -33" /> <!-- Bottom nozzle region -->
|
||||
<cell id="5" material="12" surfaces=" -5 33 -34" /> <!-- Bottom FA region -->
|
||||
<cell id="6" material="11" surfaces=" -5 36 -37" /> <!-- Top FA region -->
|
||||
<cell id="7" material="10" surfaces=" -5 37 -38" /> <!-- Top nozzle region -->
|
||||
<cell id="8" material="7" surfaces=" -7 38 -39" /> <!-- Upper plate region -->
|
||||
<cell id="9" material="4" surfaces="6 -7 32 -38" /> <!-- Downcomer -->
|
||||
<cell id="10" material="5" surfaces="7 -8 31 -39" /> <!-- RPV -->
|
||||
<cell id="11" material="6" surfaces="5 -6 32 -34" /> <!-- Bottom of radial reflector -->
|
||||
<cell id="12" material="7" surfaces="5 -6 36 -38" /> <!-- Top of radial reflector -->
|
||||
|
||||
<!-- Fuel pin, cladding, cold water -->
|
||||
<cell id="21" universe="1" material="1" surfaces="-1" />
|
||||
<cell id="22" universe="1" material="2" surfaces="1 -2" />
|
||||
<cell id="23" universe="1" material="3" surfaces="2" />
|
||||
|
||||
<!-- Instrumentation guide tube -->
|
||||
<cell id="24" universe="2" material="3" surfaces="-3" />
|
||||
<cell id="25" universe="2" material="2" surfaces="3 -4" />
|
||||
<cell id="26" universe="2" material="3" surfaces="4" />
|
||||
|
||||
<!-- Fuel pin, cladding, hot water -->
|
||||
<cell id="27" universe="3" material="1" surfaces="-1" />
|
||||
<cell id="28" universe="3" material="2" surfaces="1 -2" />
|
||||
<cell id="29" universe="3" material="4" surfaces="2" />
|
||||
|
||||
<!-- Instrumentation guide tube -->
|
||||
<cell id="30" universe="4" material="4" surfaces="-3" />
|
||||
<cell id="31" universe="4" material="2" surfaces="3 -4" />
|
||||
<cell id="32" universe="4" material="4" surfaces="4" />
|
||||
|
||||
<!-- cell for water assembly (cold) -->
|
||||
<cell id="50" universe="5" material="4" surfaces="34 -35" />
|
||||
|
||||
<!-- containing cell for fuel assembly -->
|
||||
<cell id="60" universe="6" fill="100" surfaces="34 -35" />
|
||||
|
||||
<!-- cell for water assembly (hot) -->
|
||||
<cell id="70" universe="7" material="3" surfaces="35 -36" />
|
||||
|
||||
<!-- containing cell for fuel assembly -->
|
||||
<cell id="80" universe="8" fill="101" surfaces="35 -36" />
|
||||
|
||||
<!-- Fuel Assembly (Lower Half) -->
|
||||
<lattice id="100">
|
||||
<dimension>17 17</dimension>
|
||||
<lower_left>-10.71 -10.71</lower_left>
|
||||
<pitch>1.26 1.26</pitch>
|
||||
<universes>
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1
|
||||
1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1
|
||||
1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
</universes>
|
||||
</lattice>
|
||||
|
||||
<!-- Fuel Assembly (Upper Half) -->
|
||||
<lattice id="101">
|
||||
<dimension>17 17</dimension>
|
||||
<lower_left>-10.71 -10.71</lower_left>
|
||||
<pitch>1.26 1.26</pitch>
|
||||
<universes>
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3
|
||||
3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3
|
||||
3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
</universes>
|
||||
</lattice>
|
||||
|
||||
<!-- Core Lattice (Lower Half) -->
|
||||
<lattice id="200">
|
||||
<dimension>21 21</dimension>
|
||||
<lower_left>-224.91 -224.91</lower_left>
|
||||
<pitch>21.42 21.42</pitch>
|
||||
<universes>
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5
|
||||
5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5
|
||||
5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
</universes>
|
||||
</lattice>
|
||||
|
||||
<!-- Core Lattice (Upper Half) -->
|
||||
<lattice id="201">
|
||||
<dimension>21 21</dimension>
|
||||
<lower_left>-224.91 -224.91</lower_left>
|
||||
<pitch>21.42 21.42</pitch>
|
||||
<universes>
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7
|
||||
7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7
|
||||
7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7
|
||||
7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7
|
||||
7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7
|
||||
7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7
|
||||
7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
|
||||
</universes>
|
||||
</lattice>
|
||||
|
||||
</geometry>
|
||||
1
tests/test_filter_cell/inputs_true.dat
Normal file
1
tests/test_filter_cell/inputs_true.dat
Normal file
|
|
@ -0,0 +1 @@
|
|||
caae173f01f7073d634a68a5c4ce97177423e13596a863976e1c40303dc8c05afed457d5a1aa0ae73627ec953143e4f9c1f45bdbd3b0cca76433062467d59777
|
||||
|
|
@ -1,272 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<default_xs>71c</default_xs>
|
||||
|
||||
<!-- Fuel composition -->
|
||||
<material id="1">
|
||||
<density value="10.062" units="g/cm3" />
|
||||
<nuclide name="U-234" ao="4.9476e-6" />
|
||||
<nuclide name="U-235" ao="4.8218e-4" />
|
||||
<nuclide name="U-236" ao="9.0402e-5" />
|
||||
<nuclide name="U-238" ao="2.1504e-2" />
|
||||
<nuclide name="Np-237" ao="7.3733e-6" />
|
||||
<nuclide name="Pu-238" ao="1.5148e-6" />
|
||||
<nuclide name="Pu-239" ao="1.3955e-4" />
|
||||
<nuclide name="Pu-240" ao="3.4405e-5" />
|
||||
<nuclide name="Pu-241" ao="2.1439e-5" />
|
||||
<nuclide name="Pu-242" ao="3.7422e-6" />
|
||||
<nuclide name="Am-241" ao="4.5041e-7" />
|
||||
<nuclide name="Am-242m" ao="9.2301e-9" />
|
||||
<nuclide name="Am-243" ao="4.7878e-7" />
|
||||
<nuclide name="Cm-242" ao="1.0485e-7" />
|
||||
<nuclide name="Cm-243" ao="1.4268e-9" />
|
||||
<nuclide name="Cm-244" ao="8.8756e-8" />
|
||||
<nuclide name="Cm-245" ao="3.5285e-9" />
|
||||
<nuclide name="Mo-95" ao="2.6497e-5" />
|
||||
<nuclide name="Tc-99" ao="3.2772e-5" />
|
||||
<nuclide name="Ru-101" ao="3.0742e-5" />
|
||||
<nuclide name="Ru-103" ao="2.3505e-6" />
|
||||
<nuclide name="Ag-109" ao="2.0009e-6" />
|
||||
<nuclide name="Xe-135" ao="1.0801e-8" />
|
||||
<nuclide name="Cs-133" ao="3.4612e-5" />
|
||||
<nuclide name="Nd-143" ao="2.6078e-5" />
|
||||
<nuclide name="Nd-145" ao="1.9898e-5" />
|
||||
<nuclide name="Sm-147" ao="1.6128e-6" />
|
||||
<nuclide name="Sm-149" ao="1.1627e-7" />
|
||||
<nuclide name="Sm-150" ao="7.1727e-6" />
|
||||
<nuclide name="Sm-151" ao="5.4947e-7" />
|
||||
<nuclide name="Sm-152" ao="3.0221e-6" />
|
||||
<nuclide name="Eu-153" ao="2.6209e-6" />
|
||||
<nuclide name="Gd-155" ao="1.5369e-9" />
|
||||
<nuclide name="O-16" ao="4.5737e-2" />
|
||||
</material>
|
||||
|
||||
<!-- Cladding composition -->
|
||||
<material id="2">
|
||||
<density value="5.77" units="g/cm3" />
|
||||
<nuclide name="Zr-90" ao="0.5145" />
|
||||
<nuclide name="Zr-91" ao="0.1122" />
|
||||
<nuclide name="Zr-92" ao="0.1715" />
|
||||
<nuclide name="Zr-94" ao="0.1738" />
|
||||
<nuclide name="Zr-96" ao="0.0280" />
|
||||
</material>
|
||||
|
||||
<!-- Cold borated water -->
|
||||
<material id="3">
|
||||
<density value="0.07416" units="atom/b-cm" />
|
||||
<nuclide name="H-1" ao="2.0" />
|
||||
<nuclide name="O-16" ao="1.0" />
|
||||
<nuclide name="B-10" ao="6.490e-4" />
|
||||
<nuclide name="B-11" ao="2.689e-3" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Hot borated water -->
|
||||
<material id="4">
|
||||
<density value="0.06614" units="atom/b-cm" />
|
||||
<nuclide name="H-1" ao="2.0" />
|
||||
<nuclide name="O-16" ao="1.0" />
|
||||
<nuclide name="B-10" ao="6.490e-4" />
|
||||
<nuclide name="B-11" ao="2.689e-3" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- RPV Composition -->
|
||||
<material id="5">
|
||||
<density value="7.9" units="g/cm3" />
|
||||
<nuclide name="Fe-54" wo="0.05437098" />
|
||||
<nuclide name="Fe-56" wo="0.88500663" />
|
||||
<nuclide name="Fe-57" wo="0.0208008" />
|
||||
<nuclide name="Fe-58" wo="0.00282159" />
|
||||
<nuclide name="Ni-58" wo="0.0067198" />
|
||||
<nuclide name="Ni-60" wo="0.0026776" />
|
||||
<nuclide name="Ni-61" wo="0.0001183" />
|
||||
<nuclide name="Ni-62" wo="0.0003835" />
|
||||
<nuclide name="Ni-64" wo="0.0001008" />
|
||||
<nuclide name="Mn-55" wo="0.01" />
|
||||
<nuclide name="Mo-92" wo="0.000849" />
|
||||
<nuclide name="Mo-94" wo="0.0005418" />
|
||||
<nuclide name="Mo-95" wo="0.0009438" />
|
||||
<nuclide name="Mo-96" wo="0.0010002" />
|
||||
<nuclide name="Mo-97" wo="0.0005796" />
|
||||
<nuclide name="Mo-98" wo="0.0014814" />
|
||||
<nuclide name="Mo-100" wo="0.0006042" />
|
||||
<nuclide name="Si-28" wo="0.00367464" />
|
||||
<nuclide name="Si-29" wo="0.00019336" />
|
||||
<nuclide name="Si-30" wo="0.000132" />
|
||||
<nuclide name="Cr-50" wo="0.00010435" />
|
||||
<nuclide name="Cr-52" wo="0.002092475" />
|
||||
<nuclide name="Cr-53" wo="0.00024185" />
|
||||
<nuclide name="Cr-54" wo="6.1325e-05" />
|
||||
<nuclide name="C-Nat" wo="0.0025" />
|
||||
<nuclide name="Cu-63" wo="0.0013696" />
|
||||
<nuclide name="Cu-65" wo="0.0006304" />
|
||||
</material>
|
||||
|
||||
<!-- Lower radial reflector -->
|
||||
<material id="6">
|
||||
<density value="4.32" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0095661" />
|
||||
<nuclide name="O-16" wo="0.0759107" />
|
||||
<nuclide name="B-10" wo="3.08409e-5" />
|
||||
<nuclide name="B-11" wo="1.40499e-4" />
|
||||
<nuclide name="Fe-54" wo="0.035620772088" />
|
||||
<nuclide name="Fe-56" wo="0.579805982228" />
|
||||
<nuclide name="Fe-57" wo="0.01362750048" />
|
||||
<nuclide name="Fe-58" wo="0.001848545204" />
|
||||
<nuclide name="Ni-58" wo="0.055298376566" />
|
||||
<nuclide name="Ni-60" wo="0.022034425592" />
|
||||
<nuclide name="Ni-61" wo="0.000973510811" />
|
||||
<nuclide name="Ni-62" wo="0.003155886695" />
|
||||
<nuclide name="Ni-64" wo="0.000829500336" />
|
||||
<nuclide name="Mn-55" wo="0.0182870" />
|
||||
<nuclide name="Si-28" wo="0.00839976771" />
|
||||
<nuclide name="Si-29" wo="0.00044199679" />
|
||||
<nuclide name="Si-30" wo="0.0003017355" />
|
||||
<nuclide name="Cr-50" wo="0.007251360806" />
|
||||
<nuclide name="Cr-52" wo="0.145407678031" />
|
||||
<nuclide name="Cr-53" wo="0.016806340306" />
|
||||
<nuclide name="Cr-54" wo="0.004261520857" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Upper radial reflector / Top plate region -->
|
||||
<material id="7">
|
||||
<density value="4.28" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0086117" />
|
||||
<nuclide name="O-16" wo="0.0683369" />
|
||||
<nuclide name="B-10" wo="2.77638e-5" />
|
||||
<nuclide name="B-11" wo="1.26481e-4" />
|
||||
<nuclide name="Fe-54" wo="0.035953677186" />
|
||||
<nuclide name="Fe-56" wo="0.585224740891" />
|
||||
<nuclide name="Fe-57" wo="0.01375486056" />
|
||||
<nuclide name="Fe-58" wo="0.001865821363" />
|
||||
<nuclide name="Ni-58" wo="0.055815129186" />
|
||||
<nuclide name="Ni-60" wo="0.022240333032" />
|
||||
<nuclide name="Ni-61" wo="0.000982608081" />
|
||||
<nuclide name="Ni-62" wo="0.003185377845" />
|
||||
<nuclide name="Ni-64" wo="0.000837251856" />
|
||||
<nuclide name="Mn-55" wo="0.0184579" />
|
||||
<nuclide name="Si-28" wo="0.00847831314" />
|
||||
<nuclide name="Si-29" wo="0.00044612986" />
|
||||
<nuclide name="Si-30" wo="0.000304557" />
|
||||
<nuclide name="Cr-50" wo="0.00731912987" />
|
||||
<nuclide name="Cr-52" wo="0.146766614995" />
|
||||
<nuclide name="Cr-53" wo="0.01696340737" />
|
||||
<nuclide name="Cr-54" wo="0.004301347765" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Bottom plate region -->
|
||||
<material id="8">
|
||||
<density value="7.184" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0011505" />
|
||||
<nuclide name="O-16" wo="0.0091296" />
|
||||
<nuclide name="B-10" wo="3.70915e-6" />
|
||||
<nuclide name="B-11" wo="1.68974e-5" />
|
||||
<nuclide name="Fe-54" wo="0.03855611055" />
|
||||
<nuclide name="Fe-56" wo="0.627585036425" />
|
||||
<nuclide name="Fe-57" wo="0.014750478" />
|
||||
<nuclide name="Fe-58" wo="0.002000875025" />
|
||||
<nuclide name="Ni-58" wo="0.059855207342" />
|
||||
<nuclide name="Ni-60" wo="0.023850159704" />
|
||||
<nuclide name="Ni-61" wo="0.001053732407" />
|
||||
<nuclide name="Ni-62" wo="0.003415945715" />
|
||||
<nuclide name="Ni-64" wo="0.000897854832" />
|
||||
<nuclide name="Mn-55" wo="0.0197940" />
|
||||
<nuclide name="Si-28" wo="0.00909197802" />
|
||||
<nuclide name="Si-29" wo="0.00047842098" />
|
||||
<nuclide name="Si-30" wo="0.000326601" />
|
||||
<nuclide name="Cr-50" wo="0.007848910646" />
|
||||
<nuclide name="Cr-52" wo="0.157390026871" />
|
||||
<nuclide name="Cr-53" wo="0.018191270146" />
|
||||
<nuclide name="Cr-54" wo="0.004612692337" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Bottom nozzle region -->
|
||||
<material id="9">
|
||||
<density value="2.53" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0245014" />
|
||||
<nuclide name="O-16" wo="0.1944274" />
|
||||
<nuclide name="B-10" wo="7.89917e-5" />
|
||||
<nuclide name="B-11" wo="3.59854e-4" />
|
||||
<nuclide name="Fe-54" wo="0.030411411144" />
|
||||
<nuclide name="Fe-56" wo="0.495012237964" />
|
||||
<nuclide name="Fe-57" wo="0.01163454624" />
|
||||
<nuclide name="Fe-58" wo="0.001578204652" />
|
||||
<nuclide name="Ni-58" wo="0.047211231662" />
|
||||
<nuclide name="Ni-60" wo="0.018811987544" />
|
||||
<nuclide name="Ni-61" wo="0.000831139127" />
|
||||
<nuclide name="Ni-62" wo="0.002694352115" />
|
||||
<nuclide name="Ni-64" wo="0.000708189552" />
|
||||
<nuclide name="Mn-55" wo="0.0156126" />
|
||||
<nuclide name="Si-28" wo="0.007171335558" />
|
||||
<nuclide name="Si-29" wo="0.000377356542" />
|
||||
<nuclide name="Si-30" wo="0.0002576079" />
|
||||
<nuclide name="Cr-50" wo="0.006190885148" />
|
||||
<nuclide name="Cr-52" wo="0.124142524198" />
|
||||
<nuclide name="Cr-53" wo="0.014348496148" />
|
||||
<nuclide name="Cr-54" wo="0.003638294506" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Top nozzle region -->
|
||||
<material id="10">
|
||||
<density value="1.746" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0358870" />
|
||||
<nuclide name="O-16" wo="0.2847761" />
|
||||
<nuclide name="B-10" wo="1.15699e-4" />
|
||||
<nuclide name="B-11" wo="5.27075e-4" />
|
||||
<nuclide name="Fe-54" wo="0.02644016154" />
|
||||
<nuclide name="Fe-56" wo="0.43037146399" />
|
||||
<nuclide name="Fe-57" wo="0.0101152584" />
|
||||
<nuclide name="Fe-58" wo="0.00137211607" />
|
||||
<nuclide name="Ni-58" wo="0.04104621835" />
|
||||
<nuclide name="Ni-60" wo="0.0163554502" />
|
||||
<nuclide name="Ni-61" wo="0.000722605975" />
|
||||
<nuclide name="Ni-62" wo="0.002342513875" />
|
||||
<nuclide name="Ni-64" wo="0.0006157116" />
|
||||
<nuclide name="Mn-55" wo="0.0135739" />
|
||||
<nuclide name="Si-28" wo="0.006234853554" />
|
||||
<nuclide name="Si-29" wo="0.000328078746" />
|
||||
<nuclide name="Si-30" wo="0.0002239677" />
|
||||
<nuclide name="Cr-50" wo="0.005382452306" />
|
||||
<nuclide name="Cr-52" wo="0.107931450781" />
|
||||
<nuclide name="Cr-53" wo="0.012474806806" />
|
||||
<nuclide name="Cr-54" wo="0.003163190107" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Top of Fuel Assemblies -->
|
||||
<material id="11">
|
||||
<density value="3.044" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0162913" />
|
||||
<nuclide name="O-16" wo="0.1292776" />
|
||||
<nuclide name="B-10" wo="5.25228e-5" />
|
||||
<nuclide name="B-11" wo="2.39272e-4" />
|
||||
<nuclide name="Zr-90" wo="0.43313403903" />
|
||||
<nuclide name="Zr-91" wo="0.09549277374" />
|
||||
<nuclide name="Zr-92" wo="0.14759527104" />
|
||||
<nuclide name="Zr-94" wo="0.15280552077" />
|
||||
<nuclide name="Zr-96" wo="0.02511169542" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Bottom of Fuel Assemblies -->
|
||||
<material id="12">
|
||||
<density value="1.762" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0292856" />
|
||||
<nuclide name="O-16" wo="0.2323919" />
|
||||
<nuclide name="B-10" wo="9.44159e-5" />
|
||||
<nuclide name="B-11" wo="4.30120e-4" />
|
||||
<nuclide name="Zr-90" wo="0.3741373658" />
|
||||
<nuclide name="Zr-91" wo="0.0824858164" />
|
||||
<nuclide name="Zr-92" wo="0.1274914944" />
|
||||
<nuclide name="Zr-94" wo="0.1319920622" />
|
||||
<nuclide name="Zr-96" wo="0.0216912612" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
k-combined:
|
||||
1.005983E+00 2.248579E-02
|
||||
9.903196E-01 4.279617E-02
|
||||
tally 1:
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.423676E+01
|
||||
4.330937E+01
|
||||
2.914798E+00
|
||||
1.831649E+00
|
||||
4.088282E+01
|
||||
3.662539E+02
|
||||
1.767552E+01
|
||||
6.295417E+01
|
||||
3.863588E+00
|
||||
3.013300E+00
|
||||
5.356594E+01
|
||||
5.839391E+02
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>100</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>
|
||||
-160 -160 -183
|
||||
160 160 183
|
||||
</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<tallies>
|
||||
|
||||
<tally id="1">
|
||||
<filter type="cell" bins="10 21 22 23" />
|
||||
<scores>total</scores>
|
||||
</tally>
|
||||
|
||||
</tallies>
|
||||
|
|
@ -1,10 +1,29 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
from testing_harness import TestHarness
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness, PyAPITestHarness
|
||||
import openmc
|
||||
|
||||
|
||||
class FilterCellTestHarness(PyAPITestHarness):
|
||||
def _build_inputs(self):
|
||||
filt = openmc.Filter(type='cell', bins=(10, 21, 22, 23))
|
||||
tally = openmc.Tally(tally_id=1)
|
||||
tally.add_filter(filt)
|
||||
tally.add_score('total')
|
||||
self._input_set.tallies = openmc.TalliesFile()
|
||||
self._input_set.tallies.add_tally(tally)
|
||||
|
||||
super(FilterCellTestHarness, self)._build_inputs()
|
||||
|
||||
def _cleanup(self):
|
||||
super(FilterCellTestHarness, self)._cleanup()
|
||||
f = os.path.join(os.getcwd(), 'tallies.xml')
|
||||
if os.path.exists(f): os.remove(f)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
harness = TestHarness('statepoint.10.*', True)
|
||||
harness = FilterCellTestHarness('statepoint.10.*', True)
|
||||
harness.main()
|
||||
|
|
|
|||
|
|
@ -1,181 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<surface id="1" type="z-cylinder" coeffs="0. 0. 0.41" />
|
||||
<surface id="2" type="z-cylinder" coeffs="0. 0. 0.475" />
|
||||
<surface id="3" type="z-cylinder" coeffs="0. 0. 0.56" />
|
||||
<surface id="4" type="z-cylinder" coeffs="0. 0. 0.62" />
|
||||
<surface id="5" type="z-cylinder" coeffs="0. 0. 187.6" />
|
||||
<surface id="6" type="z-cylinder" coeffs="0. 0. 209.0" />
|
||||
<surface id="7" type="z-cylinder" coeffs="0. 0. 229.0" />
|
||||
<surface id="8" type="z-cylinder" coeffs="0. 0. 249.0" boundary="vacuum" />
|
||||
|
||||
<surface id="31" type="z-plane" coeffs="-229.0" boundary="vacuum" />
|
||||
<surface id="32" type="z-plane" coeffs="-199.0" />
|
||||
<surface id="33" type="z-plane" coeffs="-193.0" />
|
||||
<surface id="34" type="z-plane" coeffs="-183.0" />
|
||||
<surface id="35" type="z-plane" coeffs="0.0" />
|
||||
<surface id="36" type="z-plane" coeffs="183.0" />
|
||||
<surface id="37" type="z-plane" coeffs="203.0" />
|
||||
<surface id="38" type="z-plane" coeffs="215.0" />
|
||||
<surface id="39" type="z-plane" coeffs="223.0" boundary="vacuum" />
|
||||
|
||||
<!-- All geometry on base universe -->
|
||||
<cell id="1" fill="200" surfaces=" -6 34 -35" /> <!-- Lower core -->
|
||||
<cell id="2" fill="201" surfaces=" -6 35 -36" /> <!-- Upper core -->
|
||||
<cell id="3" material="8" surfaces=" -7 31 -32" /> <!-- Lower core plate region -->
|
||||
<cell id="4" material="9" surfaces=" -5 32 -33" /> <!-- Bottom nozzle region -->
|
||||
<cell id="5" material="12" surfaces=" -5 33 -34" /> <!-- Bottom FA region -->
|
||||
<cell id="6" material="11" surfaces=" -5 36 -37" /> <!-- Top FA region -->
|
||||
<cell id="7" material="10" surfaces=" -5 37 -38" /> <!-- Top nozzle region -->
|
||||
<cell id="8" material="7" surfaces=" -7 38 -39" /> <!-- Upper plate region -->
|
||||
<cell id="9" material="4" surfaces="6 -7 32 -38" /> <!-- Downcomer -->
|
||||
<cell id="10" material="5" surfaces="7 -8 31 -39" /> <!-- RPV -->
|
||||
<cell id="11" material="6" surfaces="5 -6 32 -34" /> <!-- Bottom of radial reflector -->
|
||||
<cell id="12" material="7" surfaces="5 -6 36 -38" /> <!-- Top of radial reflector -->
|
||||
|
||||
<!-- Fuel pin, cladding, cold water -->
|
||||
<cell id="21" universe="1" material="1" surfaces="-1" />
|
||||
<cell id="22" universe="1" material="2" surfaces="1 -2" />
|
||||
<cell id="23" universe="1" material="3" surfaces="2" />
|
||||
|
||||
<!-- Instrumentation guide tube -->
|
||||
<cell id="24" universe="2" material="3" surfaces="-3" />
|
||||
<cell id="25" universe="2" material="2" surfaces="3 -4" />
|
||||
<cell id="26" universe="2" material="3" surfaces="4" />
|
||||
|
||||
<!-- Fuel pin, cladding, hot water -->
|
||||
<cell id="27" universe="3" material="1" surfaces="-1" />
|
||||
<cell id="28" universe="3" material="2" surfaces="1 -2" />
|
||||
<cell id="29" universe="3" material="4" surfaces="2" />
|
||||
|
||||
<!-- Instrumentation guide tube -->
|
||||
<cell id="30" universe="4" material="4" surfaces="-3" />
|
||||
<cell id="31" universe="4" material="2" surfaces="3 -4" />
|
||||
<cell id="32" universe="4" material="4" surfaces="4" />
|
||||
|
||||
<!-- cell for water assembly (cold) -->
|
||||
<cell id="50" universe="5" material="4" surfaces="34 -35" />
|
||||
|
||||
<!-- containing cell for fuel assembly -->
|
||||
<cell id="60" universe="6" fill="100" surfaces="34 -35" />
|
||||
|
||||
<!-- cell for water assembly (hot) -->
|
||||
<cell id="70" universe="7" material="3" surfaces="35 -36" />
|
||||
|
||||
<!-- containing cell for fuel assembly -->
|
||||
<cell id="80" universe="8" fill="101" surfaces="35 -36" />
|
||||
|
||||
<!-- Fuel Assembly (Lower Half) -->
|
||||
<lattice id="100">
|
||||
<dimension>17 17</dimension>
|
||||
<lower_left>-10.71 -10.71</lower_left>
|
||||
<pitch>1.26 1.26</pitch>
|
||||
<universes>
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1
|
||||
1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1
|
||||
1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
</universes>
|
||||
</lattice>
|
||||
|
||||
<!-- Fuel Assembly (Upper Half) -->
|
||||
<lattice id="101">
|
||||
<dimension>17 17</dimension>
|
||||
<lower_left>-10.71 -10.71</lower_left>
|
||||
<pitch>1.26 1.26</pitch>
|
||||
<universes>
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3
|
||||
3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3
|
||||
3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
</universes>
|
||||
</lattice>
|
||||
|
||||
<!-- Core Lattice (Lower Half) -->
|
||||
<lattice id="200">
|
||||
<dimension>21 21</dimension>
|
||||
<lower_left>-224.91 -224.91</lower_left>
|
||||
<pitch>21.42 21.42</pitch>
|
||||
<universes>
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5
|
||||
5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5
|
||||
5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
</universes>
|
||||
</lattice>
|
||||
|
||||
<!-- Core Lattice (Upper Half) -->
|
||||
<lattice id="201">
|
||||
<dimension>21 21</dimension>
|
||||
<lower_left>-224.91 -224.91</lower_left>
|
||||
<pitch>21.42 21.42</pitch>
|
||||
<universes>
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7
|
||||
7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7
|
||||
7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7
|
||||
7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7
|
||||
7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7
|
||||
7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7
|
||||
7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7
|
||||
7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
|
||||
</universes>
|
||||
</lattice>
|
||||
|
||||
</geometry>
|
||||
1
tests/test_filter_cellborn/inputs_true.dat
Normal file
1
tests/test_filter_cellborn/inputs_true.dat
Normal file
|
|
@ -0,0 +1 @@
|
|||
2f24eb86cda981982a8db5bb110c72e9cef542c06e15b748c1c7e459f96b0d8ba0978b51dffc006e813cd2e2ae1fa0357336f8322ae263189841afde01f0327b
|
||||
|
|
@ -1,272 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<default_xs>71c</default_xs>
|
||||
|
||||
<!-- Fuel composition -->
|
||||
<material id="1">
|
||||
<density value="10.062" units="g/cm3" />
|
||||
<nuclide name="U-234" ao="4.9476e-6" />
|
||||
<nuclide name="U-235" ao="4.8218e-4" />
|
||||
<nuclide name="U-236" ao="9.0402e-5" />
|
||||
<nuclide name="U-238" ao="2.1504e-2" />
|
||||
<nuclide name="Np-237" ao="7.3733e-6" />
|
||||
<nuclide name="Pu-238" ao="1.5148e-6" />
|
||||
<nuclide name="Pu-239" ao="1.3955e-4" />
|
||||
<nuclide name="Pu-240" ao="3.4405e-5" />
|
||||
<nuclide name="Pu-241" ao="2.1439e-5" />
|
||||
<nuclide name="Pu-242" ao="3.7422e-6" />
|
||||
<nuclide name="Am-241" ao="4.5041e-7" />
|
||||
<nuclide name="Am-242m" ao="9.2301e-9" />
|
||||
<nuclide name="Am-243" ao="4.7878e-7" />
|
||||
<nuclide name="Cm-242" ao="1.0485e-7" />
|
||||
<nuclide name="Cm-243" ao="1.4268e-9" />
|
||||
<nuclide name="Cm-244" ao="8.8756e-8" />
|
||||
<nuclide name="Cm-245" ao="3.5285e-9" />
|
||||
<nuclide name="Mo-95" ao="2.6497e-5" />
|
||||
<nuclide name="Tc-99" ao="3.2772e-5" />
|
||||
<nuclide name="Ru-101" ao="3.0742e-5" />
|
||||
<nuclide name="Ru-103" ao="2.3505e-6" />
|
||||
<nuclide name="Ag-109" ao="2.0009e-6" />
|
||||
<nuclide name="Xe-135" ao="1.0801e-8" />
|
||||
<nuclide name="Cs-133" ao="3.4612e-5" />
|
||||
<nuclide name="Nd-143" ao="2.6078e-5" />
|
||||
<nuclide name="Nd-145" ao="1.9898e-5" />
|
||||
<nuclide name="Sm-147" ao="1.6128e-6" />
|
||||
<nuclide name="Sm-149" ao="1.1627e-7" />
|
||||
<nuclide name="Sm-150" ao="7.1727e-6" />
|
||||
<nuclide name="Sm-151" ao="5.4947e-7" />
|
||||
<nuclide name="Sm-152" ao="3.0221e-6" />
|
||||
<nuclide name="Eu-153" ao="2.6209e-6" />
|
||||
<nuclide name="Gd-155" ao="1.5369e-9" />
|
||||
<nuclide name="O-16" ao="4.5737e-2" />
|
||||
</material>
|
||||
|
||||
<!-- Cladding composition -->
|
||||
<material id="2">
|
||||
<density value="5.77" units="g/cm3" />
|
||||
<nuclide name="Zr-90" ao="0.5145" />
|
||||
<nuclide name="Zr-91" ao="0.1122" />
|
||||
<nuclide name="Zr-92" ao="0.1715" />
|
||||
<nuclide name="Zr-94" ao="0.1738" />
|
||||
<nuclide name="Zr-96" ao="0.0280" />
|
||||
</material>
|
||||
|
||||
<!-- Cold borated water -->
|
||||
<material id="3">
|
||||
<density value="0.07416" units="atom/b-cm" />
|
||||
<nuclide name="H-1" ao="2.0" />
|
||||
<nuclide name="O-16" ao="1.0" />
|
||||
<nuclide name="B-10" ao="6.490e-4" />
|
||||
<nuclide name="B-11" ao="2.689e-3" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Hot borated water -->
|
||||
<material id="4">
|
||||
<density value="0.06614" units="atom/b-cm" />
|
||||
<nuclide name="H-1" ao="2.0" />
|
||||
<nuclide name="O-16" ao="1.0" />
|
||||
<nuclide name="B-10" ao="6.490e-4" />
|
||||
<nuclide name="B-11" ao="2.689e-3" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- RPV Composition -->
|
||||
<material id="5">
|
||||
<density value="7.9" units="g/cm3" />
|
||||
<nuclide name="Fe-54" wo="0.05437098" />
|
||||
<nuclide name="Fe-56" wo="0.88500663" />
|
||||
<nuclide name="Fe-57" wo="0.0208008" />
|
||||
<nuclide name="Fe-58" wo="0.00282159" />
|
||||
<nuclide name="Ni-58" wo="0.0067198" />
|
||||
<nuclide name="Ni-60" wo="0.0026776" />
|
||||
<nuclide name="Ni-61" wo="0.0001183" />
|
||||
<nuclide name="Ni-62" wo="0.0003835" />
|
||||
<nuclide name="Ni-64" wo="0.0001008" />
|
||||
<nuclide name="Mn-55" wo="0.01" />
|
||||
<nuclide name="Mo-92" wo="0.000849" />
|
||||
<nuclide name="Mo-94" wo="0.0005418" />
|
||||
<nuclide name="Mo-95" wo="0.0009438" />
|
||||
<nuclide name="Mo-96" wo="0.0010002" />
|
||||
<nuclide name="Mo-97" wo="0.0005796" />
|
||||
<nuclide name="Mo-98" wo="0.0014814" />
|
||||
<nuclide name="Mo-100" wo="0.0006042" />
|
||||
<nuclide name="Si-28" wo="0.00367464" />
|
||||
<nuclide name="Si-29" wo="0.00019336" />
|
||||
<nuclide name="Si-30" wo="0.000132" />
|
||||
<nuclide name="Cr-50" wo="0.00010435" />
|
||||
<nuclide name="Cr-52" wo="0.002092475" />
|
||||
<nuclide name="Cr-53" wo="0.00024185" />
|
||||
<nuclide name="Cr-54" wo="6.1325e-05" />
|
||||
<nuclide name="C-Nat" wo="0.0025" />
|
||||
<nuclide name="Cu-63" wo="0.0013696" />
|
||||
<nuclide name="Cu-65" wo="0.0006304" />
|
||||
</material>
|
||||
|
||||
<!-- Lower radial reflector -->
|
||||
<material id="6">
|
||||
<density value="4.32" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0095661" />
|
||||
<nuclide name="O-16" wo="0.0759107" />
|
||||
<nuclide name="B-10" wo="3.08409e-5" />
|
||||
<nuclide name="B-11" wo="1.40499e-4" />
|
||||
<nuclide name="Fe-54" wo="0.035620772088" />
|
||||
<nuclide name="Fe-56" wo="0.579805982228" />
|
||||
<nuclide name="Fe-57" wo="0.01362750048" />
|
||||
<nuclide name="Fe-58" wo="0.001848545204" />
|
||||
<nuclide name="Ni-58" wo="0.055298376566" />
|
||||
<nuclide name="Ni-60" wo="0.022034425592" />
|
||||
<nuclide name="Ni-61" wo="0.000973510811" />
|
||||
<nuclide name="Ni-62" wo="0.003155886695" />
|
||||
<nuclide name="Ni-64" wo="0.000829500336" />
|
||||
<nuclide name="Mn-55" wo="0.0182870" />
|
||||
<nuclide name="Si-28" wo="0.00839976771" />
|
||||
<nuclide name="Si-29" wo="0.00044199679" />
|
||||
<nuclide name="Si-30" wo="0.0003017355" />
|
||||
<nuclide name="Cr-50" wo="0.007251360806" />
|
||||
<nuclide name="Cr-52" wo="0.145407678031" />
|
||||
<nuclide name="Cr-53" wo="0.016806340306" />
|
||||
<nuclide name="Cr-54" wo="0.004261520857" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Upper radial reflector / Top plate region -->
|
||||
<material id="7">
|
||||
<density value="4.28" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0086117" />
|
||||
<nuclide name="O-16" wo="0.0683369" />
|
||||
<nuclide name="B-10" wo="2.77638e-5" />
|
||||
<nuclide name="B-11" wo="1.26481e-4" />
|
||||
<nuclide name="Fe-54" wo="0.035953677186" />
|
||||
<nuclide name="Fe-56" wo="0.585224740891" />
|
||||
<nuclide name="Fe-57" wo="0.01375486056" />
|
||||
<nuclide name="Fe-58" wo="0.001865821363" />
|
||||
<nuclide name="Ni-58" wo="0.055815129186" />
|
||||
<nuclide name="Ni-60" wo="0.022240333032" />
|
||||
<nuclide name="Ni-61" wo="0.000982608081" />
|
||||
<nuclide name="Ni-62" wo="0.003185377845" />
|
||||
<nuclide name="Ni-64" wo="0.000837251856" />
|
||||
<nuclide name="Mn-55" wo="0.0184579" />
|
||||
<nuclide name="Si-28" wo="0.00847831314" />
|
||||
<nuclide name="Si-29" wo="0.00044612986" />
|
||||
<nuclide name="Si-30" wo="0.000304557" />
|
||||
<nuclide name="Cr-50" wo="0.00731912987" />
|
||||
<nuclide name="Cr-52" wo="0.146766614995" />
|
||||
<nuclide name="Cr-53" wo="0.01696340737" />
|
||||
<nuclide name="Cr-54" wo="0.004301347765" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Bottom plate region -->
|
||||
<material id="8">
|
||||
<density value="7.184" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0011505" />
|
||||
<nuclide name="O-16" wo="0.0091296" />
|
||||
<nuclide name="B-10" wo="3.70915e-6" />
|
||||
<nuclide name="B-11" wo="1.68974e-5" />
|
||||
<nuclide name="Fe-54" wo="0.03855611055" />
|
||||
<nuclide name="Fe-56" wo="0.627585036425" />
|
||||
<nuclide name="Fe-57" wo="0.014750478" />
|
||||
<nuclide name="Fe-58" wo="0.002000875025" />
|
||||
<nuclide name="Ni-58" wo="0.059855207342" />
|
||||
<nuclide name="Ni-60" wo="0.023850159704" />
|
||||
<nuclide name="Ni-61" wo="0.001053732407" />
|
||||
<nuclide name="Ni-62" wo="0.003415945715" />
|
||||
<nuclide name="Ni-64" wo="0.000897854832" />
|
||||
<nuclide name="Mn-55" wo="0.0197940" />
|
||||
<nuclide name="Si-28" wo="0.00909197802" />
|
||||
<nuclide name="Si-29" wo="0.00047842098" />
|
||||
<nuclide name="Si-30" wo="0.000326601" />
|
||||
<nuclide name="Cr-50" wo="0.007848910646" />
|
||||
<nuclide name="Cr-52" wo="0.157390026871" />
|
||||
<nuclide name="Cr-53" wo="0.018191270146" />
|
||||
<nuclide name="Cr-54" wo="0.004612692337" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Bottom nozzle region -->
|
||||
<material id="9">
|
||||
<density value="2.53" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0245014" />
|
||||
<nuclide name="O-16" wo="0.1944274" />
|
||||
<nuclide name="B-10" wo="7.89917e-5" />
|
||||
<nuclide name="B-11" wo="3.59854e-4" />
|
||||
<nuclide name="Fe-54" wo="0.030411411144" />
|
||||
<nuclide name="Fe-56" wo="0.495012237964" />
|
||||
<nuclide name="Fe-57" wo="0.01163454624" />
|
||||
<nuclide name="Fe-58" wo="0.001578204652" />
|
||||
<nuclide name="Ni-58" wo="0.047211231662" />
|
||||
<nuclide name="Ni-60" wo="0.018811987544" />
|
||||
<nuclide name="Ni-61" wo="0.000831139127" />
|
||||
<nuclide name="Ni-62" wo="0.002694352115" />
|
||||
<nuclide name="Ni-64" wo="0.000708189552" />
|
||||
<nuclide name="Mn-55" wo="0.0156126" />
|
||||
<nuclide name="Si-28" wo="0.007171335558" />
|
||||
<nuclide name="Si-29" wo="0.000377356542" />
|
||||
<nuclide name="Si-30" wo="0.0002576079" />
|
||||
<nuclide name="Cr-50" wo="0.006190885148" />
|
||||
<nuclide name="Cr-52" wo="0.124142524198" />
|
||||
<nuclide name="Cr-53" wo="0.014348496148" />
|
||||
<nuclide name="Cr-54" wo="0.003638294506" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Top nozzle region -->
|
||||
<material id="10">
|
||||
<density value="1.746" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0358870" />
|
||||
<nuclide name="O-16" wo="0.2847761" />
|
||||
<nuclide name="B-10" wo="1.15699e-4" />
|
||||
<nuclide name="B-11" wo="5.27075e-4" />
|
||||
<nuclide name="Fe-54" wo="0.02644016154" />
|
||||
<nuclide name="Fe-56" wo="0.43037146399" />
|
||||
<nuclide name="Fe-57" wo="0.0101152584" />
|
||||
<nuclide name="Fe-58" wo="0.00137211607" />
|
||||
<nuclide name="Ni-58" wo="0.04104621835" />
|
||||
<nuclide name="Ni-60" wo="0.0163554502" />
|
||||
<nuclide name="Ni-61" wo="0.000722605975" />
|
||||
<nuclide name="Ni-62" wo="0.002342513875" />
|
||||
<nuclide name="Ni-64" wo="0.0006157116" />
|
||||
<nuclide name="Mn-55" wo="0.0135739" />
|
||||
<nuclide name="Si-28" wo="0.006234853554" />
|
||||
<nuclide name="Si-29" wo="0.000328078746" />
|
||||
<nuclide name="Si-30" wo="0.0002239677" />
|
||||
<nuclide name="Cr-50" wo="0.005382452306" />
|
||||
<nuclide name="Cr-52" wo="0.107931450781" />
|
||||
<nuclide name="Cr-53" wo="0.012474806806" />
|
||||
<nuclide name="Cr-54" wo="0.003163190107" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Top of Fuel Assemblies -->
|
||||
<material id="11">
|
||||
<density value="3.044" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0162913" />
|
||||
<nuclide name="O-16" wo="0.1292776" />
|
||||
<nuclide name="B-10" wo="5.25228e-5" />
|
||||
<nuclide name="B-11" wo="2.39272e-4" />
|
||||
<nuclide name="Zr-90" wo="0.43313403903" />
|
||||
<nuclide name="Zr-91" wo="0.09549277374" />
|
||||
<nuclide name="Zr-92" wo="0.14759527104" />
|
||||
<nuclide name="Zr-94" wo="0.15280552077" />
|
||||
<nuclide name="Zr-96" wo="0.02511169542" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
<!-- Bottom of Fuel Assemblies -->
|
||||
<material id="12">
|
||||
<density value="1.762" units="g/cm3" />
|
||||
<nuclide name="H-1" wo="0.0292856" />
|
||||
<nuclide name="O-16" wo="0.2323919" />
|
||||
<nuclide name="B-10" wo="9.44159e-5" />
|
||||
<nuclide name="B-11" wo="4.30120e-4" />
|
||||
<nuclide name="Zr-90" wo="0.3741373658" />
|
||||
<nuclide name="Zr-91" wo="0.0824858164" />
|
||||
<nuclide name="Zr-92" wo="0.1274914944" />
|
||||
<nuclide name="Zr-94" wo="0.1319920622" />
|
||||
<nuclide name="Zr-96" wo="0.0216912612" />
|
||||
<sab name="HH2O" xs="71t" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
k-combined:
|
||||
1.005983E+00 2.248579E-02
|
||||
9.903196E-01 4.279617E-02
|
||||
tally 1:
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
7.007584E+01
|
||||
1.050827E+03
|
||||
8.921179E+01
|
||||
1.601939E+03
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<tallies>
|
||||
|
||||
<tally id="1">
|
||||
<filter type="cellborn" bins="10 21 22 23" />
|
||||
<scores>total</scores>
|
||||
</tally>
|
||||
|
||||
</tallies>
|
||||
|
|
@ -1,10 +1,29 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
from testing_harness import TestHarness
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import TestHarness, PyAPITestHarness
|
||||
import openmc
|
||||
|
||||
|
||||
class FilterCellbornTestHarness(PyAPITestHarness):
|
||||
def _build_inputs(self):
|
||||
filt = openmc.Filter(type='cellborn', bins=(10, 21, 22, 23))
|
||||
tally = openmc.Tally(tally_id=1)
|
||||
tally.add_filter(filt)
|
||||
tally.add_score('total')
|
||||
self._input_set.tallies = openmc.TalliesFile()
|
||||
self._input_set.tallies.add_tally(tally)
|
||||
|
||||
super(FilterCellbornTestHarness, self)._build_inputs()
|
||||
|
||||
def _cleanup(self):
|
||||
super(FilterCellbornTestHarness, self)._cleanup()
|
||||
f = os.path.join(os.getcwd(), 'tallies.xml')
|
||||
if os.path.exists(f): os.remove(f)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
harness = TestHarness('statepoint.10.*', True)
|
||||
harness = FilterCellbornTestHarness('statepoint.10.*', True)
|
||||
harness.main()
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<cell id="1" fill="5" surfaces="1 -2 3 -4" />
|
||||
<cell id="201" universe="2" material="1" surfaces="-5" />
|
||||
<cell id="202" universe="2" material="2" surfaces="5" />
|
||||
<cell id="1" fill="5" region="1 -2 3 -4" />
|
||||
<cell id="201" universe="2" material="1" region="-5" />
|
||||
<cell id="202" universe="2" material="2" region="5" />
|
||||
<cell id="301" universe="3" material="2"/>
|
||||
|
||||
<lattice id="5">
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<cell id="1" fill="5" surfaces="1 -2 3 -4" />
|
||||
<cell id="201" universe="21" material="1" surfaces="-5" />
|
||||
<cell id="202" universe="21" material="2" surfaces="5" />
|
||||
<cell id="203" universe="22" material="1" surfaces="-5" />
|
||||
<cell id="204" universe="22" material="2" surfaces="5" />
|
||||
<cell id="205" universe="23" material="1" surfaces="-5" />
|
||||
<cell id="206" universe="23" material="2" surfaces="5" />
|
||||
<cell id="207" universe="20" material="1" surfaces="-5" />
|
||||
<cell id="208" universe="20" material="2" surfaces="5" />
|
||||
<cell id="1" fill="5" region="1 -2 3 -4" />
|
||||
<cell id="201" universe="21" material="1" region="-5" />
|
||||
<cell id="202" universe="21" material="2" region="5" />
|
||||
<cell id="203" universe="22" material="1" region="-5" />
|
||||
<cell id="204" universe="22" material="2" region="5" />
|
||||
<cell id="205" universe="23" material="1" region="-5" />
|
||||
<cell id="206" universe="23" material="2" region="5" />
|
||||
<cell id="207" universe="20" material="1" region="-5" />
|
||||
<cell id="208" universe="20" material="2" region="5" />
|
||||
|
||||
<lattice id="5">
|
||||
<dimension>2 2</dimension>
|
||||
|
|
|
|||
|
|
@ -21,50 +21,50 @@
|
|||
<surface id="39" type="z-plane" coeffs="223.0" boundary="vacuum" />
|
||||
|
||||
<!-- All geometry on base universe -->
|
||||
<cell id="1" fill="200" surfaces=" -6 34 -35" /> <!-- Lower core -->
|
||||
<cell id="2" fill="201" surfaces=" -6 35 -36" /> <!-- Upper core -->
|
||||
<cell id="3" material="8" surfaces=" -7 31 -32" /> <!-- Lower core plate region -->
|
||||
<cell id="4" material="9" surfaces=" -5 32 -33" /> <!-- Bottom nozzle region -->
|
||||
<cell id="5" material="12" surfaces=" -5 33 -34" /> <!-- Bottom FA region -->
|
||||
<cell id="6" material="11" surfaces=" -5 36 -37" /> <!-- Top FA region -->
|
||||
<cell id="7" material="10" surfaces=" -5 37 -38" /> <!-- Top nozzle region -->
|
||||
<cell id="8" material="7" surfaces=" -7 38 -39" /> <!-- Upper plate region -->
|
||||
<cell id="9" material="4" surfaces="6 -7 32 -38" /> <!-- Downcomer -->
|
||||
<cell id="10" material="5" surfaces="7 -8 31 -39" /> <!-- RPV -->
|
||||
<cell id="11" material="6" surfaces="5 -6 32 -34" /> <!-- Bottom of radial reflector -->
|
||||
<cell id="12" material="7" surfaces="5 -6 36 -38" /> <!-- Top of radial reflector -->
|
||||
<cell id="1" fill="200" region=" -6 34 -35" /> <!-- Lower core -->
|
||||
<cell id="2" fill="201" region=" -6 35 -36" /> <!-- Upper core -->
|
||||
<cell id="3" material="8" region=" -7 31 -32" /> <!-- Lower core plate region -->
|
||||
<cell id="4" material="9" region=" -5 32 -33" /> <!-- Bottom nozzle region -->
|
||||
<cell id="5" material="12" region=" -5 33 -34" /> <!-- Bottom FA region -->
|
||||
<cell id="6" material="11" region=" -5 36 -37" /> <!-- Top FA region -->
|
||||
<cell id="7" material="10" region=" -5 37 -38" /> <!-- Top nozzle region -->
|
||||
<cell id="8" material="7" region=" -7 38 -39" /> <!-- Upper plate region -->
|
||||
<cell id="9" material="4" region="6 -7 32 -38" /> <!-- Downcomer -->
|
||||
<cell id="10" material="5" region="7 -8 31 -39" /> <!-- RPV -->
|
||||
<cell id="11" material="6" region="5 -6 32 -34" /> <!-- Bottom of radial reflector -->
|
||||
<cell id="12" material="7" region="5 -6 36 -38" /> <!-- Top of radial reflector -->
|
||||
|
||||
<!-- Fuel pin, cladding, cold water -->
|
||||
<cell id="21" universe="1" material="1" surfaces="-1" />
|
||||
<cell id="22" universe="1" material="2" surfaces="1 -2" />
|
||||
<cell id="23" universe="1" material="3" surfaces="2" />
|
||||
<cell id="21" universe="1" material="1" region="-1" />
|
||||
<cell id="22" universe="1" material="2" region="1 -2" />
|
||||
<cell id="23" universe="1" material="3" region="2" />
|
||||
|
||||
<!-- Instrumentation guide tube -->
|
||||
<cell id="24" universe="2" material="3" surfaces="-3" />
|
||||
<cell id="25" universe="2" material="2" surfaces="3 -4" />
|
||||
<cell id="26" universe="2" material="3" surfaces="4" />
|
||||
<cell id="24" universe="2" material="3" region="-3" />
|
||||
<cell id="25" universe="2" material="2" region="3 -4" />
|
||||
<cell id="26" universe="2" material="3" region="4" />
|
||||
|
||||
<!-- Fuel pin, cladding, hot water -->
|
||||
<cell id="27" universe="3" material="1" surfaces="-1" />
|
||||
<cell id="28" universe="3" material="2" surfaces="1 -2" />
|
||||
<cell id="29" universe="3" material="4" surfaces="2" />
|
||||
<cell id="27" universe="3" material="1" region="-1" />
|
||||
<cell id="28" universe="3" material="2" region="1 -2" />
|
||||
<cell id="29" universe="3" material="4" region="2" />
|
||||
|
||||
<!-- Instrumentation guide tube -->
|
||||
<cell id="30" universe="4" material="4" surfaces="-3" />
|
||||
<cell id="31" universe="4" material="2" surfaces="3 -4" />
|
||||
<cell id="32" universe="4" material="4" surfaces="4" />
|
||||
<cell id="30" universe="4" material="4" region="-3" />
|
||||
<cell id="31" universe="4" material="2" region="3 -4" />
|
||||
<cell id="32" universe="4" material="4" region="4" />
|
||||
|
||||
<!-- cell for water assembly (cold) -->
|
||||
<cell id="50" universe="5" material="4" surfaces="34 -35" />
|
||||
<cell id="50" universe="5" material="4" region="34 -35" />
|
||||
|
||||
<!-- containing cell for fuel assembly -->
|
||||
<cell id="60" universe="6" fill="100" surfaces="34 -35" />
|
||||
<cell id="60" universe="6" fill="100" region="34 -35" />
|
||||
|
||||
<!-- cell for water assembly (hot) -->
|
||||
<cell id="70" universe="7" material="3" surfaces="35 -36" />
|
||||
<cell id="70" universe="7" material="3" region="35 -36" />
|
||||
|
||||
<!-- containing cell for fuel assembly -->
|
||||
<cell id="80" universe="8" fill="101" surfaces="35 -36" />
|
||||
<cell id="80" universe="8" fill="101" region="35 -36" />
|
||||
|
||||
<!-- Fuel Assembly (Lower Half) -->
|
||||
<lattice id="100">
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue