mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Merge pull request #463 from paulromano/complex-cells
Support for complex cell regions
This commit is contained in:
commit
99a8762b7b
147 changed files with 3388 additions and 1791 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -182,20 +182,19 @@
|
|||
"# Create fuel Cell\n",
|
||||
"fuel_cell = openmc.Cell(name='1.6% Fuel')\n",
|
||||
"fuel_cell.fill = fuel\n",
|
||||
"fuel_cell.add_surface(fuel_outer_radius, halfspace=-1)\n",
|
||||
"fuel_cell.region = -fuel_outer_radius\n",
|
||||
"pin_cell_universe.add_cell(fuel_cell)\n",
|
||||
"\n",
|
||||
"# Create a clad Cell\n",
|
||||
"clad_cell = openmc.Cell(name='1.6% Clad')\n",
|
||||
"clad_cell.fill = zircaloy\n",
|
||||
"clad_cell.add_surface(fuel_outer_radius, halfspace=+1)\n",
|
||||
"clad_cell.add_surface(clad_outer_radius, halfspace=-1)\n",
|
||||
"clad_cell.region = +fuel_outer_radius & -clad_outer_radius\n",
|
||||
"pin_cell_universe.add_cell(clad_cell)\n",
|
||||
"\n",
|
||||
"# Create a moderator Cell\n",
|
||||
"moderator_cell = openmc.Cell(name='1.6% Moderator')\n",
|
||||
"moderator_cell.fill = water\n",
|
||||
"moderator_cell.add_surface(clad_outer_radius, halfspace=+1)\n",
|
||||
"moderator_cell.region = +clad_outer_radius\n",
|
||||
"pin_cell_universe.add_cell(moderator_cell)"
|
||||
]
|
||||
},
|
||||
|
|
@ -219,12 +218,7 @@
|
|||
"root_cell.fill = pin_cell_universe\n",
|
||||
"\n",
|
||||
"# Add boundary planes\n",
|
||||
"root_cell.add_surface(min_x, halfspace=+1)\n",
|
||||
"root_cell.add_surface(max_x, halfspace=-1)\n",
|
||||
"root_cell.add_surface(min_y, halfspace=+1)\n",
|
||||
"root_cell.add_surface(max_y, halfspace=-1)\n",
|
||||
"root_cell.add_surface(min_z, halfspace=+1)\n",
|
||||
"root_cell.add_surface(max_z, halfspace=-1)\n",
|
||||
"root_cell.region = +min_x & -max_x & +min_y & -max_y & +min_z & -max_z\n",
|
||||
"\n",
|
||||
"# Create root Universe\n",
|
||||
"root_universe = openmc.Universe(universe_id=0, name='root universe')\n",
|
||||
|
|
@ -358,7 +352,7 @@
|
|||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAACBjSFJN\nAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX///9yEhLpgJFNv8Tq\nQYT7AAAAAWJLR0QAiAUdSAAAAAd0SU1FB98JFQMZGiFPL70AAALKSURBVGje7dpLcqQwDAbgHHE2\nYeEj+D4cwQucBUfo+3CEXoSp8OhuhF70T4qpKXmdr21LogK2Pj7A8QmNP+HDhw8fPnz48Kf6VH9G\n+66vy+je8k19jnf8C5dXIPv86ms56lPdjvaYbyodx3ze+XLE76cXFiD4zPji99z0/AJ4n1lfvJ6f\nnl0A6x+578efMSg1wPr172/jPO5yFXM+Ef78gdblM+WPHyguP//t1/g6pA0wfln+ho/fwgYYn19C\n/xwDvwHGc9OvC+hs37DTrwuwfWanXxdQTC9Mvyygs3wjTL8uwPJpn/tNDbSGz7T0SBEWw4vLXzbQ\n6b6RoveIoO6TvPxlA63qs7z8ZQPF9F+SH22vbX8OQKf5Rtv+EgDNJ3X58wZaxWd1+fMGiuFvir8b\nvjp8J/tGy/6jAmRvhW8fwL3vVT+o3grfPoB7r/IpALI3tz8FoJN84/NV873hB8UnM3xzANtf8nb4\ndwmg3grfFEDJO8JPE0i9Ff4pAYL3pI8mkHor/HMCeO9JH00g9SafEsh7T/ppARBvp48UwJnelT5S\nACd7O31TAlnvKx9SQCd7B58KgPO+8iMFuPWe9E8F8BveWX7bAjzX9y4//Jve+fhsH6Ctv7n8PTzj\nvY/v9gEOHz58+PBX+6v/f/wPvnd54f3j6venE/yl769Xv7+j3x/o98/V32/o9+fl389Xnx+g5x/o\n+Qt6/oOeP6HnX+j5G3z+h54/ouefV5/foufP6Pk3ev4On/+j9w/o/Qd6/4Le/6D3T/D9V67Y/ZsV\nQBq+s+8f0ftP+P41axXguP9NWgDuu/Cdfv+N3r/D9/9TAID+A7T/Ae2/gPs/0P4TtP8F7r9J3AIO\n9P+g/Udw/9Oygbf7r9D+L7j/DO1/Q/vv4P4/tP8Q7n9E+y/h/k+0/xTuf4X7b+H+X7T/+BPuf3aM\n8OHDhw8fPnz4w/4vzcvgeY10sY0AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDktMjFUMTA6MDg6\nNTcrMDc6MDALr51VAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA5LTIxVDEwOjA4OjU3KzA3OjAw\nevIl6QAAAABJRU5ErkJggg==\n",
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAACBjSFJN\nAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX///9yEhLpgJFNv8Tq\nQYT7AAAAAWJLR0QAiAUdSAAAAAd0SU1FB98KAwI1HbUKyRQAAAPZSURBVGje7Zs7buMwEIZ9iey5\n0gyNjQpXKTYudIScgkdQYTfut1idwkdQkQNsYQO2Qj0sPiVK+mlQDmwgwIcgg8Cc4fCTSK5W4OeF\nkM8rHv+2I/rgxPZEPZgR7XtQxKdXYuUXJSUnBQ/9WCgo4vOSJ+WFUvF7E08mlia+rn7VcKXP8sRs\nzFX8b2MdX2y6v1Tw6MZUw4H4ojfIjD8mvn/qRL5p4+vvlMqvp2EhR8WBzfiz20hXORmP9fi/bM9E\neUFvV5H/0yRkeSbiGRfFJErxD9ENdz7Mbhig/h89fvtFdMiI/ePUIXV4lXju8K3DKv9NThOZ3q2K\nmUy6grxFES8rjeyic+FFQav+ncg3fXjH+Ts+/iibztFqOiZuZP/Z3OafPX40NGgST2r+uvQkXXp6\ncKvmr+r0e1Eef5um3+JHP3IFF1D/seNZJgaDmvY0Gav1s+2f1fqpIcublfKGt6apotG/NVx3SInW\ntLX+7Vg/Pv1YqOsnun6JSVdOXT/X7vk75f938QP+8OmSBs0fXtymMhJbf8qlPynYmpKCh7OB1fzN\nalOj1sl0ZAruHLiA+RM73pDe/VjMVP89+aTXwjyc/x5n+u991895/utrJTy8/06TXh0r/5JOa2Jm\nYmqi4r/vUm/H4wLmT+z4anhr05X+q6KUXhtzr/9qSff5L5uMT//V/NdU4YuBTPa/8P67l/6r44ds\n+hYuoP5jx9ciy6XTWlibBrmx8V/TdMfjkP+6pOsu/lvM9N90sf7r+f6m/65n+S8p/itN15v0UkW3\n/+48+PRfJX6S9Joo4g+G/1qYG9KroqP/WypcuvyXPf13wH89/hHef7MB6R3Cqn55U4rv4kfH3zaS\ngQuYP7HjVf89tXrbO+hfLdr+Ozv/SP1dgtQ/Ov8C+i/3+q/Zf2D/HWi6bjT6rym9I/v/03/b+LHS\n4cTg/utTsV7/net/Afzz4f0XGX84/2j9xZ4/sePR/of2X7D/o+vPo/sv6h9B/Bfxr9j1Hz2eN/hO\n8/wfff4A848+f/1A/530/I0+/8PvH9D3H9HnT+R49P0b+v4PfP/4E/wXfP8Mvf9G37/D/ovuP8Se\nP7Hj0f0vdP8tqP9O339cyv7p3P1fdP8Z3v9G999j13/seMax8x/o+ZN7+O+E8zdP/8XOf8Hnz9Dz\nb7HnT+x49PxlCp7/BM+fOv13wvnXBfivt2lMvD8TyH/Hnb+Gz3+j589jz5/Y8ej9h4D+W7qQmf57\nefqv239n3T+C7z+h969i13/seMax+3/o/cMcu/8Y2H9n3p+J6r98pv8m4fwXuH+M3n+OO3++AX9c\nlR+4PhbRAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTEwLTAzVDA5OjUxOjU5KzA3OjAwJPCZIQAA\nACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0xMC0wM1QwOTo1MTo1OSswNzowMFWtIZ0AAAAASUVORK5C\nYII=\n",
|
||||
"text/plain": [
|
||||
"<IPython.core.display.Image object>"
|
||||
]
|
||||
|
|
@ -569,8 +563,9 @@
|
|||
" 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: b167d70c877c516deca785801b9fa6f53fb0985b\n",
|
||||
" Date/Time: 2015-09-21 10:25:26\n",
|
||||
" Git SHA1: 71dfde8d12942170a9a8d91796ab40a6e9becaaf\n",
|
||||
" Date/Time: 2015-10-03 09:53:29\n",
|
||||
" OpenMP Threads: 4\n",
|
||||
"\n",
|
||||
" ===========================================================================\n",
|
||||
" ========================> INITIALIZATION <=========================\n",
|
||||
|
|
@ -625,20 +620,20 @@
|
|||
"\n",
|
||||
" =======================> TIMING STATISTICS <=======================\n",
|
||||
"\n",
|
||||
" Total time for initialization = 9.1800E-01 seconds\n",
|
||||
" Reading cross sections = 6.5800E-01 seconds\n",
|
||||
" Total time in simulation = 1.7037E+01 seconds\n",
|
||||
" Time in transport only = 1.7024E+01 seconds\n",
|
||||
" Time in inactive batches = 2.8600E+00 seconds\n",
|
||||
" Time in active batches = 1.4177E+01 seconds\n",
|
||||
" Time synchronizing fission bank = 4.0000E-03 seconds\n",
|
||||
" Sampling source sites = 4.0000E-03 seconds\n",
|
||||
" Total time for initialization = 3.7200E-01 seconds\n",
|
||||
" Reading cross sections = 1.2400E-01 seconds\n",
|
||||
" Total time in simulation = 4.7110E+00 seconds\n",
|
||||
" Time in transport only = 4.6510E+00 seconds\n",
|
||||
" Time in inactive batches = 6.1900E-01 seconds\n",
|
||||
" Time in active batches = 4.0920E+00 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",
|
||||
" Time accumulating tallies = 0.0000E+00 seconds\n",
|
||||
" Total time for finalization = 1.0000E-03 seconds\n",
|
||||
" Total time elapsed = 1.7971E+01 seconds\n",
|
||||
" Calculation Rate (inactive) = 4370.63 neutrons/second\n",
|
||||
" Calculation Rate (active) = 2645.13 neutrons/second\n",
|
||||
" Total time for finalization = 2.0000E-03 seconds\n",
|
||||
" Total time elapsed = 5.0950E+00 seconds\n",
|
||||
" Calculation Rate (inactive) = 20193.9 neutrons/second\n",
|
||||
" Calculation Rate (active) = 9164.22 neutrons/second\n",
|
||||
"\n",
|
||||
" ============================> RESULTS <============================\n",
|
||||
"\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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
@ -213,10 +214,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)
|
||||
|
|
@ -241,13 +242,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)
|
||||
|
|
|
|||
|
|
@ -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 :: &
|
||||
|
|
|
|||
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
|
||||
|
|
@ -4716,4 +4795,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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -1385,7 +1383,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))
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
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
|
||||
|
|
|
|||
120
src/summary.F90
120
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)
|
||||
|
|
|
|||
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
|
||||
|
|
@ -296,56 +296,52 @@ class InputSet(object):
|
|||
fuel_cold = openmc.Universe(name='Fuel pin, cladding, cold water',
|
||||
universe_id=1)
|
||||
c21 = openmc.Cell(cell_id=21)
|
||||
c21.add_surface(s1, -1)
|
||||
c21.region = -s1
|
||||
c21.fill = fuel
|
||||
c22 = openmc.Cell(cell_id=22)
|
||||
c22.add_surface(s1, +1)
|
||||
c22.add_surface(s2, -1)
|
||||
c22.region = +s1 & -s2
|
||||
c22.fill = clad
|
||||
c23 = openmc.Cell(cell_id=23)
|
||||
c23.add_surface(s2, +1)
|
||||
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.add_surface(s3, -1)
|
||||
c24.region = -s3
|
||||
c24.fill = cold_water
|
||||
c25 = openmc.Cell(cell_id=25)
|
||||
c25.add_surface(s3, +1)
|
||||
c25.add_surface(s4, -1)
|
||||
c25.region = +s3 & -s4
|
||||
c25.fill = clad
|
||||
c26 = openmc.Cell(cell_id=26)
|
||||
c26.add_surface(s4, +1)
|
||||
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.add_surface(s1, -1)
|
||||
c27.region = -s1
|
||||
c27.fill = fuel
|
||||
c28 = openmc.Cell(cell_id=28)
|
||||
c28.add_surface(s1, +1)
|
||||
c28.add_surface(s2, -1)
|
||||
c28.region = +s1 & -s2
|
||||
c28.fill = clad
|
||||
c29 = openmc.Cell(cell_id=29)
|
||||
c29.add_surface(s2, +1)
|
||||
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.add_surface(s3, -1)
|
||||
c30.region = -s3
|
||||
c30.fill = hot_water
|
||||
c31 = openmc.Cell(cell_id=31)
|
||||
c31.add_surface(s3, +1)
|
||||
c31.add_surface(s4, -1)
|
||||
c31.region = +s3 & -s4
|
||||
c31.fill = clad
|
||||
c32 = openmc.Cell(cell_id=32)
|
||||
c32.add_surface(s4, +1)
|
||||
c32.region = +s4
|
||||
c32.fill = hot_water
|
||||
tube_hot.add_cells((c30, c31, c32))
|
||||
|
||||
|
|
@ -419,33 +415,27 @@ class InputSet(object):
|
|||
[fuel_hot]*17 ]
|
||||
|
||||
# Define assemblies.
|
||||
fa_cw = openmc.Universe(name='Water assembly (cold)',
|
||||
universe_id=5)
|
||||
fa_cw = openmc.Universe(name='Water assembly (cold)', universe_id=5)
|
||||
c50 = openmc.Cell(cell_id=50)
|
||||
c50.add_surface(s34, +1)
|
||||
c50.add_surface(s35, -1)
|
||||
c50.region = +s34 & -s35
|
||||
c50.fill = cold_water
|
||||
fa_cw.add_cells((c50, ))
|
||||
|
||||
fa_hw = openmc.Universe(name='Water assembly (hot)',
|
||||
universe_id=7)
|
||||
fa_hw = openmc.Universe(name='Water assembly (hot)', universe_id=7)
|
||||
c70 = openmc.Cell(cell_id=70)
|
||||
c70.add_surface(s35, +1)
|
||||
c70.add_surface(s36, -1)
|
||||
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.add_surface(s34, +1)
|
||||
c60.add_surface(s35, -1)
|
||||
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.add_surface(s35, +1)
|
||||
c80.add_surface(s36, -1)
|
||||
c80.region = +s35 & -s36
|
||||
c80.fill = l101
|
||||
fa_hot.add_cells((c80, ))
|
||||
|
||||
|
|
@ -509,79 +499,51 @@ class InputSet(object):
|
|||
# Define root universe.
|
||||
root = openmc.Universe(universe_id=0, name='root universe')
|
||||
c1 = openmc.Cell(cell_id=1)
|
||||
c1.add_surface(s6, -1)
|
||||
c1.add_surface(s34, +1)
|
||||
c1.add_surface(s35, -1)
|
||||
c1.region = -s6 & +s34 & -s35
|
||||
c1.fill = l200
|
||||
|
||||
c2 = openmc.Cell(cell_id=2)
|
||||
c2.add_surface(s6, -1)
|
||||
c1.add_surface(s35, +1)
|
||||
c2.add_surface(s36, -1)
|
||||
c2.region = -s6 & +s35 & -s36
|
||||
c2.fill = l201
|
||||
|
||||
c3 = openmc.Cell(cell_id=3)
|
||||
c3.add_surface(s7, -1)
|
||||
c3.add_surface(s31, +1)
|
||||
c3.add_surface(s32, -1)
|
||||
c3.region = -s7 & +s31 & -s32
|
||||
c3.fill = bot_plate
|
||||
|
||||
c4 = openmc.Cell(cell_id=4)
|
||||
c4.add_surface(s5, -1)
|
||||
c4.add_surface(s32, +1)
|
||||
c4.add_surface(s33, -1)
|
||||
c4.region = -s5 & +s32 & -s33
|
||||
c4.fill = bot_nozzle
|
||||
|
||||
c5 = openmc.Cell(cell_id=5)
|
||||
c5.add_surface(s5, -1)
|
||||
c5.add_surface(s33, +1)
|
||||
c5.add_surface(s34, -1)
|
||||
c5.region = -s5 & +s33 & -s34
|
||||
c5.fill = bot_fa
|
||||
|
||||
c6 = openmc.Cell(cell_id=6)
|
||||
c6.add_surface(s5, -1)
|
||||
c6.add_surface(s36, +1)
|
||||
c6.add_surface(s37, -1)
|
||||
c6.region = -s5 & +s36 & -s37
|
||||
c6.fill = top_fa
|
||||
|
||||
c7 = openmc.Cell(cell_id=7)
|
||||
c7.add_surface(s5, -1)
|
||||
c7.add_surface(s37, +1)
|
||||
c7.add_surface(s38, -1)
|
||||
c7.region = -s5 & +s37 & -s38
|
||||
c7.fill = top_nozzle
|
||||
|
||||
c8 = openmc.Cell(cell_id=8)
|
||||
c8.add_surface(s7, -1)
|
||||
c8.add_surface(s38, +1)
|
||||
c8.add_surface(s39, -1)
|
||||
c8.region = -s7 & +s38 & -s39
|
||||
c8.fill = upper_rad_ref
|
||||
|
||||
c9 = openmc.Cell(cell_id=9)
|
||||
c9.add_surface(s6, +1)
|
||||
c9.add_surface(s7, -1)
|
||||
c9.add_surface(s32, +1)
|
||||
c9.add_surface(s38, -1)
|
||||
c9.region = +s6 & -s7 & +s32 & -s38
|
||||
c9.fill = bot_nozzle
|
||||
|
||||
c10 = openmc.Cell(cell_id=10)
|
||||
c10.add_surface(s7, +1)
|
||||
c10.add_surface(s8, -1)
|
||||
c10.add_surface(s31, +1)
|
||||
c10.add_surface(s39, -1)
|
||||
c10.region = +s7 & -s8 & +s31 & -s39
|
||||
c10.fill = rpv_steel
|
||||
|
||||
c11 = openmc.Cell(cell_id=11)
|
||||
c11.add_surface(s5, +1)
|
||||
c11.add_surface(s6, -1)
|
||||
c11.add_surface(s32, +1)
|
||||
c11.add_surface(s34, -1)
|
||||
c11.region = +s5 & -s6 & +s32 & -s34
|
||||
c11.fill = lower_rad_ref
|
||||
|
||||
c12 = openmc.Cell(cell_id=12)
|
||||
c12.add_surface(s5, +1)
|
||||
c12.add_surface(s6, -1)
|
||||
c12.add_surface(s36, +1)
|
||||
c12.add_surface(s38, -1)
|
||||
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))
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
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
|
||||
16
tests/test_complex_cell/settings.xml
Normal file
16
tests/test_complex_cell/settings.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
7
tests/test_complex_cell/tallies.xml
Normal file
7
tests/test_complex_cell/tallies.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<tallies>
|
||||
<tally id="1">
|
||||
<filter type="cell" bins="1 2 3 4" />
|
||||
<scores>total</scores>
|
||||
</tally>
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -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,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,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,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,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,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,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,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 +1 @@
|
|||
3b06e27fa039762b59076bb9431ef003e69ef32f8d01bcf908fe85f59bf7127bd8b94bf2f895b1b63e9fcdbd97aeaf4b02bc02e7bd029bfd85263c68498ce562
|
||||
caae173f01f7073d634a68a5c4ce97177423e13596a863976e1c40303dc8c05afed457d5a1aa0ae73627ec953143e4f9c1f45bdbd3b0cca76433062467d59777
|
||||
|
|
@ -1 +1 @@
|
|||
6dd7d019587330bbf9c19bae7ad1d888331858b68bd77218315d5fa7b85df7fb97cb208daed584a780592cf9840e67ea3777ccbde502f3861798aac95722be9c
|
||||
2f24eb86cda981982a8db5bb110c72e9cef542c06e15b748c1c7e459f96b0d8ba0978b51dffc006e813cd2e2ae1fa0357336f8322ae263189841afde01f0327b
|
||||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<geometry>
|
||||
<cell fill="5" id="1" name="Cell 1" surfaces="1 -2 3 -4" universe="0" />
|
||||
<cell id="101" material="1" name="cell 2" surfaces="-5" universe="1" />
|
||||
<cell id="102" material="2" name="cell 3" surfaces="5" universe="1" />
|
||||
<cell id="500" material="2" name="cell 4" surfaces="" universe="3" />
|
||||
<cell fill="5" id="1" name="Cell 1" region="1 -2 3 -4" universe="0" />
|
||||
<cell id="101" material="1" name="cell 2" region="-5" universe="1" />
|
||||
<cell id="102" material="2" name="cell 3" region="5" universe="1" />
|
||||
<cell id="500" material="2" name="cell 4" region="" universe="3" />
|
||||
<hex_lattice id="5" n_rings="2">
|
||||
<pitch>1.0</pitch>
|
||||
<outer>3</outer>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
bc9f43ff6368da544942b93ecfb2561911071c44524e35608fcb92c1262fe5543e09525414a87cd647fbc50113d64ff867730e5f4391f31b096abd7a0543b474
|
||||
49835200052ee1a4c9583a7bb4e9430de7d01a6d7a8d4f63ae37be9bbac4fd8c7ed9135ecbc4ab4cb075fd4d77b322265783463dd07c127decceee8c9fe25bfd
|
||||
|
|
@ -1 +1 @@
|
|||
74c55768b2b0f5696d5bff9d36a3639c6d858bf2984d799c8b46908b897af11e691b1f9f05646d52fcee046de3bfee11e35b9b379b2967abb0922f60168017b7
|
||||
183b4a06cbd0930cfa4f28d0c385cf3ae93ab97c171580c2ba9eec0e4b716102ad83f510d62258ef6769c446e72e1d5ba9f630b171ee239ec04c9bbd1e56742e
|
||||
|
|
@ -1 +1 @@
|
|||
dd69e0768aa7a4e28efd20adc6a607337c9a15682fa307b1aa2459595f90a523f1fa6e4e4f6db1d74e52a2287ef4efa85d77b1751cd1a2d2e6618385cf7f4607
|
||||
461a6a4ec3b0b6dc7199c09fa8f527e51cc7a1ea4281a708f8b7bcdbb12f7162027928dfcef68a24eaf6c06037a68e151df9aac9eac6ce56617466f2f5270b71
|
||||
|
|
@ -1 +1 @@
|
|||
91dd096441a7f01689ed605b7b3322c63a90c4802d73450acd825b715a8163fc892b4971e4b8b0d5a179eb51ad22bcc886f3935e7ab734d0fedebaf679415816
|
||||
2fbd0986abff08126680925284929cf67bdad0cd564775197b78065ce3b0e6ad8094f5ca4d14ea69347db69a6cdcc9796a095178ae9b14a927b101f32f3cd0ec
|
||||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
f3dc4c28827ca9035d2d1a39f4adef794f0e27b8c95776485e419b9610aefc6c268e6a1d5889d8170ec9400fc3a4a52bc69cd94e5056078aee7405e0bc62bad5
|
||||
51fcaf0aa527d1fd1022e5f312d4d25cd9bacc5fc9792d9f7702ee97cac43700a31f25be767a2cff769c37b5e1cdf3f922467977a9958fa34561e2a102bf8537
|
||||
|
|
@ -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,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
<cell id="11" universe="11" material="1"/>
|
||||
<cell id="12" universe="12" material="2" surfaces=""/>
|
||||
<cell id="12" universe="12" material="2" region=""/>
|
||||
|
||||
<lattice id="21" dimension="2 2" lower_left="-2.0 -2.0"
|
||||
pitch="2.0 2.0" outer="12">
|
||||
|
|
@ -13,5 +13,5 @@
|
|||
|
||||
|
||||
<surface id="101" type="z-cylinder" coeffs="0.0 0.0 5.0" boundary="vacuum"/>
|
||||
<cell id="101" universe="0" fill="21" surfaces="-101"/>
|
||||
<cell id="101" universe="0" fill="21" region="-101"/>
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@
|
|||
|
||||
|
||||
<!-- overall geometry -->
|
||||
<cell id="1" material="4" surfaces="21 23 -25 1 -2" /> <!-- Bottom and Top Refl -->
|
||||
<cell id="2" material="5" surfaces="21 23 -25 2 -4" /> <!-- Aluminum Plate -->
|
||||
<cell id="3" fill="11" surfaces="21 23 -25 4 -12" /> <!-- Core Lattice -->
|
||||
<cell id="4" material="6" surfaces="21 23 -25 12 -14" /> <!-- Lead Shield -->
|
||||
<cell id="5" material="4" surfaces="21 23 -25 14 -15" /> <!-- Bottom and Top Refl -->
|
||||
<cell id="1" material="4" region="21 23 -25 1 -2" /> <!-- Bottom and Top Refl -->
|
||||
<cell id="2" material="5" region="21 23 -25 2 -4" /> <!-- Aluminum Plate -->
|
||||
<cell id="3" fill="11" region="21 23 -25 4 -12" /> <!-- Core Lattice -->
|
||||
<cell id="4" material="6" region="21 23 -25 12 -14" /> <!-- Lead Shield -->
|
||||
<cell id="5" material="4" region="21 23 -25 14 -15" /> <!-- Bottom and Top Refl -->
|
||||
|
||||
<!-- Cube cell filled Fuel -->
|
||||
<lattice id="11">
|
||||
|
|
@ -85,38 +85,38 @@
|
|||
</lattice>
|
||||
|
||||
<!-- fuel cell universe -->
|
||||
<cell id="21" universe="1" material="3" surfaces="-6 -36" /> <!-- Bottom Clad -->
|
||||
<cell id="22" universe="1" material="2" surfaces=" 6 -7 -35" /> <!-- UO2 layer -->
|
||||
<cell id="23" universe="1" material="1" surfaces=" 7 -11 -35" /> <!-- MOX -->
|
||||
<cell id="24" universe="1" material="3" surfaces=" 6 -11 35 -36" /> <!-- Middle Clad -->
|
||||
<cell id="25" universe="1" material="3" surfaces="11 -36" /> <!-- Top clad -->
|
||||
<cell id="26" universe="1" material="4" surfaces="-5 36" /> <!-- Moderator below bottom egg-crate -->
|
||||
<cell id="27" universe="1" material="5" surfaces=" 5 -8 -37" /> <!-- Bottom Al Egg-Crate Left -->
|
||||
<cell id="28" universe="1" material="5" surfaces=" 5 -8 38" /> <!-- Bottom Al Egg-Crate Right -->
|
||||
<cell id="29" universe="1" material="5" surfaces=" 5 -8 -39 37 -38" /> <!-- Bottom Al Egg-Crate Top -->
|
||||
<cell id="30" universe="1" material="5" surfaces=" 5 -8 40 37 -38" /> <!-- Bottom Al Egg-Crate Bottom -->
|
||||
<cell id="31" universe="1" material="4" surfaces=" 5 -8 37 -38 39 -40 36" /> <!-- Moderator within bottom egg-crate -->
|
||||
<cell id="32" universe="1" material="4" surfaces=" 8 -9 36" /> <!-- Moderator in middle -->
|
||||
<cell id="33" universe="1" material="5" surfaces=" 9 -10 -37" /> <!-- Top Al Egg-Crate Left -->
|
||||
<cell id="34" universe="1" material="5" surfaces=" 9 -10 38" /> <!-- Top Al Egg-Crate Right -->
|
||||
<cell id="35" universe="1" material="5" surfaces=" 9 -10 -39 37 -38" /> <!-- Top Al Egg-Crate Top -->
|
||||
<cell id="36" universe="1" material="5" surfaces=" 9 -10 40 37 -38" /> <!-- Top Al Egg-Crate Bottom -->
|
||||
<cell id="37" universe="1" material="4" surfaces=" 9 -10 37 -38 39 -40 36" /> <!-- Moderator within top egg-crate -->
|
||||
<cell id="38" universe="1" material="4" surfaces="10 36" /> <!-- Moderator above top egg-crate -->
|
||||
<cell id="21" universe="1" material="3" region="-6 -36" /> <!-- Bottom Clad -->
|
||||
<cell id="22" universe="1" material="2" region=" 6 -7 -35" /> <!-- UO2 layer -->
|
||||
<cell id="23" universe="1" material="1" region=" 7 -11 -35" /> <!-- MOX -->
|
||||
<cell id="24" universe="1" material="3" region=" 6 -11 35 -36" /> <!-- Middle Clad -->
|
||||
<cell id="25" universe="1" material="3" region="11 -36" /> <!-- Top clad -->
|
||||
<cell id="26" universe="1" material="4" region="-5 36" /> <!-- Moderator below bottom egg-crate -->
|
||||
<cell id="27" universe="1" material="5" region=" 5 -8 -37" /> <!-- Bottom Al Egg-Crate Left -->
|
||||
<cell id="28" universe="1" material="5" region=" 5 -8 38" /> <!-- Bottom Al Egg-Crate Right -->
|
||||
<cell id="29" universe="1" material="5" region=" 5 -8 -39 37 -38" /> <!-- Bottom Al Egg-Crate Top -->
|
||||
<cell id="30" universe="1" material="5" region=" 5 -8 40 37 -38" /> <!-- Bottom Al Egg-Crate Bottom -->
|
||||
<cell id="31" universe="1" material="4" region=" 5 -8 37 -38 39 -40 36" /> <!-- Moderator within bottom egg-crate -->
|
||||
<cell id="32" universe="1" material="4" region=" 8 -9 36" /> <!-- Moderator in middle -->
|
||||
<cell id="33" universe="1" material="5" region=" 9 -10 -37" /> <!-- Top Al Egg-Crate Left -->
|
||||
<cell id="34" universe="1" material="5" region=" 9 -10 38" /> <!-- Top Al Egg-Crate Right -->
|
||||
<cell id="35" universe="1" material="5" region=" 9 -10 -39 37 -38" /> <!-- Top Al Egg-Crate Top -->
|
||||
<cell id="36" universe="1" material="5" region=" 9 -10 40 37 -38" /> <!-- Top Al Egg-Crate Bottom -->
|
||||
<cell id="37" universe="1" material="4" region=" 9 -10 37 -38 39 -40 36" /> <!-- Moderator within top egg-crate -->
|
||||
<cell id="38" universe="1" material="4" region="10 36" /> <!-- Moderator above top egg-crate -->
|
||||
|
||||
<!-- radial reflector cell universe -->
|
||||
<cell id="41" universe="2" material="4" surfaces="-5" /> <!-- Moderator below bottom egg-crate -->
|
||||
<cell id="42" universe="2" material="5" surfaces="5 -8 -37" /> <!-- Bottom Al Egg-Crate Left -->
|
||||
<cell id="43" universe="2" material="5" surfaces="5 -8 38" /> <!-- Bottom Al Egg-Crate Right -->
|
||||
<cell id="44" universe="2" material="5" surfaces="5 -8 -39 37 -38" /> <!-- Bottom Al Egg-Crate Top -->
|
||||
<cell id="45" universe="2" material="5" surfaces="5 -8 40 37 -38" /> <!-- Bottom Al Egg-Crate Bottom -->
|
||||
<cell id="46" universe="2" material="4" surfaces="5 -8 37 -38 39 -40" /> <!-- Moderator within bottom egg-crate -->
|
||||
<cell id="47" universe="2" material="4" surfaces="8 -9" /> <!-- Moderator in middle -->
|
||||
<cell id="48" universe="2" material="5" surfaces="9 -10 -37" /> <!-- Top Al Egg-Crate Left -->
|
||||
<cell id="49" universe="2" material="5" surfaces="9 -10 38" /> <!-- Top Al Egg-Crate Right -->
|
||||
<cell id="50" universe="2" material="5" surfaces="9 -10 -39 37 -38" /> <!-- Top Al Egg-Crate Top -->
|
||||
<cell id="51" universe="2" material="5" surfaces="9 -10 40 37 -38" /> <!-- Top Al Egg-Crate Bottom -->
|
||||
<cell id="52" universe="2" material="4" surfaces="9 -10 37 -38 39 -40" /> <!-- Moderator within top egg-crate -->
|
||||
<cell id="53" universe="2" material="4" surfaces="10" /> <!-- Moderator within top egg-crate -->
|
||||
<cell id="41" universe="2" material="4" region="-5" /> <!-- Moderator below bottom egg-crate -->
|
||||
<cell id="42" universe="2" material="5" region="5 -8 -37" /> <!-- Bottom Al Egg-Crate Left -->
|
||||
<cell id="43" universe="2" material="5" region="5 -8 38" /> <!-- Bottom Al Egg-Crate Right -->
|
||||
<cell id="44" universe="2" material="5" region="5 -8 -39 37 -38" /> <!-- Bottom Al Egg-Crate Top -->
|
||||
<cell id="45" universe="2" material="5" region="5 -8 40 37 -38" /> <!-- Bottom Al Egg-Crate Bottom -->
|
||||
<cell id="46" universe="2" material="4" region="5 -8 37 -38 39 -40" /> <!-- Moderator within bottom egg-crate -->
|
||||
<cell id="47" universe="2" material="4" region="8 -9" /> <!-- Moderator in middle -->
|
||||
<cell id="48" universe="2" material="5" region="9 -10 -37" /> <!-- Top Al Egg-Crate Left -->
|
||||
<cell id="49" universe="2" material="5" region="9 -10 38" /> <!-- Top Al Egg-Crate Right -->
|
||||
<cell id="50" universe="2" material="5" region="9 -10 -39 37 -38" /> <!-- Top Al Egg-Crate Top -->
|
||||
<cell id="51" universe="2" material="5" region="9 -10 40 37 -38" /> <!-- Top Al Egg-Crate Bottom -->
|
||||
<cell id="52" universe="2" material="4" region="9 -10 37 -38 39 -40" /> <!-- Moderator within top egg-crate -->
|
||||
<cell id="53" universe="2" material="4" region="10" /> <!-- Moderator within top egg-crate -->
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -14,29 +14,29 @@
|
|||
<surface id="015" type="sphere" coeffs="0.0 0.0 -2.5639 2.0"/>
|
||||
<surface id="016" type="sphere" coeffs="0.0 0.0 2.5639 2.0"/>
|
||||
|
||||
<cell id="011" universe="011" material="void" surfaces="-011"/>
|
||||
<cell id="012" universe="011" material="13" surfaces="011 -012 015 016"/>
|
||||
<cell id="013" universe="011" material="void" surfaces="011 -012 -015"/>
|
||||
<cell id="014" universe="011" material="void" surfaces="011 -012 -016"/>
|
||||
<cell id="015" universe="011" material="void" surfaces="012 -013"/>
|
||||
<cell id="016" universe="011" material="21" surfaces="013 -014"/>
|
||||
<cell id="017" universe="011" material="01" surfaces="014"/>
|
||||
<cell id="011" universe="011" material="void" region="-011"/>
|
||||
<cell id="012" universe="011" material="13" region="011 -012 015 016"/>
|
||||
<cell id="013" universe="011" material="void" region="011 -012 -015"/>
|
||||
<cell id="014" universe="011" material="void" region="011 -012 -016"/>
|
||||
<cell id="015" universe="011" material="void" region="012 -013"/>
|
||||
<cell id="016" universe="011" material="21" region="013 -014"/>
|
||||
<cell id="017" universe="011" material="01" region="014"/>
|
||||
|
||||
|
||||
<!-- Universe 051: Central guide tube -->
|
||||
<surface id="051" type="z-cylinder" coeffs="0.0 0.0 0.44"/>
|
||||
<surface id="052" type="z-cylinder" coeffs="0.0 0.0 0.515"/>
|
||||
<cell id="051" universe="051" material="01" surfaces="-051"/>
|
||||
<cell id="052" universe="051" material="21" surfaces="051 -052"/>
|
||||
<cell id="053" universe="051" material="01" surfaces="052"/>
|
||||
<cell id="051" universe="051" material="01" region="-051"/>
|
||||
<cell id="052" universe="051" material="21" region="051 -052"/>
|
||||
<cell id="053" universe="051" material="01" region="052"/>
|
||||
|
||||
|
||||
<!-- Universe 055: Cluster tube -->
|
||||
<surface id="155" type="z-cylinder" coeffs="0.0 0.0 0.55"/>
|
||||
<surface id="156" type="z-cylinder" coeffs="0.0 0.0 0.63"/>
|
||||
<cell id="155" universe="055" material="01" surfaces="-155"/>
|
||||
<cell id="156" universe="055" material="22" surfaces="155 -156"/>
|
||||
<cell id="157" universe="055" material="01" surfaces="156"/>
|
||||
<cell id="155" universe="055" material="01" region="-155"/>
|
||||
<cell id="156" universe="055" material="22" region="155 -156"/>
|
||||
<cell id="157" universe="055" material="01" region="156"/>
|
||||
|
||||
|
||||
|
||||
|
|
@ -194,6 +194,6 @@
|
|||
<surface id="1008" type="z-plane" coeffs="177.4" boundary="vacuum"/>
|
||||
|
||||
<cell id="1001" universe="0" fill="101"
|
||||
surfaces="-1001 -1002 -1003 -1004 -1005 -1006 1007 -1008"/>
|
||||
region="-1001 -1002 -1003 -1004 -1005 -1006 1007 -1008"/>
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -15,29 +15,29 @@
|
|||
<surface id="015" type="sphere" coeffs="0.0 0.0 -2.5639 2.0"/>
|
||||
<surface id="016" type="sphere" coeffs="0.0 0.0 2.5639 2.0"/>
|
||||
|
||||
<cell id="011" universe="011" material="void" surfaces="-011"/>
|
||||
<cell id="012" universe="011" material="13" surfaces="011 -012 015 016"/>
|
||||
<cell id="013" universe="011" material="void" surfaces="011 -012 -015"/>
|
||||
<cell id="014" universe="011" material="void" surfaces="011 -012 -016"/>
|
||||
<cell id="015" universe="011" material="void" surfaces="012 -013"/>
|
||||
<cell id="016" universe="011" material="21" surfaces="013 -014"/>
|
||||
<cell id="017" universe="011" material="01" surfaces="014"/>
|
||||
<cell id="011" universe="011" material="void" region="-011"/>
|
||||
<cell id="012" universe="011" material="13" region="011 -012 015 016"/>
|
||||
<cell id="013" universe="011" material="void" region="011 -012 -015"/>
|
||||
<cell id="014" universe="011" material="void" region="011 -012 -016"/>
|
||||
<cell id="015" universe="011" material="void" region="012 -013"/>
|
||||
<cell id="016" universe="011" material="21" region="013 -014"/>
|
||||
<cell id="017" universe="011" material="01" region="014"/>
|
||||
|
||||
|
||||
<!-- Universe 051: Central guide tube -->
|
||||
<surface id="051" type="z-cylinder" coeffs="0.0 0.0 0.44"/>
|
||||
<surface id="052" type="z-cylinder" coeffs="0.0 0.0 0.515"/>
|
||||
<cell id="051" universe="051" material="01" surfaces="-051"/>
|
||||
<cell id="052" universe="051" material="21" surfaces="051 -052"/>
|
||||
<cell id="053" universe="051" material="01" surfaces="052"/>
|
||||
<cell id="051" universe="051" material="01" region="-051"/>
|
||||
<cell id="052" universe="051" material="21" region="051 -052"/>
|
||||
<cell id="053" universe="051" material="01" region="052"/>
|
||||
|
||||
|
||||
<!-- Universe 055: Cluster tube -->
|
||||
<surface id="155" type="z-cylinder" coeffs="0.0 0.0 0.55"/>
|
||||
<surface id="156" type="z-cylinder" coeffs="0.0 0.0 0.63"/>
|
||||
<cell id="155" universe="055" material="01" surfaces="-155"/>
|
||||
<cell id="156" universe="055" material="22" surfaces="155 -156"/>
|
||||
<cell id="157" universe="055" material="01" surfaces="156"/>
|
||||
<cell id="155" universe="055" material="01" region="-155"/>
|
||||
<cell id="156" universe="055" material="22" region="155 -156"/>
|
||||
<cell id="157" universe="055" material="01" region="156"/>
|
||||
|
||||
|
||||
|
||||
|
|
@ -151,6 +151,6 @@
|
|||
<surface id="1008" type="z-plane" coeffs="177.4" boundary="vacuum"/>
|
||||
|
||||
<cell id="1001" universe="0" fill="103"
|
||||
surfaces="-1001 -1002 -1003 -1004 -1005 -1006 1007 -1008"/>
|
||||
region="-1001 -1002 -1003 -1004 -1005 -1006 1007 -1008"/>
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -45,50 +45,50 @@
|
|||
|
||||
|
||||
<!-- Beryllium Reflector -->
|
||||
<cell id="1" material="2" surfaces=" 1 -2 -30" />
|
||||
<cell id="2" material="2" surfaces="28 -29 -30" />
|
||||
<cell id="1" material="2" region=" 1 -2 -30" />
|
||||
<cell id="2" material="2" region="28 -29 -30" />
|
||||
|
||||
<!-- Duralumin base and top -->
|
||||
<cell id="3" material="4" surfaces=" 2 -4 -30 31" />
|
||||
<cell id="4" material="4" surfaces="25 -28 -30 31" />
|
||||
<cell id="3" material="4" region=" 2 -4 -30 31" />
|
||||
<cell id="4" material="4" region="25 -28 -30 31" />
|
||||
|
||||
<!-- Duralumin top cylindrical shell -->
|
||||
<cell id="6" material="5" surfaces="15 -28 -31 32" />
|
||||
<cell id="6" material="5" region="15 -28 -31 32" />
|
||||
|
||||
<!-- Duralumin bottom cylindrical shell -->
|
||||
<cell id="7" material="6" surfaces=" 2 -14 -31 32" />
|
||||
<cell id="7" material="6" region=" 2 -14 -31 32" />
|
||||
|
||||
<!-- Steel Cover -->
|
||||
<cell id="8" material="3" surfaces=" 2 -3 -33" />
|
||||
<cell id="9" material="3" surfaces=" 5 -6 -33" />
|
||||
<cell id="10" material="3" surfaces=" 7 -8 -33" />
|
||||
<cell id="11" material="3" surfaces=" 9 -10 -33" />
|
||||
<cell id="12" material="3" surfaces="11 -12 -33" />
|
||||
<cell id="13" material="3" surfaces="13 -14 -33" />
|
||||
<cell id="14" material="3" surfaces="15 -16 -33" />
|
||||
<cell id="15" material="3" surfaces="17 -18 -33" />
|
||||
<cell id="16" material="3" surfaces="19 -20 -33" />
|
||||
<cell id="17" material="3" surfaces="21 -22 -33" />
|
||||
<cell id="18" material="3" surfaces="23 -24 -33" />
|
||||
<cell id="19" material="3" surfaces="26 -27 -33" />
|
||||
<cell id="20" material="3" surfaces=" 2 -14 33 -32" />
|
||||
<cell id="21" material="3" surfaces="15 -27 33 -32" />
|
||||
<cell id="8" material="3" region=" 2 -3 -33" />
|
||||
<cell id="9" material="3" region=" 5 -6 -33" />
|
||||
<cell id="10" material="3" region=" 7 -8 -33" />
|
||||
<cell id="11" material="3" region=" 9 -10 -33" />
|
||||
<cell id="12" material="3" region="11 -12 -33" />
|
||||
<cell id="13" material="3" region="13 -14 -33" />
|
||||
<cell id="14" material="3" region="15 -16 -33" />
|
||||
<cell id="15" material="3" region="17 -18 -33" />
|
||||
<cell id="16" material="3" region="19 -20 -33" />
|
||||
<cell id="17" material="3" region="21 -22 -33" />
|
||||
<cell id="18" material="3" region="23 -24 -33" />
|
||||
<cell id="19" material="3" region="26 -27 -33" />
|
||||
<cell id="20" material="3" region=" 2 -14 33 -32" />
|
||||
<cell id="21" material="3" region="15 -27 33 -32" />
|
||||
|
||||
<!-- Plutonium -->
|
||||
<cell id="22" material="1" surfaces=" 3 -5 -33" />
|
||||
<cell id="23" material="1" surfaces=" 6 -7 -33" />
|
||||
<cell id="24" material="1" surfaces=" 8 -9 -33" />
|
||||
<cell id="25" material="1" surfaces="10 -11 -33" />
|
||||
<cell id="26" material="1" surfaces="12 -13 -33" />
|
||||
<cell id="27" material="1" surfaces="16 -17 -33" />
|
||||
<cell id="28" material="1" surfaces="18 -19 -33" />
|
||||
<cell id="29" material="1" surfaces="20 -21 -33" />
|
||||
<cell id="30" material="1" surfaces="22 -23 -33" />
|
||||
<cell id="31" material="1" surfaces="24 -26 -33" />
|
||||
<cell id="22" material="1" region=" 3 -5 -33" />
|
||||
<cell id="23" material="1" region=" 6 -7 -33" />
|
||||
<cell id="24" material="1" region=" 8 -9 -33" />
|
||||
<cell id="25" material="1" region="10 -11 -33" />
|
||||
<cell id="26" material="1" region="12 -13 -33" />
|
||||
<cell id="27" material="1" region="16 -17 -33" />
|
||||
<cell id="28" material="1" region="18 -19 -33" />
|
||||
<cell id="29" material="1" region="20 -21 -33" />
|
||||
<cell id="30" material="1" region="22 -23 -33" />
|
||||
<cell id="31" material="1" region="24 -26 -33" />
|
||||
|
||||
<!-- Void -->
|
||||
<cell id="32" material="void" surfaces="14 -15 -31" />
|
||||
<cell id="33" material="void" surfaces=" 4 -25 31 -30" />
|
||||
<cell id="34" material="void" surfaces="27 -28 -30" />
|
||||
<cell id="32" material="void" region="14 -15 -31" />
|
||||
<cell id="33" material="void" region=" 4 -25 31 -30" />
|
||||
<cell id="34" material="void" region="27 -28 -30" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
<!-- Sphere with no boundary condition -->
|
||||
<surface id="1" type="sphere" coeffs="0.0 0.0 0.0 80.0" />
|
||||
<surface id="2" type="sphere" coeffs="0.0 0.0 0.0 10000.0" boundary="vacuum" />
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
<!-- Sphere with no boundary condition -->
|
||||
<surface id="1" type="sphere" coeffs="0.0 0.0 0.0 80.0" />
|
||||
<surface id="2" type="sphere" coeffs="0.0 0.0 0.0 10000.0" boundary="vacuum" />
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<surface id="3" type="z-cylinder" coeffs="0 0 10" boundary="vacuum" />
|
||||
<surface id="4" type="y-plane" coeffs="5" boundary="vacuum" />
|
||||
|
||||
<cell id="1" material="1" surfaces=" -1 -4" />
|
||||
<cell id="2" material="3" surfaces="1 -2 -4" />
|
||||
<cell id="3" material="2" surfaces="2 -3 -4" />
|
||||
<cell id="1" material="1" region=" -1 -4" />
|
||||
<cell id="2" material="3" region="1 -2 -4" />
|
||||
<cell id="3" material="2" region="2 -3 -4" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
6a2400a95ea5baee432dd04a85252818d682004dc80b225b99c4bbc7cfd20d8523bd8e5df8a272df288cb2f300e5eee55f7ffa7b4d28ea64f92b78839ab0e86b
|
||||
368e0135c136d5c8a2dabb4c8085279dc7ac0bd81b2ec905bdf11ecb5fe99803868631cdff0b3ddec941323bcc661747d4c16edfd4f8d38582155bd6fd7e82e8
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<surface id="3" type="z-cylinder" coeffs="0 0 10" boundary="vacuum" />
|
||||
<surface id="4" type="y-plane" coeffs="5" boundary="vacuum" />
|
||||
|
||||
<cell id="1" material="1" surfaces=" -1 -4" />
|
||||
<cell id="2" material="3" surfaces="1 -2 -4" />
|
||||
<cell id="3" material="2" surfaces="2 -3 -4" />
|
||||
<cell id="1" material="1" region=" -1 -4" />
|
||||
<cell id="2" material="3" region="1 -2 -4" />
|
||||
<cell id="3" material="2" region="2 -3 -4" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
d888a734d6e69c5ca92457dc865c4defd8a1d8a1d4a01e0c8e7c528dde25d96df1283da37889dac0857329051958be2f2b491f2fd2bc22c8424a60ec6cda04bd
|
||||
a7cb65bf40c84c0540d45ff292c398f9ae51b3d9396e88b9b4e5cdf05e8730f409bddb53aec6d396058194c6293c5bd3ef39efd0b0f30f2423f696193c85176c
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
<geometry>
|
||||
|
||||
<surface id="1" type="z-cone" coeffs="0 0 0 5" boundary="reflective"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- cylinder with radius 10 -->
|
||||
<surface id="1" type="z-cylinder" coeffs="0 0 10" boundary="reflective"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@
|
|||
<surface id="4" type="y-plane" coeffs="5" boundary="reflective"/>
|
||||
<surface id="5" type="z-plane" coeffs="-5" boundary="reflective"/>
|
||||
<surface id="6" type="z-plane" coeffs="5" boundary="reflective"/>
|
||||
<cell id="1" material="1" surfaces="1 -2 3 -4 5 -6" />
|
||||
<cell id="1" material="1" region="1 -2 3 -4 5 -6" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="reflective"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
<cell id="1" material="1" region="-1" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
k-combined:
|
||||
2.271012E+00 3.466350E-03
|
||||
2.271012E+00 3.466351E-03
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<surface id="2" type="z-plane" coeffs="-100" />
|
||||
<surface id="3" type="z-plane" coeffs="100" />
|
||||
|
||||
<cell id="1" fill="2" rotation="45 45 45" surfaces="-1" />
|
||||
<cell id="2" universe="2" material="1" surfaces="2 -3" />
|
||||
<cell id="1" fill="2" rotation="45 45 45" region="-1" />
|
||||
<cell id="2" universe="2" material="1" region="2 -3" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<surface id="3" type="x-plane" coeffs="5" />
|
||||
<surface id="4" type="x-plane" coeffs="10" boundary="vacuum"/>
|
||||
|
||||
<cell id="1" material="1" surfaces="1 -2" />
|
||||
<cell id="2" material="2" surfaces="2 -3" />
|
||||
<cell id="3" material="3" surfaces="3 -4" />
|
||||
<cell id="1" material="1" region="1 -2" />
|
||||
<cell id="2" material="2" region="2 -3" />
|
||||
<cell id="3" material="3" region="3 -4" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -45,52 +45,52 @@
|
|||
|
||||
|
||||
<!-- Bottom Beryllium Reflector -->
|
||||
<cell id="1" material="2" surfaces=" 1 -2 -30" />
|
||||
<cell id="1" material="2" region=" 1 -2 -30" />
|
||||
|
||||
<!-- Top ZrH Reflector -->
|
||||
<cell id="2" material="7" surfaces="28 -29 -30" />
|
||||
<cell id="2" material="7" region="28 -29 -30" />
|
||||
|
||||
<!-- Duralumin base and top -->
|
||||
<cell id="3" material="4" surfaces=" 2 -4 -30 31" />
|
||||
<cell id="4" material="4" surfaces="25 -28 -30 31" />
|
||||
<cell id="3" material="4" region=" 2 -4 -30 31" />
|
||||
<cell id="4" material="4" region="25 -28 -30 31" />
|
||||
|
||||
<!-- Duralumin top cylindrical shell -->
|
||||
<cell id="6" material="5" surfaces="15 -28 -31 32" />
|
||||
<cell id="6" material="5" region="15 -28 -31 32" />
|
||||
|
||||
<!-- Duralumin bottom cylindrical shell -->
|
||||
<cell id="7" material="6" surfaces=" 2 -14 -31 32" />
|
||||
<cell id="7" material="6" region=" 2 -14 -31 32" />
|
||||
|
||||
<!-- Steel Cover -->
|
||||
<cell id="8" material="3" surfaces=" 2 -3 -33" />
|
||||
<cell id="9" material="3" surfaces=" 5 -6 -33" />
|
||||
<cell id="10" material="3" surfaces=" 7 -8 -33" />
|
||||
<cell id="11" material="3" surfaces=" 9 -10 -33" />
|
||||
<cell id="12" material="3" surfaces="11 -12 -33" />
|
||||
<cell id="13" material="3" surfaces="13 -14 -33" />
|
||||
<cell id="14" material="3" surfaces="15 -16 -33" />
|
||||
<cell id="15" material="3" surfaces="17 -18 -33" />
|
||||
<cell id="16" material="3" surfaces="19 -20 -33" />
|
||||
<cell id="17" material="3" surfaces="21 -22 -33" />
|
||||
<cell id="18" material="3" surfaces="23 -24 -33" />
|
||||
<cell id="19" material="3" surfaces="26 -27 -33" />
|
||||
<cell id="20" material="3" surfaces=" 2 -14 33 -32" />
|
||||
<cell id="21" material="3" surfaces="15 -27 33 -32" />
|
||||
<cell id="8" material="3" region=" 2 -3 -33" />
|
||||
<cell id="9" material="3" region=" 5 -6 -33" />
|
||||
<cell id="10" material="3" region=" 7 -8 -33" />
|
||||
<cell id="11" material="3" region=" 9 -10 -33" />
|
||||
<cell id="12" material="3" region="11 -12 -33" />
|
||||
<cell id="13" material="3" region="13 -14 -33" />
|
||||
<cell id="14" material="3" region="15 -16 -33" />
|
||||
<cell id="15" material="3" region="17 -18 -33" />
|
||||
<cell id="16" material="3" region="19 -20 -33" />
|
||||
<cell id="17" material="3" region="21 -22 -33" />
|
||||
<cell id="18" material="3" region="23 -24 -33" />
|
||||
<cell id="19" material="3" region="26 -27 -33" />
|
||||
<cell id="20" material="3" region=" 2 -14 33 -32" />
|
||||
<cell id="21" material="3" region="15 -27 33 -32" />
|
||||
|
||||
<!-- Plutonium -->
|
||||
<cell id="22" material="1" surfaces=" 3 -5 -33" />
|
||||
<cell id="23" material="1" surfaces=" 6 -7 -33" />
|
||||
<cell id="24" material="1" surfaces=" 8 -9 -33" />
|
||||
<cell id="25" material="1" surfaces="10 -11 -33" />
|
||||
<cell id="26" material="1" surfaces="12 -13 -33" />
|
||||
<cell id="27" material="1" surfaces="16 -17 -33" />
|
||||
<cell id="28" material="1" surfaces="18 -19 -33" />
|
||||
<cell id="29" material="1" surfaces="20 -21 -33" />
|
||||
<cell id="30" material="1" surfaces="22 -23 -33" />
|
||||
<cell id="31" material="1" surfaces="24 -26 -33" />
|
||||
<cell id="22" material="1" region=" 3 -5 -33" />
|
||||
<cell id="23" material="1" region=" 6 -7 -33" />
|
||||
<cell id="24" material="1" region=" 8 -9 -33" />
|
||||
<cell id="25" material="1" region="10 -11 -33" />
|
||||
<cell id="26" material="1" region="12 -13 -33" />
|
||||
<cell id="27" material="1" region="16 -17 -33" />
|
||||
<cell id="28" material="1" region="18 -19 -33" />
|
||||
<cell id="29" material="1" region="20 -21 -33" />
|
||||
<cell id="30" material="1" region="22 -23 -33" />
|
||||
<cell id="31" material="1" region="24 -26 -33" />
|
||||
|
||||
<!-- Void -->
|
||||
<cell id="32" material="void" surfaces="14 -15 -31" />
|
||||
<cell id="33" material="void" surfaces=" 4 -25 31 -30" />
|
||||
<cell id="34" material="void" surfaces="27 -28 -30" />
|
||||
<cell id="32" material="void" region="14 -15 -31" />
|
||||
<cell id="33" material="void" region=" 4 -25 31 -30" />
|
||||
<cell id="34" material="void" region="27 -28 -30" />
|
||||
|
||||
</geometry>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
6ba3ebe9d50584343b012b7a935a0f75b8366659600d4de050a8e4e48405f8da36682e8ab5f495f69b646fc72e176755c0a3540f235806c73d5ebc4fc67db107
|
||||
63295b9d510370e65e63a3db627d47d286f5479e53c8eabeda9a5cb25ffe35becb636835aadad11691e34c23292fe11b5f688daee76d76ceac4b5dfd2f9ede4c
|
||||
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