[general] about the future of the FEM workbench

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

[general] about the future of the FEM workbench

Post by uwestoehr »

Since in different threads we speak about the general things, I open this thread.

-------------------------

My personal point of view:
For FEM I see these 3 main applications
1. analysis of existing objects
2. improvement of existing objects
3. creation of new objects

For case 1., there is already ElmerGui available. it offers nice visualization, is feature complete (all kinds of physics covered), has a good documentation and an active community. So for this application case FreeCAD is not necessary, would just reinvent the wheel and never be as good feature-complete as ElmerGUI.

I am a physicist working as engineer and I usually have use case 2. and 3. And for this one needs a feedback loop in this form:
A. take simulation result (at what position was what value calculated)
B. change geometry
C. re-run simulation with changed geometry
D. continue with A. and so on

FreeCAD covers to script changing the geometry but we don't have a framework yet to take the values from the simulation results. Without this framework, I don't see why one should not directly use a GUI-based solver like ElmerGUI.
During my Ph.D. times I faced the same issue: Comsol was almost perfect but lacked to establish a proper geometry change loop. Therefore I used Solidwork's "FlowWorks" framework (meanwhile called "SOLIDWORKS Flow Simulation") and that worked great.

To bring FreeCAD's UI to a level that it is as feature-complete as ElmerGUI, Comsol etc. would take fur sure a person year fulltime. And even then, somebody has to check for every new release of Elmer what had been changed. This work should have a clear benefit.

-------------------

Concerning our user experience. It is great! Definitely the best I experienced yet. But it weighs you is false security. Newbies might think they can just click something together and get sensible results. This is of course not possible because the solver will always give you a result and it is up to you to setup the right equations with the right settings.
For example my project was to calculate the deformation and stress of a squeezed rubber tube. I got nice-looking results but reality is different than what I got. And stupid me, for elastic materials one needs another equation from Elmer that is not yet supported by FreeCAD. :oops:
Therefore I don't think we should focus too much on the user experience for now. At least for Elmer it is useful as it is, only lacks here and there some features. More important is for me now the change loop to to be able to do proper engineering work.
User avatar
NewJoker
Veteran
Posts: 3018
Joined: Sun Oct 11, 2020 7:49 pm

Re: [general] about the future of the FEM workbench

Post by NewJoker »

uwestoehr wrote: Tue Aug 16, 2022 11:26 pm Since in different threads we speak about the general things, I open this thread.
Maybe a development roadmap wiki page for the FEM workbench would be a good idea, TechDraw and Path workbenches have something like that.

uwestoehr wrote: Tue Aug 16, 2022 11:26 pm For case 1., there is already ElmerGui available. it offers nice visualization, is feature complete (all kinds of physics covered), has a good documentation and an active community. So for this application case FreeCAD is not necessary, would just reinvent the wheel and never be as good feature-complete as ElmerGUI.
Yes, Elmer has a GUI but I wouldn't say that FreeCAD shouldn't try to offer similar capabilities. Its workflow is totally different and FreeCAD offers more than ElmerGUI in some ways. For example, postprocessing features derived from ParaView and integration with CAD modeling.

Your focus is on Elmer but maybe the development of FEM module should focus more on CalculiX which is still the main and default solver, likely the most general and versatile for most applications (Elmer doesn't even have well-established contact if I'm correct). CalculiX doesn't have its own fully complete and user-friendly GUI so I think that the way to go is to support more features of CalculiX. I would vote for those first:
1. Rigid body constraint
2. Support for multiple meshes
3. Beams with arbitrary cross-section
4. Simple creation of node and element sets
5. Advanced material models (orthotropy, hyperelasticity, creep and so on)

Let's keep in mind that FEM modules in CAD software are not meant for analysts but for designers and should be kept relatively simple. FreeCAD's users are usually even less advanced since there are many hobbyists without experience in other CAD/CAM/CAE software. But nowadays even professional FEM software meant for specialists tries to be as user-friendly as possible. After all, there's no reason to make our job harder with an unintuitive interface just because we are FEM experts. And that's the problem with almost all open-source FEA codes - some don't have a GUI at all while others (like Code_Aster) have extremely unintuitive GUI. FreeCAD's FEM module is one of a very few exceptions and I would stick to that.

I agree that the possibility to easily run multiple analyses with different settings in FreeCAD would be great. Currently, it's even necessary to manually delete all the results before rerunning the analysis because postprocessing objects are not updated. Maybe we should start by changing that. A way to run parametric studies (like parametric sweep in Comsol) would be great. The rest could require scripting.

uwestoehr wrote: Tue Aug 16, 2022 11:26 pm For example my project was to calculate the deformation and stress of a squeezed rubber tube. I got nice-looking results but reality is different than what I got. And stupid me, for elastic materials one needs another equation from Elmer that is not yet supported by FreeCAD.
Do you mean hyperelasticity ? It's usually necessary for analyses involving rubber. CalculiX offers multiple models for hyperelastic materials, Elmer has only the Neo-Hookean model, from what I know.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [general] about the future of the FEM workbench

