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.UniverseBase 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.UniverseBase 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
\[\left [ \begin{array}{ccc} \cos\theta \cos\psi & -\cos\phi \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 ]\]A rotation matrix can also be specified directly by setting this attribute to a nested list (or 2D numpy array) that specifies each element of the matrix.
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. For ‘distribmat’ cells it is the total volume of all instances.atoms (collections.OrderedDict) –
Mapping of nuclides to the total number of atoms for each nuclide present in the cell, or in all of its instances for a ‘distribmat’ fill. For example, {‘U235’: 1.0e22, ‘U238’: 5.0e22, …}.
New in version 0.12.
- add_volume_information(volume_calc)[source]¶
Add volume information to a cell.
- Parameters
volume_calc (openmc.VolumeCalculation) – Results from a stochastic volume calculation
- clone(clone_materials=True, clone_regions=True, memo=None)[source]¶
Create a copy of this cell with a new unique ID, and clones the cell’s region and fill.
- Parameters
clone_materials (bool) – Whether to create separate copies of the materials filling cells contained in this cell, or the material filling this cell.
clone_regions (bool) – Whether to create separate copies of the regions bounding cells contained in this cell, and the region bounding this cell.
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
- create_xml_subelement(xml_element, memo=None)[source]¶
Add the cell’s xml representation to an incoming xml element
- Parameters
xml_element (xml.etree.ElementTree.Element) – XML element to be added to
memo (set or None) – A set of object IDs representing geometry entities already written to
xml_element
. This parameter is used internally and should not be specified by users.
- Return type
None
- classmethod from_xml_element(elem, surfaces, materials, get_universe)[source]¶
Generate cell from XML element
- Parameters
elem (xml.etree.ElementTree.Element) – <cell> element
surfaces (dict) – Dictionary mapping surface IDs to
openmc.Surface
instancesmaterials (dict) – Dictionary mapping material IDs to
openmc.Material
instances (defined in \(openmc.Geometry.from_xml\))get_universe (function) – Function returning universe (defined in
openmc.Geometry.from_xml()
)
- Returns
Cell instance
- Return type
- get_all_cells(memo=None)[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
collections.orderedDict
- get_all_materials(memo=None)[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
- 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