openmc.stats.SphericalIndependent

class openmc.stats.SphericalIndependent(r, cos_theta, phi, origin=(0.0, 0.0, 0.0))[source]

Spatial distribution represented in spherical coordinates.

This distribution allows one to specify coordinates whose \(r\), \(\theta\), and \(\phi\) components are sampled independently from one another and centered on the coordinates (x0, y0, z0).

Added in version 0.12.

Changed in version 0.13.1: Accepts cos_theta instead of theta

Parameters:
  • r (openmc.stats.Univariate) – Distribution of r-coordinates in a reference frame specified by the origin parameter

  • cos_theta (openmc.stats.Univariate) – Distribution of the cosine of the theta-coordinates (angle relative to the z-axis) in a reference frame specified by the origin parameter

  • phi (openmc.stats.Univariate) – Distribution of phi-coordinates (azimuthal angle) in a reference frame specified by the origin parameter

  • origin (Iterable of float, optional) – coordinates (x0, y0, z0) of the center of the spherical reference frame for the source. Defaults to (0.0, 0.0, 0.0)

Variables:
  • r (openmc.stats.Univariate) – Distribution of r-coordinates in the local reference frame

  • cos_theta (openmc.stats.Univariate) – Distribution of the cosine of the theta-coordinates (angle relative to the z-axis) in the local reference frame

  • phi (openmc.stats.Univariate) – Distribution of phi-coordinates (azimuthal angle) in the local reference frame

  • origin (Iterable of float, optional) – coordinates (x0, y0, z0) of the center of the spherical reference frame. Defaults to (0.0, 0.0, 0.0)

classmethod from_xml_element(elem: Element)[source]

Generate spatial distribution from an XML element

Parameters:

elem (lxml.etree._Element) – XML element

Returns:

Spatial distribution generated from XML element

Return type:

openmc.stats.SphericalIndependent

to_xml_element()[source]

Return XML representation of the spatial distribution

Returns:

element – XML element containing spatial distribution data

Return type:

lxml.etree._Element