issues with region meshing and jac < 0 (0.19dev master)

About the development of the FEM module/workbench.

Moderator: bernd

user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by user1234 »

I will try it.

Yes, gmsh-4.7.1

Greetings
user1234
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by user1234 »

So i tested directly in gmsh.


Here the output from the good 2nd order shaft.
text_good.txt
(18.39 KiB) Downloaded 46 times
good_shape2mesh.geo.txt
(2.44 KiB) Downloaded 48 times

Here the output from the bad 2nd order shaft.
text_bad.txt
(35.5 KiB) Downloaded 46 times
bad_shape2mesh.geo.txt
(3.75 KiB) Downloaded 41 times
Same bad mesh like when i have done it in FreeCAD.


One stupid question: in the *.geo file are the lines like:

Code: Select all

// Face8
Characteristic Length { 7, 13 } = 0.8;
What are the number in the brackets? In the documentation https://gmsh.info/doc/texinfo/gmsh.html i found nothing when i searched "Characteristic".

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

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by bernd »

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

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by bernd »

bernd wrote: Fri Dec 04, 2020 11:17 am node numbers AFAIK
yes node numbes from the region with the length given for meshing. https://github.com/FreeCAD/FreeCAD/blob ... ls.py#L683
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by user1234 »

Hello!

So i spent some time into meshing and now i am a little bit wiser than before. Now i know some rules for meshing with gmsh.

- If you have more regions to mesh, you have also to mesh the regions on the neighbor faces, else it could be that the purpose mesh region will be ignored (mostly on torri).

- Torri (on a round part the fillets) should be defined at last, else they will be ignored.

- Meshing at first the rough meshes, then the fine meshes, else also some mesh region will be ignored.

- When defined boundaries edges, the whole surface will be defined the same. This is often too fine (RAM expensive).

Anyways gmsh ignores some regions, but much better than before. For example the long shaft part is too fine and feed RAM, even though it is defined rougher. But it works.

Greetings
user1234

1.png
1.png (397.57 KiB) Viewed 1180 times
2.png
2.png (295.38 KiB) Viewed 1180 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by bernd »

Great!

What des the last picture mean. What can not be defined?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by bernd »

works great here


face_on_cylinder_region.FCStd
(431.76 KiB) Downloaded 50 times

screen.png
screen.png (216.55 KiB) Viewed 1137 times
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by user1234 »

Hello!

Thanks for looking for it!

On small parts with few surfaces, meshing regions works very good. But with parts with more faces (but also not big complicated parts), it does not work properly. If i want that the meshing works, i must always order the regions definitions in the tree. Else only one or two surfaces (out of four or five) will be meshed correctly (on ever part i tried) and get jacobian errors. Also when i try only get a valid mesh, i must define some regions, else i get jacobian errors because the elements big size differences.

For what i need to mesh regions? I often have long shafts with detailed ends. Mostly it is only for comparison with the calculations. But also i must be safe that all works. I am pretty sure, that you know what i mean as you are also a technician. And some nasty things on shafts are the transition from larger to smaller diameters.

For example:
bernd wrote: Mon Dec 14, 2020 3:50 pm What des the last picture mean. What can not be defined?
1.png
1.png (721.38 KiB) Viewed 1098 times
This are the bearings of a shaft (greens circles). Because the force is vertical, i expect peaks on FEM calculations because the force are going till the tangent --> 90° when you looking into the shaft axis. So i wanted to only fine meshing the seams of the bearing, to get valid results (or better say, to get rid of the peaks, which are not real there). But when i did that, the whole surface is fine what is unnecessary.
3.png
3.png (27.98 KiB) Viewed 1098 times
So i did that the other way. I defined the counter forces and fix the shaft only on points on the shaft. Now i get the expected results and also the real nasty peak, what i tried to get visual.
2.png
2.png (519.18 KiB) Viewed 1098 times
I expected the peak, but when you calculate the shaft conventionally, you do not get the peak, see diagram above. Conventionally i get a maximum (first near, without running a running x --> on lenght of the shaft) of |39.78| N/(mm)^2 on bearing of the bigger side of the shaft.

Note, that is the half of the truth, because on the the FEM calculation is no Torque. But i think that is not possible in the way i needed. But FEM calculations is for me just for verification and analyze for possible unexpected results. Also note, that above is no real project. It is just a testcase for FreeCAD.

You did a great work in FreeCAD and thank you for that.

bernd wrote: Fri Dec 04, 2020 11:20 am yes node numbes from the region with the length given for meshing.
I did not understand from where you get the information how to fine MeshSize for breps. I digging the documentation in gmsh for hours and did not find that. Only when you built up a geometry IN gmsh and MeshSize. But not on brep imports and get nodes numbers for the imports.

Sorry for bad english
Greetings
user1234
BDL42
Posts: 221
Joined: Mon Jun 06, 2022 5:55 pm

Re: issues with region meshing and jac < 0 (0.19dev master)

Post by BDL42 »

bernd wrote: Wed Dec 02, 2020 11:40 am
user1234 wrote: Tue Dec 01, 2020 9:57 pm Also the warning Group meshing for analysis is set to true in FEM General Preferences. Are you really sure about this? You could run into trouble! : is that a serious issue? I can not uncheck this setting in the preferences, because it is grayed out.
yes, I have seen here and there problems with gmsh and this setting. Usually it should be deactivated by default, but is seams activated by default. Deactivate it with:

- Tools --> Edit Parameters
- Mod --> Fem --> General --> AnalysisGroupMeshing --> Double click on the word true --> a widget opens --> set it to false
- check Fem preferences
- restart FreeCAD to be sure the value is saved
This is still the case as of today, with yesterdays git build.

Code: Select all

OS: Pop!_OS 22.04 LTS (pop:GNOME/pop)
Word size of FreeCAD: 64-bit
Version: 0.21.0.33127 (Git)
Build type: Unknown
Branch: master
Hash: a669e4423a32174eef1a65c65f718fb55ecf042f
Python 3.10.6, Qt 5.15.3, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.1
Locale: English/United States (en_US)
Installed mods: 
  * fasteners 0.4.56
  * kicadStepUpMod.backup1663010049.9382765
  * Render 2023.2.3
  * Help 1.0.3
  * A2plus 0.4.60k
  * fcgear 1.0.0
  * lattice2 1.0.0
  * kicadStepUpMod 10.18.8
Group meshing was turned on, and greyed out. The default solver is set to None.
Mine is set to 0, which shows up as None.
For the record, the tree in Parameter Editor to find the setting is now:
BaseApp > Preferences > Mod > Fem > General

For the record, this WRONG setting caused gmsh to repeatedly fail with cryptic messages. I wasted a lot of time with my models, trying to figure this out. Please, please change this default for the next build. This is a totally unnecessary gotcha, that doesn't need to exist!
Post Reply