FreeCAD as pre-post processor for MBDyn

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: FreeCAD as pre-post processor for MBDyn

Post by RatonLaveur »

Thank Zolko, do you see a Synergy here with Jose's work?

Would you recommend that he uses Assembly4 tools to augment his workbench?
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: FreeCAD as pre-post processor for MBDyn

Post by Zolko »

RatonLaveur wrote: Mon Apr 12, 2021 11:29 am Thank Zolko, do you see a Synergy here with Jose's work?
I was thinking about such things, but I'm not sure to understand what he's doing. My ideas was that Assembly4 is actually, at its very heart, a raw interface to App::Part and App::Link objects, and these objects are placed relative to each other using PartDesign::Datum objects and FreeCAD's built-in ExpressionEngine. This forms a 3D solver that has the particularity to be isostatic and reversible, meaning all objects have all their 6 DoF fixed, and only 6 DoF. This is both powerful, fast and reliable.

While this is good for many real-world assemblies, it doesn't answer all problems, there are at least 2 classes of problems that cannot be solved by that:

1) "traditional" assemblies with constraints across many parts. The typical example is that of the F-16's landing gear.

2) "physical" assemblies where the user has a physical model for the interactions between objects, especially dynamic movements and interactions. If I understand correctly MBDyn treats this aspect.

BUT: these problems are not mutually exclusive: most assemblies can be solved by the Asm4 model, because most parts are placed relative to others in an isostatic way: think about screws in a hole: why solve an "axis-collinear" and "planes-touching" constraints when you actually have a "concentric-circle" that can be represented by 2 LCS attached to their respective circles by the built-in Attachment ?

Currently, all Asm4 objects that are assembled get some properties that define their attachment:

Asm4EE.png
Asm4EE.png (367.74 KiB) Viewed 4483 times


As can be seen, one of the properties is "Assembly Type" and is set to be Asm4EE (for Assembly 4 ExpressionEngine). But, objects can also be placed in an assembly manually, using the "Transform" tool, in which case there is no solver at all. The name of this property "AssemblyType" might be badly chosen, something like "SolverType", or "Solver", might be better adapted. We should decide about some key-world that would set the solver to be applied for each objects and that would be recognized and respected by all solvers. Thus, each part that is assembled into an assembly could receive a text property "Solver" (or SolverType or ...TBD) in the "Assembly" property group, and each solver only treats objects that have that property set for it. An assembly could contain objects that are placed manually ("SolverType" empty), by an ExpressionEngine ("SolverType"="Asm4EE"), by the A2+ solver ("SolverType"="A2+", by MBDyn ("SolverType"="MBDyn") ...

We can then imagine adding another solver type (MBDyn ?) in which case that object would be handled by that solver. What one would do is to parse the objects of the assembly tree, and if the MBDyn encounters an object with the solver "MBDyn" than it calculates it's position, and ignores all other objects.

There was also a topic to incoprorate the A2+ solver into Asm4 (this is stalled right now).

So the short answer is: I think that MBDyn could become a solver for Asm4. After each MBDyn update, the FreeCAD ExpressionEngine would kick in and correctly place all relevant objects to their corresponding location. This way, you could make a regular assembly, with all screws and whatever, and set the "solver" property for the MBDyn objects to MBDyn.

But I don't knowh how MBDyn works so I don't really know what would be needed to do this integration.
try the Assembly4 workbench for FreCAD — tutorials here and here
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: FreeCAD as pre-post processor for MBDyn

Post by RatonLaveur »

while browsing the information superhighway, I stumbled upon FreeDyn
http://www.freedyn.at/

Jose-Gabriel seems to know about it:
https://www.youtube.com/watch?v=BN07ZRm ... rtu%C3%B1o
Or at least, this seemed to be the original intent to name the workbench FreeDyn (which makes sense).

There is a cool dissertation an multi body dynamics, apprently based on FreeDyn from TU Graz in Autria:
https://diglib.tugraz.at/download.php?i ... ion=browse
What i find especially cool is that this dissertation makes the link between multi-body dynamics and FEA analysis, a topic that has been addressed here at some point.

First (and apparently only) mention of FreeDyn in the FC forums:
https://forum.freecadweb.org/viewtopic. ... 6&start=10

Is there a confusion in terms? are this (here in this topic) project and the one from the team in austria different? competing? aware of each-other?

Anyway, just trying to increase situation awareness ;)

EDIT: from a couple of screenshots online, I had a strong feeling that FreeDyn was based on FreeCAD modifications, it turns out, these screenshots came from Jose-Gabriel. Hence I believe this can be chucked as one of the plethora of multi-body codes, it just so turns out that someone (wink wink) decided to go for MBDyn with FreeCAD...but how do we name it now...oh the possibilities! (I really like FreeDyn's logo though...)
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: FreeCAD as pre-post processor for MBDyn

Post by Zolko »

RatonLaveur wrote: Mon Apr 12, 2021 3:59 pm while browsing the information superhighway, I stumbled upon FreeDyn
http://www.freedyn.at/
FreeCAD can also simulate a piston engine :

Image
try the Assembly4 workbench for FreCAD — tutorials here and here
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: FreeCAD as pre-post processor for MBDyn

Post by RatonLaveur »

For fully rigid and constrained bodies, sure ;) but if moving masses, elastic systems...https://www.youtube.com/watch?v=_SHpmfu ... rtu%C3%B1o
Then MBDyn can take over apparently :D
Also it calculates forces (or it can), and that's when FEA can come in.
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.

