Rigid body constraint

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Rigid body constraint

Post by bernd »

jnxd wrote: Mon Oct 31, 2022 2:58 pm ... A question came up: this particular constraint requires a new node to be created; (how) can this be done within write_constraint_rigidbody.py? This node will need to have a number different than existing nodes, and there could be multiple rigid bodies, which would need different nodes to be added.
How about the coordinates? Where do you get them from.

Adding a node py python is not difficault. FEM_Mesh The problem we face than. Depending if we just write the node to the inp file or if we would write it back to the FreeCAD mesh object. It is either not the mesh from the mesher anymore or the mesher mesh is not the same as the post processing mesh.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

bernd wrote: Mon Oct 31, 2022 3:08 pm How about the coordinates? Where do you get them from.

Adding a node py python is not difficault. FEM_Mesh The problem we face than. Depending if we just write the node to the inp file or if we would write it back to the FreeCAD mesh object. It is either not the mesh from the mesher anymore or the mesher mesh is not the same as the post processing mesh.
Coordinates come from the constraint itself, provided in something like this: https://forum.freecadweb.org/viewtopic. ... 92#p523853. It probably will be different for other solvers (elmer, z88) so probably needs to be added just to the inp file for now. This might have some implications on the post processor as well.
My latest (or last) project: B-spline Construction Project.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

OK. Hi @NewJoker. Been working on a this, but it's been a while since I worked on FEM WB so it's going really slow. The work isn't particularly difficult but there's quite a bit to be done: connections to be set in Qt-side and the write-up. Additionally as I said in yesterday's post, post-processing might need to be changed as well.
NewJoker wrote: Wed Aug 11, 2021 10:00 am When it comes to the implementation of rigid body constraint, for the input file we just need this one *RIGID BODY keyword and two additional nodes to serve as REF NODE and ROT NODE.
They don't seem necessary:
In the absence of any of the parameters REF NODE or ROT NODE, extra nodes are generated internally assuming their tasks. The position of the default REF NODE is the origin.
From a user's point of view, we need a possibility to select a region (face or volume) and specify coordinates of a reference point (RP). It would be nice to display this constraint on the model somehow or at least show the RP. But it must be also possible to apply loads and boundary conditions to the RP and torque loads have to be added. Maybe instead of editing the existing boundary condition and load features, we could implement this all into one menu for a rigid body constraint definition. In fact, that's how it's done in SolidWorks for example. In such a case the menu would have to look something like this:

rb gui.png
This does seem to be a pretty loaded set of actions. Let's start small first and skip the displacement part. Also, displacements and forces are only applied on RefNode, and rotations and moments only on RotNode. In the future we can try to define ref and rot nodes using datum points and then apply displacements and rotations to them (this would simplify this task-view, maybe at the cost of generalizing other constraints).
Screenshot from 2022-11-01 13-51-56.png
Screenshot from 2022-11-01 13-51-56.png (46.94 KiB) Viewed 2408 times
My latest (or last) project: B-spline Construction Project.
User avatar
NewJoker
Veteran
Posts: 3016
Joined: Sun Oct 11, 2020 7:49 pm

Re: Rigid body constraint

Post by NewJoker »

jnxd wrote: Tue Nov 01, 2022 8:26 am They don't seem necessary:
In the absence of any of the parameters REF NODE or ROT NODE, extra nodes are generated internally assuming their tasks. The position of the default REF NODE is the origin.
The location of the REF NODE is often important and can't be left as default. Especially when applying loads via rigid body constraint (torsion, remote forces).

jnxd wrote: Tue Nov 01, 2022 8:26 am This does seem to be a pretty loaded set of actions. Let's start small first and skip the displacement part. Also, displacements and forces are only applied on RefNode, and rotations and moments only on RotNode. In the future we can try to define ref and rot nodes using datum points and then apply displacements and rotations to them (this would simplify this task-view, maybe at the cost of generalizing other constraints).

Screenshot from 2022-11-01 13-51-56.png
A way to simplify this task panel would be to add a checkbox to switch from loads to displacements. When checked it would change the units of the input field to mm or rad. So it would look like this:

Screenshot from 2022-11-01 13-51-56.png
Screenshot from 2022-11-01 13-51-56.png (49.7 KiB) Viewed 2377 times

Something like this is implemented in SolidWorks Simulation. Being able to define displacements/rotations is important since, among others, it allows you to apply rotational BCs to solids which is normally impossible. For example, you can use prescribed rotation instead of torque (much better for convergence in nonlinear analyses).

Also, the section for ROT NODE coordinates can be removed:

