Model induction between two coils

The graphical user interface of Elmer
mrbearb
Posts: 20
Joined: 07 May 2024, 20:41
Antispam: Yes

Re: Model induction between two coils

Post by mrbearb »

kevinarden wrote: 08 May 2024, 17:05 Is it possible to zip and post the mesh?
Attachments
20TurnCoil_Rough.zip
(715.75 KiB) Downloaded 6 times
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Model induction between two coils

Post by kevinarden »

You have no BCs at the ends, only a desired coil current specified in the solver.

I let the solver calculate the coil current, and specify the potential at each end.

! CoilSolver
Solver 1
Exec Solver = Before All
Equation = CoilSolver
Procedure = "CoilSolver" "CoilSolver"
Linear System Solver = Iterative
Linear System Direct Method = Mumps
Linear System Preconditioning = ILU1
Linear System Max Iterations = 2000
Linear System Iterative Method = idrs
Linear System Convergence Tolerance = 1e-9
Linear System Residual Output = 20
Coil Closed = Logical False

Calculate Elemental Fields = True
Fix Input Current Density = True

Normalize Coil Current = True
! Desired Coil Current = 100.0
Calculate Coil Current = True
End


Boundary Condition 1
Name = "bc_surrounding"
Target Boundaries(1) = 1
Temperature = 293.15

AV re {e} = Real 0.0
AV im {e} = Real 0.0
! No BCs needed for scalar potential
End

Boundary Condition 2
Name = "bc_inductor_end_bottom"
Target Boundaries(1) = 2
Coil Start = True
AV re = Real 1.0
AV im = Real 1.0
AV re {e} = Real 1.0
AV im {e} = Real 1.0
End

Boundary Condition 3
Name = "bc_inductor_end_top"
Target Boundaries(1) = 3
Coil End = True
AV re = Real 0.0
AV im = Real 0.0
AV re {e} = Real 0.0
AV im {e} = Real 0.0
End
mrbearb
Posts: 20
Joined: 07 May 2024, 20:41
Antispam: Yes

Re: Model induction between two coils

Post by mrbearb »

Ok, so when I went and ran a rougher mesh version of the coil, but same sif as before:

Rough Mesh:
potential_multi_rough.png
potential_multi_rough.png (72.33 KiB) Viewed 100 times
Finer Mesh:
potential_multi_wrong.png
potential_multi_wrong.png (61.11 KiB) Viewed 100 times
Last edited by mrbearb on 08 May 2024, 17:29, edited 1 time in total.
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Model induction between two coils

Post by kevinarden »

When i run the mesh you posted with the sif you posted it looks OK to me
coilpot.png
coilpot.png (132.1 KiB) Viewed 100 times
What version of Elmer are you running?
mrbearb
Posts: 20
Joined: 07 May 2024, 20:41
Antispam: Yes

Re: Model induction between two coils

Post by mrbearb »

kevinarden wrote: 08 May 2024, 17:29 When i run the mesh you posted with the sif you posted it looks OK to me
What version of Elmer are you running?
Thanks again for taking a look at this!

I'm running a version complied February 7 2024.

The only difference between the two is the mesh resolution, which I am changing in Gmsh by changing the "Compute element size from curvature" from 5 (rough mesh) to 10 (finer mesh)

Here is a link to my ElmerGui project containing the finer mesh that gives the strange results:
https://tigermailauburn-my.sharepoint.c ... g?e=ymsnJP
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Model induction between two coils

Post by kevinarden »

The problem is the more complex one has not converged. One issue with iterative solvers, is every iteration is a solution, but it might not be a converged solution. By default Elmer moves on when the number of specified iterations has taken place, even if convergence is not reached.

If you change to
Linear System Max Iterations = 2500

you get a nice converged solution, it converges at 1884 iterations.
coilpot.png
coilpot.png (142.55 KiB) Viewed 86 times
mrbearb
Posts: 20
Joined: 07 May 2024, 20:41
Antispam: Yes

Re: Model induction between two coils

Post by mrbearb »

kevinarden wrote: 08 May 2024, 19:15 The problem is the more complex one has not converged. One issue with iterative solvers, is every iteration is a solution, but it might not be a converged solution. By default Elmer moves on when the number of specified iterations has taken place, even if convergence is not reached.

If you change to
Linear System Max Iterations = 2500

you get a nice converged solution, it converges at 1884 iterations.
Wow, thank you! That makes a lot of sense. Is there a way to see whether a solution has converged successfully or not, other than "that don't look right" :D ?
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Model induction between two coils

Post by kevinarden »

There are two options.
1. You can set the message level such that you see the result for each iteration and compare it to the convergence criteria. Or if it converges prior to to the max iterations set you know it converged to the criteria.
e.g. Elmer out puts
820 0.2350E-06
830 0.2391E-06
840 0.1909E-06
850 0.1909E-06
856 0.1909E-06
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.57768715 2.0000000 ) :: coilsolver
CoilSolver: Initial coil current for coil 1: 3.0754E+03
CoilSolver: Coil potential multiplier: 3.2516E-03
5 0.3499E-11
5 0.3599E-11
5 0.5075E-11
I had iterations set to 2500 but it converged to the criteria on iteration 856,

2. You can tell Elmer to stop and post an error if it does not met the convergence criteria

Linear System Abort Not Converged = True

If the value of this keyword is set to be True, ElmerSolver aborts the run when the maximum number
of iterations the algorithm is permitted to perform is reached and the approximate solution does not
satisfy the stopping criterion.
mrbearb
Posts: 20
Joined: 07 May 2024, 20:41
Antispam: Yes

Re: Model induction between two coils

Post by mrbearb »

kevinarden wrote: 08 May 2024, 23:02 There are two options.
1. You can set the message level such that you see the result for each iteration and compare it to the convergence criteria. Or if it converges prior to...
Thank you for that, I had wondered how to read the message output level.. Is the output explained in any documentation?

Also, here's an update on what I've got so far:

Coil With H field Vectors Drawn:
singleturn_DenseAroundCoil_0_8.png
singleturn_DenseAroundCoil_0_8.png (148.56 KiB) Viewed 64 times
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Model induction between two coils

Post by kevinarden »

There is not specific information but the higher the number the more messages are echoed, the lower the number the more important the messages are.

The integer value levelnumber indicates the importance
of the message, starting from 1 (most important). The maximum level of messages being displayed
can be determined in the simulation section of the solver input file

5 is typical for a well executing problem
20 is used for more debugging
Post Reply