pyleecan.Classes.Magnetics module

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

class Magnetics(is_remove_slotS=False, is_remove_slotR=False, is_remove_ventS=False, is_remove_ventR=False, is_mmfs=True, is_mmfr=True, type_BH_stator=0, type_BH_rotor=0, is_periodicity_t=False, is_periodicity_a=False, angle_stator_shift=0, angle_rotor_shift=0, logger_name='Pyleecan.Magnetics', Slice_enforced=None, Nslices_enforced=None, type_distribution_enforced=None, is_current_harm=True, T_mag=20, is_periodicity_rotor=False, init_dict=None, init_str=None)[source]

Bases: FrozenClass

Magnetic module abstract object

VERSION = 1
run()

Run the Magnetics module

comp_axes(output)

Compute the axes required in any Magnetics module

Parameters:
  • self (Magnetic) – a Magnetic object

  • output (Output) – an Output object (to update)

Returns:

axes_dict – Dict containing Time and Angle axes including (anti-)periodicties used in any Magnetics module

Return type:

{Data}

get_slice_model()

Compute the slice axis required in any Magnetics module

Parameters:

self (SliceModel) – a SliceModel object

Returns:

Slice – Slice axis

Return type:

DataPattern

comp_I_mag(output, Time)

Compute the currents on both stator and rotor laminations for given Magnetics time axis Phase currents are divided by the number of parallel circuits per pole and per phase to account for actual current in slot conductors

Parameters:
  • self (Magnetics) – an Magnetics object

  • output (Output) – An Output object

  • Time (Data) – Time vector on which to interpolate currents stored in OutElec

Returns:

  • Is_val (ndarray) – Stator current matrix accounting for magnetic periodicities [qs_pera,len(time)]

  • Ir_val (ndarray) – Rotor current matrix accounting for magnetic periodicities [qr_pera,len(time)]

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 is_remove_slotS

1 to artificially remove stator slotting effects in permeance mmf calculations

Type:

bool

property is_remove_slotR

1 to artificially remove rotor slotting effects in permeance mmf calculations

Type:

bool

property is_remove_ventS

1 to artificially remove the ventilations duct of the stator

Type:

bool

property is_remove_ventR

1 to artificially remove the ventilations duct of the rotor

Type:

bool

property is_mmfs

1 to compute the stator magnetomotive force / stator armature magnetic field

Type:

bool

property is_mmfr

1 to compute the rotor magnetomotive force / rotor magnetic field

Type:

bool

property type_BH_stator

0 to use the B(H) curve, 1 to use linear B(H) curve according to mur_lin, 2 to enforce infinite permeability (mur_lin =100000)

Type:

int

Min:

0

Max:

2

property type_BH_rotor

0 to use the B(H) curve, 1 to use linear B(H) curve according to mur_lin, 2 to enforce infinite permeability (mur_lin =100000)

Type:

int

Min:

0

Max:

2

property is_periodicity_t

True to compute only on one time periodicity (use periodicities defined in axes_dict[time])

Type:

bool

property is_periodicity_a

True to compute only on one angle periodicity (use periodicities defined in axes_dict[angle])

Type:

bool

property angle_stator_shift

Shift angle to appy to the stator in magnetic model

Type:

float

property angle_rotor_shift

Shift angle to appy to the rotor in magnetic model

Type:

float

property logger_name

Name of the logger to use

Type:

str

property Slice_enforced

Enforce slice model to account for skew

Type:

SliceModel

property Nslices_enforced

To enforce number of slices in slice model

Type:

int

property type_distribution_enforced

To enforce type of slice distribution to use for rotor skew if linear and continuous (“uniform”, “gauss”, “user-defined”)

Type:

str

property is_current_harm

0 To compute only the airgap flux from fundamental current harmonics

Type:

bool

property T_mag

Permanent magnet temperature to adapt magnet remanent flux density

Type:

float

property is_periodicity_rotor

True to consider rotor periodicity over time instead of stator

Type:

bool