The rotational node can be defined explicitly using the parameter ROT NODE. In that case, this node must be been assigned coordinates (their value is irrelevant) and should not belong to any element of the structure.
And it would be good to allow for the selection also of other entities than faces - vertices, edges and, most importantly, solids (since this constraint can make a whole solid rigid) but faces are a good start.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

NewJoker wrote: Tue Nov 01, 2022 12:08 pm The location of the REF NODE is often important and can't be left as default. Especially when applying loads via rigid body constraint (torsion, remote forces).
I guess it's not important if, for example it's in the "middle" of the model, with no BC's on it.
NewJoker wrote: Tue Nov 01, 2022 12:08 pm
A way to simplify this task panel would be to add a checkbox to switch from loads to displacements. When checked it would change the units of the input field to mm or rad. So it would look like this:


Screenshot from 2022-11-01 13-51-56.png
That's a good idea. Possibly better to make it a checkbox per coordinate.
NewJoker wrote: Tue Nov 01, 2022 12:08 pm Also, the section for ROT NODE coordinates can be removed:
The rotational node can be defined explicitly using the parameter ROT NODE. In that case, this node must be been assigned coordinates (their value is irrelevant) and should not belong to any element of the structure.
Thanks for pointing it out before I spent time coding it in :lol:.
NewJoker wrote: Tue Nov 01, 2022 12:08 pm And it would be good to allow for the selection also of other entities than faces - vertices, edges and, most importantly, solids (since this constraint can make a whole solid rigid) but faces are a good start.
Pretty sure it can take other entities, despite the label.
My latest (or last) project: B-spline Construction Project.
User avatar
NewJoker
Veteran
Posts: 3016
Joined: Sun Oct 11, 2020 7:49 pm

Re: Rigid body constraint

Post by NewJoker »

jnxd wrote: Tue Nov 01, 2022 1:19 pm I guess it's not important if, for example it's in the "middle" of the model, with no BC's on it.
Yeah, it may not matter when a rigid body constraint is used to make a part rigid. Unless the rigid part is supposed to move freely under applied loads in the analysis (then the ref point should be placed in the center of mass of the model) but dynamic simulations are not yet supported in FreeCAD anyway.

jnxd wrote: Tue Nov 01, 2022 1:19 pm That's a good idea. Possibly better to make it a checkbox per coordinate.
Right, I think that this is how it's implemented in SW.

jnxd wrote: Tue Nov 01, 2022 1:19 pm Thanks for pointing it out before I spent time coding it in :lol:.
I've mentioned this in private messages when we were talking this topic for the first time:

In CalculiX, rotational DOFs for rigid bodies are handled by a separate entity - ROT NODE, but its location is arbitrary.
In addition to REF NODE, rigid body constraint also needs a ROT NODE but its location is arbitrary and can be the same as that of the REF NODE, as I've mentioned before.
jnxd wrote: Tue Nov 01, 2022 1:19 pm Pretty sure it can take other entities, despite the label.
That can be the case, like with some other constraints in the FEM workbench but there can be some differences between them in this regard. However, I would include this information in the label if possible to make it clear which geometric entities can be selected.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

NewJoker wrote: Tue Nov 01, 2022 2:00 pm

I've mentioned this in private messages when we were talking this topic for the first time:
...

...However, I would include this information in the label if possible to make it clear which geometric entities can be selected.
I'm sorry it's been a while, and I had less context while reading the PM.

Let's change one at a time. I'll reply once something basic is implemented.
My latest (or last) project: B-spline Construction Project.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

@NewJoker can you try building from https://github.com/AjinkyaDahale/FreeCA ... onstraints? I have a minimal setup. Only the load and moment definitions work, and you'll have to "edit input file" and put the ref and rot nodes manually for now.

For future reference, known issues:
0. No icon. It's just the "X" next to fixed constraint.
1. No displacement definitions. Need to implement free/displacement/force switch a la displacement constraints.
2. REF NODE and ROT NODE not written into input file.
3. No option to not give REF NODE. By default if loads and moments are all zero it's not written
4. Solids are not yet supported.

Let me know if I miss anything.
My latest (or last) project: B-spline Construction Project.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Rigid body constraint

Post by bernd »

cool ... the python method to create the object and the unit test for the new object is missing ... See git commit 27f50ad13188faff changes in files
- src/Mod/Fem/femtest/app/test_object.py
- src/Mod/Fem/ObjectsFem.py (but for a C++ object the code is different, look at the file)
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Rigid body constraint

Post by bernd »

if you make a PR to main FreeCAD and write in the heading [DO NOT MERGE] the FreeCAD CI will be triggered automatically and you see if it builds and what unit test problems it has.
Post Reply