CCX_Mode_Result GUI

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
paytonbroaddus
Posts: 1
Joined: Thu Aug 08, 2019 8:41 pm

CCX_Mode_Result GUI

Postby paytonbroaddus » Thu Aug 08, 2019 9:02 pm

I couldn't find a simple one so I built a Macro to display the oscillation of a FEM mode.
V2: I included a Heuristic for amplitude. This makes it easier for people who just want to see something reasonable without fiddling with parameters. Editing of total Amplitude is still available.
phpBB [video]


By popular demand I am including the file this was done with and the version of FreeCAD. There are a number of difficulties/tips I ran into in getting this all together:
-Current 0.18 version materials don't work, you have to use the 0.19dev version (oof)
-Maybe this is well known in the meshing/FEM community, but the reason boolean fragmenting everything is so important is that any time different objects WITH DIFFERENT MATERIALS meshes overlap the solver will give an error. Often times it might not look like there are any overlaps but they pop up all over the place, even when you really think they shouldn't. Just to be safe always boolean fragment if you have more than 1 material
-There is an open issue with the Calculixccx solver giving results that are correct (IE they have the correct spring constants/displacements in the small signal and thus linear regime). However the scale bar = 1 for some reason has crazy large forces and thus crazy large displacements. This is an open issue: https://forum.freecadweb.org/viewtopic. ... 8&start=10

Exact workflow
-Open File
-Go to FEM workbench
-Click on Body
-Click on Netgen Mesh
-Moderate Fineness meshing is okay
-Click Ok
-If not already, move the FEMMeshNetgen under Analysis
-Double click on CalculiXccxTools under Analysis
-Analysis type: Frequency
-Write .inp file
-Run Calculix
-Double Click on the mode result you want. For example click on: CCX_Mode1_Results
-Click on Absolute displacement
-Look at the min, max, and avg displacement. Sometimes you will get huge displacements. In the Mode_Demo I included the total length of the board is 100mm, and the max Abs displacement is 774.98mm. I want to see maybe a 1.5mm displacement max, so I will set my Amplitude value in my such that 774.98*Amplitude = 1.5mm
-Go to the AnimateMode Macro, set the Amplitude value. I want about a 1.5mm max displacement, so I set my Amplitude to 1.5mm/774.98mm ~= 0.002
-Single Click on the mode result you want. For example click on: CCX_Mode1_Results
-Run the AnimateMode Macro. It will recognize you have selected CCX_Mode1_Results

OS: macOS 10.14
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17499 (Git)
Build type: Release
Branch: master
Hash: 6b1be38f35686faf21e1015bf562520929890870
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Attachments
AnimateModev2.FCMacro
(1.29 KiB) Downloaded 7 times
Mode_Demo.FCStd
(94.16 KiB) Downloaded 6 times
AnimateMode.FCMacro
(996 Bytes) Downloaded 7 times
Last edited by paytonbroaddus on Fri Aug 09, 2019 9:45 am, edited 4 times in total.
User avatar
Kunda1
Posts: 5121
Joined: Thu Jan 05, 2017 9:03 pm

Re: CCX_Mode_Result GUI

Postby Kunda1 » Thu Aug 08, 2019 9:04 pm

This is awesome. Can you post your full FC version ? And talk a little about your process... what you found easy/difficult etc...?

Edit: I wish it had sound :lol:
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
sgrogan
Posts: 5238
Joined: Wed Oct 22, 2014 5:02 pm

Re: CCX_Mode_Result GUI

Postby sgrogan » Thu Aug 08, 2019 9:59 pm

Hello paytonbroaddus! Welcome to FreeCAD and the Forum :D
This is a pretty great first post.

This works for me on
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17513 (Git)
Build type: Release
Branch: master
Hash: 7c48ad754c6a35f6331f133b27294fdd458bf67d
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)

Using the FemCalculixCantilever3D example. I had to set Amplitude to 5000 in the macro.

I think this needs to be in master.
Simplest would be to just add the macro to the FEM toolbar, in this case I think "Amplitude" should use the Displacement stuff from the Show result dialog.
Better yet, would be to include it in the dialog.
bernd wrote:ping
Thanks for the contribution :D