pyleecan.Classes.Lamination module

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

class Lamination(L1=0.35, mat_type=- 1, Nrvd=0, Wrvd=0, Kf1=0.95, is_internal=True, Rint=0, Rext=1, is_stator=True, axial_vent=- 1, notch=- 1, skew=None, bore=None, yoke=None, init_dict=None, init_str=None)[source]

Bases: FrozenClass

abstract class for lamination

VERSION = 1
build_geometry(sym=1, alpha=0, delta=0, is_circular_radius=False)

Build the geometry of the Lamination

Parameters:
  • self (Lamination) – Lamination Object

  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)

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

  • delta (complex) – Complex value for translation

  • is_circular_radius (bool) – True to add surfaces to “close” the Lamination radii

  • Returns

  • surf_list (list) – list of surfaces needed to draw the lamination

check()

Check that the Lamination object is correct

Parameters:

self – A Lamination object

Return type:

None

Raises:
  • LC_VentYokeIn – The ventilation ducts cross the yoke internal radius

  • LC_VentYokeOut – The ventilation ducts cross the yoke external radius

  • LC_RadiusError – The internal radius is greater than the external one

comp_length()

Compute the total length of the Lamination (including radial ventilations duct)

Parameters:

self (Lamination) – A Lamination object

Returns:

Lt – Total Lenght of the Lamination [m]

Return type:

float

comp_masses()

Compute the masses of the Lamination

Parameters:

self (Lamination) – A Lamination object

Returns:

M_dict – Lamination mass dictionary (Mtot, Mlam, Mteeth, Myoke) [kg]

Return type:

dict

comp_radius_mec()

Compute the mechanical radius of the Lamination [m]

Parameters:

self (Lamination) – A Lamination object

Returns:

Rmec – Mechanical radius [m]

Return type:

float

comp_surface_axial_vent()

Compute the Lamination axial vent

Parameters:

self (Lamination) – A Lamination object

Returns:

Svent – Surface of the Lamination’s axial ventilation [m**2]

Return type:

float

comp_surfaces()

Compute the Lamination surface (Total, Vent).

Parameters:

self (Lamination) – A Lamination object

Returns:

S_dict – Lamination surface dictionary (Slam, Svent, Syoke, Steeth, Sslot) [m**2]

Return type:

dict

comp_volumes()

Compute the volumes of the Lamination

Parameters:

self (Lamination) – A Lamination object

Returns:

V_dict – Volume of the Lamination (Vlam, Vvent, Vyoke, Vteeth) [m**3]

Return type:

dict

get_Rbo()

Return the bore lamination radius

Parameters:

self (Lamination) – A Lamination object

Returns:

Rbo – The lamination bore radius [m]

Return type:

float

get_Ryoke()

Return the yoke lamination radius

Parameters:

self (Lamination) – A Lamination object

Returns:

Ryoke – The lamination yoke radius [m]

Return type:

float

get_name_phase()

Return the name of the winding phases

Parameters:

self (Lamination) – A Lamination object

Returns:

name_phase – Empty list

Return type:

list

plot(fig=None, ax=None, is_lam_only=False, sym=1, alpha=0, delta=0, is_edge_only=False, edgecolor=None, is_add_arrow=False, is_show_fig=True, save_path=None)

Plot the Lamination in a matplotlib fig

Parameters:
  • self (Lamination) – A Lamination object

  • fig (Matplotlib.figure.Figure) – existing figure to use if None create a new one

  • ax (Matplotlib.axes.Axes object) – Axis on which to plot the data

  • is_lam_only (bool) – True to plot only the lamination (no effect for Lamination object)

  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)

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

  • delta (complex) – Complex value for translation

  • is_edge_only (bool) – To plot transparent Patches

  • edgecolor – Color of the edges if is_edge_only=True

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

  • save_path (str) – full path including folder, name and extension of the file to save if save_path is not None

Returns:

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

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

comp_output_geo()

Compute the main geometry output

Parameters:

self (Lamination) – A Lamination object

Returns:

output – Main geometry output of the lamintion

Return type:

OutGeoLam

get_polar_eq()

Returns a polar equivalent of the lamination

Parameters:

self (Lamination) – Lamination object

Returns:

polar_eq – The polar equivalent of the lamination

Return type:

Lamination

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

comp_height_yoke()

Compute the yoke height

Parameters:

self (Lamination) – A Lamination object

Returns:

Hy – yoke height [m]

Return type:

float

comp_angle_q_axis()

Compute the angle between the X axis and the first q+ axis By convention a “Tooth” is centered on the X axis By convention the first magnet is +

Parameters:

self (Lamination) – A Lamination object

Returns:

d_angle – angle between the X axis and the first d+ axis

Return type:

float

comp_radius_mid_yoke()

Compute the Lamination middle of the yoke radius

Parameters:

self (Lamination) – A Lamination object

Returns:

Ry – middle of the yoke radius [m]

Return type:

float

comp_point_ref(sym=1)

Compute coordinates of a point in the lamination to assign property in FEA software Account for slot, notches and ventilations (TODO)

Parameters:
  • self (Lamination) – Lamination Object

  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)

  • Returns

  • point_ref (complex) – Reference point of the lamination

comp_periodicity_spatial()

Compute the periodicity factor of the lamination

Parameters:

self (lamination) – A lamination object

