## Closed coil with core simulation

Numerical methods and mathematical models of Elmer
raback
Posts: 3546
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Closed coil with core simulation

Hi

Maybe this will help to understand some weirdness of the solver: The "AV" variable is such that vector potential lives on edges (Hcurl space) and scalar potential lives on nodes (H1 space). It is a convention of Elmer that you can request elements with suitable degrees of freedom. The defintion for the lowest order AV solver would be "Element = n:1 e:1" i.e. one dof on node, and one on edge (it is hidded from end-user).

Now, you can only visualize nodal fields (or cell values, but that's another story). Therefore for visualization there is nothing on the solution for the edges. Instead you need to map it from edge field to nodal field. There the CalcFields routine has even keyword "Calculate Magnetic Vector Potential = True'" which does not make sense unless you understand that it asks to map the from Hcurl to H1.

To complicate things when giving Dirichlet BCs the library functionality assigns the default name to the nodal field, whereas you need to use {e} for edge field. So

Code: Select all

``````  AV = 0.0      ! sets electric scalar potential to zero
AV {e} = 0.0 ! sets magnetic vector potential to zero
``````
Hope this helps.

-Peter

Cedric54
Posts: 8
Joined: 13 Jan 2020, 15:14
Antispam: Yes

### Re: Closed coil with core simulation

Hello Peter and Kevin,

Peter thanks for clarifying the BCs on AV.

I'm struggling on my problem to close the loop...
I began to use coilsolver but I'm not sure if I can use it in my case: the coil is a cylinder and I want a constant current inside.
In the coilsolver dialog box, I checked the case "closed loop", defined the desired coil current=1000.
In the body force I added "Equals CoilCurrent i" and the result is:

CoilSolver: Assuming coil that is not closed
ERROR:: CoilSolver: > Coil Start < must be defined on some BC

Elmer seems to ask me the beginning and the end of the coil.....

See my file here:

https://www.transfernow.net/61lc4973j7dx

Where am I wrong?

Maybe coilsolver cannot be used for my specific case and I have to impose current density in my coil?

Trying this, I impose current density in my cylinder (body 3) with these formulas:

Current Density 1=variable coordinate ;Real MATC "2000*10*tx(0)/(sqrt(tx(0)*tx(0)+tx(1)*tx(1)))/(1e-2*10e-2)";

Current Density 2=variable coordinate ;Real MATC "2000*10*tx(1)/(sqrt(tx(0)*tx(0)+tx(1)*tx(1)))/(1e-2*10e-2)";

Current Density 3=0

I believe that with these formulas the module of the current density was constant in the plane x, y .

The result is the field line are concentric....so I suppose that the current is not circular but flow in the heigth of the cylinder....

Hope I'am clear...

Any ideas to get current to be circular?

My file is here:

https://www.transfernow.net/13ags8a5slg0

Cédric.

kevinarden
Posts: 435
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: Closed coil with core simulation

For the coilsolver the checkbox did not work these lines should have appeared in solver 3

Coil Closed = Logical true
Calculate Coil Current = Logical True
Desired Coil Current = Real 1000

I added them manually to the sif and there is a coil current x,y and z calculated.

Cedric54
Posts: 8
Joined: 13 Jan 2020, 15:14
Antispam: Yes

### Re: Closed coil with core simulation

Hello Kevin,

I've added the three lines in the .sif and you're right, elmer calculates now the current in the coil but the current in the coil is not continuous,

there is only some points at 3700A, do you see the same problem on your simulation? (also my magnetic field is at zero)

ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.65804479 0.16585769E-02 ) :: coilsolver
WARNING:: CoilSolver: Positive and negative sums differ too much!
CoilSolver: Initial coil current for coil 1: 2.2286E+06
CoilSolver: Coil potential multiplier: 4.4871E-07

I joined to this mail my .sif and a view of the current...

Thanks.
Attachments
case.sif coilcurrent.jpg (25.67 KiB) Viewed 125 times

kevinarden
Posts: 435
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: Closed coil with core simulation

Yes I have seen the same problems. We now get current and in paraview you can view the x, y, z, and magnitude. However the current density and magnetic field is zero. I have tried several different things but no success. So far turning the current into magnetic force fields has not been successful.

WARNING:: CoilSolver: Positive and negative sums differ too much! I believe this goes away in later iterations. I increased the minimum number of iterations and only output the last one. Did this by: Output Intervals = 0 outputs the last itteration.

Steady State Max Iterations = 10
Steady State Min Iterations = 5
Output Intervals = 0

kevinarden
Posts: 435
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: Closed coil with core simulation

These parameters made the coil current continuous and seemed to make it go around the coil but the jfix and current density is still zero

Coil Closed = Logical true
Desired Coil Current = Real 100
Normalize Coil Current = Logical True
Coil Normal(3) = 0 0 1

Cedric54
Posts: 8
Joined: 13 Jan 2020, 15:14
Antispam: Yes

### Re: Closed coil with core simulation

Hello,

Coming back to this post to try to close it....

Finally I decide to have a real coil with wire it's difficult to modelized in 3D but I succeed to do it with GMSH....

So now I have three domains : air, iron and copper of the wire....

Elmer succeed to solver current, magnetic field strength and magnetic flux density all this with linear relative permeability of iron at 2000.

My questions are:

1) Could you please confirm the unity of magnetic field strength (supposed to be A/m?) and magnetic flux density (Tesla/m² ????)

2) Then when I see the solution on paraview the field seems to avoid the iron piece as I can't see any field in iron. Where I made a mistake?

3) I try to put HB curve, I succeed finally that Elmer accept HB curve, after hours to understand parser I added the following line, spaces seems

to be important (I see the posts on parser), hope it would be useful for readers:

Variable coupled iter;real Monotone Cubic Include HB.txt; End

Elmer accept this formula but Mgdynpost doesn't succeed to solve magnetic field strength, there are NaN in solver log and paraview cannot view magnetic field strength...

Whole simulation is here:

https://www.transfernow.net/11c594j6s774

4) Concerning the force, my goal is to calculate whole force on iron in z direction (body 2). To do this a added a equation called "force" that solves magnetic field on body 2 and I add scalar solver to output Nodal force 1, 2 and 3, do I have to understand that Nodal force 1, 2 and 3 represents WHOLE force in x, y and z direction?

5) If not, how can I have the whole force on body 2 that is an integrated force over surface of body 2?

Thanks for help.

Cédric.
Attachments
Solver.log
field strength with linear relative permeability.jpg

Cedric54
Posts: 8
Joined: 13 Jan 2020, 15:14
Antispam: Yes

### Re: Closed coil with core simulation

Hello,

Somebody could help me on my last questions ?

Thanks a lot!

Regards.