Hole (class)

Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Slot/Hole

class Hole(Zh=36, mat_void=-1, magnetization_dict_offset=None, init_dict=None, init_str=None)[source]

Bases: pyleecan.Classes._frozen.FrozenClass

Holes for lamination (abstract)

VERSION = 1
comp_height()

Compute the height of the Hole (Rmax-Rmin)

Parameters

self (Hole) – A Hole object

Returns

H – Height of the hole

Return type

float

comp_magnetization_dict(is_north=True)

Compute the dictionary of the magnetization direction of the magnets (key=magnet_X, value=angle[rad]) Mangetization angle with Hole centered on Ox axis

Parameters
  • self (Hole) – a Hole object

  • is_north (True) – True: comp north magnetization, else add pi [rad]

Returns

mag_dict – magnetization dictionary (key=magnet_X, value=angle[rad])

Return type

dict

comp_radius()

Compute the radius of the min and max circle that contains the hole

Parameters

self (Hole) – A Hole object

Returns

(Rmin,Rmax) – Radius of the circle that contains the hole

Return type

tuple

comp_surface()

Compute the Hole total surface (by numerical computation).

Parameters

self (Hole) – A Hole object

Returns

S – Slot total surface [m**2]

Return type

float

convert_to_UD()

Convert the hole to HoleUD

get_is_stator()

Return True if the parent lamination is stator and False if is a rotor

Parameters

self (Hole) – A Hole object

Returns

is_stator – True if the Lamination is a stator and False if not

Return type

bool

get_magnet_by_id(index)

Return the magnet at the corresponding index returns None is the magnet is None Raise error if the hole doesn’t have a magnet for the corresponding index

Parameters
  • self (Hole) – A Hole object

  • index (int) – Index of the magnet to return

Returns

magnet – Magnet object (or None)

Return type

Magnet

get_magnet_dict()

Return a dictionnary with all the magnets of the Hole

Parameters

self (Hole) – A Hole object

Returns

magnet_dict – Dictionnary of magnet (key = magnet_X, value= Magnet or None)

Return type

{Magnet}

get_Rbo()

Return the parent lamination bore radius

Parameters

self (Hole) – A Hole object

Returns

Rbo – The parent lamination bore radius [m]

Return type

float

get_Rext()

Return the parent lamination exterior radius

Parameters

self (Hole) – A Hole object

Returns

Rext – The parent lamination exterior radius [m]

Return type

float

has_magnet()

Return if the Hole has magnets

Parameters

self (Hole) – A Hole object

Returns

has_magnet – False

Return type

bool

plot(fig=None, ax=None, display_magnet=True, is_add_arrow=False, is_show_fig=True)

Plot the Hole in a matplotlib fig

Parameters
  • self (Hole) – A Hole object

  • fig – if None, open a new fig and plot, else add to the current one (Default value = None)

  • display_magnet (bool) – if True, plot the magnet inside the hole, if there is any (Default value = True)

  • is_add_arrow (bool) – To add an arrow for the magnetization

Returns

Return type

None

set_magnet_by_id(index, magnet)

Set the magnet at the corresponding index Raise error if the hole doesn’t have a magnet for the corresponding index

Parameters
  • self (Hole) – A Hole object

  • index (int) – Index of the magnet to return

  • magnet (Magnet) – Magnet object to set (or None)

save(save_path='', is_folder=False)

Save the object to the save_path

Parameters
  • self – A pyleecan object

  • save_path (str) – path to the folder to save the object

  • is_folder (bool) – to split the object in different files: separate simulation machine and materials

copy(**kwargs)

Return a copy of the class

get_logger()

Get the object logger or its parent’s one

Parameters

obj – A pyleecan object

Returns

logger – Pyleecan object dedicated logger

Return type

logging.Logger

compare(other, name='self')[source]

Compare two objects and return list of differences

as_dict(**kwargs)[source]

Convert this object in a json serializable dict (can be use in __init__). Optional keyword input parameter is for internal use only and may prevent json serializability.

property Zh

Number of Hole around the circumference

Type

int

Min

0

Max

1000

property mat_void

Material of the void part of the hole (Air in general)

Type

Material

property magnetization_dict_offset

Dictionary add an offset to the magnetization direction of the magnets (key=magnet_X, value=angle[rad])

Type

dict