bluemira.builders.tf_coils ========================== .. py:module:: bluemira.builders.tf_coils .. autoapi-nested-parse:: Built-in build steps for making parameterised TF coils. Classes ------- .. autoapisummary:: bluemira.builders.tf_coils.ParameterisedRippleSolver bluemira.builders.tf_coils.RipplePointSelector bluemira.builders.tf_coils.EquispacedSelector bluemira.builders.tf_coils.ExtremaSelector bluemira.builders.tf_coils.FixedSelector bluemira.builders.tf_coils.MaximiseSelector bluemira.builders.tf_coils.RippleConstrainedLengthGOPParams bluemira.builders.tf_coils.RippleConstrainedLengthGOP Module Contents --------------- .. py:class:: ParameterisedRippleSolver(wp_xs: bluemira.geometry.wire.BluemiraWire, nx: int, ny: int, n_TF: int, R_0: float, z_0: float, B_0: float) A parameterised Biot-Savart HelmholtzCage solver. :param wp_xs: Geometry of the TF coil winding pack cross-section :param nx: Number of radial Biot-Savart filaments to use :param ny: Number of toroidal Biot-Savart filaments to use :param n_TF: Number of TF coils :param R_0: Major radius at which to calculate B_0 :param z_0: Vertical coordinate at which to calculate B_0 :param B_0: Toroidal field at (R_0, z_0) .. py:attribute:: wp_xs .. py:attribute:: nx .. py:attribute:: ny .. py:attribute:: n_TF .. py:attribute:: R_0 .. py:attribute:: z_0 .. py:attribute:: B_0 .. py:attribute:: cage :value: None .. py:method:: update_cage(wire: bluemira.geometry.wire.BluemiraWire) Update the HelmHoltzCage, setting the current to produce a field of B_0 at (R_0, z_0). :param wire: TF coil winding pack current centreline .. py:method:: _make_single_circuit(wire: bluemira.geometry.wire.BluemiraWire) -> bluemira.magnetostatics.biot_savart.BiotSavartFilament :returns: A single BioSavart Filament for a single TF coil .. py:method:: ripple(x: float | numpy.ndarray, y: float | numpy.ndarray, z: float | numpy.ndarray) -> float | numpy.ndarray Get the toroidal field ripple at points. :param x: The x coordinate(s) of the points at which to calculate the ripple :param y: The y coordinate(s) of the points at which to calculate the ripple :param z: The z coordinate(s) of the points at which to calculate the ripple :returns: The value of the TF ripple at the point(s) [%] .. py:class:: RipplePointSelector Baseclass for ripple point selection strategies. .. py:attribute:: _wire :type: bluemira.geometry.wire.BluemiraWire :value: None .. py:attribute:: points :type: bluemira.geometry.coordinates.Coordinates :value: None .. py:method:: set_wire(wire: bluemira.geometry.wire.BluemiraWire) Set the wire along which the points will be selected :param wire: Wire along which the points will be selected .. py:method:: make_ripple_constraint(parameterisation, solver, TF_ripple_limit, rip_con_tol) -> bluemira.geometry.optimisation.GeomConstraintT Make the ripple OptimisationConstraint .. py:method:: _constrain_ripple(parameterisation: bluemira.geometry.parameterisations.GeometryParameterisation) -> numpy.ndarray Ripple constraint function :param parameterisation: Geometry parameterisation .. py:class:: EquispacedSelector(n_rip_points: int, x_frac: float | None = None) Bases: :py:obj:`RipplePointSelector` .. autoapi-inheritance-diagram:: bluemira.builders.tf_coils.EquispacedSelector :parts: 1 :private-bases: Equispaced ripple points along a wire for a given number of points. :param n_rip_points: Number of points along the wire constrain the ripple :param x_frac: If specified, the fraction of radius above which the points will be selected. If unspecified, the points will be selected on the full wire .. py:attribute:: n_rip_points .. py:attribute:: x_frac :value: None .. py:method:: set_wire(wire: bluemira.geometry.wire.BluemiraWire) Set the wire along which the points will be selected :param wire: Wire along which the points will be selected .. py:class:: ExtremaSelector Bases: :py:obj:`RipplePointSelector` .. autoapi-inheritance-diagram:: bluemira.builders.tf_coils.ExtremaSelector :parts: 1 :private-bases: Select the extrema of the wire and constrain ripple there. .. py:method:: set_wire(wire: bluemira.geometry.wire.BluemiraWire) Set the wire along which the points will be selected :param wire: Wire along which the points will be selected .. py:class:: FixedSelector(points: bluemira.geometry.coordinates.Coordinates) Bases: :py:obj:`RipplePointSelector` .. autoapi-inheritance-diagram:: bluemira.builders.tf_coils.FixedSelector :parts: 1 :private-bases: Specified points at which to constrain the ripple, overrides any information relating directly to the separatrix. :param points: Points at which the ripple should be constrained. .. py:attribute:: points .. py:class:: MaximiseSelector Bases: :py:obj:`RipplePointSelector` .. autoapi-inheritance-diagram:: bluemira.builders.tf_coils.MaximiseSelector :parts: 1 :private-bases: Finds and constrains the maximum ripple along the specified wire during each minimisation function call. .. py:attribute:: points :value: None .. py:method:: set_wire(wire: bluemira.geometry.wire.BluemiraWire) Set the wire along which the points will be selected :param wire: Wire along which the points will be selected .. py:method:: make_ripple_constraint(parameterisation, solver, TF_ripple_limit, rip_con_tol) -> bluemira.geometry.optimisation.GeomConstraintT Make the ripple OptimisationConstraint .. py:method:: _constrain_max_ripple(parameterisation: bluemira.geometry.parameterisations.GeometryParameterisation) -> float Ripple constraint function :param parameterisation: Geometry parameterisation .. py:class:: RippleConstrainedLengthGOPParams Bases: :py:obj:`bluemira.base.parameter_frame.ParameterFrame` .. autoapi-inheritance-diagram:: bluemira.builders.tf_coils.RippleConstrainedLengthGOPParams :parts: 1 :private-bases: Parameters for the RippleConstrainedLengthGOP .. py:attribute:: n_TF :type: bluemira.base.parameter_frame.Parameter[int] .. py:attribute:: R_0 :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: z_0 :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: B_0 :type: bluemira.base.parameter_frame.Parameter[float] .. py:attribute:: TF_ripple_limit :type: bluemira.base.parameter_frame.Parameter[float] .. py:class:: RippleConstrainedLengthGOP(parameterisation: bluemira.geometry.parameterisations.GeometryParameterisation, algorithm: str, opt_conditions: dict[str, float], opt_parameters: dict[str, float], params: bluemira.base.parameter_frame.typed.ParameterFrameLike, wp_cross_section: bluemira.geometry.wire.BluemiraWire, ripple_wire: bluemira.geometry.wire.BluemiraWire, ripple_selector: RipplePointSelector | None = None, keep_out_zone: bluemira.geometry.wire.BluemiraWire | None = None, rip_con_tol: float = 0.001, koz_con_tol: float = 0.001, nx: int = 1, ny: int = 1, n_koz_points: int = 100) Bases: :py:obj:`bluemira.geometry.optimisation.GeomOptimisationProblem` .. autoapi-inheritance-diagram:: bluemira.builders.tf_coils.RippleConstrainedLengthGOP :parts: 1 :private-bases: Toroidal field coil winding pack shape optimisation problem. :param parameterisation: Geometry parameterisation for the winding pack current centreline :param algorithm: Optimisation algorithm to use :param opt_conditions: Optimisation termination conditions dictionary :param opt_parameters: Optimisation parameters dictionary :param params: Parameters required to solve the optimisation problem :param wp_cross_section: Geometry of the TF coil winding pack cross-section :param separatrix: Separatrix shape at which the TF ripple is to be constrained :param ripple_selector: Selection strategy for the poitns at which to calculate ripple. :type ripple_selector: RipplePointSelector :param keep_out_zone: Zone boundary which the WP may not enter :param rip_con_tol: Tolerance with which to apply the ripple constraints :param kox_con_tol: Tolerance with which to apply the keep-out-zone constraints :param nx: Number of radial Biot-Savart filaments to use :param ny: Number of toroidal Biot-Savart filaments to use :param n_koz_points: Number of discretised points to use when enforcing the keep-out-zone constraint .. rubric:: Notes x^* = minimise: winding_pack_length subject to: .. math:: \text{ripple}|\text{separatrix} \preceq \text{TF_ripple_limit SDF(wp_shape, keep_out_zone)} \preceq 0 The geometry parameterisation is updated in place .. py:attribute:: parameterisation .. py:attribute:: params .. py:attribute:: wp_cross_section .. py:attribute:: algorithm .. py:attribute:: opt_parameters .. py:attribute:: opt_conditions .. py:attribute:: ripple_wire .. py:attribute:: ripple_values :value: None .. py:attribute:: solver .. py:attribute:: _ripple_constraint .. py:attribute:: ripple_selector :value: None .. py:method:: objective(parameterisation: bluemira.geometry.parameterisations.GeometryParameterisation) -> float :staticmethod: Objective function (minimise length) .. py:method:: keep_out_zones() -> list[bluemira.geometry.optimisation.KeepOutZone] Keep out zone .. py:method:: ineq_constraints() -> bluemira.geometry.optimisation.GeomConstraintT Inequality constraints .. py:method:: optimise() -> bluemira.geometry.parameterisations.GeometryParameterisation Solve the GeometryOptimisationProblem. .. py:method:: plot(ax: matplotlib.pyplot.Axes | None = None) Plot the optimisation problem. :param ax: The optional Axes to plot onto, by default None. If None then the current Axes will be used.