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.
- paths (list of str) – The paths traversed through the CSG tree to reach each cell
instance. This property is initialized by calling the
Geometry.determine_paths()
method. - num_instances (int) – The number of instances of this cell throughout the geometry.
- volume (float) – Volume of the cell in cm^3. This can either be set manually or
calculated in a stochastic volume calculation and added via the
Cell.add_volume_information()
method.
-
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
-
add_volume_information
(volume_calc)[source]¶ Add volume information to a cell.
Parameters: volume_calc (openmc.VolumeCalculation) – Results from a stochastic volume calculation
-
clone
(memo=None)[source]¶ Create a copy of this cell with a new unique ID, and clones the cell’s region and fill.
Parameters: memo (dict or None) – A nested dictionary of previously cloned objects. This parameter is used internally and should not be specified by the user. Returns: clone – The clone of this cell Return type: openmc.Cell
-
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
instancesReturn type: collections.orderedDict
-
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
instancesReturn type: collections.OrderedDict
-
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
instancesReturn type: collections.OrderedDict
-
get_nuclide_densities
()[source]¶ Return all nuclides contained in the cell and their densities
Returns: nuclides – Dictionary whose keys are nuclide names and values are 2-tuples of (nuclide, density) Return type: collections.OrderedDict