Enhanced description of CSG in docs.

This commit is contained in:
Paul Romano 2012-06-28 13:31:43 -04:00
parent 3ff8762f75
commit fe5b61b941
3 changed files with 106 additions and 171 deletions

View file

@ -7,48 +7,12 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="302"
height="198.50891"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="New document 1">
width="338.45703"
height="172"
id="svg2">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="186"
inkscape:cy="5.0242485"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1366"
inkscape:window-height="712"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2985"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="-189px"
originy="-678.98718px" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
@ -62,40 +26,29 @@
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-189,-174.86609)">
transform="translate(-152.54297,-201.36218)"
id="layer1">
<path
sodipodi:type="arc"
style="fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 490,287.36218 a 150,85 0 1 1 -300,0 150,85 0 1 1 300,0 z"
id="path2987"
sodipodi:cx="340"
sodipodi:cy="287.36218"
sodipodi:rx="150"
sodipodi:ry="85"
d="m 490,287.36218 c 0,46.94421 -67.15729,85 -150,85 -82.84271,0 -150,-38.05579 -150,-85 0,-46.9442 67.15729,-85 150,-85 82.84271,0 150,38.0558 150,85 z" />
style="fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<text
xml:space="preserve"
style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
x="210"
y="192.36218"
x="150"
y="272.36218"
id="text3765"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
x="210"
y="192.36218"
xml:space="preserve"
style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan
x="150"
y="272.36218"
id="tspan3769">+1</tspan></text>
<text
xml:space="preserve"
style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
x="300"
y="262.36218"
x="205"
y="272.36218"
id="text3765-4"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
x="300"
y="262.36218"
xml:space="preserve"
style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan
x="205"
y="272.36218"
id="tspan3794">-1</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Before After
Before After

View file

@ -7,48 +7,12 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="452"
height="272"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="halfspace.svg">
id="svg2">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="266"
inkscape:cy="103.43381"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1366"
inkscape:window-height="712"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2985"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="-109px"
originy="-629px" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
@ -62,102 +26,80 @@
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-109,-151.36218)">
transform="translate(-109,-151.36218)"
id="layer1">
<path
sodipodi:type="arc"
style="fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 490,287.36218 a 150,85 0 1 1 -300,0 150,85 0 1 1 300,0 z"
id="path2987"
sodipodi:cx="340"
sodipodi:cy="287.36218"
sodipodi:rx="150"
sodipodi:ry="85"
d="m 490,287.36218 c 0,46.94421 -67.15729,85 -150,85 -82.84271,0 -150,-38.05579 -150,-85 0,-46.9442 67.15729,-85 150,-85 82.84271,0 150,38.0558 150,85 z" />
style="fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 151,-22.503909 0,269.999999"
transform="translate(189,174.86609)"
id="path3817"
inkscape:connector-curvature="0"
transform="translate(189,174.86609)" />
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m -79,127.49609 450,0"
transform="translate(189,174.86609)"
id="path3819"
inkscape:connector-curvature="0"
transform="translate(189,174.86609)" />
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
style="fill:#aab4ff;fill-opacity:1;stroke:none"
d="m 152.14286,162.63371 0,-33.57143 72.14285,0 c 39.67858,0 72.14286,0.1556 72.14286,0.34577 0,0.83636 -4.22498,8.93075 -6.5305,12.51137 -1.39125,2.16072 -4.89349,6.45329 -7.78275,9.53904 -19.70935,21.04977 -54.95495,36.54118 -96.04389,42.21394 -7.56736,1.04476 -25.70992,2.51107 -31.25,2.52568 l -2.67857,0.007 0,-33.57143 z"
transform="translate(189,174.86609)"
id="path3821"
inkscape:connector-curvature="0"
transform="translate(189,174.86609)" />
style="fill:#aab4ff;fill-opacity:1;stroke:none" />
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
x="210"
y="222.36218"
id="text3823"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3825"
x="210"
y="222.36218">+1</tspan></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan
x="210"
y="222.36218"
id="tspan3825">+1</tspan></text>
<text
x="240"
y="242.36218"
id="text3823-0"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3825-1"
x="240"
y="242.36218">-1</tspan></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan
x="240"
y="242.36218"
id="tspan3825-1">-1</tspan></text>
<text
x="315"
y="262.36218"
id="text3823-0-5"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3825-1-8"
x="315"
y="262.36218">-2</tspan></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan
x="315"
y="262.36218"
id="tspan3825-1-8">-2</tspan></text>
<text
x="345"
y="262.36218"
id="text3823-0-5-2"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3825-1-8-2"
x="345"
y="262.36218">+2</tspan></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan
x="345"
y="262.36218"
id="tspan3825-1-8-2">+2</tspan></text>
<text
x="260"
y="322.36218"
id="text3823-0-5-0"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3825-1-8-0"
x="260"
y="322.36218">-3</tspan></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan
x="260"
y="322.36218"
id="tspan3825-1-8-0">-3</tspan></text>
<text
x="255"
y="297.36218"
id="text3823-0-5-2-4"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3825-1-8-2-2"
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"><tspan
x="255"
y="297.36218">+3</tspan></text>
y="297.36218"
id="tspan3825-1-8-2-2">+3</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

