Elmer integration as a solver

ELMER https://www.csc.fi/web/elmer is a “well” known multiphysics academic code with plenty of features that might be needed to us (I mean Open Hardware computer developpers).

Currently we are using codes like Flotherm https://www.mentor.com/products/mechanical/flotherm/flotherm/ which are crazy expensive and use very bad meshing technology. The other thing is that it is impossible to integrate a CAD model directly into the tool and processing a system requires a new model. So roughly a nightmare.

CalculiX seems to be able to manage CFD, but some of its features has been disabled for accuracy issues. Solving the same issues than Flotherm requires at least three physics support (thermal conduction, thermal radiation, and some thermal convection for solid/fluid exchange with Navier-Stokes equation solving) which seems properly supported by Elmer. I made some quick and dirty stuff with it, and the solver seems quite interesting for our use case even if I am still trying to figure out how to properly modelize a fan.

Supporting Elmer in FeM module is a “challenge” but I think it might be a great contribution to both project as Elmer UI is not as good as it should be, and FreeCAD is far much better in that area. SO I would like to give it a try and that is why I opened this topic ! Just to get some support from you, and having you following the story.

I loved to see @bernd patches regarding material and thermal support with CalculiX going into master as to test them and see what might be the output through VTK post process from @ickby. Perhaps these features might be good enough for our needs on thermal side, but Elmer is providing EMI analysis which are not present in CalculiX and will be my next step by the way.

During a traineeship i used COMSOL Multiphysics. During this traineeship i liked the idea of processing multiple variables at the same time. a few FEM packages can handle that well. most do multiple calculations and sum them up.
From that i have always been looking to an open source Fem Package what can handle multiple variables at the same time. Every time i come back to Elmer but i had never the courage the dive into it….
My todo list is to big :wink: and what i read it isn’t the most easy package

But if you give it a try… I want follow it and if i have some spare time left test is!!

I’ll be watching the progress and supporting if possible. I hope that FreeCAD FEM wb will be able to conquer the FEA world if we can support multiple solvers :smiley:

We might need to rethink/rewrite FEM code to use as much common code for all solvers as possible - that should lower the long term code maintenance cost (fix one piece of code instead of fix each solver separately).

It would be great to see another solver in FEM module! The integration should be straight forward. For all interested have a look at the commits made to integrate z88:

main commit:
https://github.com/FreeCAD/FreeCAD/commit/b4630ba45d5a3c163cf67759e433028a42058a3f

since I did all z88 commits just scoll down my FreeCAD commits:
https://github.com/FreeCAD/FreeCAD/commits?author=berndhahnebach

This was done already just before integration of solver z88. Actually the only reason for integrating z88 was to make FreeCAD FEM independent from CalculiX. I knew z88 so I took z88. But since you guys from Open Hardware computer developers are crazy good we may rethink the solver handling in FEM completely. :open_mouth: :sunglasses:

I appreciate the compliments but IT guys are mostly good at generating bugs while users are good at reporting them :wink:. This doesn’t means we shouldn’t try t improve !

Ok, still a lot of studies to run before implementing anything but some good news, I have been able to use the excellent code from Ickby to import Elmer basic Thermal results :wink:. I used a mesh that I generated on FreeCAD to perform this test, then setup the boundary conditions through ElmerGUI (which is far from being intuitive).
elmer.png
The great news is that the tool is using a proprietary open mesh format, but provide a converter from UNV, so we shall be able to provide input mesh in a quick way. The bad one is one of Elmer advantage is the number of possibilities that the solvers offer. I will first focus on Thermal studies.

I am starting to think about something regarding that. Do we want to expose everything or do we want to simplify the task to the end user like providing preset for “standard” thermal analysis by setting up only Ambiant as boundary conditions in a first step, and provide a second level which will expose all solver parameters ?

vejmarie

Could you elaborate more? What is a “standard” ambient analysis. Does it include convection and radiation? Do we need to define view factor, emisstivity, convection coefficient etc? Is/Can there be a “base plate” fixed temp on a given face(s)?

