FEMM 21Apr2019
David Meeker
dmeeker@ieee.org
The distribution also includes the OctaveFEMM, SciFEMM, and MathFEMM toolboxes for interfacing Octave/Matlab, Scilab, and Mathematica to FEMM. See the documentation in FEMM 4.2 folder of your Start menu for more details.
21Apr2019
* Start from previous solution for magnetics problems. To use this, specify a file name in "Previous Solution" edit box in the Problem Definition dialog. Specify the "Prev Type" to be "None". This works if the mesh has not changed from the last solution, for example, rotating problems using the "sliding band" boundary connecting the rotor and stator. These problems often involve consideration of a sequence of problems with slightly different rotor angles and currents. The "sliding band" approach lets the rotor move without modifying the mesh.
* Updated materials library for heat flow problems (thanks to Daniel Gheorghe). A detailed explanation of the updated values and their sources is at the SpecificHeat page.
* Updated hard magnetic materials in magnetics materials library (thanks to Mike Devine). Includes new definitions for Sintered NdFeB, Bonded NdFeB, Sintered SmCo, and Alnico. See the explanatory web page HardMagneticMaterials for sources and rationale.
* Fixed precision in exported DXF so that no precision is lost in DXF exports.
* Changed the algorithm that identifies limits for plotting flux density so that exterior regions (both Kelvin Transformation and IABC) are not considered. These exterior regions can have high flux densities that mask the flux density variations in the interior region of interest.
06Oct2018: (Test Build)
* Fixed the cause of an occasional error that happens running many runs in Mathematica. Fkn.exe occasionally could not open a *.ans file to write over older results. The fix adds a retry if the file can't be opened.
* Fixed a bug with the computation of the "sliding band" incremental torque integral. The "previous solution" used to calculate the integral was not obtained correctly.
* For incremental runs, mesh temporary files never got deleted, leaving extra, spurious files hanging around. Code has been added to get rid of these files when they're not needed any more.
From 25Feb2018 Release
Rotor Motion Model
In the 25Feb2018 version, a rotor motion model was added to FEMM. The rotor motion model is described in detain on the SlidingBand page. This functionality makes it possible to analyze a rotating machine at different rotor angles without changing the mesh. Smooth torque and voltage vs. rotor angle can be obtained from relatively coarsely meshed models.
Rotor Motion Example 1
An example application of the rotor motion model (animated in Figure 1 below) is given on the RotorMotion page. Performance is compared to a benchmark problem from the literature, and performance appears to be similar to that of a moving band approach with high-order elements inside the moving band.
Figure 1: Animation of rotor motion model example.
Rotor Motion Example 2
A second example is provided by the TorqueBenchmark page. Torque results from FEMM are compared to exact results for the case of torque on a bar magnet in a constant magnetic field. Agreement with the analytical solution is good.
Figure 2: Solution for torque bench mark with a rotor angle of 45 degrees.
Rotor Motion Example 3
A reworked version of the script for computing loss in the laminations, magnets, and coils of a surface mount permanent magnet machine are now at the end of SPMLoss. In the reworked script, the mesh is the same for every time step, which eliminates a source of numerical noise in the original calculation. The script also no longer has to rotate the locations of the rotor elements, since the rotor is always pictured in a reference frame where the rotor looks stationary.
Frozen Permeability / Incremental Permeability Solvers
A 23Jun2016 test build is available with support for "Frozen Permeability" and "Incremental Permeability" formulations in DC Magnetics problems.
To link a problem to an existing solution (i.e. to automatically use the element-by-element permeabilities determined in a previous DC solution in a new DC solution), specify the name of the problem in the "Previous Solution" edit box in the problem properties. Pick "Incremental" or "Frozen" in the associated drop list, depending on what sort of problem is desired.
FrozenBenchmark Frozen Permeability Benchmark and FrozenTorqueSeparation Torque Separation examples are available.
The "incremental permeability" solution type essentially implements the hooks necessary to do transient problems using the methods described in:
E. Lange, F. Henrotte, and K. Hameyer, "An Efficient Field-Circuit Coupling Based on a Temporary Linearization of FE Electrical Machine Models", IEEE Transactions on Magnetics, 45(3):1258-1261, Mar 2009.
First, a nonlinear problem is solved at a particular nonlinear operating point (i.e. a particular set of instantaneous currents at a particular rotor orientation) Then, a linear, incremental problem based on the incremental permeabilities gleaned from the nonlinear operating point is solved for each phase where the phase of interest has a current of 1A and all other excitation is turned off. For each solution, the self inductance and the mutual inductances with all other phases are computed to generate one row of the incremental inductance matrix. Then, the "interaction torque" with the full nonlinear solution is computed to determine the back EMF voltage seen by the phase of interest. The development build contains a new torque integral that evaluates this interaction torque using the "weighted stress tensor" paradigm for good accuracy.
Looking at it another way, linearizing for small changes in current, \(i\), a very general equation that describes most rotating machines is: \[ L_{inc} \frac{di}{dt} + \omega \frac{d \psi}{d\theta} + R i = v \] where \(L_{inc}\) is the incremental inductance matrix gleaned by evaluation of inductance from the incremental permeability solutions; \(\frac{d \psi}{d\theta}\) is the change in flux linkage with respect to the change in rotor orientation gleaned by the evaluation of interaction force from the incremental permeability solutions; \(\theta\) represents the rotor orientation; and \(\omega\) is the change in \(\theta\) with respect to time. Matrix \(R\) is the phase resistance matrix (which is not necessarily evaluated by FEA and should contain resistance contributions from the end turns), and \(v\) is an externally applied voltage vector.
It should then be possible to include a direct link to FEMM in various transient simulation engines, by wrapping the above generalized model in in the "right way". In particular, I am interested in making a full transient simulation of a rotating electric machine that couples FEMM directly to Simulink. The Simscape Power Systems toolbox could be used for modeling the associated drive electronics.
Visual Studio 2017
The source code for FEMM development builds now compiles with either Visual Studio 2008 or Visual Studio 2017. Solution files are included in the source code distribution for both versions of Visual Studio (femm43_VS2008.sln and femm43_VS2017.sln). To compile with Visual Studio Community 2017, you need to specify the optional Visual C++ and MFC components when you install Visual Studio.
Release Notes
FEMM 4.2 25Feb2018
- Added an "air gap boundary condition" that allows the rotor to be continuously moved without the mesh changing with rotor position. A number of new scripting functions have been added to calculate forces, torques, and field values of associated with an analytical solution in the air gap between the rotor and stator. Detailed examples to follow.
- Added file-by-file smartmesh attribute along with scripting commands for each input file type (mi_smartmesh, ei_smartmesh, hi_smartmesh, ci_smartmesh) to turn smartmesh on or off for a particular file. The global smartmesh scripting function still works to turn smartmesh on or off across all problem types for a particular session.
- Changed to Triangle 1.6 instead of Triangle 1.3. Version 1.6 is more robust and usually does not hang / crash if there are small angles in the input geometry.
- In cases where Triangle previously hung (displaying an error message) when an error occured, the program now terminates and indicates that an error has occured. This is especially useful for Matlab/Octave scripts, which now get passed the error indication rather than having the script hang on the meshing error.
- Fixed the problem of focus-stealing during script execution. This makes it possible to do other things while FEMM is running a long (Matlab/Octave or Mathematica) script.
- Added a new optional parameter to openfemm in Matlab/Octave/Mathematica and Scilab scripting. openfemm(1) starts FEMM fully minimized.
- Calls to the analysis (mi_analyze and friends) assume the state of the main window. For example, if a scripting run is started minimized with openfemm(1), subsequent mi_analyze() calls will also be run minimized automatically.
- Fixed SciFEMM interface so that it works with Scilab 6.0.0
- Fixed mi_attachdefault, ei_attachdefault, hi_attachdefault, and ci_attachdefault functions, which didn't work correctly.
- Added a "frozen permeability" problem type that can be used to split up field contributions between various excitation sources for nonlinear DC problems. Also extends the "incremental permeability" formulation to DC problems. The DC incremental results can be used as part of a general time-transient solver, essentially providing the derivatives of flux linkage with respect to incremental changes in current and with respect to small changes in position / orientation of moving parts.
- Dropped support for versions of Mathematica before version 5.0. Versions prior to 5.0 do not include .NET/Link for interprocess communications.
- Fixes bug added in 01Nov2015 that messed up the reported permeability and field intensity for nonlinear time harmonic problems.
FEMM 4.2 01Nov2015
- Adds "incremental permeability" AC solver. An example application for this functionality is the analysis of the frequency-dependent impedance of speaker drivers about the DC operating point established by the speaker's permanent magnet. The DC operating point specified as the "Previous Solution" in the problem definition or via the mi_setprevious(filename,1) command in Lua.
- Adds 10% and 15% Copper Clad Aluminum magnet wire material types. The material definition is intended to provide accurate estimates of proximity and skin effect losses across a wide range of frequencies with a bulk wire model (i.e. not every turn has to be individually modeled).
- Change to InTriangle test to fix the issues that could occur if a specified point is exactly on the line between two elements
- Lua command to programmatically turn off "smart mesh" with the smartmesh(state) Lua command. State is 0 for no "smart mesh" and 1 for "smart mesh". Function has the same name in the Matlab interface and is named SmartMesh in the Mathematica implementation
- Fixed bug where "mo_zoom", "eo_zoom", etc. didn't work right
- Fixed an issue where the right energy / flux linkage was not reported for wound coils in AC magnetic problems if the frequency is very small (e.g. <1μHz)
- For increased compatibility with Mathematica 10, the Mathematica interface has been changed to use .NET/Link when it is available (instead of MathLink). .NET/Link invokes FEMM as an out-of-proc ActiveX server (the same way that FEMM communicates with Matlab).
FEMM 4.2 15Nov2013
- Changed the way that errors are trapped in Matlab/Octave and Scilab implementations so that errors that would normally display as message boxes in a normal GUI session instead get returned as errors to Matlab/Octave or Scilab. Errors can then be trapped, e.g. by using a try/catch block.
- Fixed instances of GetWindowLong and SetWindowLong which caused the x64 build to crash when running on Linux via Wine. (see http://bugs.winehq.org/show_bug.cgi?id=34868)
- Fixes to eo_blockintegral and co_blockintegral functions. Previously wouldn't allow integration (e.g. for Weighted Stress Tensor force) if the only selected area was a conductor surface.
FEMM 4.2 25Aug2013
- Added mi_selectcircle, mi_selectrectangle and friends to programmatically select regions.
- Changed .dxf import so that objects assigned to layers are imported as being in the same group.
- Added new "Improvised Asymptotic Boundary Condition" button, and mi_makeABC and friends Lua functions, analogous Octave/Matlab, Mathematica, and Scilab functions, as an alternate way of solving unbounded problems.
FEMM 4.2 11Apr2012 with installer fix
- Functionally identical to 11Apr2012, but fixes a bug in the installer where registry keys the ActiveX interface (part of the infrastructure for Matlab, Octave, and Scilab) were not created properly. I'd inadvertently re-introduced Bug 14.
FEMM 4.2 11Apr2012
- Can turn off "smart meshing" via a Preferences selection on the "General Attributes" tab by unchecking "use smart meshing"
- Fixed a newly introduced bug where an erroneous resistive loss is computed for AC problems in regions where conductivity = 0
- Fixed mi_readdxf problem described as Bug 18 in the Bug Tracker.
- Fixed problem with running with 64-bit Scilab described as Bug 16 in the Bug Tracker. Now, FEMM 32-bit works with Scilab 32-bit on Win7 32-bit, and FEMM 64-bit works with Scilab 64-bit on Win7 64-bit.
FEMM 4.2 01Oct2011
- Fixed error in reported flux linkage. Flux linkage for stranded regions carrying zero current is not reported correctly for AC problems.
- The Lua "format" command did not work properly with complex number--it stripped off the imaginary part of the number. This is now fixed.
- The units reported for some heat flow block integral results were erroneous. This has now been rectified.
- 64-bit version of FEMM 4.2 is now available.
- FEMM has been modified to allow multiple instance of FEMM to run at the same time via ActiveX. For example, This allows multiple instance of FEMM to be controlled by one instance of Matlab or Octave.
- FEMM 42 09Nov2010 asks for Mathematica integration when using the silent install method. The installer script has been modified so that the silent install assumes that Mathematica is not available, letting the installation complete without requiring operator intervention.
- Default material. A feature has been added which allows one block label to be designated as the default block label. Any unlabeled blocks are then assumed to be tagged by the default block label.
- In the current flow problem type, line plots of quantities normal and tangential to a user-define contour were messed up because the normal and tangential directions were computed incorrectly. This is now fixed.
- The "default" mesh size has been changed. In previous builds, using the default mesh size nearly always resulted in a mesh that was too coarse to give accurate results. The default mesh size has been changed so that specifying the default mesh size is adequate for most applications. Note: can use the <F3> and <F4> keys to uniformly refine and coarsen the mesh for the entire model with one keystroke.
- Added automatic refinement of the mesh near corners. This refinement improves convergence of results like force, stored energy, etc.
- Changed the way that the maximum flux density is computed for flux density plotting purposes. With the automatic refinement of corners, small elements with high flux densities can appear in corners. The modified algorithm discounts these small corner elements when picking a maximum for the purposes of picking plot contours.
- Changed the key that is used to break out of Lua scripts to ESC from BREAK. Many keyboards don't have a BREAK key anymore, so it made sense to make this change.
- Changed the selection rectangle to a dotted line so that it would render faster.
- Modified the DXF import to understand closed POLYLINE entities. Previously, only open POLYLINE entities were supported.
- Fixed problem with functionality that creates rounded corners (i.e. the functionality invoked by mi_createradius) where the program would not allow a radius to be created if the intersection was between a line segment and an arc segment if the line segment laid along a ling that passed through the center of the circle associated with the arc segment.
- Default install directory changed to c:\femm42 to avoid directory permissions problems in Windows 7.
FEMM 4.2 09Nov2010
- There are no changes to the FEMM binaries vs. 11Oct2010, but a set of Scilab functions for interfacing with FEMM has been added. These functions were tested using Scilab 5.2.2. The descriptions of these functions are identical to those described in the OctaveFEMM documentation. Example Scilab scripts are in the femm42/examples directory of the FEMM distribution and have a .sce file extension and can be run by typing:
exec('examplename.sce',-1)
at the Scilab command line. If you did not install FEMM to the default c:\Program Files\femm42 directory, you'll need to change the first line of the *.sce files that loads the FEMM library so that it points to the correct library location.
FEMM 4.2 11Oct2010
- Fixed bug in values of
reported in the Output Window for time harmonic magnetic problems. - Fixed bug where in some plots, units of H given as A/m^2 instead of A/m
- Fixed error in mo_showvectorplot Matlab/Octave function. Also fixed similar errors in co_showvectorplot, ho_showvectorplot, eo_showvectorplot
- Fixed messed-up definitions of the Lua functions ei_defineouterspace, ei_attachouterspace, and ei_detachouterspace
- Installer now prompts for whether or not Mathetmatica support is to be included. If Mathematica support is selected, a version of FEMM is installed that assumes the availability of ML32I2.DLL, a DLL installed by Mathematica. Otherwise, a version of FEMM is installed that doesn't need the Mathlink DLL.
- Re-wrote the GetIntersection routine that finds intersections between two line segments. In some uncommon circumstances, the routine could create extra points when the geometry was moved or rotated.
- Added extra Lua functions mi_getmaterial, ei_getmaterial, hi_getmaterial, and ci_getmaterial to fetch material definitions from the materials library on disk. Analogous functions were also added to the Matlab/Octave and Mathematica interfaces.
FEMM 4.2 02Nov2009
- Added the Lua commands mi_setgroup, ei_setgroup, hi_setgroup, ci_setgroup that assign all selected items to the group number specified by the argument to the function.
- Fixed a bug that caused an incorrect permeability to be reported for nonlinear materials at points where the flux density is less than 10nT.
- Fixed bugs with ci_addconductor and ci_modifyconductor Lua functions.
- Fixed bug with CIAddMaterial function in MathFEMM
FEMM 4.2 15Jul2009
- Added the following Lua commands that allow direct access to finite element mesh information (as well as Matlab/Octave and Mathematica analogs):
mo_numnodes, mo_numelements, mo_getnode, mo_getelement,
eo_numnodes, eo_numelements, eo_getnode, eo_getelement,
ho_numnodes, ho_numelements, ho_getnode, ho_getelement,
co_numnodes, co_numelements, co_getnode, co_getelement.
- Made a few more performance tweaks to the Mathematica interface.
- Fixed bug in computation of heat flux passing through a constant temperature-type "conductor property"
- Included a new selection of SoftMagneticMaterials soft magnetic materials in the magnetic materials library. The BH curves for these materials were obtained by digitizing the curves picutured in Figure 17, "Direct current magnetization curves for various magnetic materials", Metals Handbook, 8th ed, Vol. 1, p. 792. These curves represent a wide variety of materials, and the curves are defined to very high flux levels at which all materials are fully saturated.
FEMM 4.2 01Apr2009
- Fixed the Lua Console output window so that the window does not freeze up if more than 30K of information is printed to the output window. Now, the buffer size has been increased to 64K. If more than 64K is printed to the output window, the first few lines in the buffer are deleted to make room for the newly printed lines.
- The expected function arguments for the lua functions co_showdensityplot, eo_showdensityplot, and ho_showdensityplot did not match the documentation. The manual and functions have now been reconciled.
- In the thermal, electrostatic, and current flow problems, only 255 point properties could be defined. The program has been changed to allow up to ~65,000 point properties to be defined, along with ~32,000 "conductor" properties.
- In previous versions, a Newton-type solver for AC magnetic problems could be turned on by setting a compiler flag and recompiling the solver. The latest version has been modified so that the solver method for AC programs is now selectable as part of the "problem definition" dialog.
- During scripting runs, FEMM would load down the processor by checking at the highest possible rate to see if the solver was finished. A very short delay has been put in between checks so that the processor time used is now negligible.
- The implementation of MathFEMM also checked for the completion of solver analysis at a high rate, bogging down the processor. A very short delay has been put in between checks in the MathFEMM code so that the processor time used doing these checks is now negligible.
- Modified OctaveFEMM so that it takes advantage of the Octave-Forge Windows package if it is available. The Windows package implements the actxserver command, which allows Octave to communicate with FEMM via ActiveX automation, rather than a very slow temporary file-based scheme. The Octave-Forge Windows package is installed by default in Octave 3.0.3 and QtOctave.
- The Lua function mo_showvectorplot was not documented. This is now fixed.
- The mo_showvector, ho_showvectorplot, co_showvectorplot, and eo_showvectorplot functions were not available in OctaveFEMM or in MathFEMM. This is now fixed.
- For AC problems with laminated, linear materials with an electrical conductivity of zero and a fill factor of less than 100%, some properties were reported erroneously in the postprocessor. This has been fixed.
- Fixed a long-standing issue with the materials library that caused the program to crash when running on Linux machines via Wine.
FEMM 4.2 04Nov2008
- Bug in mo_lineintegral(2) has been fixed.
- Bug in co_showdensityplot that limited the types of plots that could be shown has been fixed.
- Source code to MDITabs.cpp, MyRecentFileList.cpp have been modified to fix portions that compile OK with MSVC++ 6 but that generate errors in Visual Studio 2005. There is no change in functionality associated with these mods.
- Bug in the OctaveFEMM implemenation of mo_bendcontour fixed.
- Initialization file init.lua has been modified so that it will load correctly when FEMM is running via newer versions of WINE.
- Versions of the mfc42.dll and msvcrt.dll redistributables are now included in the distribution. These only get installed if there are no existing version of these DLLs.
- The way that FEMM registers itself has been changed for Windows Vista compatibility.
FEMM 4.2 23May2008
Patched to fix a bug that can sometimes arise in the implementation of periodic and antiperiodic boundary conditions in all problem types.
FEMM 4.2 06Sep2007
- Fixed a bug in the definition of the temperature prescribed for a thermal conductor in hsolv.exe.
- Fixed a bug in the axisymmetric AC magnetics solver incorrect results were returned for problems with complex-valued permeability. (Fix is now rolled back into v4.0.1, too.)
- Fixed a bug in both the axisymmetric and planar magnetics solvers where incorrect results were returned if a non-zero fixed boundary condition was applied at the boundary of a material with complex-valued permeability.
FEMM 4.2 03Jun2007
- Fixed a few bugs in hsolv, the thermal solver.
- Removed the "fast point location" routines. The purpose of these routines is to figure out which mesh element (if any) in which a given point is located. Although these routines work well 99.9% of the time, there are special cases where this code could give the wrong triangle or hang the program altogether. The old (mindless) InTriangle routine (which the fast point location routines had been designed to replace) just looked through the triangles one at a time until it found the correct triangle. This could make the plotting of values along a user-defined line quite slow, especially for large meshes. I realized that the way that InTriangle is typically used where execution time matters (plotting points along a line), the desired triangle is usually in the same triangle as the last InTriangle call, or it is one of the neighboring triangles of the result of the last call to InTriangle. The implication is that the mindless version of InTriangle can be fast as long as
- Each search starts in the triangle that was returned in the last call to InTriangle
- The elements are sorted in a bandwidth-minimizing way so that difference in the indices of nearby elements is small.
FEMM 4.2 03May2007
- Fixed implemenation of trig functions like atan and atan2 so that they return purely real results for purely real arguments, as applicable. Previously, atan could return a result with a round-off sized imaginary component in addition to the correct real value for a real valued argument.
- Fixed some formatting errors in property definition menus for thermal problems.
FEMM 4.2 02Apr2007
- Changed the way that stored energy is computed for permanent magnet materials. Energy in PMs was computed incorrectly in previous versions. Energy is now computed in a way that is similar to the method described here.
- The program now loads and runs the contents of the file init.lua as part of its startup procedure. The user can edit this file to add in "standard" extra definitions and functions.
FEMM 4.2 02Mar2007
As compared to FEMM 4.0.1, version 4.2 :
- Incorporates a new problem type for conduction problems encompassing both DC and AC conductivity, in addition to DC Magnetics, AC Magnetics, Electrostatics, and Heat Flow.
- Incorporates ComplexLua, a modified version of the Lua scripting language in which the default number type is complex (rather than double). Modifications resulting from this change are:
- There are no longer separate edit boxes for the real and complex parts of complex-valued parameters (e.g. source current density in the material properties dialog for magnetic problems). Instead, there is a single edit box in which a complex number can be entered.
- No longer need to separately specify real and imaginary parts of complex numbers in Lua function calls--these parameters are now rolled into one complex-valued parameter
- Real and imaginary parts no longer returned separately by Lua functions; they now return complex values as appropriate.
- Can include complex math in Lua scripts. All standard math functions have been modified to yield correct answers for complex-values arguments.
- The setcompatibilitymode(1) command can be used to temporarily revert to the lua function definitions as defined in FEMM 4.0. However, some caution is in order--in FEMM 4.2, all trigonometric functions take arguments in radians regardless of compatibility mode setting, whereas in FEMM 4.0, trigonometric functions take arguments in terms of degrees.
- However, Matlab, Mathematica, and Octave interfaces are unchanged from the user's perspective. These interfaces already collected and returned values as complex numbers. All Octave/Matlab scripts and Mathematica notebooks from FEMM 4.0 should work without modification in FEMM 4.2
- Additional math functions defined: arg, conj, sinh, cosh, tanh.
- Can define a magnetization direction as an equation, rather than a fixed value. For the purposes of defining the magnetization direction, the variables x, y, r, z and theta are built-in variables that are used to denote the location of the particular spot at which the magnetization is being defined. For example, to define a radial magnetization, one would enter theta into the block property dialog, rather than a fixed number.
- For magnetic problems, density plots allow field intensity (H) to be plotted, in addition to flux density (B) and current density (J).
- Incorporates a modified version of the ProximityLoss continuum proximity/skin effect loss model deployed in FEMM 4.0. The version in FEMM 4.2 is based on a similar form, but parameters are selected to provide a best fit match to a battery finite element calculations. There is an improvement in accuracy as compared to the FEMM 4.0 approach, especially in the case of very high or very low fill factors.