Post by Jee-Bee »

I start thinking about what is a good workflow (without creating complexity). I think the workflow is most important from that it is possible to create a roadmap. Part of the workflow can be / should be sequental calculations (what we don't have now (at least not in Calculix)) for example: static and frequency.
Since i prefer a graphical workflow the result shall be a picture ;)

Edit: Maybe is workflows more realistic... and thus pictures
User avatar
NewJoker
Veteran
Posts: 3018
Joined: Sun Oct 11, 2020 7:49 pm

Re: [general] about the future of the FEM workbench

Post by NewJoker »

Jee-Bee wrote: Wed Aug 17, 2022 10:01 am Part of the workflow can be / should be sequental calculations (what we don't have now (at least not in Calculix)) for example: static and frequency.
CalculiX allows multistep analyses like frequency or buckling with preload and you are right that having them supported in FreeCAD would be great. But implementation of such a feature could require some significant changes in the current handling of ccx analyses.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [general] about the future of the FEM workbench

Post by uwestoehr »

NewJoker wrote: Wed Aug 17, 2022 9:36 am Your focus is on Elmer but maybe the development of FEM module should focus more on CalculiX which is still the main and default solver, likely the most general and versatile for most applications
Where is defined that CCX is the default? I worked initially not on Elmer but on the result pipeline system. I started to work on Elmer because CCX does not provide what I need - deformation of a rubber tube while there is a flow inside the tube. CCX in general should be able to do this but its documentation is not that good and I miss a forum I can search. For Elmer I found this and once I tried to solve my real-life issue I encountered so many bugs that I first had to fix them. Meanwhile I think our existing Elmer support is usable but I got frustrated to see how much time it costs to implement even a single and simple constraint. See for example the initial pressure constraint I need: git commit 27f50ad13 - a lot of work to write a single line to the solver input file.

And this is my point. It is so much work to just support a fraction of the functionality of the different solvers. This applies for all solvers, CCX and Elmer.
NewJoker wrote: Wed Aug 17, 2022 9:36 am I agree that the possibility to easily run multiple analyses with different settings in FreeCAD would be great. Currently, it's even necessary to manually delete all the results before rerunning the analysis because postprocessing objects are not updated. Maybe we should start by changing that. A way to run parametric studies (like parametric sweep in Comsol) would be great. The rest could require scripting.
What do you mean with you have to delete before rerunning? I don't have to (using Elmer).
For CCX it is annoying that it delivers no VTK output. So I have to create manually a pipeline from its result mesh, setup the filters I need to look inside and to find the calculation values at the desired mesh position. But when I re-run CCX, it deletes the result mesh and thus the pipeline is disconnected and I have to setup a new pipeline. That is why I cannot work with CCX.
(I wonder how the current CCX workflow is useful for many users since I _always_ have to look inside the result mesh and make decisions based on calculation result values at certain mesh positions.)
NewJoker wrote: Wed Aug 17, 2022 9:36 am Do you mean hyperelasticity ? It's usually necessary for analyses involving rubber. CalculiX offers multiple models for hyperelastic materials, Elmer has only the Neo-Hookean model, from what I know.
No, it uses by default the constitutive law. You can however, set to use neo-hookian, see the Elmer manual, section 7: https://www.nic.funet.fi/index/elmer/do ... Manual.pdf

And here we are back to my main problem. Supporting the ElasticSolver of Elmer for FreeCAD would cost me about a week. I setup my model now in ElmerGUI directly in just one hour. Therefore I meant just to analyze an existing geometry/setup, FreeCAD FEM brings no benefit.
User avatar
NewJoker
Veteran
Posts: 3018
Joined: Sun Oct 11, 2020 7:49 pm

Re: [general] about the future of the FEM workbench

Post by NewJoker »

uwestoehr wrote: Wed Aug 17, 2022 10:18 am Where is defined that CCX is the default?
The Analysis container is added with the ccx solver each time.

uwestoehr wrote: Wed Aug 17, 2022 10:18 am CCX in general should be able to do this but its documentation is not that good and I miss a forum I can search.
It could be better but I like CalculiX's documentation. However, you have to get used to keyword syntax to use it efficiently. When it comes to forum, CalculiX has a really nice group on discourse: https://calculix.discourse.group/

uwestoehr wrote: Wed Aug 17, 2022 10:18 am And this is my point. It is so much work to just support a fraction of the functionality of the different solvers. This applies for all solvers, CCX and Elmer.
Yes, it can be really tedious. But we don't have to add all the features or even a large part of it. Let's just focus on what is needed most, like the 5 features I listed.

uwestoehr wrote: Wed Aug 17, 2022 10:18 am What do you mean with you have to delete before rerunning? I don't have to (using Elmer).
This applies to CalculiX, as you said below.

uwestoehr wrote: Wed Aug 17, 2022 10:18 am No, it uses by default the constitutive law. You can however, set to use neo-hookian, see the Elmer manual, section 7: https://www.nic.funet.fi/index/elmer/do ... Manual.pdf
What they describe as finite elasticity, is usually called hyperelasticity (or nonlinear elasticity). Elmer offers only the Neo-Hookean model while CalculiX supports a wide range of models: Arruda-Boyce, Mooney-Rivlin, Neo-Hookean, Ogden, Polynomial, Reduced Polynomial and Yeoh.

uwestoehr wrote: Wed Aug 17, 2022 10:18 am And here we are back to my main problem. Supporting the ElasticSolver of Elmer for FreeCAD would cost me about a week. I setup my model now in ElmerGUI directly in just one hour.
Sure, it's often easier to just use the solver's native interface. But these days of work to implement something for the FEM workbench will have to be spent only once, then all users may benefit from the new functionality. And some features are small enough to implement them really quickly. Actually, it's similar to the development of any other module. You can employ the workarounds that you are used to but once the feature is implemented, life is easier for everyone.

uwestoehr wrote: Wed Aug 17, 2022 10:18 am Therefore I meant just to analyze an existing geometry/setup, FreeCAD FEM brings no benefit.
I assume that by existing geometry you mean objects designed in other CAD software and available e.g. in STEP format. There might be better tools to analyze such models but if someone works in FreeCAD anyway (and for instance imports the STEP file to FreeCAD for other reasons), it might be easier for him to prepare the simulation directly in FreeCAD and not learn and switch to another software. Unless more advanced FEM features are needed. However, I agree that FreeCAD's FEM module is mainly needed for analyses performed on models designed in this software so that you don't have to export the model and leave FreeCAD each time you want to check the strength of your current design.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [general] about the future of the FEM workbench

Post by Kunda1 »

An aside, I've x-posted this thread to the the CalculiX discourse forum.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: [general] about the future of the FEM workbench

Post by johnwang »

Elmer doesn't suggest to use elmergui. GUI is too much for them.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: [general] about the future of the FEM workbench

Post by HarryvL »

uwestoehr wrote: Tue Aug 16, 2022 11:26 pm Since in different threads we speak about the general things, I open this thread.

1. analysis of existing objects … there is already ElmerGui available. it offers nice visualization, is feature complete (all kinds of physics covered), has a good documentation and an active community. So for this application case FreeCAD is not necessary, would just reinvent the wheel and never be as good feature-complete as ElmerGUI.
Let me start by saying that I don’t know Elmer GUI nor the capabilities of its solver, but I suspect it is like some other packages a very capable, but general, PDE solver.

I cannot imagine that the Elmer GUI has the same flexibility as FC in modelling geometries and meshing them.

I came to FreeCAD for exactly that. Modelling, meshing and exporting to an engineering FEM package. After that viewing results, but I find myself using Paraview more than FC for post processing.

Judging from your list you are focused on product design, whereas I and some others (eg Bernd and Thomas) are more focused on civil engineering. I can’t imagine Elmer has practical tools for structural analysis. So I don’t see how Elmer can replace FC for the first category.

So in my view FC is unique for category 1 and I would certainly not want to lose it. In addition, as you may have seen I am (slowly) developing my own FOSS solver for cat 1 Civil engineering problems and it aims to offer a robust tool that will be integrated with FC. If development on FEM takes a completely different direction then I don’t know where else to go.
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: [general] about the future of the FEM workbench

Post by thschrader »

How can I do geometry changes in elmer GUI?
With FC I can easy change the geometry (here: height of stiffeners) an remesh/rerun the sim.
BTW: when using netgen the remeshing is parametric.
How can I do that with elmer? Loading a new stp-file from FC? This brakes the model, you start again.
In elmer GUI you have no visual presentation of forces/fixings like in FC

I did the flange calculation with ccx and elmer. Deformations are nearly equal,
but stresses are different, 480 MPa ccx vs 320 MPa elmer. Used elmerGrid an Umfpack solver.
But elmer runs faster, 19 sec vs 50 sec ccx.

As far as I know, there is no material nonlinearity in elmer, like in ccx (*PLASTIC command).
For calculating steel constructions the plastic option is often very helpful to
"squeeze out" excessive local stress peaks.
Sooo... ccx is the first choice for me in daily work.

Wishes: 1D-beams with different sections in ccx, definition of hinges.
FC_flange.JPG
FC_flange.JPG (42.27 KiB) Viewed 3434 times
elmerGUI.JPG
elmerGUI.JPG (150.12 KiB) Viewed 3434 times
Post Reply