Hi sgrogan yes it needs to support convection and radiation. emissivity and physical properties of material shall be initiated at the material library level of the FEM module I believe. And yes we need to add some thermal boundary value at face and volume level. Lot of work ahead. We need also to solve the Navier-Stokes equation as to manage heat transfer between solid and fluid, which might complexify the mesh generation. I am currently evaluating the work to do through basic test case.

Thanks vejmarie,
To be more specific what are you thinking for the “preset” for a “standard” thermal analysis?

Great to see the progress!

Thank you!! :sunglasses:
I love the idea of having FC as “frontend” for Elmer. I have done some electrostatics simulations in Elmer but I do not like the GUI especially if you use custom edf-definitions. The developers are busy in improving the solvers but do not really enhance the GUI.

Maybe it would be good idea to contact also the developers of Elmer (https://github.com/ElmerCSC/elmerfem/graphs/contributors)?

“standard” settings for example for the surrounding temp. would be good as log as they are editable.

Looking forward to test your work especially if you are able to do electrostatics.
BR

regarding the Elmer contact:
I found your post…http://www.elmerfem.org/forum/viewtopic.php?f=7&t=4315&p=15398&hilit=freecad&sid=a9553c43e67e40545e45b713a535fdbc#p15398

Thanks. I agree on the fact that ElmerGUI is not the best tool currently, but the solver is really great. We have a major challenge in FreeCAD which is to properly generate multibody mesh perhaps based on solid. I will post shortly an example of the needed function as to open the discussion with other FEM developpers of FreeCAD. Whatever happens we will need multibody for multiphysics solver especially CFD coupled to Thermal. Electromagnetic is part of my goal also.

Looks like that people at Elmer are not closed to have a look to what we could do on this. I will for sure pursue the work.

:laughing: I have been proposing using “FemAnalysis” as a shared/purely container while solver* holding solver specific info. it is accepted in mainline.
Making a abstract FemSolver class with meta properties to reuse job control, start external tool etc. However, this part is not accepted.

I also try to re-use “SolverControlTaskPanel”, using if solvername=XXX, elif solvername = YYY to deal the difference. but I just could not catch up the update of that class, so I gave up as I almost waste all my time on rebasing.




Hi all
one thing to be aware off Elmer is GPL. It took some searching to find what licence they use but eventually I found it here: -
http://www.elmerfem.org/elmerwiki/index.php?title=Frequently_Asked_Questions

quote from above link

Q: Can I use parts of Elmer in my own code?
A: Yes, with the condition that if you publish the code it must be published under the same license i.e. GPL.

FreeCAD is LGPL so you have to consider this. GPL code will not be pushed into FreeCAD master but that does not mean that it can’t be used at all but it does mean that it can not become a part of the main official FreeCAD code.

Hi all
one thing to be aware off Elmer is GPL.

The Elmer solver is LGPL
https://www.csc.fi/web/elmer/services-and-contact

Non-GPL use of Elmer

Elmer is open source software lisenced under GPL (except for the ElmerSolver library which is under LGPL). Therefore you may freely use Elmer for academic, educational and even commercial purposes. However, the GPL license includes a viral effect i.e. all derived work, if distributed, must be distributed under the same license. It is possible that Elmer would also be licensed under other terms if agreed upon.

If you’re interested in joint development, contracted services or non-GPL use of Elmer, please contact Peter Råback for further discussions.

Great! But honestly, fancy putting the licence information under Services and Contacts…in that regard what a crappy website.

I hope this all works out, it sounds great. :slight_smile:

By the way I do not think we will have to integrate Elmer code inside FreeCAD, both of them can leave side by side. We have a lot of work to do on the meshing side first :frowning: I will introduce some new post later on.

We have a lot of work to do on the meshing side first > :frowning: > I will introduce some new post later on.

We have to consider how we are going to handle meshing multi body analysis. Sometime you want a single mesh for all objects, sometimes you want separate meshes for separate objects, it depend on what you want to analyse.
We also still don’t have auto meshing for beams and shells (1D ,2D) meshes ?

Agree I just opened a thread on the forum regarding this abstract. Single mesh will not work for most analysis with coupled physics. So we need to start some work on this before.