Electromagnetic Workbench - again..

About the development of the FEM module/workbench.

Moderator: bernd

ediloren
Posts: 209
Joined: Wed May 08, 2013 9:23 pm
Location: Italy
Contact:

Electromagnetic Workbench - again..

Postby ediloren » Tue Oct 30, 2018 12:26 am

Hi All,

you might remember (or might not..) that some time ago I briefly announced my company's intention to start an electromagnetic workbench, in the early days of FreeCAD FEM. We then published a minimal set of macros to be used for our solver FasterCap.

Many events happened since then, one of the most relevant is the fact that we released all our code base in Open Source. You can download the binaries and freely use the software, with no catch and no limits, from FastFieldSolvers, where you can also find the links to the source code GitHub repositories.
The second relevant event is that we also finally found some sponsorship for developing a FreeCAD workbench for FastHenry (the quasistatic inductance solver) to release in the public domain.

I would like therefore to announce that we'll soon start to publish some code, while the workbench evolves. We'll try to leverage, whenever possible, the FEM developments, but as I noted in another post, our solvers are BEM, not FEM, and do not use tetrahedral conformal elements; so this is not a simple plug-in for the FEM workbench. The community feedback and comments will be greatly appreciated.

Cheers,
Enrico
User avatar
Kunda1
Posts: 5563
Joined: Thu Jan 05, 2017 9:03 pm

Re: Electromagnetic Workbench - again..

Postby Kunda1 » Tue Oct 30, 2018 1:03 am

Fantastic. Keep us posted!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
bernd
Posts: 8351
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Electromagnetic Workbench - again..

Postby bernd » Tue Oct 30, 2018 5:59 am

great news!

What kind of elements do you use? If SMESH does support this element type most FEM mesh related methods will work.

If vtk does support it FEM post processing might be working too.

But if you use text input files you could use FEM solver frame work and help to improve this frame work.
User avatar
bernd
Posts: 8351
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Electromagnetic Workbench - again..

Postby bernd » Tue Oct 30, 2018 6:19 am

Ahh there is another point to know about FreeCAD FEM tools. They are geometry driven. Means boundary conditions are defined on the geometry! During solver input file writing the appropriate mesh data is extracted.

IMHO this is the main advantage of FreeCAD FEM since user input data is mesh independent and one can play with mesh size without changing boudary conditions.

What meshing software do you use?
ediloren
Posts: 209
Joined: Wed May 08, 2013 9:23 pm
Location: Italy
Contact:

Re: Electromagnetic Workbench - again..

Postby ediloren » Tue Oct 30, 2018 10:46 pm

Hi Bernd,

regarding your questions:

What kind of elements do you use? If SMESH does support this element type most FEM mesh related methods will work
The answer changes according to the solver. We support FastHenry, FastCap, FasterCap, FastImp, VoxHenry. In the specific case, we are working with first priority to create a workbench support for FastHenry. This solver, as hinted, do not use conformal meshing. The primitives are conductive segments and conductor planes. The former are actually rectangular parallelepipeds, the latter are slabs, internally translated into a mesh of segments, but defined in the input file as a single entity; the definition can also include directive to create holes in the plane.
So while in some cases you can create complex geometries connecting together multiple segments, you do not use these primitives to conform to the interior of a conductor, unless in specific cases. I attach a photo of a geometry as an example.

onebargp.PNG
onebargp.PNG (34.49 KiB) Viewed 1163 times

We then have some other entity, i.e. nodes (points in the 3D space) that specify the starting and ending point of the segments, the union of the nodes, to define connectivity between segments (segments do NOT connect electrically if they touch or intersect), and the electromagnetic ports, defined across two nodes.
So I'm afraid this does not fit the usual case for FEM. We are anyway building Python objects for all those primitives. For instance, for defining a conductive wire, you create a path, that is the base of the Python object that defines a set of segments discretizing the path into a certain number of segments. Specific rules must be followed in the discretization, as segments should not be too short w.r.t. their width etc.
I am wondering if adding those capabilities to the FEM workbench, or if we are too far from how it is intended to work, and we should keep them separated instead.

