pyleecan.Classes.OutMag module

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

class OutMag(axes_dict=None, B=None, Tem=None, Tem_av=None, Tem_rip_norm=None, Tem_rip_pp=None, Phi_wind_stator=None, Phi_wind=None, emf=None, meshsolution=- 1, logger_name='Pyleecan.Magnetics', internal=None, Rag=None, Pem_av=None, Slice=None, Tem_slice=None, Phi_wind_slice=None, Tem_norm=0.001, init_dict=None, init_str=None)[source]

Bases: FrozenClass

Gather the magnetic module outputs

VERSION = 1
clean(clean_level=1)

Clean Magnetics standard outputs depending on cleaning level

Parameters:
  • self (OutMag) – the OutMag object to update

  • clean_level (int) – Value to indicate which fields to clean in OutMag (default=1/min=0/max=4/5=LUT)

comp_emf()

Compute the Electromotive force [V]

Parameters:

self (OutMag) – an OutMag object

comp_power()

Compute the Ouput power

Parameters:

self (OutMag) – An OutMag object

get_demag(Hmax, group_name=None)

Get the surface area of the magnets that exceed a given field strenght H

Parameters:
  • Hmax (float) – demagnetization field strenght

  • group_name (str) – optional name of the group, default group is ‘rotor magnets’

Returns:

  • area (float) – surface area that exceed the max. field strength

  • area_ref (float) – total magnets surface area as a reference

  • indices (list) – list of cells indices that exceed the max. field strength

store(out_dict, axes_dict)

Store the standard outputs of Magnetics that are temporarily in out_dict as arrays into OutMag as Data object

Parameters:
  • self (OutMag) – the OutMag object to update

  • out_dict (dict) – Dict containing all magnetic quantities that have been calculated in comp_flux_airgap

  • axes_dict ({Data}) – Dict of axes used for magnetic calculation

comp_torque_MT()

Compute the rotor electromagnetic torque from Maxwell Stress Tensor.

Parameters:

self (OutMag) – an OutMag object

Returns:

Tem_slice – Rotor electromagnetic torque per slice [N]

Return type:

ndarray

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 axes_dict

Dict containing axes data used for Magnetics

Type:

{SciDataTool.Classes.DataND.Data}

property B

Airgap flux density VectorField object

Type:

SciDataTool.Classes.VectorField.VectorField

property Tem

Electromagnetic torque DataTime object

Type:

SciDataTool.Classes.DataND.DataND

property Tem_av

Average Electromagnetic torque

Type:

float

property Tem_rip_norm

Peak to Peak Torque ripple normalized according to average torque (None if average torque=0)

Type:

float

property Tem_rip_pp

Peak to Peak Torque ripple

Type:

float

property Phi_wind_stator

Stator winding flux DataTime object

Type:

SciDataTool.Classes.DataND.DataND

property Phi_wind

Dict of lamination winding fluxlinkage DataTime objects

Type:

{SciDataTool.Classes.DataND.DataND}

property emf

Electromotive force DataTime object

Type:

SciDataTool.Classes.DataND.DataND

property meshsolution

FEA software mesh and solution

Type:

MeshSolution

property logger_name

Name of the logger to use

Type:

str

property internal

OutInternal object containg outputs related to a specific model

Type:

OutInternal

property Rag

Radius value for air-gap computation

Type:

float

property Pem_av

Average Electromagnetic power

Type:

float

property Slice

Slice model to account for skew

Type:

SliceModel

property Tem_slice

Electromagnetic torque DataTime object including torque per slice

Type:

SciDataTool.Classes.DataND.DataND

property Phi_wind_slice

Dict of lamination winding fluxlinkage DataTime objects per slice

Type:

{SciDataTool.Classes.DataND.DataND}

property Tem_norm

Torque normalization

Type:

float