Skip to content

Commit

Permalink
Update to a consistent definition of the r2 parameter for cones (#3254)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Nyberg <[email protected]>
Co-authored-by: Paul Romano <[email protected]>
  • Loading branch information
3 people authored Jan 12, 2025
1 parent d2edf0c commit cf3f020
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 56 deletions.
45 changes: 24 additions & 21 deletions openmc/model/surface_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ def __neg__(self):


class XConeOneSided(CompositeSurface):
"""One-sided cone parallel the x-axis
r"""One-sided cone parallel the x-axis
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
Expand All @@ -742,15 +742,16 @@ class XConeOneSided(CompositeSurface):
Parameters
----------
x0 : float, optional
x-coordinate of the apex. Defaults to 0.
x-coordinate of the apex in [cm].
y0 : float, optional
y-coordinate of the apex. Defaults to 0.
y-coordinate of the apex in [cm].
z0 : float, optional
z-coordinate of the apex. Defaults to 0.
z-coordinate of the apex in [cm].
r2 : float, optional
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.
The square of the slope of the cone. It is defined as
:math:`\left(\frac{r}{h}\right)^2` for a radius, :math:`r` and an axial
distance :math:`h` from the apex. An easy way to define this quantity is
to take the square of the radius of the cone (in cm) 1 cm from the apex.
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 @@ -783,7 +784,7 @@ def __neg__(self):


class YConeOneSided(CompositeSurface):
"""One-sided cone parallel the y-axis
r"""One-sided cone parallel the y-axis
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
Expand All @@ -796,15 +797,16 @@ class YConeOneSided(CompositeSurface):
Parameters
----------
x0 : float, optional
x-coordinate of the apex. Defaults to 0.
x-coordinate of the apex in [cm].
y0 : float, optional
y-coordinate of the apex. Defaults to 0.
y-coordinate of the apex in [cm].
z0 : float, optional
z-coordinate of the apex. Defaults to 0.
z-coordinate of the apex in [cm].
r2 : float, optional
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.
The square of the slope of the cone. It is defined as
:math:`\left(\frac{r}{h}\right)^2` for a radius, :math:`r` and an axial
distance :math:`h` from the apex. An easy way to define this quantity is
to take the square of the radius of the cone (in cm) 1 cm from the apex.
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 @@ -836,7 +838,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
r"""One-sided cone parallel the z-axis
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
Expand All @@ -849,15 +851,16 @@ class ZConeOneSided(CompositeSurface):
Parameters
----------
x0 : float, optional
x-coordinate of the apex. Defaults to 0.
x-coordinate of the apex in [cm].
y0 : float, optional
y-coordinate of the apex. Defaults to 0.
y-coordinate of the apex in [cm].
z0 : float, optional
z-coordinate of the apex. Defaults to 0.
z-coordinate of the apex in [cm].
r2 : float, optional
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.
The square of the slope of the cone. It is defined as
:math:`\left(\frac{r}{h}\right)^2` for a radius, :math:`r` and an axial
distance :math:`h` from the apex. An easy way to define this quantity is
to take the square of the radius of the cone (in cm) 1 cm from the apex.
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
71 changes: 36 additions & 35 deletions openmc/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@ def evaluate(self, point):


class Cone(QuadricMixin, Surface):
"""A conical surface parallel to the x-, y-, or z-axis.
r"""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.
Expand All @@ -1763,24 +1763,22 @@ class Cone(QuadricMixin, Surface):
Parameters
----------
x0 : float, optional
x-coordinate of the apex in [cm]. Defaults to 0.
x-coordinate of the apex in [cm].
y0 : float, optional
y-coordinate of the apex in [cm]. Defaults to 0.
y-coordinate of the apex in [cm].
z0 : float, optional
z-coordinate of the apex in [cm]. Defaults to 0.
z-coordinate of the apex in [cm].
r2 : float, optional
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.
The square of the slope of the cone. It is defined as
:math:`\left(\frac{r}{h}\right)^2` for a radius, :math:`r` and an axial
distance :math:`h` from the apex. An easy way to define this quantity is
to take the square of the radius of the cone (in cm) 1 cm from the apex.
dx : float, optional
x-component of the vector representing the axis of the cone.
Defaults to 0.
dy : float, optional
y-component of the vector representing the axis of the cone.
Defaults to 0.
dz : float, optional
z-component of the vector representing the axis of the cone.
Defaults to 1.
surface_id : int, optional
Unique identifier for the surface. If not specified, an identifier will
automatically be assigned.
Expand All @@ -1805,7 +1803,7 @@ class Cone(QuadricMixin, Surface):
z0 : float
z-coordinate of the apex in [cm]
r2 : float
Parameter related to the aperature [cm^2]
Parameter related to the aperture
dx : float
x-component of the vector representing the axis of the cone.
dy : float
Expand Down Expand Up @@ -1911,7 +1909,7 @@ def to_xml_element(self):


class XCone(QuadricMixin, Surface):
"""A cone parallel to the x-axis of the form :math:`(y - y_0)^2 + (z - z_0)^2 =
r"""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::
Expand All @@ -1921,15 +1919,16 @@ class XCone(QuadricMixin, Surface):
Parameters
----------
x0 : float, optional
x-coordinate of the apex in [cm]. Defaults to 0.
x-coordinate of the apex in [cm].
y0 : float, optional
y-coordinate of the apex in [cm]. Defaults to 0.
y-coordinate of the apex in [cm].
z0 : float, optional
z-coordinate of the apex in [cm]. Defaults to 0.
z-coordinate of the apex in [cm].
r2 : float, optional
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.
The square of the slope of the cone. It is defined as
:math:`\left(\frac{r}{h}\right)^2` for a radius, :math:`r` and an axial
distance :math:`h` from the apex. An easy way to define this quantity is
to take the square of the radius of the cone (in cm) 1 cm from the apex.
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 All @@ -1953,7 +1952,7 @@ class XCone(QuadricMixin, Surface):
z0 : float
z-coordinate of the apex in [cm]
r2 : float
Parameter related to the aperature
Parameter related to the aperture
boundary_type : {'transmission', 'vacuum', 'reflective', 'white'}
Boundary condition that defines the behavior for particles hitting the
surface.
Expand Down Expand Up @@ -2012,7 +2011,7 @@ def evaluate(self, point):


class YCone(QuadricMixin, Surface):
"""A cone parallel to the y-axis of the form :math:`(x - x_0)^2 + (z - z_0)^2 =
r"""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::
Expand All @@ -2022,15 +2021,16 @@ class YCone(QuadricMixin, Surface):
Parameters
----------
x0 : float, optional
x-coordinate of the apex in [cm]. Defaults to 0.
x-coordinate of the apex in [cm].
y0 : float, optional
y-coordinate of the apex in [cm]. Defaults to 0.
y-coordinate of the apex in [cm].
z0 : float, optional
z-coordinate of the apex in [cm]. Defaults to 0.
z-coordinate of the apex in [cm].
r2 : float, optional
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.
The square of the slope of the cone. It is defined as
:math:`\left(\frac{r}{h}\right)^2` for a radius, :math:`r` and an axial
distance :math:`h` from the apex. An easy way to define this quantity is
to take the square of the radius of the cone (in cm) 1 cm from the apex.
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 All @@ -2054,7 +2054,7 @@ class YCone(QuadricMixin, Surface):
z0 : float
z-coordinate of the apex in [cm]
r2 : float
Parameter related to the aperature
Parameter related to the aperture
boundary_type : {'transmission', 'vacuum', 'reflective', 'white'}
Boundary condition that defines the behavior for particles hitting the
surface.
Expand Down Expand Up @@ -2113,7 +2113,7 @@ def evaluate(self, point):


class ZCone(QuadricMixin, Surface):
"""A cone parallel to the z-axis of the form :math:`(x - x_0)^2 + (y - y_0)^2 =
r"""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::
Expand All @@ -2123,15 +2123,16 @@ class ZCone(QuadricMixin, Surface):
Parameters
----------
x0 : float, optional
x-coordinate of the apex in [cm]. Defaults to 0.
x-coordinate of the apex in [cm].
y0 : float, optional
y-coordinate of the apex in [cm]. Defaults to 0.
y-coordinate of the apex in [cm].
z0 : float, optional
z-coordinate of the apex in [cm]. Defaults to 0.
z-coordinate of the apex in [cm].
r2 : float, optional
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.
The square of the slope of the cone. It is defined as
:math:`\left(\frac{r}{h}\right)^2` for a radius, :math:`r` and an axial
distance :math:`h` from the apex. An easy way to define this quantity is
to take the square of the radius of the cone (in cm) 1 cm from the apex.
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 All @@ -2155,7 +2156,7 @@ class ZCone(QuadricMixin, Surface):
z0 : float
z-coordinate of the apex in [cm]
r2 : float
Parameter related to the aperature
Parameter related to the aperture.
boundary_type : {'transmission', 'vacuum', 'reflective', 'white'}
Boundary condition that defines the behavior for particles hitting the
surface.
Expand Down

0 comments on commit cf3f020

Please sign in to comment.