MgDyn: non-converging simulation

Numerical methods and mathematical models of Elmer
Post Reply
OscarS
Posts: 7
Joined: 12 Jan 2024, 12:32
Antispam: Yes

MgDyn: non-converging simulation

Post by OscarS »

Hi all,

I am trying to familiarize with Gmsh for geometry and Elmer for electromagnetic (and eventually also thermal) FEA.
This goes a bit with trial and error. I try to gradually increase complexity of my model, but at the moment I am a bit stuck and I am hoping there is someone out here who can help me with it:)

The model contains one closed coil, a ferrite tile, and is surrounded by air.
The coil domain is solved with "CoilSolver" and "MgDyn", and the other two with solely "MgDyn". This "MgDyn" solver however does not converge at all.
I have tried to:
- reduce mesh size
(- apply 2nd order mesh, but this is not allowed by the solver)
- increased BiCGstabl polynomial degree (from 2 to 6)
- tried to increase ILU from 0 to 1 or 2, but this made it diverge instead of converge.
- increase the max nr of iterations

but the above trials did not result in a converging solution. Somehow I expect I am doing something completely worng with this model, but I can not discover it. Anyone out there that can have a look and is able to help me out?
In case the model and simulation setup is ok, I would expect to then start playing around with the iteration methods (e.g. CG or GMRES)?

In the attachments I added the sif file, and the file to generate the mesh (the mesh file itself is too large).

regards,
Oscar
Attachments
coil_and_ferrite_in_space.geo
(4.02 KiB) Downloaded 18 times
case.sif
(5 KiB) Downloaded 27 times
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: MgDyn: non-converging simulation

Post by kevinarden »

ycase.sif
(4.97 KiB) Downloaded 44 times
This worked for me.
OscarS
Posts: 7
Joined: 12 Jan 2024, 12:32
Antispam: Yes

Re: MgDyn: non-converging simulation

Post by OscarS »

Thank you for your quick reply and help!

Unfortunately this doe snot work for me.. I included is the solver log.
Compared to my original sif file I see the main changes are :
- the boundary condition, to Potential = 0 (Static Current conduction)? --> why? Or does this the same as AV = 0?
- added a definition of the current densities, but it is not acting on any of the bodies if I understand it correctly? So then why add it?

Or did you change more, e.g. to the mesh file?
Attachments
solver_log.txt
(6.13 KiB) Downloaded 19 times
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: MgDyn: non-converging simulation

Post by kevinarden »

I was following this example
https://github.com/ElmerCSC/elmer-elmag ... /FiveCoils
I used P because I set the variable to P in the mag solver, you can use any variable you want, but the example used P
The body force is applied to body 1 in the body definition section
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: MgDyn: non-converging simulation

Post by kevinarden »

You might consider updating the code, updates are released daily

MAIN: Version: 9.0 (Rev: Release, Compiled: 2022-08-02)
OscarS
Posts: 7
Joined: 12 Jan 2024, 12:32
Antispam: Yes

Re: MgDyn: non-converging simulation

Post by OscarS »

Hmm, odd.
Even after updating I get the same solver log
MAIN: Version: 9.0 (Rev: Release, Compiled: 2024-01-18)

I will try out some different solver settings, but at the moment I do not really understand what is going so different with my simulation compared to yours..:(
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: MgDyn: non-converging simulation

Post by kevinarden »

I also made changes to the mag solver did you use those?
OscarS
Posts: 7
Joined: 12 Jan 2024, 12:32
Antispam: Yes

Re: MgDyn: non-converging simulation

Post by OscarS »

You mean the changes as defined in the sif file you shared?
In that case; yes. I copied to full file and ran the simulation, but unfortunately, it gave the same outcomes.
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: MgDyn: non-converging simulation

Post by kevinarden »

Mine goes like this:

WhitneyAVSolver: Solving steady-state AV equations with edge elements
OptimizeBandwidth: Initial bandwidth for mgdynamics: 100811
OptimizeBandwidth: Optimized bandwidth for mgdynamics: 7794
WARNING:: JfixPotentialSolver: No Dirichlet conditions used to define Jfix level!
RowEquilibration: Unscaled matrix norm: 0.22638486096065069
20 0.3719E-14 0.3000E-03
40 0.6779E-15 0.5468E-04
60 0.2391E-18 0.1928E-07
80 0.2136E-17 0.1723E-06

Yours goes like this:
WhitneyAVSolver: Solving the AV equations with edge elements

OptimizeBandwidth: ---------------------------------------------------------

OptimizeBandwidth: Computing matrix structure for: mgdynamics...done.
OptimizeBandwidth: Half bandwidth without optimization: 100166
OptimizeBandwidth:

OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 8179
OptimizeBandwidth: ---------------------------------------------------------

WARNING:: JfixPotentialSolver: No Dirichlet conditions used to define Jfix level!

RowEquilibration: Unscaled matrix norm: 0.19831773078610776

20 0.2020E-14 0.2109E-03

40 0.4591E-10 0.4794E+01

60 0.9441E-09 0.9858E+02

80 0.1925E-04 0.2010E+07
Post Reply