openmc.Cell

class openmc.Cell(cell_id=None, name='', fill=None, region=None)[source]

A region of space defined as the intersection of half-space created by quadric surfaces.

Parameters:
  • cell_id (int, optional) – Unique identifier for the cell. If not specified, an identifier will automatically be assigned.
  • name (str, optional) – Name of the cell. If not specified, the name is the empty string.
  • fill (openmc.Material or openmc.Universe or openmc.Lattice or None or iterable of openmc.Material, optional) – Indicates what the region of space is filled with
  • region (openmc.Region, optional) – Region of space that is assigned to the cell.
Variables:
  • id (int) – Unique identifier for the cell
  • name (str) – Name of the cell
  • fill (openmc.Material or openmc.Universe or openmc.Lattice or None or iterable of openmc.Material) – Indicates what the region of space is filled with. If None, the cell is treated as a void. An iterable of materials is used to fill repeated instances of a cell with different materials.
  • fill_type ({'material', 'universe', 'lattice', 'distribmat', 'void'}) – Indicates what the cell is filled with.
  • region (openmc.Region or None) – Region of space that is assigned to the cell.
  • rotation (Iterable of float) –

    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 rotated. The rotation applied is an intrinsic rotation with specified Tait-Bryan angles. That is to say, if the angles are \((\phi, \theta, \psi)\), then the rotation matrix applied is \(R_z(\psi) R_y(\theta) R_x(\phi)\) or

    \[\begin{split}\left [ \begin{array}{ccc} \cos\theta \cos\psi & -\cos\theta \sin\psi + \sin\phi \sin\theta \cos\psi & \sin\phi \sin\psi + \cos\phi \sin\theta \cos\psi \\ \cos\theta \sin\psi & \cos\phi \cos\psi + \sin\phi \sin\theta \sin\psi & -\sin\phi \cos\psi + \cos\phi \sin\theta \sin\psi \\ -\sin\theta & \sin\phi \cos\theta & \cos\phi \cos\theta \end{array} \right ]\end{split}\]
  • rotation_matrix (numpy.ndarray) – The rotation matrix defined by the angles specified in the Cell.rotation property.
  • temperature (float or iterable of float) – Temperature of the cell in Kelvin. Multiple temperatures can be given to give each distributed cell instance a unique temperature.
  • translation (Iterable of float) – If the cell is filled with a universe, this array specifies a vector that is used to translate (shift) the universe.
  • offsets (ndarray) – Array of offsets used for distributed cell searches
  • distribcell_index (int) – Index of this cell in distribcell arrays
add_surface(surface, halfspace)[source]

Add a half-space to the list of half-spaces whose intersection defines the cell.

Deprecated since version 0.7.1: Use the Cell.region property to directly specify a Region expression.

Parameters:
  • surface (openmc.Surface) – Quadric surface dividing space
  • halfspace ({-1, 1}) – Indicate whether the negative or positive half-space is to be used
get_all_cells()[source]

Return all cells that are contained within this one if it is filled with a universe or lattice

Returns:cells – Dictionary whose keys are cell IDs and values are Cell instances
Return type:dict
get_all_materials()[source]

Return all materials that are contained within the cell

Returns:materials – Dictionary whose keys are material IDs and values are Material instances
Return type:dict
get_all_nuclides()[source]

Return all nuclides contained in the cell

Returns:nuclides – Dictionary whose keys are nuclide names and values are 2-tuples of (nuclide, density)
Return type:dict
get_all_universes()[source]

Return all universes that are contained within this one if any of its cells are filled with a universe or lattice.

Returns:universes – Dictionary whose keys are universe IDs and values are Universe instances
Return type:dict