Toy hierarchical problem

Numerical methods and mathematical models of Elmer
sspickle
Posts: 12
Joined: 10 Apr 2024, 14:01
Antispam: Yes

Toy hierarchical problem

Post by sspickle »

I'm just learning Elmer and I want to start with a simple problem. I'd like to learn how to handle FEM EMAG calculations related to PCB traces, cross talk, and such. I tried to modify the "End Windings" example from Elmer-Elmag:

https://github.com/ElmerCSC/elmer-elmag ... ndWindings

But the solution I get for static current is "trivially zero". I was hoping to solve for the static current in a toy PCB trace (copper solid with varying cross section) and then use that as a source in determining the DC magnetic field in the surrounding larger (air) box. I did get a static current solution without the magnetic field by setting the potential at one end of the trace and then setting the current density into and out of the "end" boundaries.

Can I accomplish the same thing in this case? Any insights would be appreciated!

See geo/sif files attached. I meshed in GMSH and then used "ElmerGrid 14 2" to prepare for ElmerSolver.

thansk!
-steve
Attachments
pcb_trace_test.zip
(3.55 KiB) Downloaded 17 times
sspickle
Posts: 12
Joined: 10 Apr 2024, 14:01
Antispam: Yes

Re: Toy hierarchical problem

Post by sspickle »

Is there any other information I could provide that would be helpful to get me pointed in the right direction?

Or does this question even make sense?

I did consider trying Coil Solver, but it wasn't clear that I could set it up to get the result I need.

thanks,
-steve
kevinarden
Posts: 2398
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Toy hierarchical problem

Post by kevinarden »

These are the names of the bodies and boundaries in your mesh
! ----- names for bodies -----
$ body = 1
$ enclosure = 2
! ----- names for boundaries -----
$ inlet = 1
$ outlet = 2
$ walls = 3
$ left_face = 4
$ front_face = 5
$ right_face = 6
$ back_face = 7
$ top_face = 8
$ bottom_face = 9

So the BCs do not apply to anything because nothing is named "plus"
Boundary Condition 1
Name = "plus"
Current Density = 5000.0
AV = Real 5
AV {e} = real 0
Save Scalars = Logical True
End

You can use the numbers of the boundaries instead of the names
Boundary Condition 1
Target Boundaries(1)= 1
Current Density = 5000.0
AV = Real 5
AV {e} = real 0
Save Scalars = Logical True
End
kevinarden
Posts: 2398
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Toy hierarchical problem

Post by kevinarden »

Sphere for the air is better, 1 infinity boundary, and the BC is written for the spherical case.
Electric Infinity BC Logical
The spherical approximation for the open boundaries extending to infinity.
potential.png
(46.26 KiB) Not downloaded yet
toy.zip
(1.62 KiB) Downloaded 17 times
sspickle
Posts: 12
Joined: 10 Apr 2024, 14:01
Antispam: Yes

Re: Toy hierarchical problem

Post by sspickle »

Thank you so much!
sspickle
Posts: 12
Joined: 10 Apr 2024, 14:01
Antispam: Yes

Re: Toy hierarchical problem

Post by sspickle »

Thank you kevinarden!

You've gotten me moving forward. Unfortunately I'm still not quite there, but I'm encouraged!

I am working towards a setup similar to the "End Windings" example from Elmer-Elmag (see previous post). I got the static current calculation to work pretty well, but I notice that when I try to plot the current density or potential along a line, the result depends sensitively on the exact line a choose. Here are two images, one from x=0.001 m, and another from x=0.0011 m:
grab.png
(509.77 KiB) Not downloaded yet
Is my mesh too loose? Something else? Thanks for any suggestions.

The files for this are attached (toy2.zip)

Also, when I try to add the magnetic field (case.sif attached) as is done in "End Windings" it never converges. Any insights appreciated!

Thank you!
-steve
Attachments
case.sif
(4.07 KiB) Downloaded 15 times
toy2.zip
(2.62 KiB) Downloaded 8 times
kevinarden
Posts: 2398
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Toy hierarchical problem

Post by kevinarden »

You use many of the default constants on Elmer and Elmer materials these are in SI units therefore the physical dimensions are to be in meters. Your geometry looked very large so I threw in a scale factor of 0.001, but I do not know if that is correct. Having the wrong dimensions could cause divergence issues. I noticed your geo did not fragment and coherence the geometry, but perhaps you did these steps later, but doing it after you name the volumes and surfaces could cause the labels to change.
sspickle
Posts: 12
Joined: 10 Apr 2024, 14:01
Antispam: Yes

Re: Toy hierarchical problem

Post by sspickle »

Yes, the dimensions in the .geo file are meant to be in mm, so 1e-3 is the correct scaling factor.

I have to confess, I have no idea what you mean by "fragment" and "coherence". No doubt I'm missing something important. I'll try to track down documentation about that.

thank you!
kevinarden
Posts: 2398
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Toy hierarchical problem

Post by kevinarden »

https://www.nic.funet.fi/pub/sci/physic ... dElmer.pdf

This document particularly chapter 9.3 on Elmer and gmsh.

Basically the volume of the thing wrapped in air has to be cut from the volume representing the air, and the solid representing the thing is included back (fragments in gmsh), boolean operators in other tools.

Coherence is merging coincident points form that operation so that the boundary between the two share nodes.

The cut and fill creates the multiple bodies, the coherence ensures the boundaries are shared.

Without that you have the thing in the middle and a sphere of air, but they do not know about each other in the solution.
sspickle
Posts: 12
Joined: 10 Apr 2024, 14:01
Antispam: Yes

Re: Toy hierarchical problem

Post by sspickle »

Excellent. Thank you again! I'll give that a try.
Post Reply