In short: what I try to do is to turn FreeCAD into a user-friendly and intuitive graphic interface for MBDyn.

The long answer:

I think what I´m doing is still not mature enough to think of parametric stuff. Actually, before one performs any simulation with my workbench, one has to create non-parametric objects: simple copies from the parametric assembly, because my workbench will surely break a parametric model.

What my workbench does can be summarized as:

1.- Create a rigid body by taking a non-parametric body and calculating it´s physical properties (volume, mass (given a material and its density), and inertia moments).
2.- Create a node associated to this rigid body. Calculate the position/orientation of this node relative to its body. Allow the user to move and rotate the node as convenient.
3.- Repeat the two steps above to create as many nodes/bodies as required.
4.- Apply constraints to reduce the degrees of freedom of the nodes (clamps, in-lines, revolute-pin, hinges, spherical, etc).
5.- Apply forces, couples, gravity, etc, and give initial conditions to the nodes created.
6.- Automatically write an input file in the adequate format for MBDyn.
7.- Execute MBDyn. Before the MBD simulation itself, MBDyn will check the initial assembly. If the initial assembly fails, it means that some constrains cannot be solved or that the model is over-constrained. One problem here is that the user has to have a good understanding of the degrees of freedom of the model, because if the initial assembly fails, the software will not guide the user to a possible solution.
8.- Read the results of the MBDyn simulation.
9.- Present these results to the user either as plots, spreadsheets or by animations.

By now, I see my work only as a mechanism to reduce the steep learning curve of MBDyn. Working with input files can be hard/frustrating, and can limit people to perform only quite simple simulations. With this software, one can generate more complicated input files in a more intuitive way, and hopefully people will also be able to study and understand how input files work with less effort. I also see it as a mechanism to reduce the time required by experienced users to perform MBDyn simulations and visualize the results. By now, I do not see my software as adding any new functionalities to MBDyn, other than making life easier for learners and experienced users too.

This is, however, not to say that I do not see the value of performing simulations with parametric CAD objects or parametric assemblies. I think this would indeed be a very valuable tool. Something I did some time ago is a parametric study of an engine I designed for my research project. The idea was to automatically test different crank and connecting rod designs and analyze vibrations and loads under different operating conditions. Something similar as this:

https://www.sky-engin.jp/en/MBDynTutori ... hap20.html

In the example above they do a parametric study of the piston offset. It would be fantastic if one could have a parametric assembly of an engine´s CAD model and tell the software to perform a number of MBD simulations for a number of design variables, say for instance piston offset, geometric properties of the parts, etc. And then get a bunch of results to compare…

By now my objective is to implement most of the functionality of MBDyn within FreeCAD, rather than creating new tools. MBDyn is quite a powerful tool, and having it within FreeCAD will be a great plus. I know one can already perform kinematic simulations with FreeCAD´s existing tools, but MBDyn offers much more than this.

Only to integrate MBDyn within FreeCAD is already a challenging objective. This is basically to give MBDyn a user-friendly graphical interface, something it has never had. Once this objective is achieved, I will have to validate the software. To use other well-known programs such as Adams or Ansys to perform the same simulations as with the FreeCAD-MBDyn tool, and compare results. This will tell me if my software is in fact generating the correct input files for MBDyn… This can be quite simple for simulations such as a pendulum, but things like a car suspension can be more challenging. After this validation, I believe, we could start thinking of adding new functionalities, such as studying parametric bodies or assemblies.

What do people think? I hope this helps clarify what I try to achieve…

Cheers.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: FreeCAD as pre-post processor for MBDyn

Post by RatonLaveur »

I believe that what you've been doing from the get go has been fanstastic. There is no doubt about the value of your scope or your work.

The only key point in the recent discussion i think is whether you want to use LCS's as nodes and use tools from Assembly4 to achieve that.

Beyond this... most of my other points were merely inspirations.
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 all.

I have a question. Any idea will be very welcome.

So far, I don´t really have problems to use FreeCAD to visualize the results of simulations involving only rigid bodies, but the "beam elements" in MBDyn allow the simulation of flexible bodies too. The thing is that I do not know how can I animate a flexible body in FreeCAD.

Think of these simulations:

phpBB [video]


phpBB [video]


I guess a "flexible body" will in fact be composed of a number of rigid bodies, as in FEA. The FEM workbench has a nice way to visualize deformed bodies, but I´m not familiar with how it works. Neither I know if this would help with the animation of MBDyn results.

Any ideas?

Cheers.
stanislau
Posts: 18
Joined: Wed Nov 05, 2014 5:13 am

Re: FreeCAD as pre-post processor for MBDyn

Post by stanislau »

Jose,it's posible simulate collisions?Something like this:
phpBB [video]

Thanks for your work,and keep doing!
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 »

stanislau wrote: Wed Apr 14, 2021 5:16 pm Jose,it's posible simulate collisions?Something like this:
phpBB [video]

Thanks for your work,and keep doing!
Hi. Not yet, sorry.
Post Reply