If vtk does support it FEM post processing might be working too
Would be nice, but as a first step there is no specific graphical post-processing. FastHenry has some capability to visualize currents in the conductive planes, however the real result of FastHenry is an impedance matrix (or a set of impedance matrices at different frequencies), or even the direct generation of a wide-band Spice model approximating the behavior of the structure for direct circuit simulation. This is another main difference w.r.t. FEM methods for inductance / capacitance extraction, that derive the values of inductance and capacitance indirectly, as they calculate the fields and then usually integrate along a path to get those values.

But if you use text input files you could use FEM solver frame work and help to improve this frame work
Yes, text files. I would be happy to plug this into the FEM framework - even if in this case the name is misleading as noted above, the methods all our solvers employ are BEM, and as such do not require any discretization of the space around the conductors (i.e. where the E.M. field lies) but only at the boundaries.

Cheers,
Enrico
User avatar
Kunda1
Posts: 5563
Joined: Thu Jan 05, 2017 9:03 pm

Re: Electromagnetic Workbench - again..

Postby Kunda1 » Thu Nov 01, 2018 12:41 pm

@ediloren
When are you planning to release the code and for the community to test the workbench?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
looo
Posts: 2824
Joined: Mon Nov 11, 2013 5:29 pm

Re: Electromagnetic Workbench - again..

Postby looo » Thu Nov 01, 2018 12:59 pm

What about a bem-workbench? I guess There are multiple application in this field of simulation which share some common features.
ediloren
Posts: 209
Joined: Wed May 08, 2013 9:23 pm
Location: Italy
Contact:

Re: Electromagnetic Workbench - again..

Postby ediloren » Thu Nov 01, 2018 5:44 pm

@Kunda1: there is not a ready-to-use workbench yet, but some macro code. The intention of my message was to announce the start of the activity, not the upload of a complete workbench, so that the community can also provide opinions and comments, for example if merging the macros into the FEM workbench or starting another EM workbench. More on this here below..

@looo: actually this was my intention at the beginning (even before FEM workbench was started), but if we can improve the FEM workbench along with the support of our E.M. solvers, this would be nice. On the other hand, we could in any case re-use the useful methods of the FEM workbench also in another BEM / E.M. workbench, so the question is still open.
I am a bit against the large expansionof the number of workbenches, on the other hand probably it will be faster to proceed in a separate way.

I'll anyway publish some code early next week. Do you prefer I branch the whole FreeCAD, or shall I publish just the relevant Python code?

Ciao,
Enrico
ediloren
Posts: 209
Joined: Wed May 08, 2013 9:23 pm
Location: Italy
Contact:

Re: Electromagnetic Workbench - again..

Postby ediloren » Fri Nov 16, 2018 9:16 am

I'm happy to announce that a beta version of the FreeCAD E.M. workbench for FastHenry is available for testing.

In the end, we decided for a stand-alone workbench, to be added in the FreeCAD addons page. In this way, it can be readily used on the 0.17 stable version for any user. Eventually, if possible, we can discuss full integration into FEM, but in this way you may also evaluate how it works and to which level an integration of these methods might be beneficial for FEM (even if the methods behind our solvers are BEM, not FEM, as I already discussed).

You can find the source code and the installation instructions on GitHub E.M. Workbench repository.

Comments are welcome, either on this forum or on the FastFieldSolver's forum.

Best Regards,
Enrico
User avatar
bernd
Posts: 8351
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Electromagnetic Workbench - again..

Postby bernd » Fri Nov 16, 2018 10:44 am

Since you do not use either constraints nor material from FEM workbench it is much more easier to create an stand alone workbench. From the first view what could make sence is to include the mesh export and import modules for the FasterCap format if this is not specific to only your solver.

bernd