MagElmer (class)

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

class MagElmer(Kmesh_fineness=1, Kgeo_fineness=1, file_name='', FEA_dict=-1, is_get_mesh=False, is_save_FEA=False, transform_list=-1, rotor_dxf=None, stator_dxf=None, import_file='', nb_worker=1, is_remove_slotS=False, is_remove_slotR=False, is_remove_vent=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', init_dict=None, init_str=None)[source]

Bases: pyleecan.Classes.Magnetics.Magnetics

Magnetic module: Finite Element model with Elmer

VERSION = 1
comp_flux_airgap(output, axes_dict)

Build and solve Elmer model to calculate and store magnetic quantities

Parameters
  • self (MagElmer) – a MagElmer object

  • output (Output) – an Output object

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

solve_FEA(output, sym, angle, time, angle_rotor, Is, Ir)

Solve Elmer model to calculate airgap flux density, torque instantaneous/average/ripple values, flux induced in stator windings and flux density, field and permeability maps

Parameters
  • self (MagElmer) – A MagElmer object

  • output (Output) – An Output object

  • sym (int) – Spatial symmetry factor

  • time (ndarray) – Time vector for calculation

  • angle (ndarray) – Angle vector for calculation

  • Is (ndarray) – Stator current matrix (qs,Nt) [A]

  • Ir (ndarray) – Stator current matrix (qs,Nt) [A]

  • angle_rotor (ndarray) – Rotor angular position vector (Nt,)

get_meshsolution(output)

Build the MeshSolution objects from the FEA outputs.

Parameters
  • self (MagElmer) – a MagElmer object

  • output (Output) – An Output object

Returns

meshsol – a MeshSolution object with Elmer outputs at every time step

Return type

MeshSolution

get_path_save_fea(output)

Return the path to save the Elmer simulation

Parameters
  • self (MagElmer) – a MagElmer object

  • output (Output) –

    an Output object

    Returns

  • -------

  • save_path (str) – Path to save the .fem file

get_path_save(output)

Return the path to save the Elmer simulation

Parameters
  • self (MagElmer) – a MagElmer object

  • output (Output) –

    an Output object

    Returns

  • -------

  • save_path (str) – Path to save the Elmer simulation

comp_axes(output)

Compute the additional axes required in the MagElmer module

Parameters
  • self (Magnetic) – a Magnetic object

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

Returns

axes_dict – Dict containing Time_Tem axis used in MagFEMM to store torque result

Return type

{Data}

gen_elmer_mesh(output)

Call ElmerGrid process to convert mesh from Gmsh format to Elmer’s compatible

Parameters
  • self (Magnetic) – a Magnetic object

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

Returns

success – Status flag

Return type

{Boolean}

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 Kmesh_fineness

finner , < 1 : less fine)

Type

float

Type

global coefficient to adjust mesh fineness (1

Type

default , > 1

property Kgeo_fineness

finner , < 1 : less fine)

Type

float

Type

global coefficient to adjust geometry fineness (1

Type

default , > 1

property file_name

Name of the file to save the Elmer model

Type

str

property FEA_dict

To enforce user-defined values for Elmer main parameters

Type

dict

property is_get_mesh

To save FEA mesh for latter post-procesing

Type

bool

property is_save_FEA

To save FEA mesh and solution in a file

Type

bool

property transform_list

label (to select the surface), type (rotate or translate), value (alpha or delta)

Type

list

Type

List of dictionnary to apply transformation on the machine surfaces. Key

property rotor_dxf

To use a dxf version of the rotor instead of build_geometry

Type

DXFImport

property stator_dxf

To use a dxf version of the rotor instead of build_geometry

Type

DXFImport

property import_file

To import an existing simulation file

Type

str

property nb_worker

To run Elmer in parallel (the parallelization is on the time loop)

Type

int