Comparison between ELMER and FEMM

Numerical methods and mathematical models of Elmer
Post Reply
cris91
Posts: 10
Joined: 21 Nov 2017, 12:38
Antispam: Yes

Comparison between ELMER and FEMM

Post by cris91 »

Hi all,

I've been a FEMM user for a long time.
I'm trying to implement transient simulations for a simple reluctance motor with salient rotor, to understand how Elmer works.

FEMM does not allow transient simulations, but I study the rotor motion with a series of magnetostatic simulations.
The FEMM folder in the attached arhive contains all the procedure to launch the simulations.
The FEMM torque behavior is this:
Torque_FEMM.png
(15.84 KiB) Not downloaded yet
I analyzed the same motor with Elmer using transient simulations. The attached archive contains all the simulation files for Elmer.
The Elmer torque behavior is this:
Torque_ELMER.png
(22.82 KiB) Not downloaded yet
There are two main issues:
- I expected Elmer solver to be faster than FEMM (which re-meshes at each step): 2 minutes vs 40 seconds even with a coarser mesh
- the Elmer torque waveform shows more noise (torque oscillations)

Are there particular guidelines to mesh the air-gap and the sliding surface?
What about the time consumption? Did I select wrong solver settings?

Thank you.

Best regards.
Attachments
Comparison_FEMM_vs_Elmer.zip
Archive with all the files
(304.06 KiB) Downloaded 457 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Comparison between ELMER and FEMM

Post by raback »

Hi

Nicely done!

I tried to find places where time is spent. The usual suspect is the linear solvers. For the mgdyn2d solver the iterative ones didn't really work well because of the mortar constraints that make the system to be a saddle point problems. Luckily in 2D we have the luxury to use biorthogonal test functions which allow the elimination of the Lagrange multipliers (there are some complaints in the code that we need to look into). This enables also the use of iterative solvers. However, this didn't help much for the time consumption.

The majority of time seems to have been used for in the postprocess solver which also solves a small system. It seems that the defaults there really didn't work well. Altering the settings there eliminated most of the time. Also I did some other minor changes. For example, using MATC for constant is better to be done only once than for every node separately. I guess the total speed-up was about 80%. I suggest that you only use those changes relavant for you. There is really no reason to ditch the direct solver, for example, for this case.

Generally I would not see any reason why Elmer should be faster than FEMM. Elmer is a multiphysics code and many things are done in quite a generic manner. For more specialized codes it is easier to do fine level tuning. However, I would expect the parallel performance of Elmer to be better since for a specialized code usually the excess work on parallelization is harder to justify.

For 2D the remeshing of the air gap may well be the better strategy. However, we opted to weakly enforce the continuity since remeshing of the airgap seemed daunting in parallel & 3D problems. The convergence rate for the error in the mortar interface goes like h^3/2 where as generally for a linear mesh it goes as h^2.

The torque could be smoother. I will ask my colleague to comment whether this was the best way to compute that.

-Peter
Attachments
Transient.sif
modified sif file
(7.6 KiB) Downloaded 416 times
cris91
Posts: 10
Joined: 21 Nov 2017, 12:38
Antispam: Yes

Re: Comparison between ELMER and FEMM

Post by cris91 »

Thank you Peter for your interest in my issue and for your advice.

I tried your code and the solver is way faster.
However, as you already observed, there are warning messages as

Code: Select all

Requesting time from non-existing timer: PeriodicProjector

and

Code: Select all

Tvals too small
I look forward to hearing more information on how to obtain a smoother torque.

I'm asking these questions because I and my colleagues would like to move from FEMM to Elmer.
In addition we would like to document some test cases, such as:
  • single wire in air
  • C-core with one coil
  • simple transformer
  • simple reluctance motor
in order to help the beginner to start with Elmer.

Thank you again for your help
Best Regards

Cristian
Attachments
Transformer.png
(113.66 KiB) Not downloaded yet
Ccore.png
Ccore.png (45.24 KiB) Viewed 5161 times
SingleWire.png
(156.79 KiB) Not downloaded yet
kataja
Posts: 74
Joined: 09 May 2014, 16:06
Antispam: Yes

Re: Comparison between ELMER and FEMM

Post by kataja »

Good to hear your experiences on elmer. I suspect that the torque ripple is due to low order of approximation. Does FEMM utilize second order elements by default?

I tried your simulation (with Peter's additions) using nodal second order elements which can be generated using ElmerGrid (or with gmsh):

Code: Select all

 ElmerGrid 2 2 REL -increase 
This will just increase the order of the mesh from 1 to 2 in this case.

Anyway, I quickly tried mesh levels 2 and second order nodal elements and it seems that the accuracy of the field solution is the cause of the torque ripple.
Attachments
torque_elmer_comparison_nodal.png
torque_elmer_comparison_nodal.png (27.68 KiB) Viewed 5117 times
cris91
Posts: 10
Joined: 21 Nov 2017, 12:38
Antispam: Yes

Re: Comparison between ELMER and FEMM

Post by cris91 »

Thank you for your feedback.

FEMM uses only first order elements.
I noted that the accuracy of the torque waveform strongly depends on the mesh quality within the air-gap.

I will follow your suggestion in future analyses.

Best Regards

Cristian
Post Reply