bluemira.codes.openmc.make_csg ============================== .. py:module:: bluemira.codes.openmc.make_csg .. autoapi-nested-parse:: Create csg geometry by converting from bluemira geometry objects made of wires. All units in this module are in SI (distrance:[m]) unless otherwise specified by the docstring. Attributes ---------- .. autoapisummary:: bluemira.codes.openmc.make_csg.SHRINK_DISTANCE Classes ------- .. autoapisummary:: bluemira.codes.openmc.make_csg.CellStage bluemira.codes.openmc.make_csg.BluemiraNeutronicsCSG bluemira.codes.openmc.make_csg.BlanketCell bluemira.codes.openmc.make_csg.BlanketCellStack bluemira.codes.openmc.make_csg.BlanketCellArray bluemira.codes.openmc.make_csg.DivertorCell bluemira.codes.openmc.make_csg.DivertorCellStack bluemira.codes.openmc.make_csg.DivertorCellArray Functions --------- .. autoapisummary:: bluemira.codes.openmc.make_csg.is_monotonically_increasing bluemira.codes.openmc.make_csg.plot_surfaces bluemira.codes.openmc.make_csg.plot_surface_at_1000cm bluemira.codes.openmc.make_csg.get_depth_values bluemira.codes.openmc.make_csg.check_inboard_outboard bluemira.codes.openmc.make_csg.torus_from_3points bluemira.codes.openmc.make_csg.torus_from_circle bluemira.codes.openmc.make_csg.z_torus bluemira.codes.openmc.make_csg.choose_halfspace bluemira.codes.openmc.make_csg.choose_plane_cylinders bluemira.codes.openmc.make_csg.flat_intersection bluemira.codes.openmc.make_csg.intersection_dictionary bluemira.codes.openmc.make_csg.flat_union bluemira.codes.openmc.make_csg.union_dictionary bluemira.codes.openmc.make_csg.round_up_next_openmc_ids bluemira.codes.openmc.make_csg.exterior_vertices bluemira.codes.openmc.make_csg.interior_vertices bluemira.codes.openmc.make_csg.make_universe_box bluemira.codes.openmc.make_csg.make_radiation_shield_box bluemira.codes.openmc.make_csg.make_coils bluemira.codes.openmc.make_csg.make_dividing_surface bluemira.codes.openmc.make_csg.blanket_and_divertor_outer_regions bluemira.codes.openmc.make_csg.plasma_void bluemira.codes.openmc.make_csg.make_void_cells bluemira.codes.openmc.make_csg.make_cell_arrays Module Contents --------------- .. py:data:: SHRINK_DISTANCE :value: 0.0005 .. py:class:: CellStage Stage of making cells. .. py:attribute:: blanket :type: BlanketCellArray .. py:attribute:: divertor :type: DivertorCellArray .. py:attribute:: tf_coils :type: list[openmc.Cell] .. py:attribute:: cs_coil :type: openmc.Cell .. py:attribute:: plasma :type: openmc.Cell .. py:attribute:: radiation_shield :type: openmc.Cell .. py:attribute:: ext_void :type: openmc.Cell .. py:attribute:: universe :type: openmc.region.Intersection .. py:property:: cells Get the list of all cells. .. py:method:: get_all_hollow_merged_cells() Blanket and divertor cells .. py:method:: set_volumes() Sets the volume of the voids. Not necessary/ used anywhere yet. .. py:function:: is_monotonically_increasing(series) Check if a series is monotonically increasing .. py:function:: plot_surfaces(surfaces_list: list[openmc.Surface], ax=None) Plot a list of surfaces in matplotlib. .. py:function:: plot_surface_at_1000cm(ax, surface: openmc.Surface, color_num: int) In the range [-1000, 1000], plot the RZ cross-section of the ZCylinder/ZPlane/ZCone. .. py:function:: get_depth_values(pre_cell: bluemira.radiation_transport.neutronics.make_pre_cell.PreCell, blanket_dimensions: bluemira.radiation_transport.neutronics.geometry.TokamakDimensions) -> numpy.typing.NDArray[numpy.float64] Choose the depth values that this pre-cell is suppose to use, according to where it is physically positioned (hence is classified as inboard or outboard). :param pre_cell: :class:`~PreCell` to be classified as either inboard or outboard :param blanket_dimensions: :class:`bluemira.radiation_transport.neutronics.params.TokamakDimensions` recording the dimensions of the blanket in SI units (unit: [m]). :returns: a series of floats corresponding to the N-1 interfaces between the N layers. Each float represents how deep into the blanket (i.e. how many [m] into the first wall we need to drill, from the plasma facing surface) to hit that interface layer. :rtype: depth_series .. py:function:: check_inboard_outboard(pre_cell: bluemira.radiation_transport.neutronics.make_pre_cell.PreCell, blanket_dimensions: bluemira.radiation_transport.neutronics.geometry.TokamakDimensions) -> bool If this pre-cell is an inboard, return True. Otherwise, this pre-cell belongs to outboard, return False .. py:function:: torus_from_3points(point1: numpy.typing.NDArray[numpy.float64], point2: numpy.typing.NDArray[numpy.float64], point3: numpy.typing.NDArray[numpy.float64], surface_id: int | None = None, name: str = '') -> openmc.ZTorus Make a circular torus centered on the z-axis using 3 points. All 3 points should lie on the RZ plane AND the surface of the torus simultaneously. :param point1: RZ coordinates of the 3 points on the surface of the torus. :param point2: RZ coordinates of the 3 points on the surface of the torus. :param point3: RZ coordinates of the 3 points on the surface of the torus. :param surface_id: See openmc.Surface :param name: See openmc.Surface .. py:function:: torus_from_circle(center: collections.abc.Sequence[float], minor_radius: float, surface_id: int | None = None, name: str = '') -> openmc.ZTorus Make a circular torus centered on the z-axis. The circle would lie on the RZ plane AND the surface of the torus simultaneously. :param minor_radius: Radius of the cross-section circle, which forms the minor radius of the torus. :param center: Center of the cross-section circle, which forms the center of the torus. :param surface_id: See openmc.Surface :param name: See openmc.Surface .. py:function:: z_torus(center: numpy.typing.ArrayLike, minor_radius: float, surface_id: int | None = None, name: str = '') -> openmc.ZTorus A circular torus centered on the z-axis. The center refers to the major radius and it's z coordinate. :param center: The center of the torus' RZ plane cross-section :param minor_radius: minor radius of the torus .. py:function:: choose_halfspace(surface: openmc.Surface, choice_points: numpy.typing.NDArray) -> openmc.Halfspace Simply take the centroid point of all of the choice_points, and choose the corresponding half space :param surface: an openmc surface :raises GeometryError: Point is directly on surface .. py:function:: choose_plane_cylinders(surface: openmc.ZPlane | openmc.ZCylinder, choice_points: numpy.typing.NDArray) -> openmc.Halfspace Choose a side of the Halfspace in the region of ZPlane and ZCylinder. :param surface: :class:`openmc.surface.Surface` of a openmc.ZPlane or openmc.ZCylinder :param choice_points: a list of points representing the vertices of a convex polygon in RZ plane :type choice_points: np.ndarray of shape (N, 3) :raises GeometryError: Points on both sides of surface .. py:function:: flat_intersection(region_list: collections.abc.Iterable[openmc.Region]) -> openmc.Intersection Get the flat intersection of an entire list of regions. e.g. (a (b c)) becomes (a b c) .. py:function:: intersection_dictionary(region: openmc.Region) -> dict[str, openmc.Region] Get a dictionary of all of the elements that shall be intersected together, applying the rule of associativity .. py:function:: flat_union(region_list: collections.abc.Iterable[openmc.Region]) -> openmc.Union Get the flat union of an entire list of regions. e.g. (a | (b | c)) becomes (a | b | c) .. py:function:: union_dictionary(region: openmc.Region) -> dict[str, openmc.Region] Get a dictionary of all of the elements that shall be unioned together, applying the rule of associativity .. py:function:: round_up_next_openmc_ids(surface_step_size: int = 1000, cell_step_size: int = 100) Make openmc's surfaces' and cells' next IDs to be incremented to the next pre-determined interval. .. py:function:: exterior_vertices(blanket, divertor) -> numpy.typing.NDArray Get the 3D coordinates of every point at the outer boundary of the tokamak's poloidal cross-section. :returns: array of shape (N+1+n*M, 3), where N = number of blanket pre-cells, M = number of divertor pre-cells, n = discretisation_level used when chopping up the divertor in :meth:`bluemira.radiation_transport.neutronics.DivertorWireAndExteriorCurve.make_divertor_pre_cell_array` :rtype: coordinates .. py:function:: interior_vertices(blanket, divertor) -> numpy.typing.NDArray Get the 3D coordinates of every point at the interior boundary of the tokamak's poloidal cross-section :returns: array of shape ((N+1)+sum(number of interior points of the divertor), 3), where N = number of blanket pre-cells, M = number of divertor pre-cells. Runs clockwise, beginning at the inboard blanket-divertor joining point. :rtype: coordinates .. py:function:: make_universe_box(csg, z_min: float, z_max: float, r_max: float, *, control_id: bool = False) Box up the universe in a cylinder (including top and bottom). .. py:function:: make_radiation_shield_box(csg, z_min: float, z_max: float, r_max: float, universe: openmc.region.Intersection, materials: bluemira.codes.openmc.material.MaterialsLibrary) Define the radiation shield wall as a hollow of the universe box. .. py:function:: make_coils(csg, solenoid_radius: float, tf_coil_thick: float, z_min: float, z_max: float, materials) -> tuple[openmc.Cell, list[openmc.Cell]] Make tf coil and the central solenoid. The former wraps around the latter. :param solenoid_radius: Central solenoid radius [m] :param tf_coil_thick: Thickness of the tf-coil, wrapped around the central solenoid [m] :param z_max: z-coordinate of the the top z-plane shared by both cylinders (cs and tf coil) :param z_min: z-coordinate of the the bottom z-plane shared by both cylinders (cs and tf coil) :raises GeometryError: Thickness of TF coil and solenoid must be positive .. py:function:: make_dividing_surface(csg, component) Surface that marks the end of the divertor/blanket's exterior. .. py:function:: blanket_and_divertor_outer_regions(csg, blanket, divertor, *, control_id: bool = False) -> openmc.Region Get the entire tokamak's poloidal cross-section (everything inside self.geom.boundary) as an openmc.Region. .. py:function:: plasma_void(csg, blanket, divertor, *, control_id: bool = False) -> openmc.Region Get the plasma chamber's poloidal cross-section :raises GeometryError: Geometry must be convex .. py:function:: make_void_cells(csg, universe: openmc.region.Intersection, blanket: BlanketCellArray, divertor: DivertorCellArray, central_solenoid: openmc.Cell, tf_coils: list[openmc.Cell] | None, rad_shield: openmc.Cell | None = None, *, control_id: bool = False) Make the plasma chamber and the outside ext_void. This should be called AFTER the blanket and divertor cells are created. .. py:function:: make_cell_arrays(pre_cell_reactor: bluemira.radiation_transport.neutronics.neutronics_axisymmetric.NeutronicsReactor, csg: BluemiraNeutronicsCSG, materials: bluemira.codes.openmc.material.MaterialsLibrary, *, control_id: bool = False) -> CellStage Make pre-cell arrays for the blanket and the divertor. :param control_id: Whether to set the blanket Cells and surface IDs by force or not. With this set to True, it will be easier to understand where each cell came from. However, it will lead to warnings and errors if a cell/surface is generated to use a cell/surface ID that has already been used respectively. Keep this as False if you're running openmc simulations multiple times in one session. :type control_id: bool .. py:class:: BluemiraNeutronicsCSG Container for CSG planes to enable reuse of planes, very eco friendly .. py:attribute:: hangar .. py:method:: surface_from_2points(point1: numpy.typing.NDArray[numpy.float64], point2: numpy.typing.NDArray[numpy.float64], surface_id: int | None = None, name: str = '') -> openmc.Surface | openmc.model.ZConeOneSided | None Create either a cylinder, a cone, or a surface from 2 points using only the rz coordinates of any two points on it. :param point1: any two non-trivial (i.e. cannot be the same) points on the rz cross-section of the surface, each containing the r and z coordinates Units: [m] :param point2: any two non-trivial (i.e. cannot be the same) points on the rz cross-section of the surface, each containing the r and z coordinates Units: [m] :param surface_id: see openmc.Surface :param name: see openmc.Surface :returns: if the two points provided are redundant: don't return anything, as this is a single point pretending to be a surface. This will come in handy for handling the creation of BlanketCells made with 3 surfaces rather than 4. :rtype: surface .. py:method:: surface_from_straight_line(straight_line_info: bluemira.radiation_transport.neutronics.wires.StraightLineInfo, surface_id: int | None = None, name: str = '') Create a surface to match the straight line info provided. .. py:method:: surfaces_from_info_list(wire_info_list: bluemira.radiation_transport.neutronics.wires.WireInfoList, name: str = '') Create a list of surfaces using a list of wire infos. :param wire_info_list: List of wires :param name: This name will be *reused* across all of the surfaces created in this list. .. py:method:: find_suitable_z_plane(z0: float, z_range: collections.abc.Iterable[float] | None = None, surface_id: int | None = None, name: str = '', **kwargs) Find a suitable z from the hangar, or create a new one if no matches are found. :param z0: The height of the plane, if we need to create it. Unit: [m] :param z_range: If we a suitable z-plane already exists, then we only accept it if it lies within this range of z. Unit: [m] :param surface_id: See openmc.Surface :param name: See openmc.Surface .. py:method:: choose_region_cone(surface: openmc.ZCone, choice_points: numpy.typing.NDArray, *, control_id: bool = False) -> openmc.Region Choose the region for a ZCone. When reading this function's code, bear in mind that a Z cone can be separated into 3 parts: A. the upper cone (evaluates to negative), B. outside of the cone (evaluates to positive), C. the lower cone (evaluates to negative). We have to account for the following cases: +------------+---------+------------+ | upper cone | outside | lower cone | +============+=========+============+ | Y | N | N | +------------+---------+------------+ | Y | Y | N | +------------+---------+------------+ | N | Y | N | +------------+---------+------------+ | N | Y | Y | +------------+---------+------------+ | N | N | Y | +------------+---------+------------+ All other cases should raise an error. The tricky part to handle is the floating point precision problem. It's possible that th every point used to create the cone does not lie on the cone/ lies on the wrong side of the cone. Hence the first step is to shrink the choice_points by SHRINK_DISTANCE towards the centroid. :param surface: where all points are expected to be excluded from at least one of its two one-sided cones. :param choice_points: An array of points that, after choosing the appropriate region, should all lie in the chosen region. :param control_id: When an ambiguity plane is needed, we ned to create a surface. if control_id = True, then this would force the surface to be created with id = 1000 + the id of the cone. This is typically only used so that we have full control of (and easily understandable records of) every surfaces' ID. Thus elsewhere in the code, most other classes/methods turns control_id on when cell_ids are also provided (proving intention on controlling IDs of OpenMC objects). :returns: openmc.Region, specifically (openmc.Halfspace) or (openmc.Union of 2 openmc.Halfspaces) :rtype: region :raises GeometryError: cone construction invalid .. py:method:: choose_region(surface: openmc.Surface | tuple[openmc.Surface] | tuple[openmc.Surface | openmc.ZTorus], vertices_array: numpy.typing.NDArray, *, control_id: bool = False) -> openmc.Region Pick the correct region of the surface that includes all of the points in vertices_array. :param surface: Either a :class:`openmc.Surface`, or a 1-tuple or 2-tuple of :class:`openmc.Surface`. If it is a tuple, the first element is always a :class:`openmc.ZPlane`/:class:`openmc.ZCone`/:class:`openmc.ZCylinder`; the second element (if present) is always :class:`openmc.ZTorus`. :param vertices_array: array of shape (?, 3), that the final region should include. :param control_id: Passed as argument onto :meth:`~bluemira.radiation_transport.neutronics.make_csg.BluemiraNeutronicsCSG.choose_region_cone` :rtype: An openmc.Region built from surface provided and includes all of these .. py:method:: region_from_surface_series(series_of_surfaces: collections.abc.Sequence[openmc.Surface | tuple[openmc.Surface, openmc.ZTorus | None] | None], vertices_array: numpy.typing.NDArray, *, control_id: bool = False) -> openmc.Intersection Switch between choose_region() and choose_region_from_tuple_of_surfaces() depending on the type of each element in the series_of_surfaces. :param series_of_surfaces: Each of them can be a None, a 1-tuple of surface, a 2-tuple of surfaces, or a surface. For the last 3 options, see :func:`~bluemira.radiation_transport.neutronics.make_csg.BluemiraNeutronicsCSG.choose_region` for more. :param vertices_array: array of shape (?, 3), where every single point should be included by, or at least on the edge of the returned Region. :param control_id: Passed as argument onto :meth:`~bluemira.radiation_transport.neutronics.make_csg.BluemiraNeutronicsCSG.choose_region_cone` :returns: openmc.Intersection of a list of [(openmc.Halfspace) or (openmc.Union of openmc.Halfspace)] :rtype: intersection_region .. py:class:: BlanketCell(exterior_surface: openmc.Surface, ccw_surface: openmc.Surface, cw_surface: openmc.Surface, interior_surface: openmc.Surface | None, vertices: bluemira.geometry.coordinates.Coordinates, csg: BluemiraNeutronicsCSG, cell_id: int | None = None, name: str = '', fill: openmc.Material | None = None) Bases: :py:obj:`openmc.Cell` .. autoapi-inheritance-diagram:: bluemira.codes.openmc.make_csg.BlanketCell :parts: 1 :private-bases: A generic blanket cell that forms the base class for the five specialised types of blanket cells. It's a special case of openmc.Cell, in that it has 3 to 4 surfaces (mandatory surfaces: exterior_surface, ccw_surface, cw_surface; optional surface: interior_surface), and it is more wieldy because we don't have to specify the relevant half-space for each surface; instead the corners of the cell is provided by the user, such that the appropriate regions are chosen. .. py:attribute:: exterior_surface .. py:attribute:: ccw_surface .. py:attribute:: cw_surface .. py:attribute:: interior_surface .. py:attribute:: vertex .. py:attribute:: csg .. py:attribute:: volume .. py:class:: BlanketCellStack(cell_stack: list[BlanketCell]) A stack of openmc.Cells, first cell is closest to the interior and last cell is closest to the exterior. They should all be situated at the same poloidal angle. .. py:attribute:: cell_stack .. py:method:: __len__() -> int Number of cells in stack .. py:method:: __getitem__(index_or_slice) -> list[BlanketCell] | BlanketCell Get cell from stack .. py:method:: __iter__() -> collections.abc.Iterator[BlanketCell] Iterator for BlanketCellStack .. py:method:: __repr__() -> str String representation .. py:method:: check_cut_point_ordering(cut_point_series: numpy.typing.NDArray[numpy.float64], direction_vector: numpy.typing.NDArray[numpy.float64], location_msg: str = '') :staticmethod: :param cut_point_series: array of shape (M+1, 2) where M = number of cells in the blanket cell stack (i.e. number of layers in the blanket). Each point has two dimensions :param direction_vector: direction that these points are all supposed to go towards. :raises GeometryError: Crossing surfaces .. py:property:: interior_surface Get interior surface .. py:property:: exterior_surface Get exterior surface .. py:property:: ccw_surface Get counter clockwise surface .. py:property:: cw_surface Get clockwise surface .. py:property:: interfaces All of the radial surfaces, including the innermost (exposed to plasma) and outermost (facing vacuum vessel); arranged in that order (from innermost to outermost). .. py:method:: get_overall_region(csg: BluemiraNeutronicsCSG, *, control_id: bool = False) -> openmc.Region Calculate the region covering the entire cell stack. :param control_id: Passed as argument onto :meth:`~bluemira.radiation_transport.neutronics.make_csg.BluemiraNeutronicsCSG.region_from_surface_series` :raises GeometryError: Vertices must be convex .. py:method:: from_pre_cell(pre_cell: bluemira.radiation_transport.neutronics.make_pre_cell.PreCell, ccw_surface: openmc.Surface, cw_surface: openmc.Surface, depth_series: numpy.typing.NDArray, csg: BluemiraNeutronicsCSG, fill_lib: bluemira.codes.openmc.material.MaterialsLibrary, *, inboard: bool, blanket_stack_num: int | None = None) :classmethod: Create a CellStack using a precell and TWO surfaces that sandwiches that precell. :param pre_cell: An instance of :class:`~PreCell` :param ccw_surface: An instance of :class:`openmc.surface.Surface` :param cw_surface: An instance of :class:`openmc.surface.Surface` :param depth_series: a series of floats corresponding to the N-2 interfaces between the N-1 layers, whereas the N-th layer is the vacuum vessel (and the pre-cell has already stored the thickness for that). Each float represents how deep into the blanket (i.e. how many [cm] into the first wall we need to drill, from the plasma facing surface) to hit that interface layer. :param csg: CSG reactor CAD :param fill_lib: :class:`~MaterialsLibrary` so that it separates into .inboard, .outboard, .divertor, .tf_coil_windings, etc. :param inboard: boolean denoting whether this cell is inboard or outboard :param blanket_stack_num: An optional number indexing the current stack. Used for labelling. If None: we will not be controlling the cell and surfaces id. :raises TypeError: Incorrect number of edges on external wire .. py:class:: BlanketCellArray(blanket_cell_array: list[BlanketCellStack], csg: BluemiraNeutronicsCSG) An array of BlanketCellStack. Interior and exterior curve are both assumed convex. :param blanket_cell_array: a list of BlanketCellStack .. py:attribute:: blanket_cell_array .. py:attribute:: poloidal_surfaces .. py:attribute:: radial_surfaces :value: [] .. py:attribute:: csg .. py:method:: __len__() -> int Number of cell stacks .. py:method:: __getitem__(index_or_slice) -> list[BlanketCellStack] | BlanketCellStack Get cell stack .. py:method:: __iter__() -> collections.abc.Iterator[BlanketCellStack] Iterator for BlanketCellArray .. py:method:: __repr__() -> str String representation .. py:method:: exterior_vertices() -> numpy.typing.NDArray Returns all of the tokamak's poloidal cross-section's outside corners' coordinates, in 3D. :returns: array of shape (N+1, 3) arranged clockwise (inboard to outboard). :rtype: exterior_vertices .. py:method:: interior_vertices() -> numpy.typing.NDArray Returns all of the tokamak's poloidal cross-section's inside corners' coordinates, in 3D. :returns: array of shape (N+1, 3) arranged clockwise (inboard to outboard). :rtype: interior_vertices .. py:method:: interior_surfaces() -> list[openmc.Surface] Get all of the innermost (plasm-facing) surface. Runs clockwise. .. py:method:: exterior_surfaces() -> list[openmc.Surface] Get all of the outermost (vacuum-vessel-facing) surface. Runs clockwise. .. py:method:: exclusion_zone(*, control_id: bool = False) -> openmc.Region Get the exclusion zone AWAY from the plasma. Usage: plasma_region = openmc.Union(..., ~self.exclusion_zone(), ...) Assumes that all of the panels (interior surfaces) together forms a convex hull. :param control_id: Passed as argument onto :meth:`~bluemira.radiation_transport.neutronics.make_csg.BluemiraNeutronicsCSG.region_from_surface_series`. :raises GeometryError: Vertices must be convex .. py:method:: from_pre_cell_array(pre_cell_array: bluemira.radiation_transport.neutronics.make_pre_cell.PreCellArray, materials: bluemira.codes.openmc.material.MaterialsLibrary, blanket_dimensions: bluemira.radiation_transport.neutronics.geometry.TokamakDimensions, csg: BluemiraNeutronicsCSG, *, control_id: bool = False) -> BlanketCellArray :classmethod: Create a BlanketCellArray from a :class:`~bluemira.radiation_transport.neutronics.make_pre_cell.PreCellArray`. This method assumes itself is the first method to be run to create cells in the :class:`~openmc.Universe.` :param pre_cell_array: PreCellArray :param materials: :class:`~MaterialsLibrary` so that it separates into .inboard, .outboard, .divertor, .tf_coil_windings, etc. :param blanket_dimensions: :class:`bluemira.radiation_transport.neutronics.params.TokamakDimensions` recording the dimensions of the blanket in SI units (unit: [m]). :param control_id: Passed as argument onto :meth:`~bluemira.radiation_transport.neutronics.make_csg.BluemiraNeutronicsCSG.region_from_surface_series`. .. py:class:: DivertorCell(exterior_surfaces: list[tuple[openmc.Surface]], cw_surface: openmc.Surface, ccw_surface: openmc.Surface, interior_surfaces: list[tuple[openmc.Surface]], exterior_wire: bluemira.radiation_transport.neutronics.wires.WireInfoList, interior_wire: bluemira.radiation_transport.neutronics.wires.WireInfoList, csg: BluemiraNeutronicsCSG, subtractive_region: openmc.Region | None = None, cell_id: int | None = None, name: str = '', fill: openmc.Material | None = None) Bases: :py:obj:`openmc.Cell` .. autoapi-inheritance-diagram:: bluemira.codes.openmc.make_csg.DivertorCell :parts: 1 :private-bases: A generic Divertor cell forming either the (inner target's/outer target's/ dome's) (surface/ bulk). .. py:attribute:: exterior_surfaces .. py:attribute:: cw_surface .. py:attribute:: ccw_surface .. py:attribute:: interior_surfaces .. py:attribute:: exterior_wire .. py:attribute:: interior_wire .. py:attribute:: csg .. py:attribute:: volume .. py:property:: outline Make the outline into a BluemiraWire. This method is created solely for the purpose of calculating the volume. This is slow but it is accurate and works well. .. py:method:: get_volume() Get the volume using the BluemiraWire of its own outline. :raises GeometryError: Volume is negative .. py:method:: get_all_vertices() -> numpy.typing.NDArray Get all of the vertices of this cell, which should help us find its convex hull. .. py:method:: exclusion_zone(*, away_from_plasma: bool = True, control_id: bool = False, additional_test_points: numpy.typing.NDArray | None = None) -> openmc.Region Get the exclusion zone of a semi-CONVEX cell. This can only be validly used: If away_from_plasma=True, then the interior side of the cell must be convex. If away_from_plasma=False, then the exterior_side of the cell must be convex. Usage: next_cell_region = flat_intersection(..., ~this_cell.exclusion_zone()) :param control_id: Passed as argument onto :func:`~bluemira.radiation_transport.neutronics.make_csg.region_from_surface_series` :raises GeometryError: Interior and exterior wire vertices must be convex .. py:class:: DivertorCellStack(divertor_cell_stack: list[DivertorCell], csg: BluemiraNeutronicsCSG) A CONVEX object! i.e. all its exterior points together should make a convex hull. A stack of DivertorCells (openmc.Cells), first cell is closest to the interior and last cell is closest to the exterior. They should all be situated on the same poloidal angle. .. py:attribute:: cell_stack .. py:attribute:: csg .. py:property:: interior_surfaces Get interior surfaces .. py:property:: exterior_surfaces Get exterior surfaces .. py:property:: ccw_surface Get counter clockwise surface .. py:property:: cw_surface Get clockwise surface .. py:property:: exterior_wire Alias to find the outermost cell's exterior_wire .. py:property:: interior_wire Alias to find the innermost cell's interior_wire .. py:property:: interfaces All of the radial surfaces, including the innermost (exposed to plasma) and outermost (facing the vacuum vessel); arranged in that order (from innermost to outermost). .. py:method:: __len__() -> int Length of DivertorCellStack .. py:method:: __getitem__(index_or_slice) -> list[DivertorCell] | DivertorCell Get item for DivertorCellStack .. py:method:: __iter__() -> collections.abc.Iterator[DivertorCell] Iterator for DivertorCellStack .. py:method:: __repr__() -> str String representation .. py:method:: get_all_vertices() -> numpy.typing.NDArray :returns: shape = (N+M, 3) :rtype: vertices_array .. py:method:: get_overall_region(*, control_id: bool = False) -> openmc.Region Get the region that this cell-stack encompasses. :param control_id: Passed as argument onto :func:`~bluemira.radiation_transport.neutronics.make_csg.region_from_surface_series` :raises GeometryError: All vertices myst be convex .. py:method:: from_divertor_pre_cell(divertor_pre_cell: bluemira.radiation_transport.neutronics.make_pre_cell.DivertorPreCell, cw_surface: openmc.Surface, ccw_surface: openmc.Surface, materials: bluemira.codes.openmc.material.MaterialsLibrary, csg: BluemiraNeutronicsCSG, armour_thickness: float = 0, stack_num: str | int = '') -> DivertorCellStack :classmethod: Create a stack from a single pre-cell and two poloidal surfaces sandwiching it. :param stack_num: A string or number to identify the cell stack by. .. py:class:: DivertorCellArray(cell_array: list[DivertorCellStack]) Turn the divertor into a cell array .. py:attribute:: cell_array .. py:attribute:: poloidal_surfaces .. py:attribute:: radial_surfaces :value: [] .. py:method:: __len__() -> int Length of DivertorCellArray .. py:method:: __getitem__(index_or_slice) -> list[DivertorCellStack] | DivertorCellStack Get item for DivertorCellArray .. py:method:: __iter__() -> collections.abc.Iterator[DivertorCellStack] Iterator for DivertorCellArray .. py:method:: __repr__() -> str String representation .. py:method:: interior_surfaces() -> list[openmc.Surface] Get all of the innermost (plasm-facing) surface. Runs clockwise. .. py:method:: exterior_surfaces() -> list[openmc.Surface] Get all of the outermost (vacuum-vessel-facing) surface. Runs clockwise. .. py:method:: exterior_vertices() -> numpy.typing.NDArray Returns all of the tokamak's poloidal cross-section's outside corners' coordinates, in 3D. :returns: **exterior_vertices** -- Arranged counter-clockwise (inboard to outboard). :rtype: npt.NDArray of shape (N+1, 3) .. py:method:: interior_vertices() -> numpy.typing.NDArray Returns all of the tokamak's poloidal cross-section's inside corners' coordinates, in 3D. :returns: **interior_vertices** -- Arranged counter-clockwise (inboard to outboard). :rtype: npt.NDArray of shape (N+1, 3) .. py:method:: exclusion_zone(*, control_id: bool = False) -> openmc.Region Get the exclusion zone AWAY from the plasma. Usage: plasma_region = openmc.Union(..., ~self.exclusion_zone(), ...) Assumes every single cell-stack is made of an interior surface which itself forms a convex hull. :param control_id: Passed as argument onto :func:`~bluemira.radiation_transport.neutronics.make_csg.region_from_surface_series` .. py:method:: from_pre_cell_array(pre_cell_array: bluemira.radiation_transport.neutronics.make_pre_cell.DivertorPreCellArray, materials: bluemira.codes.openmc.material.MaterialsLibrary, divertor_thickness: bluemira.radiation_transport.neutronics.geometry.DivertorThickness, csg: BluemiraNeutronicsCSG, override_start_end_surfaces: tuple[openmc.Surface, openmc.Surface] | None = None) -> DivertorCellArray :classmethod: Create the entire divertor from the pre-cell array. :param pre_cell_array: The array of divertor pre-cells. :param materials: container of openmc.Material :param divertor_thickness: A parameter :class:`bluemira.radiation_transport.neutronics.params.DivertorThickness`. For now it only has one scalar value stating how thick the divertor armour should be. :param override_start_end_surfaces: openmc.Surfaces that would be used as the first cw_surface and last ccw_surface .. py:method:: get_hollow_merged_cells() -> list[openmc.Cell] Returns a list of cells (unnamed, unspecified-ID) where each corresponds to a cell-stack.