Skip to main content

FEM Magnetics Toolbox

Project description

FEM Magnetics Toolbox (FEMMT)

Python toolbox to generate preconfigured figures for FEM simulation tools in power electronics.

The toolbox contains two parts, a reluctance module and a FEM module.

  • The reluctance module is for pre-calculations
  • The FEM module is for detailed calculations

The toolbox is accessible via python code or a graphical user interface (GUI), which current development status is experimental.

Functionality examples

  • work with pre-defined standard core structures
  • work with pre-defined litz wires
  • use python to perform parametersweeps, e.g. perform several automated simulations of different air gap sizes
  • read the results automated with python from the FEM simulation tool

Note: Alpha Version!

  • GUI is experimental,
  • reluctance module is currently working for a single optimization example and not fully implemented yet.

1. Detailed Documentation

Can be found here.

2. Installation

2.1 ONELAB installation

  • Go to https://onelab.info/
  • Download the Desktop Version for your OS (Windows, Linux or macOS)
  • Unpack the software and remember the file path. This will be needed later when installing FEMMT.

2.2 FEMM installation [for Windows User only]

2.3 Install FEMMT

Chose to install the development version of FEMMT or the release version.

FEMMT release version (recommended)

This is the stable release version.

pip install femmt

FEMMT development version (for developers only)

This is the latest development version with the latest features. Note: You may need to install git.

cd /Documents/Folder/of/Interest   
git clone git@github.com:upb-lea/FEM_Magnetics_Toolbox.git
pip install -e .

2.4 Minimal example and first run

Run the example from here: basic_example.py. FEMMT will ask you for the installation path of ONELAB during first use.

3. Examples

This toolbox is able to build a complete FEM simulation from simple Python code. The following figure shows the Python code on the left and the corresponding FEM simulation on the right.

3.1 Basics

Code examples can be found in this example file. This file is updated regulary.

The magnetic component can be an inductor, a transformer, or a transformer with integrated stray path. The parameterization process is divided into the following steps:

  1. Chose simulation type,
  2. set core parameters (geometry, material),
  3. set air gap parameters (position, height),
  4. set conductor parameters (litz/solid wire),
  5. start simulation with given frequencies and currents and phases.

Find an example here, and check out the example file for more examples!

import femmt as fmt
# 1. chose simulation type
geo = fmt.MagneticComponent(component_type="inductor")

# 2. set core parameters
geo.core.update(window_h=0.03, window_w=0.011,
                mu_rel=3100, phi_mu_deg=12,
                sigma=0.6)

# 3. set air gap parameters
geo.air_gaps.update(method="center", n_air_gaps=1, air_gap_h=[0.0005], position_tag=[0])

# 4. set conductor parameters
geo.update_conductors(n_turns=[[14]], conductor_type=["solid"], conductor_radii=[0.0015],
                      winding=["primary"], scheme=["square"],
                      core_cond_isolation=[0.001, 0.001, 0.002, 0.001], cond_cond_isolation=[0.0001],
                      conductivity_sigma=["copper"])

# 5. start simulation with given frequency, currents and phases
geo.create_model(freq=100000)
geo.single_simulation(freq=100000, current=[3])

The examples contain among other things:

  • Geometries: Coil, transformer, transformer with integrated stray path,
  • wire and stranded wire definition,
  • air gaps definition,
  • excitation with different frequencies, amplitudes and phases.

The simulation results can be found in the file /python-side-packages-path/femmt/femmt/results/result_log_electro_magnetic.json. In it you can find

  • power loss in the core: hysteresis losses and eddy current losses,
  • losses per winding and for each individual winding,
  • self- and mutual inductances.

4. GUI

There is a first preview for a GUI. Installing this is a bit cumbersome at first, but will be simplified in the future:

  • Download the complete repository via Code -> Download ZIP and unpack it.
  • install the development version of femmt as described above
  • run python downloads/path-to_femmt/femmt/gui/femmt_gui.py

5. Roadmap

Planned features in 2022:

  • Software stability and general improvements,
  • add more Functionality to the GUI,
  • implement basics for thermal simulation in python code.

6. Bug Reports

Please use the issues report button within github to report bugs.

7. Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. For contributing, please refer to this section.

8. Changelog

Find the changelog here

9. License

GPLv3

10. History and project status

This project was initially written in matlab using FEMM simulation tool. It became clear that the project was no longer a small project. The project should be completely rewritten, because many new complex levels have been added. To place the project in the open source world, the programming language python is used.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

Updated

  • possibility to assign fixed magnetic loss angle and conductivity in update_core function
  • new isolation scheme (looking from core to all windings): core_cond_isolation=[top, bottom, inner, outer] instead of core_cond_isolation=[prim2core, sec2core]
  • gmsh 4.9.5 as minimum requirement

Added

  • example for foil winding inductor
  • conductor material can be chosen from a small material database, used in update_conductors(), e.g. conductivity_sigma=["copper"]
  • isolations for thermal simulation

Fixed

  • fix #15: Secondary to Core isolation thickness not working

0.2.0 - 2022-02-14

Updated

  • updated the winding generation
  • updated the femm reference model
  • updated project structure
  • updated meshing to hybrid mesh
  • updated class structure

Added

  • add file Analytical_Core_Data.py
  • add example files DAB_Input_Data.py, DAB_trafo_optimization.py
  • add file mu_imag.pro
  • add folder femmt/thermal
  • add result_log_electro_magnetic
  • add horizontal interleaved winding scheme
  • add method write_log() to femmt.py
  • add thermal simulation with onelab
  • add femm heat flow validation with femm

Fixed

  • fix #5: changed typo to L_h_conc = self.M**2 / self.L_22
  • fix #11: rename femmt.py to femmt_classes.py due to package problems

0.1.2 - 2021-08-08

Updated

  • updated strand approximation

Added

  • add option for dedicated stray path
  • add complex permeability and permitivity for core materials for Core Loss estimation
  • add iGSE and GSE for Core Loss estimation

0.1.1 - 2021-08-11

Updated

  • updated inductance calculations
  • code clean up

Fixed

  • fix #2: config.json was not read correct
  • fix #3: Install pyfemm on windows machines in case of not installed pyfemm

0.1.0 - 2021-07-28

Added

Structure

  • add README.md
  • add CHANGELOG.md
  • add femmt/init.py

Essentials

  • add femmt/FEMMT.py
  • add femmt/functions.py
  • add femmt/ind_axi_python_controlled.pro
  • add femmt/solver.pro
  • add femmt/BH.pro

Examples

  • add femmt/FEMMT_geometric.py
  • add femmt/basic_example.py

Additional/Experimental Code

  • add femmt/pandas_json.py
  • add femmt/femm_test.py
  • add femmt/SimComparison.py
  • add femmt/SolidComp.py
  • add femmt/CompRes.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

femmt-0.2.1-py3-none-any.whl (172.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page