bluemira.equilibria.coils._coil =============================== .. py:module:: bluemira.equilibria.coils._coil .. autoapi-nested-parse:: Coil and coil grouping objects Classes ------- .. autoapisummary:: bluemira.equilibria.coils._coil.Coil Module Contents --------------- .. py:class:: Coil(x: float, z: float, dx: float | None = None, dz: float | None = None, name: str | None = None, ctype: str | bluemira.base.constants.CoilType = CoilType.NONE, current: float = 0, j_max: float = np.nan, b_max: float = np.nan, discretisation: float = np.nan, n_turns: int = 1, resistance: float = 0, *, psi_analytic: bool = False, Bx_analytic: bool = True, Bz_analytic: bool = True) Bases: :py:obj:`bluemira.equilibria.coils._field.CoilFieldsMixin` .. autoapi-inheritance-diagram:: bluemira.equilibria.coils._coil.Coil :parts: 1 :private-bases: Coil Object For use with PF/CS/passive coils. All coils have a rectangular cross section. :param x: Coil geometric centre x coordinate [m] :param z: Coil geometric centre z coordinate [m] :param dx: Coil radial half-width [m] from coil centre to edge (either side) :param dz: Coil vertical half-width [m] from coil centre to edge (either side) :param name: The name of the coil :param ctype: Type of coil as defined in CoilType :param current: Coil current [A] (default = 0) :param j_max: Maximum current density in the coil [A/m^2] :param b_max: Maximum magnetic field at the coil [T] :param discretisation: discretise the coil, value in [m]. The minimum size is COIL_DISCR :param n_turns: Number of turns .. rubric:: Notes If dx and dz are specified the coil size is fixed when modifying j_max or current .. py:attribute:: __slots__ :value: ('_b_max', '_ctype', '_current', '_current_radius', '_discretisation', '_dx', '_dz',... .. py:attribute:: _dx :value: None .. py:attribute:: _dz :value: None .. py:attribute:: _discretisation .. py:attribute:: _flag_sizefix .. py:property:: x :type: float Get coil x position .. py:property:: z :type: float Get coil z position .. py:property:: dx :type: float | None Get coil width (half) .. py:property:: dz :type: float | None Get coil height (half) .. py:property:: discretisation :type: float Get coil discretisation .. py:property:: current :type: float Get coil current .. py:property:: j_max :type: float Get coil max current density .. py:property:: b_max :type: float Get coil max field .. py:property:: ctype :type: bluemira.base.constants.CoilType Get coil type .. py:attribute:: name :value: None .. py:attribute:: n_turns :value: 1 .. py:property:: resistance Get coil resistance .. py:attribute:: _number :value: 1 .. py:method:: __repr__() Pretty printing .. py:method:: plot(ax: matplotlib.axes.Axes | None = None, *, subcoil: bool = True, label: bool = False, force: collections.abc.Iterable | None = None, **kwargs) -> bluemira.equilibria.plotting.CoilGroupPlotter | None Plot a Coil :param ax: Matplotlib axis object :param subcoil: plot coil discretisations :param label: show coil labels on plot :param force: force arrows iterable :param kwargs: passed to matplotlib's Axes.plot :returns: the axis if created .. py:method:: n_coils() -> int :staticmethod: Number of coils in coil .. rubric:: Notes Allows n_coils to be accessed if an individual coil or a CoilGroup .. py:property:: position :type: numpy.ndarray Get coil x, z position .. py:property:: area :type: float The cross-sectional area of the coil :rtype: The cross-sectional area of the coil [m^2] .. rubric:: Notes .. math:: \text{area} = 4 \cdot dx \cdot dz .. py:property:: volume :type: float The volume of the coil :rtype: The volume of the coil [m^3] .. rubric:: Notes .. math:: \text{volume} =\text{area} \cdot 2 \pi x .. py:property:: x_boundary Get coil x coordinate boundary .. py:property:: z_boundary Get coil z coordinate boundary .. py:property:: _quad_boundary Get coil quadrature x,z coordinate boundary .. py:method:: assign_material(j_max: float = NBTI_J_MAX, b_max: float = NBTI_B_MAX, resistance: float = 0) -> None Assigns EM material properties to coil :param j_max: Overwrite default constant material max current density [A/m^2] :param b_max: Overwrite default constant material max field [T] .. rubric:: Notes Will always modify both j_max and b_max of the coil with either the default or specified values. .. py:method:: get_max_current() :returns: Max current .. py:method:: _discretise() Discretise a coil for greens function magnetic field calculations .. rubric:: Notes Only discretisation method currently implemented is rectangular. Possible improvement: multiple discretisations for different coils .. py:method:: _validate_size() .. py:method:: _set_coil_attributes() .. py:method:: _rectangular_discretisation() Discretise a coil into filaments based on the length in [m] of the discretisation. Each filament will be plotted as a rectangle with the filament at its centre. .. py:method:: fix_size() Fixes the size of the coil .. py:method:: resize(current: float | None = None) Resize coil given a current .. py:method:: _resize(current) .. py:method:: _re_discretise() Re discretise and re set attributes if sizing information changes. .. py:method:: _make_size(current: float | None = None) Size the coil based on a current and a current density. :returns: * change in x * change in z .. py:method:: _make_boundary(x_c: float, z_c: float, dx: float, dz: float) -> tuple[numpy.ndarray, numpy.ndarray] :staticmethod: Makes the coil boundary vectors :param x_c: x coordinate of centre :param z_c: z coordinate of centre :param dx: dx of coil :param dz: dz of coil :returns: * *x_boundary* -- Radial coordinates of the boundary * *z_boundary* -- Vertical coordinates of the boundary .. note:: Only rectangular coils