FreeCAD as pre-post processor for MBDyn

About the development of the FEM module/workbench.

Moderator: bernd

josegegas
Posts: 241
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

T-Garnier wrote: Thu Sep 22, 2022 1:22 pm Not all the class can be subclassed with python.
Did you try to create a Part::FeaturePython + your coordinatesystem object and then link the coordinate to the FeaturePython object ? It's been a long time since I the freecad python api so I could be wrong.

https://wiki.freecadweb.org/FeaturePyth ... opertyLink
I think I have found another solution. I simply created a method that recomputes the desired values of the object, and placed this method within a third class. Then call the method when needed. This also helps me solve another problem I had with the previous workbench, and is that the model had dependency issues. By precomputing in this way I can keep the MBD part of the system unlinked from the CAD part, and avoid these dependency problems. It seems to work just fine.
michav
Posts: 52
Joined: Mon Sep 09, 2019 7:34 am

Re: FreeCAD as pre-post processor for MBDyn

Post by michav »

Jose,
you have done really amazing work!

some qeustions:

looking at your spanish tutorial on the wingnut: https://www.youtube.com/watch?v=DMbY4eU ... J0qarH1qoM

I have some differences regarding my setup that I wanted to ask how do I achieve a setup like yours,

1. when I click on the world symbol, it sets me up a set of directories in my model tree that is a bit overwealming,
in your tutorial you only had the elements that you are using and its alot more clean,
how do I acheive this?

2. I cannot find the ground element? what subgroup is it under?

3. you have many more icons / tools than me, including DEM
how do I get these?

really good job,
I can't wait to read your tutorial.pdf, (I can't find it anywhere!)
michav
Posts: 52
Joined: Mon Sep 09, 2019 7:34 am

Re: FreeCAD as pre-post processor for MBDyn

Post by michav »

Jose,
I am getting the following errorr when I try to apply a dynamic node to the wing nut
rigid body 1: warning no strucural node asociated to this body, relative center of mass cannot be calculated
josegegas
Posts: 241
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

michav wrote: Wed Oct 12, 2022 7:31 pm Jose,
I am getting the following errorr when I try to apply a dynamic node to the wing nut
rigid body 1: warning no strucural node asociated to this body, relative center of mass cannot be calculated
Hello.

This is normal.

When you create a rigid body, the software tries to compute the relative center of mass. The relative center of mass is the position of the center of mass of the body relative to its node. Since one has to create the rigid body first, and then add the node, the relative center of mass cannot be computed while the node does not exist. Once you add the node, the error will dissapear.

To create the rigid body, please make sure to have only one solid object selected.

To create the dynamic node, please make sure you only have one rigid body selected, not a solid object.
josegegas
Posts: 241
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

michav wrote: Wed Oct 12, 2022 7:31 pm Jose,
I am getting the following errorr when I try to apply a dynamic node to the wing nut
rigid body 1: warning no strucural node asociated to this body, relative center of mass cannot be calculated
Hello.

This is normal.

When you create a rigid body, the software tries to compute the relative center of mass. The relative center of mass is the position of the center of mass of the body relative to its node. Since one has to create the rigid body first, and then add the node, the relative center of mass cannot be computed while the node does not exist. Once you add the node, the error will dissapear.

To create the rigid body, please make sure to have only one solid object selected.

To create the dynamic node, please make sure you only have one rigid body selected, not a solid object.
josegegas
Posts: 241
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

Hi.

I have uploaded a first tutorial. It is in Spanish, but just added English subtitles.

https://www.youtube.com/watch?v=DMbY4eUlnyc&t=2235s
michav
Posts: 52
Joined: Mon Sep 09, 2019 7:34 am

Re: FreeCAD as pre-post processor for MBDyn

Post by michav »

Jose,
I got the node working,
I had to select, the reference body feature, the reference body origin and the rigid body element :)
next I am trying to get clamp joint and gravity working,

Clamp joint:
I keep getting the error: invalid property name 'node label'
I simply select the node and then click on the clamp joint.
someone in your gitlab has added this issue: https://gitlab.com/josegegas/freecad-mb ... /issues/22
according to Nils: I just add the "_" to the corresponding name and it works. , which I don't understand what he's talking about.

Static Node:
didn't work for me, I just thought to add a dynamic node and clamp it down. that is what you did in the contact example with the falling ball.

gravity:
I added gravity,
when I go to write the simulation file: it says
please provide a drive or scaler function to device the gravitation acceleration.
I want to add a scaler function, but I can't connect it to the gravity element. I select the gravity element, and select user defined function,
I get asked how many steps? and then it doens't get added to the scaler functions folder, it gets added to the bottom, and from there, I understand that it didn't work and i erased it.

I would like to introduce rigid body dynamics to an experimental high school physics class,
please help
-micha
michav
Posts: 52
Joined: Mon Sep 09, 2019 7:34 am

Re: FreeCAD as pre-post processor for MBDyn

Post by michav »

see attached simulation file
Attachments
block2.FCStd
(52.8 KiB) Downloaded 54 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD as pre-post processor for MBDyn

Post by Kunda1 »

@josegegas are you still hacking on this project? there doesn't seem to be activity on the gitlab repo (are you developing it elsewhere?)
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
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: FreeCAD as pre-post processor for MBDyn

Post by saso »

josegegas wrote: Fri Oct 14, 2022 1:03 am ...
Jose, I would like to recommend that you change the structure of your "mbd simulation containers"...

First, I would probably prefer not to change the existing model, I understand that since FreeCAD does not really enforce a strict Assembly/Part structure the user cad models can sometimes be large and unstructured, so moving (hiding) them in to a group could be helpful, but changing the existing model is in general considered a bad practice, so I would not do it and it should be IMO more up to the user to manage the structure of the cad model in a way that works for them.

Second, add all your groups under one main group, this is also how the FEM, CFD and Path are doing it so it can be a more consistent workflow and this way is also in general common in commercial tools. So maybe something like this image (Note: my "model" in this example is just a cube, but regardless how big the cad model is or how it is structured I would not change/move it, so there is no "CAD_objects" group, everything else is as you have just under the "Dynamics" group, this would in theory also allow to have several different simulations for the same cad model)... ?

dyn.png
dyn.png (65.82 KiB) Viewed 2810 times
Post Reply