View file

@ -5,9 +5,51 @@ Geometry
========
OpenMC uses a technique known as `constructive solid geometry`_ (CSG) to build
arbitrarily complex 3D models. In a CSG model, every simply-connected region is
described as the union, intersection, or difference of half-spaces created by
bounding surfaces. In OpenMC, any second-order surface of the form
arbitrarily complex three-dimensional models in Euclidean space. In a CSG model,
every unique object is described as the union, intersection, or difference of
half-spaces created by bounding `surfaces`_. Every surface divides all of space
into exactly two half-spaces. We can mathematically define a surface as a
collection of points that satisfy an equation of the form :math:`f(x,y,z) = 0`
where :math:`f(x,y,z)` is a given function. The region for which :math:`f(x,y,z)
< 0` can be called the negative half-space (or simply the "negative side") and
the region for which :math:`f(x,y,z) > 0` can be called the positive half-space.
Let us take the example of a sphere centered at the point :math:`(x_0,y_0,z_0)`
with radius :math:`R`. One would normally write the equation of the sphere as
.. math::
(x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 = R^2
By subtracting the right-hand term from both sides of the equation, we can then
write the surface equation:
.. math::
f(x,y,z) = (x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 - R^2 = 0
One can confirm that any point inside this sphere will correspond to
:math:`f(x,y,z) < 0` and any point outside the sphere will correspond to
:math:`f(x,y,z) > 0`.
In OpenMC, every surface defined by the user is assigned an integer to uniquely
identify it. We can then refer to either of the two half-spaces created by a
surface by a combination of the unique ID of the surface and a positive/negative
sign. For example, to refer to the negative half-space of a sphere (the volume
inside the sphere) with unique ID 35, the reference would be -35. These
references to half-spaces are used in created regions in space of homogeneous
material, known as "cells".
.. figure:: ../../img/halfspace.svg
:align: center
:figclass: align-center
.. figure:: ../../img/union.svg
:align: center
:figclass: align-center
In OpenMC, any second-order surface of the form
.. math::
@ -16,9 +58,6 @@ bounding surfaces. In OpenMC, any second-order surface of the form
can be modeled in OpenMC. For example, the equation for a sphere centered at
:math:`(\bar{x},\bar{y},\bar{z})` and of radius :math:`R` can be written as
.. math::
f(x,y,z) = (x - \bar{x})^2 + (y - \bar{y})^2 + (z - \bar{z})^2 + R^2 = 0
-------------------
Reflective Surfaces
@ -40,3 +79,4 @@ gradient to the surface at the point of crossing, i.e. :math:`\mathbf{n} =
\nabla f(x,y,z)`.
.. _constructive solid geometry: http://en.wikipedia.org/wiki/Constructive_solid_geometry
.. _surfaces: http://en.wikipedia.org/wiki/Surface