Topology optimization

About the development of the FEM module/workbench.

Moderator: bernd

DMST1990
Posts: 8
Joined: Fri Jun 24, 2016 7:43 am

Re: Topology optimization

Post by DMST1990 »

Hi,

you need also define the nonlinear material properties for the concrete for CalculiX.
There you have to define a Strain/Young module relationship to cover the nonlinariety in the material section.
Maybe there exists a predefined material.

Afterwards you need to replace the void material with the concrete material properties,
so that its switching between concrete and steel.

Due to the nonlinarity it can happen, that it wont converge.

I hope that it kinda helps you.

Best REgards
jtm2020hyo wrote: Wed Jan 20, 2021 12:15 am something like this:

https://wiki.freecadweb.org/Analysis_of ... ith_FEM/en

Image

... here the white lines should be rebars
AstaBlak
Posts: 4
Joined: Mon Jun 14, 2021 9:28 am

Re: Topology optimization

Post by AstaBlak »

Good Day,

I want to find out whether this workbench is still working on FreeCAD?

When I initially opened the addon manager, the beso workbench did not exist. After adding the GitHub link to the custom repositories, I was able to see the beso workbench in the addon manager. I then proceeded to install it.

The add-on manager shows it's installed (highlighted in green), but the workbench disappears when I restart the software. The beso does not show up on the enabled workbenches, nor does it show up on the disabled workbenches.

Is it located elsewhere, or is it not working anymore?

I am using the most recent FreeCad version available.

Any help and assistance would be greatly appreciated.

Thank you.

Kind Regards
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Topology optimization

Post by PrzemoF »

AstaBlack, please post the version of FreeCAD. The "most recent" is not enough.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Topology optimization

Post by chrisb »

Do you see any message in report view? Or in the log if you add --write-log as commandline parameter.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Topology optimization

Post by Syres »

AstaBlak wrote: Mon Jun 14, 2021 9:42 am The add-on manager shows it's installed (highlighted in green), but the workbench disappears when I restart the software. The beso does not show up on the enabled workbenches, nor does it show up on the disabled workbenches.

Is it located elsewhere, or is it not working anymore?
From what I can see, it's not supposed to be a listed Wb, it's really more a collection of Python macros and config files that better belong in the macros folder if you're going to use them in FreeCAD itself.
Probably best to go through the first example detailed in the Wb Wiki https://github.com/fandaL/beso/wiki/Exa ... ed-2D-beam

I got it working using:

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.24986 (Git)
Build type: Release
Branch: master
Hash: ff6845e2f31988cc714027980e0100bb5521843e
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United Kingdom (en_GB)
AstaBlak
Posts: 4
Joined: Mon Jun 14, 2021 9:28 am

Re: Topology optimization

Post by AstaBlak »

PrzemoF wrote: Mon Jun 14, 2021 12:17 pm AstaBlack, please post the version of FreeCAD. The "most recent" is not enough.
Hi,

I am using FreeCAD version 0.19.

The software (FreeCAD) is installed on a Windows 10 OS

The image below shows the workbench:

Image

