Skip to content

Commit

Permalink
Clarifying documentation for Cones (#2892)
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahGale committed Mar 9, 2024
1 parent aa0516f commit 7ed1278
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 14 deletions.
24 changes: 15 additions & 9 deletions openmc/model/surface_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def __pos__(self):
class XConeOneSided(CompositeSurface):
"""One-sided cone parallel the x-axis
A one-sided cone is composed of a normal cone surface and an "ambiguity"
A one-sided cone is composed of a normal cone surface and a "disambiguation"
surface that eliminates the ambiguity as to which region of space is
included. This class acts as a proper surface, meaning that unary `+` and
`-` operators applied to it will produce a half-space. The negative side is
Expand All @@ -634,7 +634,9 @@ class XConeOneSided(CompositeSurface):
z0 : float, optional
z-coordinate of the apex. Defaults to 0.
r2 : float, optional
Parameter related to the aperature. Defaults to 1.
Parameter related to the aperture [:math:`\\rm cm^2`].
It can be interpreted as the increase in the radius squared per cm along
the cone's axis of revolution.
up : bool
Whether to select the side of the cone that extends to infinity in the
positive direction of the coordinate axis (the positive half-space of
Expand All @@ -647,7 +649,7 @@ class XConeOneSided(CompositeSurface):
cone : openmc.XCone
Regular two-sided cone
plane : openmc.XPlane
Ambiguity surface
Disambiguation surface
up : bool
Whether to select the side of the cone that extends to infinity in the
positive direction of the coordinate axis (the positive half-space of
Expand Down Expand Up @@ -675,7 +677,7 @@ def __pos__(self):
class YConeOneSided(CompositeSurface):
"""One-sided cone parallel the y-axis
A one-sided cone is composed of a normal cone surface and an "ambiguity"
A one-sided cone is composed of a normal cone surface and a "disambiguation"
surface that eliminates the ambiguity as to which region of space is
included. This class acts as a proper surface, meaning that unary `+` and
`-` operators applied to it will produce a half-space. The negative side is
Expand All @@ -692,7 +694,9 @@ class YConeOneSided(CompositeSurface):
z0 : float, optional
z-coordinate of the apex. Defaults to 0.
r2 : float, optional
Parameter related to the aperature. Defaults to 1.
Parameter related to the aperture [:math:`\\rm cm^2`].
It can be interpreted as the increase in the radius squared per cm along
the cone's axis of revolution.
up : bool
Whether to select the side of the cone that extends to infinity in the
positive direction of the coordinate axis (the positive half-space of
Expand All @@ -705,7 +709,7 @@ class YConeOneSided(CompositeSurface):
cone : openmc.YCone
Regular two-sided cone
plane : openmc.YPlane
Ambiguity surface
Disambiguation surface
up : bool
Whether to select the side of the cone that extends to infinity in the
positive direction of the coordinate axis (the positive half-space of
Expand All @@ -727,7 +731,7 @@ def __init__(self, x0=0., y0=0., z0=0., r2=1., up=True, **kwargs):
class ZConeOneSided(CompositeSurface):
"""One-sided cone parallel the z-axis
A one-sided cone is composed of a normal cone surface and an "ambiguity"
A one-sided cone is composed of a normal cone surface and a "disambiguation"
surface that eliminates the ambiguity as to which region of space is
included. This class acts as a proper surface, meaning that unary `+` and
`-` operators applied to it will produce a half-space. The negative side is
Expand All @@ -744,7 +748,9 @@ class ZConeOneSided(CompositeSurface):
z0 : float, optional
z-coordinate of the apex. Defaults to 0.
r2 : float, optional
Parameter related to the aperature. Defaults to 1.
Parameter related to the aperture [:math:`\\rm cm^2`].
It can be interpreted as the increase in the radius squared per cm along
the cone's axis of revolution.
up : bool
Whether to select the side of the cone that extends to infinity in the
positive direction of the coordinate axis (the positive half-space of
Expand All @@ -757,7 +763,7 @@ class ZConeOneSided(CompositeSurface):
cone : openmc.ZCone
Regular two-sided cone
plane : openmc.ZPlane
Ambiguity surface
Disambiguation surface
up : bool
Whether to select the side of the cone that extends to infinity in the
positive direction of the coordinate axis (the positive half-space of
Expand Down
35 changes: 30 additions & 5 deletions openmc/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,11 @@ def evaluate(self, point):
class Cone(QuadricMixin, Surface):
"""A conical surface parallel to the x-, y-, or z-axis.
.. Note::
This creates a double cone, which is two one-sided cones that meet at their apex.
For a one-sided cone see :class:`~openmc.model.XConeOneSided`,
:class:`~openmc.model.YConeOneSided`, and :class:`~openmc.model.ZConeOneSided`.
Parameters
----------
x0 : float, optional
Expand All @@ -1757,7 +1762,9 @@ class Cone(QuadricMixin, Surface):
z0 : float, optional
z-coordinate of the apex in [cm]. Defaults to 0.
r2 : float, optional
Parameter related to the aperature. Defaults to 1.
Parameter related to the aperture [:math:`\\rm cm^2`].
It can be interpreted as the increase in the radius squared per cm along
the cone's axis of revolution.
dx : float, optional
x-component of the vector representing the axis of the cone.
Defaults to 0.
Expand Down Expand Up @@ -1791,7 +1798,7 @@ class Cone(QuadricMixin, Surface):
z0 : float
z-coordinate of the apex in [cm]
r2 : float
Parameter related to the aperature
Parameter related to the aperature [cm^2]
dx : float
x-component of the vector representing the axis of the cone.
dy : float
Expand Down Expand Up @@ -1900,6 +1907,10 @@ class XCone(QuadricMixin, Surface):
"""A cone parallel to the x-axis of the form :math:`(y - y_0)^2 + (z - z_0)^2 =
r^2 (x - x_0)^2`.
.. Note::
This creates a double cone, which is two one-sided cones that meet at their apex.
For a one-sided cone see :class:`~openmc.model.XConeOneSided`.
Parameters
----------
x0 : float, optional
Expand All @@ -1909,7 +1920,9 @@ class XCone(QuadricMixin, Surface):
z0 : float, optional
z-coordinate of the apex in [cm]. Defaults to 0.
r2 : float, optional
Parameter related to the aperature. Defaults to 1.
Parameter related to the aperture [:math:`\\rm cm^2`].
It can be interpreted as the increase in the radius squared per cm along
the cone's axis of revolution.
boundary_type : {'transmission, 'vacuum', 'reflective', 'white'}, optional
Boundary condition that defines the behavior for particles hitting the
surface. Defaults to transmissive boundary condition where particles
Expand Down Expand Up @@ -1995,6 +2008,10 @@ class YCone(QuadricMixin, Surface):
"""A cone parallel to the y-axis of the form :math:`(x - x_0)^2 + (z - z_0)^2 =
r^2 (y - y_0)^2`.
.. Note::
This creates a double cone, which is two one-sided cones that meet at their apex.
For a one-sided cone see :class:`~openmc.model.YConeOneSided`.
Parameters
----------
x0 : float, optional
Expand All @@ -2004,7 +2021,9 @@ class YCone(QuadricMixin, Surface):
z0 : float, optional
z-coordinate of the apex in [cm]. Defaults to 0.
r2 : float, optional
Parameter related to the aperature. Defaults to 1.
Parameter related to the aperture [:math:`\\rm cm^2`].
It can be interpreted as the increase in the radius squared per cm along
the cone's axis of revolution.
boundary_type : {'transmission, 'vacuum', 'reflective', 'white'}, optional
Boundary condition that defines the behavior for particles hitting the
surface. Defaults to transmissive boundary condition where particles
Expand Down Expand Up @@ -2090,6 +2109,10 @@ class ZCone(QuadricMixin, Surface):
"""A cone parallel to the z-axis of the form :math:`(x - x_0)^2 + (y - y_0)^2 =
r^2 (z - z_0)^2`.
.. Note::
This creates a double cone, which is two one-sided cones that meet at their apex.
For a one-sided cone see :class:`~openmc.model.ZConeOneSided`.
Parameters
----------
x0 : float, optional
Expand All @@ -2099,7 +2122,9 @@ class ZCone(QuadricMixin, Surface):
z0 : float, optional
z-coordinate of the apex in [cm]. Defaults to 0.
r2 : float, optional
Parameter related to the aperature. Defaults to 1.
Parameter related to the aperature [cm^2].
This is the square of the radius of the cone 1 cm from.
This can also be treated as the square of the slope of the cone relative to its axis.
boundary_type : {'transmission, 'vacuum', 'reflective', 'white'}, optional
Boundary condition that defines the behavior for particles hitting the
surface. Defaults to transmissive boundary condition where particles
Expand Down

0 comments on commit 7ed1278

Please sign in to comment.