Closed coil in air

General discussion about Elmer
Post Reply
Tobias
Posts: 6
Joined: 14 Apr 2020, 13:45
Antispam: Yes

Closed coil in air

Post by Tobias »

Hi all,

I want to simulated a closed coil with 2000 turns. With Gmsh I created a sphere and placed a ring inside, I exported this to a .unv file and loaded it into Elmer. My first questions raises here. First I created the geometry by creating the sphere, then I crated the ring and substraced the ring from the sphere and placed a new ring inside. I did this so the two bodies do not overlap. The problem here war, that this messed the mesh up and it resulted in a strange boundary region, because the mesh size differs from the ring to the sphere. I then just placed a ring in a sphere. Is this the rgiht way to do it?

Then I used the CoilSolver, MagDym and MagdymPost solver to creat the two equations for the SImulation. As boundary condition I set the surface of the sphere to have a potential of zero.

I wrote with raback via discord and I set the priority higher for the coil solver, so it runs before the magdym solver.
Sadly, I ahve stil a magnetic flux density of zero. I attached my case.sif and the geometry file.

Cheers,
Tobi
Attachments
SingleCoilOfMagnet.geo
(805 Bytes) Downloaded 260 times
case.sif
(4.29 KiB) Downloaded 222 times
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil in air

Post by kevinarden »

No that is not the way to do it. The two bodies have to share the same surface and nodes at the interface otherwise the two bodies do not know about each other. The first approach was closer, you put the ring you used to cut the volume back in but it has to be joined so it shares the geometry at the surface. The calculation will not work on the second mesh because the two bodies do not share nodes at the interface. You could try to use mortar boundary conditions to join two independent surfaces at the interface using the mortar boundary condition.
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil in air

Post by kevinarden »

Here is a start. Create the coil, create the sphere, remove the coil from the sphere but keep it, coherence the geometry to merge coincident points.
Attachments
coilcurrent.png
(293.34 KiB) Not downloaded yet
case.sif
(4.35 KiB) Downloaded 265 times
coil.geo
(499 Bytes) Downloaded 242 times
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil in air

Post by kevinarden »

This sif will get the magntetic fields calculated using the coil current
Attachments
case.sif
(4.62 KiB) Downloaded 258 times
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil in air

Post by kevinarden »

I used Peter's five coil example to create a better sif, reduced the thickness of the coil, increased the size of the air sphere, and increased the density of the mesh. Results much improved. The mesh size was 0.15.
Attachments
fivecoils.sif
(3.82 KiB) Downloaded 285 times
coil.geo
(500 Bytes) Downloaded 258 times
results.png
(115.54 KiB) Not downloaded yet
Tobias
Posts: 6
Joined: 14 Apr 2020, 13:45
Antispam: Yes

Re: Closed coil in air

Post by Tobias »

Thanks a lot for your replys and work. I read your first post and struggled to connect the surfaces, so a big thanks for your continous work.

When I use the method
"BooleanDifference{ Volume{2}; Delete; }{ Volume{3}; }"
to cut the ring (volume{3} ) out of the sphere(volume{2}), it seems to connect the surfaces already, at least I only see one boundary at each surface between coil and sphere not two as before. But if I double click on the ring to set the equation, material, etc. Elmer crashes all the time. If I set them with the GUI like Model->Material, etc. it does not crash. So I hope there will be no problem with the simulation, realted to the geometry.

In the case.sif examples you send me, a body force was defined and I do not know how to set the coil current to be the curent calculated by the coil solver. I use the GUI and I see the option to set the current by hand in Model->Bodyforce.
In generel I do not know how to load .sif files. As it is stated the case.sif files are newly generated if i load a project, so I have to change the .xml file but I do not know how to pass there the new .sif file. Is this even possible with the GUI?

At least, in the end I want to simulate a electro magenet wit two opposing coils, and compare the simulation to my measurements. I am unsure how to pass the information of the coils number of turns and thickness of the wire to Elmer. Both will influence the potential or the magnetic field.
Cheers,
Tobi
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil in air

Post by kevinarden »

Working only in the GUI is limiting. The sif file is a text file that can be edited. You can open a command line window, change to the working directory and execute ElmerSolver by typing ElmerSolver. It runs the sif file in ELMERSOLVER_STARTINFO.
You can run your sif file by adding it to the command for example.
ElmerSolver mysifefile.sif

I keep my sif file in a separate file from case.sif because ElmerGUI will overwrite case.sif.

ElmerGUI crashing may have to do with how you are translating the mesh into ElmerGUI. ElmerGrid is the perferred command, again it is a command line.
Type ElmerGrid and ElmerGrids options are listed. If you are using unv files
ElmerGrid 8 2 myfile.unv -autoclean
generally works the best.

Number of coils, thickness, etc my be covered in the Elmer Manuals. Page 158 of the Elmer Models Manual covers coil solver

http://www.nic.funet.fi/pub/sci/physics/elmer/doc/
Tobias
Posts: 6
Joined: 14 Apr 2020, 13:45
Antispam: Yes

Re: Closed coil in air

Post by Tobias »

Thanks a lot for your help. I installed the gui on my windows pc. At the moment I struggle a bit with installing it on my Mac, to use the command line. As soon as I manage it I will test your .sif file. Again thanks for your help so far.
Post Reply