The image below shows the macros (which doesn't have this):

Image

The image below shows the workbench customiser (which doesn't have this):

Image

The image below shows the report view when I open up Freecad:

Image


Any help and assistance would be greatly appreciated.

Thank you.

Kind Regards
AstaBlak
Posts: 4
Joined: Mon Jun 14, 2021 9:28 am

Re: Topology optimization

Post by AstaBlak »

Syres wrote: Mon Jun 14, 2021 2:49 pm
AstaBlak wrote: Mon Jun 14, 2021 9:42 am The add-on manager shows it's installed (highlighted in green), but the workbench disappears when I restart the software. The beso does not show up on the enabled workbenches, nor does it show up on the disabled workbenches.

Is it located elsewhere, or is it not working anymore?
From what I can see, it's not supposed to be a listed Wb, it's really more a collection of Python macros and config files that better belong in the macros folder if you're going to use them in FreeCAD itself.
Probably best to go through the first example detailed in the Wb Wiki https://github.com/fandaL/beso/wiki/Exa ... ed-2D-beam

I got it working using:

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.24986 (Git)
Build type: Release
Branch: master
Hash: ff6845e2f31988cc714027980e0100bb5521843e
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United Kingdom (en_GB)

Thank you.

I will have a read through.
fandaL
Posts: 440
Joined: Thu Jul 24, 2014 8:29 am

Re: Topology optimization

Post by fandaL »

Hello,
I would recommend to follow https://github.com/fandaL/beso/wiki/Exa ... in-FreeCAD There are instructions and link to python files which you need to copy to your macro directory.

I didn’t know about the workbench installator as you show in the figures. (I don’t see it in my FreeCAD). Maybe it just copied python files to your macro directory, if that is true, I would search for beso_fc_gui.py - from FreeCAD menu:
Macro → Macros…
AstaBlak
Posts: 4
Joined: Mon Jun 14, 2021 9:28 am

Re: Topology optimization

Post by AstaBlak »

fandaL wrote: Tue Jun 15, 2021 10:46 am Hello,
I would recommend to follow https://github.com/fandaL/beso/wiki/Exa ... in-FreeCAD There are instructions and link to python files which you need to copy to your macro directory.

I didn’t know about the workbench installator as you show in the figures. (I don’t see it in my FreeCAD). Maybe it just copied python files to your macro directory, if that is true, I would search for beso_fc_gui.py - from FreeCAD menu:
Macro → Macros…
Good Day fandaL,

Thank you for the message.

Yes, I have followed the example and have been able to add the macros to FreeCAD. You were correct; it seemed that the python scripts were copied over and, for some reason, were being partially displayed in my workbench.

I have been using your tool for a short while, and it is quite good. I have a few questions regarding the tool, based on the limited experience I have while using it:

A. Regarding the "beso.config" file:
1. Do we have to edit this file every time we perform a new type of simulation - particularly the "elset name" and the "file_name", or does the GUI do the changes after doing the first example iteration?
2. From what I understand, you used the code/research paper "A simple and compact Python code for complex 3D topology optimization" as the foundation for your BESO tool? Is this correct?
3. Have you submitted any research articles regarding your tool for reference purposes?
4. Concerning the solver - if we wanted to use a different solver, would it be a matter of changing the calculix path and its dependencies within the config file or are there multiple dependencies across the different macros?
5. If we did change the solver path, would it require a complete recode of your macros or not?

B. Results Output:
1. From what is see, the iteration steps are printed out as separate result files, and we have to select the iteration solution and import it into FreeCAD to visualise it. Is there perhaps a way to store this (hold it in memory) within FreeCAD and vary the results using a slider and promote the result we want to select?
2. Concerning result filtering - If I understand correctly, the tool doesn't have the ability to apply filters to smoothen the TO results. I did read the previous posts on the forum where you advised on the limitations and concerns about this. Is this still correct?
3. I see that a vtk file is also printed, and you did mention using Paraview as an additional tool to refine/filter the vtk file using the transition filter. Will it be fine to write a macro/s that could modify/smoothen the results by applying different filters to the final results so it can be done natively within FreeCAD so we could also get final solid parts that could be evaluated or potentially manufactured? If it works, the macros could be added to your GUI, or it could be a separate one if you prefer.

C. Usecase:
1. I am only interested in using the contour shape from a part using the BESO method as a starting point for my application and not a final result as with most topology optimisation techniques.

Any help and assistance would be greatly appreciated.

Thank you.

Kind Regards
fandaL
Posts: 440
Joined: Thu Jul 24, 2014 8:29 am

Re: Topology optimization

Post by fandaL »

AstaBlak wrote: Fri Jun 18, 2021 8:52 am A. Regarding the "beso.config" file:
1. Do we have to edit this file every time we perform a new type of simulation - particularly the "elset name" and the "file_name", or does the GUI do the changes after doing the first example iteration?
The GUI writes config file on background, so you don't need to touch it when using basic functionality.
AstaBlak wrote: Fri Jun 18, 2021 8:52 am 2. From what I understand, you used the code/research paper "A simple and compact Python code for complex 3D topology optimization" as the foundation for your BESO tool? Is this correct?
I have seen this paper, but did not follow it too much. It uses Abaqus CAE and its python commands.
AstaBlak wrote: Fri Jun 18, 2021 8:52 am 3. Have you submitted any research articles regarding your tool for reference purposes?
This was the initial conference paper https://www.engmech.cz/improc/2017/0590.pdf
And this is one application (containing results also from other commercial tools) https://dspace.vutbr.cz/bitstream/handl ... sAllowed=y
AstaBlak wrote: Fri Jun 18, 2021 8:52 am 4. Concerning the solver - if we wanted to use a different solver, would it be a matter of changing the calculix path and its dependencies within the config file or are there multiple dependencies across the different macros?
If you mean different CalculiX version, changing path should work. If you mean completely different solver (e.g. Z88 or CodeAster or whatever), it would require coding inputs and outputs.
AstaBlak wrote: Fri Jun 18, 2021 8:52 am 5. If we did change the solver path, would it require a complete recode of your macros or not?
It should work.
AstaBlak wrote: Fri Jun 18, 2021 8:52 am B. Results Output:
1. From what is see, the iteration steps are printed out as separate result files, and we have to select the iteration solution and import it into FreeCAD to visualise it. Is there perhaps a way to store this (hold it in memory) within FreeCAD and vary the results using a slider and promote the result we want to select?
resulting_states.vtk contains result overview and can be imported to Paraview to browse them.
AstaBlak wrote: Fri Jun 18, 2021 8:52 am 2. Concerning result filtering - If I understand correctly, the tool doesn't have the ability to apply filters to smoothen the TO results. I did read the previous posts on the forum where you advised on the limitations and concerns about this. Is this still correct?
Yes. Smoothing and generating surface mesh (stl) can be done in Paraview, but it might be with difficulties. From example 4:
The file resulting_states.vtk can be used to display element states through iterations by use of Threshold filter in Paraview to hide void elements.
Resulting files from separate iterations, e.g. file073.vtk can be used to display failure criteria from within the 73rd iteration and can be used for initial smoothing in Paraview by Clip filter with Clip type set to Scalar on elemet_states_averaged_at_nodes scalars with value 0.5. Then when Excract Surface filter and Triangulate filter are used, the mesh can be exported to the stl (File / Save Data). However, I got the mesh which further needed to be repaired...
AstaBlak wrote: Fri Jun 18, 2021 8:52 am 3. I see that a vtk file is also printed, and you did mention using Paraview as an additional tool to refine/filter the vtk file using the transition filter. Will it be fine to write a macro/s that could modify/smoothen the results by applying different filters to the final results so it can be done natively within FreeCAD so we could also get final solid parts that could be evaluated or potentially manufactured? If it works, the macros could be added to your GUI, or it could be a separate one if you prefer.
FreeCAD supports working with vtk data to some extend, but not all general functionality. I'm not sure if FreeCAD developers have a priority on this.
One type of smoothing can already be done in FreeCAD: Import resulting mesh, e.g. file029_state1.inp, and transform the mesh to surface mesh
Mesh -> FEM mesh to mesh
then in Mesh Design workbench
Meshes -> Smooth
It has disadvantage that it shrinks the shape.
Surface meshes (stl) are not so easy to handle (not only) in FreeCAD. I got better results with remeshing modifier in Blender.

To give you some conclusion: the code is experimental, glued to FreeCAD by the GUI macro, which controls only some functionality (mainly what works easier/better than the rest).
Post Reply