bluemira.builders.divertor ========================== .. py:module:: bluemira.builders.divertor .. autoapi-nested-parse:: Builder for making a parameterised EU-DEMO divertor. Classes ------- .. autoapisummary:: bluemira.builders.divertor.LegPosition bluemira.builders.divertor.WireEndAxis bluemira.builders.divertor.DivertorDesignerParams bluemira.builders.divertor.DivertorBuilderParams bluemira.builders.divertor.DivertorDesigner bluemira.builders.divertor.DivertorBuilder Functions --------- .. autoapisummary:: bluemira.builders.divertor.get_separatrix_legs Module Contents --------------- .. py:class:: LegPosition(*args, **kwds) Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: bluemira.builders.divertor.LegPosition :parts: 1 :private-bases: Enum classifying divertor/separatrix leg positions .. py:attribute:: INNER .. py:attribute:: OUTER .. py:function:: get_separatrix_legs(equilibrium: bluemira.equilibria.Equilibrium) -> dict[LegPosition, list[bluemira.geometry.wire.BluemiraWire]] Find the separatrix legs for the given equilibrium. :returns: Legs for given position on separatrix .. py:class:: WireEndAxis(*args, **kwds) Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: bluemira.builders.divertor.WireEndAxis :parts: 1 :private-bases: Enum for wire end axis .. py:attribute:: X .. py:attribute:: Z .. py:class:: DivertorDesignerParams Bases: :py:obj:`bluemira.base.parameter_frame.ParameterFrame` .. autoapi-inheritance-diagram:: bluemira.builders.divertor.DivertorDesignerParams :parts: 1 :private-bases: Divertor designer parameters .. py:attribute:: div_L2D_ib :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: div_L2D_ob :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: div_Ltarg_ib :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: div_Ltarg_ob :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: strike_loc_ib :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: strike_loc_ob :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: div_targ_angle_ib :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: div_targ_angle_ob :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: div_targ_type_ib :type: bluemira.base.parameter_frame.Parameter[str] .. py:attribute:: div_targ_type_ob :type: bluemira.base.parameter_frame.Parameter[str] .. py:attribute:: div_baffle_type_ib :type: bluemira.base.parameter_frame.Parameter[str] .. py:attribute:: div_baffle_type_ob :type: bluemira.base.parameter_frame.Parameter[str] .. py:class:: DivertorBuilderParams Bases: :py:obj:`bluemira.base.parameter_frame.ParameterFrame` .. autoapi-inheritance-diagram:: bluemira.builders.divertor.DivertorBuilderParams :parts: 1 :private-bases: Divertor builder parameters .. py:attribute:: n_TF :type: bluemira.base.parameter_frame.Parameter[int] .. py:attribute:: n_div_cassettes :type: bluemira.base.parameter_frame.Parameter[int] .. py:attribute:: c_rm :type: bluemira.base.parameter_frame.Parameter[float] .. py:class:: DivertorDesigner(params: dict | bluemira.base.parameter_frame.ParameterFrame, equilibrium: bluemira.equilibria.Equilibrium, x_limits: tuple[float], z_limits: tuple[float], build_config: bluemira.base.builder.BuildConfig | None = None, keep_in_zone_wire: bluemira.geometry.wire.BluemiraWire | None = None, keep_out_zone_wires: list[bluemira.geometry.wire.BluemiraWire] | bluemira.geometry.wire.BluemiraWire | None = None) Bases: :py:obj:`bluemira.base.designer.Designer`\ [\ :py:obj:`tuple`\ [\ :py:obj:`bluemira.geometry.wire.BluemiraWire`\ , :py:obj:`Ellipsis`\ ]\ ] .. autoapi-inheritance-diagram:: bluemira.builders.divertor.DivertorDesigner :parts: 1 :private-bases: Divertor Designer .. py:attribute:: INNER_BAFFLE :value: 'inner_baffle' .. py:attribute:: OUTER_BAFFLE :value: 'outer_baffle' .. py:attribute:: DOME :value: 'dome' .. py:attribute:: INNER_TARGET :value: 'inner_target' .. py:attribute:: OUTER_TARGET :value: 'outer_target' .. py:attribute:: OPEN_BAFFLE :value: 'open_baffle' .. py:attribute:: CIRCLE_BAFFLE :value: 'circle_baffle' .. py:attribute:: FLUXLINE_BAFFLE :value: 'fluxline_baffle' .. py:attribute:: STRAIGHT_BAFFLE :value: 'straight_baffle' .. py:attribute:: params :type: DivertorDesignerParams .. py:attribute:: param_cls :type: type[DivertorDesignerParams] The ParameterFrame class defining this designer's parameters. .. py:attribute:: equilibrium .. py:attribute:: x_limits .. py:attribute:: z_limits .. py:attribute:: kiz_wire :value: None .. py:attribute:: koz_wires :value: None .. py:attribute:: leg_length .. py:attribute:: separatrix_legs .. py:method:: run() Run the design problem. .. py:method:: _make_target(leg: LegPosition, label: str) Divertor designer method for making the target. :param leg: Position of leg to make target for :param label: The label to give the returned target :returns: Target .. py:method:: _make_angled_target(leg: LegPosition) Method for making a target with the angle and lengths specified in the params (DivertorDesignerParams). :param leg: Position of leg to make target for :returns: Coordinates of the target .. py:method:: _get_sols_for_leg(leg: LegPosition, layers: collections.abc.Iterable[int] = (0, -1)) -> list[bluemira.geometry.wire.BluemiraWire] Get the selected scrape-off-leg layers from the separatrix legs. :returns: Separatrix legs .. py:method:: make_dome(start: numpy.ndarray, end: numpy.ndarray, label: str, start_picked: bool | None = None) -> bluemira.geometry.wire.BluemiraWire Make a dome between the two given points. :returns: Divertor dome .. rubric:: Notes The dome shape follows a constant line of flux that is closest to the input coordinates. The nearest point on the flux surface to the start point and the end point are joined. The default is that the flux surface is picked based on the lowest z coordinate of the start and end point to ensure a continuous divertor shape is produced. .. py:method:: make_flux_line_wire(start: numpy.ndarray, end: numpy.ndarray, start_picked: bool, label: str) Get a constant line of flux that is closest to the input coordinates. The nearest point on the flux surface to the start point and the end point are joined. :returns: Selected flux line as a wire. .. py:method:: make_baffle(label: str, target_baffle_join_point: numpy.ndarray, target_dome_join_point: numpy.ndarray, target_start: bool | None = None) -> bluemira.geometry.wire.BluemiraWire Divertor designer method for making the baffles. A baffle wire joins the target wire to the wall wire. :param label: The label to give the returned Component. :param target_baffle_join_point: The position (in x-z) where the target connects to the baffle. :param target_dome_join_point: The position (in x-z) where the target connects to the dome. :param target_start: Determines which flux surface is selected to create the baffle shape when using a fluxline baffle design (see div_baffle_type_ib/ob parameter). True -> use flux surface closest to target join point. False -> use flux surface closest to wall join point. Default (None) will mean that the point with the lowest z value is selected. :returns: The baffle shape. .. py:method:: _make_straight_baffle(label: str, wall_join_point: numpy.ndarray, target_join_point: numpy.ndarray) -> bluemira.geometry.wire.BluemiraWire :staticmethod: Make a baffle using straight line shape. :param label: The label to give the returned Component. :param wall_join_point: The position (in x-z) where the wall connects to the baffle. :param target_join_point: The position (in x-z) where the target connects to the baffle. :returns: The baffle shape .. py:method:: _make_fluxline_baffle(label: str, wall_join_point: numpy.ndarray, target_join_point: numpy.ndarray, target_start: bool | None = None) -> bluemira.geometry.wire.BluemiraWire Make a baffle using the divertor leg flux line shape. :param label: The label to give the returned Component. :param wall_join_point: The position (in x-z) where the wall connects to the baffle. :param target_join_point: The position (in x-z) where the target connects to the baffle. :param target_start: Determines which flux surface is selected to create the baffle shape. True -> use flux surface closest to target join point. False -> use flux surface closest to wall join point. :returns: The baffle shape. .. rubric:: Notes The baffle shape follows a constant line of flux that is closest to the input coordinates. The nearest point on the flux surface to the start point and the end point are joined. The default is that the flux surface is picked based on the lowest z coordinate of the start and end point. .. py:method:: _make_circular_baffle(label: str, wall_join_point: numpy.ndarray, target_join_point: numpy.ndarray, target_gradient: float) -> bluemira.geometry.wire.BluemiraWire Make a circular baffle which is tangent to the target. :param label: The label to give the returned Component. :param wall_join_point: The position (in x-z) where the baffle connects to the wall. :param target_join_point: The position (in x-z) where the baffle connects to the target. :param target_gradient: The gradient (in x-z) of the divertor target. :returns: The baffle shape. :raises ValueError: Baffle internal and external radii are not equal .. py:method:: _get_wire_ends_by_psi(wire: bluemira.geometry.wire.BluemiraWire) -> tuple[numpy.ndarray, numpy.ndarray] Get the coordinates of the ends of a wire where the end with higher psi is returned first :returns: * higher psi point * lower psi point .. py:method:: _get_wire_end_with_smallest(wire: bluemira.geometry.wire.BluemiraWire, axis: str) -> numpy.ndarray :staticmethod: Get the coordinates of the end of a wire with largest value in the given dimension :returns: Wire end point .. py:method:: _get_wire_end_with_largest(wire: bluemira.geometry.wire.BluemiraWire, axis: str) -> numpy.ndarray :staticmethod: Get the coordinates of the end of a wire with largest value in the given dimension :returns: Wire end point .. py:method:: _get_wire_end(wire: bluemira.geometry.wire.BluemiraWire, axis: str, comp: collections.abc.Callable) -> numpy.ndarray :staticmethod: Get the coordinates of the end of a wire whose coordinate in the given axis satisfies the comparison function. :returns: Wire end point .. py:class:: DivertorBuilder(params: bluemira.base.parameter_frame.typed.ParameterFrameLike, build_config: bluemira.base.builder.BuildConfig, divertor_silhouette: bluemira.geometry.face.BluemiraFace) Bases: :py:obj:`bluemira.base.builder.Builder` .. autoapi-inheritance-diagram:: bluemira.builders.divertor.DivertorBuilder :parts: 1 :private-bases: Divertor builder .. py:attribute:: DIV :value: 'DIV' .. py:attribute:: BODY :value: 'Body' .. py:attribute:: CASETTES :value: 'cassettes' .. py:attribute:: SEGMENT_PREFIX :value: 'segment' .. py:attribute:: param_cls :type: type[DivertorBuilderParams] The class to hold this Builders's parameters. .. py:attribute:: params :type: DivertorBuilderParams .. py:attribute:: div_koz .. py:method:: build() -> bluemira.base.components.Component Build the divertor component. .. py:method:: build_xz() -> bluemira.base.components.PhysicalComponent Build the x-z components of the divertor. .. py:method:: build_xyz(degree: float = 360.0) -> list[bluemira.base.components.PhysicalComponent] Build the x-y-z components of the divertor.