Topology optimization

About the development of the FEM module/workbench.

Moderator: bernd

RatonLaveur
Posts: 812
Joined: Wed Mar 27, 2019 10:45 am

Re: Topology optimization

Dude, this is positively awesome!

(yeah I'm at a loss for words)
shIxx
Posts: 50
Joined: Wed Mar 28, 2018 10:13 am
Location: Bavaria (Germany)

Re: Topology optimization

Thank you for this great work.

I know topology optimization is hard to compare, but I dared try it.
beso vs z88Arion vs Ansys,.. Unfortunately I had to exclude ToOptix because I work with FreeCAD .19 and python 3

I used the same mesh on all three solvers. The mesh was generated by Netgen from the FEM WB. Otherwise I tried to set all parameters s the same as good as possible

System:
CPU: i7 3930k 6c 12t @☺ 3,9GHz
RAM: 12Gb DDR3 @ 800MHz
Windows 10 64bit

In short: beso is very slow but also gives very good results. I even find that it often gives the best results, but everyone has to decide for themselves
Here some screenshots. For a closer look, I attached the pdf file.
Attachments
balken.png (205.86 KiB) Viewed 1467 times
winkel.png (402.36 KiB) Viewed 1467 times
Topologie-vergleich.zip
shIxx
Posts: 50
Joined: Wed Mar 28, 2018 10:13 am
Location: Bavaria (Germany)

Re: Topology optimization

Here is another comparison.
Von Mises stress [MPa] original and optimized relatively well spread:
Attachments
optmzation.png (160.67 KiB) Viewed 1454 times
RatonLaveur
Posts: 812
Joined: Wed Mar 27, 2019 10:45 am

Re: Topology optimization

Thank you for this great comparison. It seems evident that beso is on fighting ground with Ansys.

I wonder if Z88 Arion's comparatively simpler output is a measure of how effective it is or too simplistic a calculation.

However, the calculation times seem to show that beso could benefit from some level of optimization. I wonder if it is using all the resources (threads/cores) of the computer you used.
shIxx
Posts: 50
Joined: Wed Mar 28, 2018 10:13 am
Location: Bavaria (Germany)

Re: Topology optimization

RatonLaveur wrote:
Mon Sep 30, 2019 6:44 am
I wonder if Z88 Arion's comparatively simpler output is a measure of how effective it is or too simplistic a calculation.
Beso only has the ability to optimize for stiffness, this is why I've used the CO solver in Arion which does very fast iterations based on stiffness. Maybe it would have been better to use TOSS. I thought it would be unfair to compare but maybe not, because beso also adds material. That's what the SKO and TOSS solver do in Arion. The TOSS solver is also relatively slow.
And due to the limitation of Ansys academic (<32k nodes and elements) I had to use a rough mesh. Certainly Arion's result will look different with a finer mesh.
RatonLaveur wrote:
Mon Sep 30, 2019 6:44 am
However, the calculation times seem to show that beso could benefit from some level of optimization.
II've noticed that beso often takes away material (especially at the load surface) and in the next few iterationen adds the same material again and so on. If it were possible to exclude areas (surfaces, edges, volumes), then you could save many iteration steps.
RatonLaveur wrote:
Mon Sep 30, 2019 6:44 am
I wonder if it is using all the resources (threads/cores) of the computer you used.
I think so, because the output says:

Code: Select all

`````` Using up to 12 cpu(s) for the stress calculation.

Using up to 12 cpu(s) for the symmetric stiffness/mass contributions.

Factoring the system of equations using the symmetric spooles solver
Using up to 12 cpu(s) for spooles.``````
It looks like Beso doesn't use the CPU optimally. I have too little programming knowledge, but it seems that beso spend too much time for something in the background (read and write data or something else) and less for the actual calculation.
Attachments
cpu.png (20.01 KiB) Viewed 1394 times
fandaL
Posts: 382
Joined: Thu Jul 24, 2014 8:29 am

Re: Topology optimization

CalculiX uses all CPU threads (not whole time it is running). BESO inside does not use more threads.

Second note is that if you would run larger and larger tasks you would notice that CalculiX takes smaller and smaller portion of the optimization time. This is due to data structure which gets rapidly slower if they contain many members.
BESO is in principle simpler method (maybe to simple), you can change its “speed” by the slider in GUI, but results could change.

Another point is about multiple load cases which are not in the comparison, but in real application they are often necessary. In CalculiX you would need to add new steps to inp file for other load cases which would do almost all the work again for each load case in CalculiX, but some solvers can solve them very efficiently.
shIxx wrote:
Mon Sep 30, 2019 8:20 am
II've noticed that beso often takes away material (especially at the load surface) and in the next few iterationen adds the same material again and so on. If it were possible to exclude areas (surfaces, edges, volumes), then you could save many iteration steps.
It is possible to define second material in FreeCAD for top flange and not include it to the optimization domain or define it as the non-design domain.
shIxx
Posts: 50
Joined: Wed Mar 28, 2018 10:13 am
Location: Bavaria (Germany)

Re: Topology optimization

fandaL wrote:
Mon Sep 30, 2019 11:07 am
It is possible to define second material in FreeCAD for top flange and not include it to the optimization domain or define it as the non-design domain.
Thanks, I didn't know that.
That means I need a model with at least two materials but if I try to add a different material to a surface, CalculiX shows me this error "it is not possible to have different reference shape types for material objects at the moment".
Ok I think I have to create a compsolid of several bodies in order to assign different materials.
To change the geometry instead of defining the surfaces with just a few clicks is a bit laborious.
However, it's great to have the possibility for topology optimization in FreeCAD.

@fandaL Have you ever thought about integrating this into the FEM WB? Please talk with the FEM guys,.. this would be awesome!
It's amazing what is possible with open source software these days!

I will play around with BESO a while. Obviously I have nothing better to do on vacation,... especially on this rainy day

EDIT:
somehow I can no longer use my keyboard in FreeCAD after BESO is finished. The arrow keys are working but space, del or contr+c are not. To restart FreeCAD helps.
fandaL
Posts: 382
Joined: Thu Jul 24, 2014 8:29 am

Re: Topology optimization

shIxx wrote:
Mon Sep 30, 2019 2:46 pm
That means I need a model with at least two materials but if I try to add a different material to a surface, CalculiX shows me this error "it is not possible to have different reference shape types for material objects at the moment".
I’m not sure if it is intended workbenchworkflow but dirty way can be to define another cube, shift it to overlap original geometry a bit and than define a new material on the cube (which has nothing to do with a mesh object).
shIxx wrote:
Mon Sep 30, 2019 2:46 pm
@fandaL Have you ever thought about integrating this into the FEM WB? Please talk with the FEM guys,.. this would be awesome!
Later I will look how to make it available through Addon Manager as a macro. As regards topology optimization directly in official FEM wb, IMHO it would be worth only with big changes, maybe turning to different method or implementing ToOptix.
fandaL
Posts: 382
Joined: Thu Jul 24, 2014 8:29 am

Re: Topology optimization

fandaL wrote:
Tue Sep 24, 2019 8:44 pm
When error is made by the GUI, FC0.18 crashes. https://github.com/fandaL/beso/issues/5
A bit annoying is that CalculiX opens everytime in foreground. https://github.com/fandaL/beso/issues/6
It should work with updated code.
shIxx wrote:
Mon Sep 30, 2019 2:46 pm
somehow I can no longer use my keyboard in FreeCAD after BESO is finished. The arrow keys are working but space, del or contr+c are not. To restart FreeCAD helps.
It was due to same bug as with 0.18 crashes.
Blaze
Posts: 2
Joined: Thu Oct 17, 2019 10:58 am

Re: Topology optimization

Hi All,
Can anyone describe how exactly should I prepare model and mesh if I ahve a regions which i don't want to optimize ? I am trying with boolean operatons but it seems to not work.