bluemira.magnetostatics.polyhedral_prism

Polyhedral prism current source using the volume integral method

The easiest description and structure to follow was:

M. Fabbri, “Magnetic Flux Density and Vector Potential of Uniform Polyhedral Sources”, IEEE TRANSACTIONS ON MAGNETICS, VOL. 44, NO. 1, JANUARY 2008

Additional information and detail also present in Passaroto’s Master’s thesis: https://thesis.unipd.it/retrieve/d0269be2-2e5d-4068-af58-4374193d38a1/Passarotto_Mauro_tesi.pdf

An alternative calculation also available, which should give identical results from Bottura et al., following essentially C. J. Collie’s 1976 RAL work

https://supermagnet.sourceforge.io/notes/CRYO-06-034.pdf

Classes

PolyhedralPrismCurrentSource

3-D polyhedral prism current source with a polyhedral cross-section and

Module Contents

class bluemira.magnetostatics.polyhedral_prism.PolyhedralPrismCurrentSource(origin: numpy.typing.NDArray[numpy.float64], ds: numpy.typing.NDArray[numpy.float64], normal: numpy.typing.NDArray[numpy.float64], t_vec: numpy.typing.NDArray[numpy.float64], xs_coordinates: bluemira.geometry.coordinates.Coordinates, alpha: float, beta: float, current: float, *, bypass_endcap_error: bool | None = False, endcap_warning: bool | None = True)

Bases: bluemira.magnetostatics.baseclass.PrismEndCapMixin, bluemira.magnetostatics.baseclass.PolyhedralCrossSectionCurrentSource

Inheritance diagram of bluemira.magnetostatics.polyhedral_prism.PolyhedralPrismCurrentSource

3-D polyhedral prism current source with a polyhedral cross-section and uniform current distribution.

The current direction is along the local y coordinate.

The cross-section is specified in the local x-z plane.

Parameters:
  • origin (numpy.typing.NDArray[numpy.float64]) – The origin of the current source in global coordinates [m]

  • ds (numpy.typing.NDArray[numpy.float64]) – The direction vector of the current source in global coordinates [m]

  • normal (numpy.typing.NDArray[numpy.float64]) – The normalised normal vector of the current source in global coordinates [m]

  • t_vec (numpy.typing.NDArray[numpy.float64]) – The normalised tangent vector of the current source in global coordinates [m]

  • xs_coordinates (bluemira.geometry.coordinates.Coordinates) – Coordinates of the conductor cross-section (specified in the x-z plane)

  • alpha (float) – The first angle of the trapezoidal prism [°] [0, 180)

  • beta (float) – The second angle of the trapezoidal prism [°] [0, 180)

  • current (float) – The current flowing through the source [A]

  • bypass_endcap_error (bool | None)

  • endcap_warning (bool | None)

Notes

Negative angles are allowed, but both angles must be equal

_origin
_warning = False
_halflength
_dcm
_alpha
_beta
_points
__kernel
property _kernel
_check_angle_values(alpha, beta, bypass_endcap_error, endcap_warning)

Check that end-cap angles are acceptable.

Raises:

MagnetostaticsError – alpha and beta must be within bound [0, 180°) Endcaps must be equal

_set_cross_section(xs_coordinates: bluemira.geometry.coordinates.Coordinates)
Parameters:

xs_coordinates (bluemira.geometry.coordinates.Coordinates)

field(x: float | numpy.typing.NDArray[numpy.float64], y: float | numpy.typing.NDArray[numpy.float64], z: float | numpy.typing.NDArray[numpy.float64]) numpy.typing.NDArray[numpy.float64]

Calculate the magnetic field at a point due to the current source.

Parameters:
  • x (float | numpy.typing.NDArray[numpy.float64]) – The x coordinate(s) of the points at which to calculate the field

  • y (float | numpy.typing.NDArray[numpy.float64]) – The y coordinate(s) of the points at which to calculate the field

  • z (float | numpy.typing.NDArray[numpy.float64]) – The z coordinate(s) of the points at which to calculate the field

Returns:

The magnetic field vector {Bx, By, Bz} in [T]

Return type:

numpy.typing.NDArray[numpy.float64]

vector_potential(x: float | numpy.typing.NDArray[numpy.float64], y: float | numpy.typing.NDArray[numpy.float64], z: float | numpy.typing.NDArray[numpy.float64]) numpy.typing.NDArray[numpy.float64]

Calculate the vector potential at a point due to the current source.

Parameters:
  • x (float | numpy.typing.NDArray[numpy.float64]) – The x coordinate(s) of the points at which to calculate the field

  • y (float | numpy.typing.NDArray[numpy.float64]) – The y coordinate(s) of the points at which to calculate the field

  • z (float | numpy.typing.NDArray[numpy.float64]) – The z coordinate(s) of the points at which to calculate the field

Returns:

The vector potential {Ax, Ay, Az} in [T]

Return type:

numpy.typing.NDArray[numpy.float64]

_calculate_points() numpy.typing.NDArray[numpy.float64]

Calculate extrema points of the current source for integration and plotting purposes

Returns:

extrema points

Return type:

numpy.typing.NDArray[numpy.float64]