Returns:

  • per_a (int) – Number of spatial periodicities of the lamination

  • is_antiper_a (bool) – True if an spatial anti-periodicity is possible after the periodicities

get_label(is_add_id=True)

Return the label of the lamination (Stator-0 for instance)

Parameters:
  • self (Lamination) – a Lamination object

  • is_add_id (bool) – True to add the “-X” part

Returns:

label – Label of the lamination

Return type:

str

build_yoke_side_line(sym, vent_surf_list, ZBR=None, ZTR=None, ZBL=None, ZTL=None)

Define the Yoke Side lines of a Lamination by taking into account sym and vent

Parameters:
  • self (Lamination) – a Lamination object

  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)

  • vent_surf_list – List of the ventilation surfaces

  • ZBR (Complex) – Yoke Side Limit point Bottom Right

  • ZTR (Complex) – Yoke Side Limit point Top Right

  • ZBL (Complex) – Yoke Side Limit point Bottom Left

  • ZTL (Complex) – Yoke Side Limit point Top Left

Returns:

right_list, left_list – List of the lines to draw the left and right side of the yoke

Return type:

([Line], [Line])

get_notches_surf(sym)

Return the list of surfaces for notches

Parameters:
  • self (Lamination) – A Lamination object

  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)

Returns:

surf_list – list of surfaces needed for the notches

Return type:

list

comp_periodicity_duct_spatial(per_a, is_antiper_a)

Compute the periodity of the axial cooling ducts

Parameters:
  • self (Lamination) – A Lamination object

  • per_a (int) – Number of spatial periodicities of the lamination

  • is_antiper_a (bool) – True if an spatial anti-periodicity is possible after the periodicities

Returns:

  • per_a (int) – Spatial periodicity of the lamination including ducts

  • is_antiper_a (bool) – Spatial antiperidicity of the lamination including ducts

get_surfaces_closing(sym=1)

Return the surfaces needed to close the radii of the Lamination

Parameters:
  • self (Lamination) – A Lamination object

  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)

Returns:

surf_list – List of the closing surfaces

Return type:

list

comp_periodicity_geo()

Compute the geometric periodicity factor of the lamination

Parameters:

self (lamination) – A lamination object

Returns:

  • per_a (int) – Number of spatial periodicities of the lamination

  • is_antiper_a (bool) – True if an spatial anti-periodicity is possible after the periodicities

has_notch(is_bore)

Check if notches are set on the requested radius

Parameters:
  • self (Lamination) – A Lamination object

  • is_bore (bool) – True check notch on bore radius, else on yoke

Returns:

has_notch – True if notches are set on the requested radius

Return type:

bool

build_radius_lines(is_bore, sym=1, is_reversed=False, prop_dict=None)

Create the lines need to draw the selected radius of the Lamination

Parameters:
  • self (Lamination) – a Lamination object

  • is_bore (bool) – True generate lines of bore, else yoke

  • is_reversed (bool) – True to return the lines in clockwise oder (reverse begin and end), False trigo

  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)

  • prop_dict (dict) – Property dictionary to apply on the radius lines (not on slot/notch)

Returns:

radius_lines – list of bore/yoke lines

Return type:

list

build_radius_desc(is_bore, sym=1)

This method returns an ordered description of the slot/notch that defines the bore/yoke radius of the lamination (Bore/Yoke shape not taken into account by this method, cf build_radius_lines)

Parameters:
  • self (Lamination) – A Lamination object

  • is_bore (bool) – True generate description of bore, else yoke

  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)

Returns:

radius_desc

trigo ordered list of dictionary with key:

”begin_angle” : float [rad] “end_angle” : float [rad] “obj” : Slot or None “lines : lines corresponding to the radius part “label” : Radius/Notch/Slot

Return type:

list

has_slot(is_bore=True)

Return if the lamination has slot on the requested radius (notches not taken into account, cf has_notch)

Parameters:
  • self (Lamination) – A Lamination object

  • is_bore (bool) – True check if there are slots on the bore, else yoke

Returns:

has_slot – True if the lamination has slot on the requested radius

Return type:

bool

plot_preview_notch(index, fig=None, ax=None)

Preview the position/shape of a notch on the lamination

Parameters:
  • self (Lamination) – Lamination object

  • index (int) – Index of the notch to preview

  • fig (Matplotlib.figure.Figure) – existing figure to use if None create a new one

  • ax (Matplotlib.axes.Axes object) – Axis on which to plot the data

Returns:

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

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

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 L1

Lamination stack active length without radial ventilation airducts but including insulation layers between lamination sheets

Type:

float

Min:

0

property mat_type

Lamination’s material

Type:

Material

property Nrvd

number of radial air ventilation ducts in lamination

Type:

int

Min:

0

property Wrvd

axial width of ventilation ducts in lamination

Type:

float

Min:

0

property Kf1

lamination stacking / packing factor

Type:

float

Min:

0

Max:

1

property is_internal

1 for internal lamination topology, 0 for external lamination

Type:

bool

property Rint

To fill

Type:

float

Min:

0

property Rext

To fill

Type:

float

Min:

0

property is_stator

To fill

Type:

bool

property axial_vent

Axial ventilation ducts

Type:

[Hole]

property notch

Lamination bore notches

Type:

[Notch]

property skew

Skew object

Type:

Skew

property bore

Bore Shape

Type:

Bore

property yoke

Yoke Shape

Type:

Bore