pyleecan.Classes.Slot module

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

class Slot(Zs=36, wedge_mat=None, is_bore=True, init_dict=None, init_str=None)[source]

Bases: FrozenClass

Generic class for slot (abstract)

VERSION = 1
build_geometry_active(Nrad, Ntan, alpha=0, delta=0)

Split the slot active area in several zone This method assume that the active area is centered on X axis and symetrical Otherwise a dedicated build_geometry_active method must be provided

Parameters:
  • self (Slot) – A Slot object

  • Nrad (int) – Number of radial layer

  • Ntan (int) – Number of tangentiel layer

  • alpha (float) – Angle for rotation (Default value = 0) [rad]

  • delta (Complex) – complex for translation (Default value = 0)

Returns:

List of surface delimiting the active zone

Return type:

surf_list

build_geometry_half_tooth(is_top=False, alpha=0, delta=0)

Build the geometry of a Half Tooth

Parameters:
  • self (LamSlot) – a LamSlot object

  • is_top (bool) – To select the part of the tooth (X>0 or X <0)

  • alpha (float) – Angle for rotation [rad]

  • delta (complex) – Complex value for translation

Returns:

surf_list – list of surfaces needed to draw the half tooth including slot base

Return type:

list

check()

Check that the Slot object is correct

Parameters:

self (Slot) – A Slot object

Return type:

None

comp_angle_active_eq()

Compute the equivalent angle of the active part of the slot (Ideal polar shape with the same surface and height)

Parameters:

self (Slot) – A Slot object

Returns:

alpha – Average angle of the slot [rad]

Return type:

float

comp_angle_opening()

Compute the average opening angle of the Slot

Parameters:

self (Slot) – A Slot object

Returns:

alpha – Average opening angle of the slot [rad]

Return type:

float

comp_height(Ndisc=200)

Compute the height of the Slot. Caution, the bottom of the Slot is an Arc

Parameters:
  • self (Slot) – A Slot object

  • Ndisc (int) – Number of point to discretize the lines

Returns:

Htot – Height of the slot [m]

Return type:

float

comp_height_active(Ndisc=200)

Compute the height of the active area

Parameters:
  • self (Slot) – A Slot object

  • Ndisc (int) – Number of point to discretize the lines

Returns:

Hwind – Height of the active area [m]

Return type:

float

comp_height_opening(Ndisc=200)

Compute the height of the opening area (Hslot - Hactive)

Parameters:
  • self (Slot) – A Slot object

  • Ndisc (int) – Number of point to discretize the lines

Returns:

Hwind – Height of the opening area [m]

Return type:

float

comp_radius()

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

Parameters:

self (Slot) – A Slot object

Returns:

(Rmin,Rmax) – Radius of the circle that contains the slot [m]

Return type:

tuple

comp_radius_mid_active()

Compute the radius at the middle of the active part of the slot

Parameters:

self (Slot) – A Slot object

Returns:

Rmw – Mid active radius [m]

Return type:

float

comp_surface(Ndisc=200)

Compute the Slot total surface (by numerical computation). Caution, the bottom of the Slot is an Arc

Parameters:
  • self (Slot) – A Slot object

  • Ndisc (int) – Number of point to discretize the lines

Returns:

S – Slot total surface [m**2]

Return type:

float

comp_surface_active(Ndisc=200)

Compute the Slot active surface (by numerical computation). Caution, the bottom of the Slot is an Arc

Parameters:
  • self (Slot) – A Slot object

  • Ndisc (int) – Number of point to discretize the lines

Returns:

S – Slot active surface [m**2]

Return type:

float

comp_surface_opening(Ndisc=200)

Compute the Slot opening surface (by numerical computation). Caution, the bottom of the Slot is an Arc

Parameters:
  • self (Slot) – A Slot object

  • Ndisc (int) – Number of point to discretize the lines

Returns:

S – Slot opening surface [m**2]

Return type:

float

comp_surface_wedges(Ndisc=200)

Compute the Slot wedges surface (by numerical computation). Caution, the bottom of the Slot is an Arc

Parameters:
  • self (Slot) – A Slot object

  • Ndisc (int) – Number of point to discretize the lines

Returns:

S – Slot wedges surface [m**2]

Return type:

float

comp_width()

Compute the average width of the Slot by dividing its surface by its height

Parameters:

self (Slot) – A Slot object

Returns:

W2 – Average width of the slot [m]

Return type:

float

comp_width_opening(is_curved=False)

Compute the average opening width of the Slot

Parameters:
  • self (Slot) – A Slot object

  • is_curved (bool) – width opening curved or straight

Returns:

W0 – Average opening width of the slot [m] or [rad]

Return type:

float

convert_to_SlotUD2()

Convert the slot to the equivalent SlotUD2

Parameters:

self (Slot) – a Slot object

Returns:

new_slot – SlotUD2 version of the Slot

Return type:

SlotUD2

get_is_stator()

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

Parameters:

self (Slot) – A Slot object

Returns:

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

Return type:

bool

get_name_lam()

Return the name of the parent lamination

Parameters:

self (Slot) – A Slot object

Returns:

name – The name of the parent lamination

Return type:

string

get_Rbo()

Return the parent lamination bore radius

Parameters:

self (Slot) – A Slot object

Returns:

Rbo – The parent lamination bore radius [m]

Return type:

float

get_surface()

Returns the surface delimiting the slot

Parameters:

self (Slot) – A Slot object

Returns:

surface – A SurfLine object representing the slot

Return type:

SurfLine

get_surface_tooth()

Returns the surface delimiting the tooth (including yoke part)

Parameters:

self (Slot) – A Slot object

Returns:

surface – A SurfLine object representing the slot

Return type:

SurfLine

get_surface_wedges(alpha=0, delta=0)

Return the list of surfaces defining the wedges area of the Slot

Parameters:
  • self (Slot) – A Slot object

  • alpha (float) – float number for rotation (Default value = 0) [rad]

  • delta (complex) – complex number for translation (Default value = 0)

Returns:

surf_list – list of surfaces objects

Return type:

list

is_outwards()

Return if the slot is outwards (on an external lamination) or inwards (on an internal lamination)

Parameters:

self (Slot) – A Slot object

Returns:

is_outwards – True if the Lamination is not internal and false if not

Return type:

bool

plot(fig=None, ax=None, is_show_fig=True)

Plot the Slot in a matplotlib fig

Parameters:
  • self (Slot) – A Slot object

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

Returns:

  • fig (Matplotlib.figure.Figure) – Figure containing the plot

  • ax (Matplotlib.axes.Axes object) – Axis containing the plot

plot_active(wind_mat=None, fig=None, ax=None, is_bar=False, is_show_fig=True, enforced_default_color=None, alpha=0, delta=0, is_add_wedge=False)

Plot the active area of the lamination according to the wind_mat

Parameters:
  • self (Slot) – A Slot object

  • wind_mat (numpy.ndarray) – A matrix [Nrad,Ntan,Zs,qs] representing the active (Default value = None)

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

  • is_bar (bool) – To adapt the legend text for squirrel cage bar (Default value = False)

  • is_show_fig (bool) – To call show at the end of the method

  • enforced_default_color (str) – If not None enforce the active color (when wind_mat is None)

  • alpha (float) – Angle for rotation (Default value = 0) [rad]

  • delta (Complex) – complex for translation (Default value = 0)

  • is_add_wedge (bool) – True to add the wedges surfaces

Return type:

None

set_label(surf_list, Nrad, Ntan, lam_label)

Set the normalized label on the active surface (internal method of build_geometry_active)

Parameters:
  • self (Slot) – A Slot object

  • surf_list ([Surface]) – List of split active surface of the winding (for one slot)

  • Nrad (int) – Number of radial layer

  • Ntan (int) – Number of tangential layer

  • lam_label (str) – Label of the lamination containing the slot

save(save_path='', is_folder=False, type_handle_old=2, type_compression=0)

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 (json only)

  • type_handle_old (int) – How to handle old file in folder mode (0:Nothing, 1:Delete, 2:Move to “Backup” folder)

  • type_compression (int) – Available only for json, 0: no compression, 1: gzip

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', ignore_list=None, is_add_value=False)[source]

Compare two objects and return list of differences

as_dict(type_handle_ndarray=0, keep_function=False, **kwargs)[source]

Convert this object in a json serializable dict (can be use in __init__). type_handle_ndarray: int

How to handle ndarray (0: tolist, 1: copy, 2: nothing)

keep_functionbool

True to keep the function object, else return str

Optional keyword input parameter is for internal use only and may prevent json serializability.

copy()[source]

Creates a deepcopy of the object

property Zs

slot number

Type:

int

Min:

0

property wedge_mat

Material for the wedge, if None no wedge

Type:

Material

property is_bore

True if the Slot is on the bore radius, False for yoke

Type:

bool