bluemira.builders.divertor

Builder for making a parameterised EU-DEMO divertor.

Classes

LegPosition

Enum classifying divertor/separatrix leg positions

WireEndAxis

Enum for wire end axis

DivertorDesignerParams

Divertor designer parameters

DivertorBuilderParams

Divertor builder parameters

DivertorDesigner

Divertor Designer

DivertorBuilder

Divertor builder

Functions

get_separatrix_legs(→ dict[LegPosition, ...)

Find the separatrix legs for the given equilibrium.

Module Contents

class bluemira.builders.divertor.LegPosition(*args, **kwds)

Bases: enum.Enum

Inheritance diagram of bluemira.builders.divertor.LegPosition

Enum classifying divertor/separatrix leg positions

INNER
OUTER
bluemira.builders.divertor.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

Parameters:

equilibrium (bluemira.equilibria.Equilibrium)

Return type:

dict[LegPosition, list[bluemira.geometry.wire.BluemiraWire]]

class bluemira.builders.divertor.WireEndAxis(*args, **kwds)

Bases: enum.Enum

Inheritance diagram of bluemira.builders.divertor.WireEndAxis

Enum for wire end axis

X
Z
class bluemira.builders.divertor.DivertorDesignerParams

Bases: bluemira.base.parameter_frame.ParameterFrame

Inheritance diagram of bluemira.builders.divertor.DivertorDesignerParams

Divertor designer parameters

div_L2D_ib: bluemira.base.parameter_frame.Parameter[float]
div_L2D_ob: bluemira.base.parameter_frame.Parameter[float]
div_Ltarg_ib: bluemira.base.parameter_frame.Parameter[float]
div_Ltarg_ob: bluemira.base.parameter_frame.Parameter[float]
strike_loc_ib: bluemira.base.parameter_frame.Parameter[float]
strike_loc_ob: bluemira.base.parameter_frame.Parameter[float]
div_targ_angle_ib: bluemira.base.parameter_frame.Parameter[float]
div_targ_angle_ob: bluemira.base.parameter_frame.Parameter[float]
div_targ_type_ib: bluemira.base.parameter_frame.Parameter[str]
div_targ_type_ob: bluemira.base.parameter_frame.Parameter[str]
div_baffle_type_ib: bluemira.base.parameter_frame.Parameter[str]
div_baffle_type_ob: bluemira.base.parameter_frame.Parameter[str]
class bluemira.builders.divertor.DivertorBuilderParams

Bases: bluemira.base.parameter_frame.ParameterFrame

Inheritance diagram of bluemira.builders.divertor.DivertorBuilderParams

Divertor builder parameters

n_TF: bluemira.base.parameter_frame.Parameter[int]
n_div_cassettes: bluemira.base.parameter_frame.Parameter[int]
c_rm: bluemira.base.parameter_frame.Parameter[float]
class bluemira.builders.divertor.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: bluemira.base.designer.Designer[tuple[bluemira.geometry.wire.BluemiraWire, Ellipsis]]

Inheritance diagram of bluemira.builders.divertor.DivertorDesigner

Divertor Designer

Parameters:
INNER_BAFFLE = 'inner_baffle'
OUTER_BAFFLE = 'outer_baffle'
DOME = 'dome'
INNER_TARGET = 'inner_target'
OUTER_TARGET = 'outer_target'
OPEN_BAFFLE = 'open_baffle'
CIRCLE_BAFFLE = 'circle_baffle'
FLUXLINE_BAFFLE = 'fluxline_baffle'
STRAIGHT_BAFFLE = 'straight_baffle'
params: DivertorDesignerParams
param_cls: type[DivertorDesignerParams]

The ParameterFrame class defining this designer’s parameters.

equilibrium
x_limits
z_limits
kiz_wire = None
koz_wires = None
leg_length
separatrix_legs
run()

Run the design problem.

_make_target(leg: LegPosition, label: str)

Divertor designer method for making the target.

Parameters:
  • leg (LegPosition) – Position of leg to make target for

  • label (str) – The label to give the returned target

Returns:

Target

_make_angled_target(leg: LegPosition)

Method for making a target with the angle and lengths specified in the params (DivertorDesignerParams).

Parameters:

leg (LegPosition) – Position of leg to make target for

Returns:

Coordinates of the target

_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

Parameters:
  • leg (LegPosition)

  • layers (collections.abc.Iterable[int])

Return type:

list[bluemira.geometry.wire.BluemiraWire]

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

Parameters:
  • start (numpy.ndarray)

  • end (numpy.ndarray)

  • label (str)

  • start_picked (bool | None)

Return type:

bluemira.geometry.wire.BluemiraWire

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.

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.

Parameters:
  • start (numpy.ndarray)

  • end (numpy.ndarray)

  • start_picked (bool)

  • label (str)

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.

Parameters:
  • label (str) – The label to give the returned Component.

  • target_baffle_join_point (numpy.ndarray) – The position (in x-z) where the target connects to the baffle.

  • target_dome_join_point (numpy.ndarray) – The position (in x-z) where the target connects to the dome.

  • target_start (bool | None) – 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.

Return type:

bluemira.geometry.wire.BluemiraWire

static _make_straight_baffle(label: str, wall_join_point: numpy.ndarray, target_join_point: numpy.ndarray) bluemira.geometry.wire.BluemiraWire

Make a baffle using straight line shape.

Parameters:
  • label (str) – The label to give the returned Component.

  • wall_join_point (numpy.ndarray) – The position (in x-z) where the wall connects to the baffle.

  • target_join_point (numpy.ndarray) – The position (in x-z) where the target connects to the baffle.

Returns:

The baffle shape

Return type:

bluemira.geometry.wire.BluemiraWire

_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.

Parameters:
  • label (str) – The label to give the returned Component.

  • wall_join_point (numpy.ndarray) – The position (in x-z) where the wall connects to the baffle.

  • target_join_point (numpy.ndarray) – The position (in x-z) where the target connects to the baffle.

  • target_start (bool | None) – 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.

Return type:

bluemira.geometry.wire.BluemiraWire

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.

_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.

Parameters:
  • label (str) – The label to give the returned Component.

  • wall_join_point (numpy.ndarray) – The position (in x-z) where the baffle connects to the wall.

  • target_join_point (numpy.ndarray) – The position (in x-z) where the baffle connects to the target.

  • target_gradient (float) – The gradient (in x-z) of the divertor target.

Returns:

The baffle shape.

Raises:

ValueError – Baffle internal and external radii are not equal

Return type:

bluemira.geometry.wire.BluemiraWire

_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

Parameters:

wire (bluemira.geometry.wire.BluemiraWire)

Return type:

tuple[numpy.ndarray, numpy.ndarray]

static _get_wire_end_with_smallest(wire: bluemira.geometry.wire.BluemiraWire, axis: str) numpy.ndarray

Get the coordinates of the end of a wire with largest value in the given dimension

Returns:

Wire end point

Parameters:
Return type:

numpy.ndarray

static _get_wire_end_with_largest(wire: bluemira.geometry.wire.BluemiraWire, axis: str) numpy.ndarray

Get the coordinates of the end of a wire with largest value in the given dimension

Returns:

Wire end point

Parameters:
Return type:

numpy.ndarray

static _get_wire_end(wire: bluemira.geometry.wire.BluemiraWire, axis: str, comp: collections.abc.Callable) numpy.ndarray

Get the coordinates of the end of a wire whose coordinate in the given axis satisfies the comparison function.

Returns:

Wire end point

Parameters:
Return type:

numpy.ndarray

class bluemira.builders.divertor.DivertorBuilder(params: bluemira.base.parameter_frame.typed.ParameterFrameLike, build_config: bluemira.base.builder.BuildConfig, divertor_silhouette: bluemira.geometry.face.BluemiraFace)

Bases: bluemira.base.builder.Builder

Inheritance diagram of bluemira.builders.divertor.DivertorBuilder

Divertor builder

Parameters:
DIV = 'DIV'
BODY = 'Body'
CASETTES = 'cassettes'
SEGMENT_PREFIX = 'segment'
param_cls: type[DivertorBuilderParams]

The class to hold this Builders’s parameters.

params: DivertorBuilderParams
div_koz
build() bluemira.base.components.Component

Build the divertor component.

Return type:

bluemira.base.components.Component

build_xz() bluemira.base.components.PhysicalComponent

Build the x-z components of the divertor.

Return type:

bluemira.base.components.PhysicalComponent

build_xyz(degree: float = 360.0) list[bluemira.base.components.PhysicalComponent]

Build the x-y-z components of the divertor.

Parameters:

degree (float)

Return type:

list[bluemira.base.components.PhysicalComponent]