bluemira.builders.divertor
Builder for making a parameterised EU-DEMO divertor.
Classes
Enum classifying divertor/separatrix leg positions |
|
Enum for wire end axis |
|
Divertor designer parameters |
|
Divertor builder parameters |
|
Divertor Designer |
|
Divertor builder |
Functions
|
Find the separatrix legs for the given equilibrium. |
Module Contents
- class bluemira.builders.divertor.LegPosition(*args, **kwds)
Bases:
enum.EnumEnum 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.EnumEnum for wire end axis
- X
- Z
- class bluemira.builders.divertor.DivertorDesignerParams
Bases:
bluemira.base.parameter_frame.ParameterFrameDivertor 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.ParameterFrameDivertor 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]]Divertor Designer
- Parameters:
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)
keep_in_zone_wire (bluemira.geometry.wire.BluemiraWire | None)
keep_out_zone_wires (list[bluemira.geometry.wire.BluemiraWire] | bluemira.geometry.wire.BluemiraWire | None)
- 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:
- 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:
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:
- 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:
- _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:
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:
- _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:
- 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:
axis (str)
- 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:
axis (str)
- 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:
axis (str)
comp (collections.abc.Callable)
- 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.BuilderDivertor builder
- Parameters:
params (bluemira.base.parameter_frame.typed.ParameterFrameLike)
build_config (bluemira.base.builder.BuildConfig)
divertor_silhouette (bluemira.geometry.face.BluemiraFace)
- 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:
- build_xz() bluemira.base.components.PhysicalComponent
Build the x-z components of the divertor.
- Return type:
- 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: