Newbie: openscad -> FEM model problem

About the development of the FEM module/workbench.

Moderator: bernd

keithsloan52
Veteran
Posts: 2336
Joined: Mon Feb 27, 2012 5:31 pm

Re: Newbie: openscad -> FEM model problem

Post by keithsloan52 »

shinkansen wrote: Fri Nov 26, 2021 5:48 pm I'm going to chalk this up to "the openscad feature doesn't work".
Well I don't think at this point that is a valid position. Your solid could have been created using the Part workbench using booleans of Part solids.
Are you also going to say the Part workbench does not work? You have already maligned the lines you see when you then found out that the problems are somewhere else. Maybe @user1234 or somebody else with more experience of using the FEM workbench can resolve.
shinkansen
Posts: 15
Joined: Thu Nov 18, 2021 9:45 pm

Re: Newbie: openscad -> FEM model problem

Post by shinkansen »

Perhaps, I'll rephrase that then,

"The openscad feature doesn't work on my model at present and I've given it so much time to it that the time saving that openscad gives me isn't worth it. It's perfectly possible I'm doing something dumb but I've had a reasonable stab at working it out and got nowhere. I feel like I'm banging my head on a brick wall and that it would be a further waste of my time to continue trying at present."

As previously discussed the location of the non-positive Jacobian vertexs are not coincident with the lines visible in the mesh (so the lines, while annoying are probably nothing to do with the errors).

I can create the part with the freecad drafting tools but I find this slow and cumbersome compared with openscad. This is more likely a statement about my skill base than anything else (there are probably people out there with the reverse problem).

I realise we've got nowhere with this but thank you for your time and help - it is much appreciated and I did not mean to sound grumpy.

If someone knows how I can pickup my cutout and reuse it please let me know - all I can manage is to replicate the based solid rather than replicate the hole.
keithsloan52
Veteran
Posts: 2336
Joined: Mon Feb 27, 2012 5:31 pm

Re: Newbie: openscad -> FEM model problem

Post by keithsloan52 »

You previously posted this screen shot
9C5F1C2A-20BD-47B5-884C-7191065442B1.jpeg
9C5F1C2A-20BD-47B5-884C-7191065442B1.jpeg (419.89 KiB) Viewed 2266 times
The green dots point to the nonpositive jacobian vertex right?
I am not that familiar with the FEM workbench. Please could you upload your FreeCAD file such that is ready for simulation. i.e. to be able to reproduce the green dots.
This post https://forum.freecadweb.org/viewtopic.php?f=18&t=55755 suggest using Gmsh, so what tool did you use to create the FEMMesh? It suggest a finer mesh, does your green dot display change with a finer mesh?
Did you try https://forum.freecadweb.org/viewtopic. ... 04#p479604
user1234
Veteran
Posts: 1396
Joined: Mon Jul 11, 2016 5:08 pm

Re: Newbie: openscad -> FEM model problem

Post by user1234 »

shinkansen wrote: Fri Nov 26, 2021 8:06 am "set it in the first order and max. mesh elemet is 5mm, it works flawless." when you say this do you mean you can run the simulation without error or something else?
No, since your model have no inputs for an analysis. But non positive jacobian is a typical error when the mesh is too rough. Post a file here with FEM inputs. Just a hint: clear the mesh before posting here (not delete the object), the n the file size is much smaller. Go to the FEM workbench , right click on the mesh and click to Clear FEM mesh, So the settings are saved, but the mesh is away. So i can rerun gmsh with the same settings easily.
0.png
0.png (148.08 KiB) Viewed 2170 times

Just said, i also so not think, that issue is openscad related.

Greetings
user1234
Laurie Hartley
Posts: 301
Joined: Mon Feb 27, 2017 5:33 am
Location: Australia

Re: Newbie: openscad -> FEM model problem

Post by Laurie Hartley »

shinkansen wrote: Fri Nov 26, 2021 5:48 pm I started to draw this in the conventional way but I'm finding it torture.

Can someone point me to something that will make it easy to copy the pocket I'm using to draw the dogbone cut out so I only have to draw it once? Thanks
Your object is symmetrical through 360 degrees yes. If so perhaps you can create one quarter of your model and use the polar array tool in the draft workbench on it to create the full object.

One more thought - sell torture is not good for you. I am guessing you like to use primitives rather than sketches. If that is the case then you could do yourself a great service by watching a master of the part workbench at work - Bugman!

https://youtu.be/0ww0a739AaQ

A few tips - to get the most out of his work slow the view speed down to 0.25 and pay particular attention to how he uses the “settings” in the transform tool and also the “refine shape” option at about 7:30.

If you can create your model in FreeCAD using these techniques I think you will have no problem meshing your object.


Hope this helps.
keithsloan52
Veteran
Posts: 2336
Joined: Mon Feb 27, 2012 5:31 pm

Re: Newbie: openscad -> FEM model problem

Post by keithsloan52 »

Laurie Hartley wrote: Wed Dec 01, 2021 11:27 am
shinkansen wrote: Fri Nov 26, 2021 5:48 pm I started to draw this in the conventional way but I'm finding it torture.

Can someone point me to something that will make it easy to copy the pocket I'm using to draw the dogbone cut out so I only have to draw it once? Thanks
Your object is symmetrical through 360 degrees yes. If so perhaps you can create one quarter of your model and use the polar array tool in the draft workbench on it to create the full object.

One more thought - sell torture is not good for you. I am guessing you like to use primitives rather than sketches. If that is the case then you could do yourself a great service by watching a master of the part workbench at work - Bugman!

https://youtu.be/0ww0a739AaQ

A few tips - to get the most out of his work slow the view speed down to 0.25 and pay particular attention to how he uses the “settings” in the transform tool and also the “refine shape” option at about 7:30.

If you can create your model in FreeCAD using these techniques I think you will have no problem meshing your object.

Hope this helps.
@Laurie Hartley @user1234 My reading of the situation is @shinkansen is a seasoned OpenSCAD user who wanted to perform some FEM analysis on his models. There are quite a few people who much prefer coding their models than using the Gui of a CAD program. He/She joined the forum on the 18th November and last visited 28th November 10 days, the only posts made were to the FEM section on this topic, I suspect we will not see him/her again, they will have given up and gone away to bad mouth the FreeCAD OpenSCAD workbench. This is not an uncommon occurrence in my experience. To my mind there is NOT concrete evidence that the problem is because the model was created with OpenSCAD and I think @user1234 is of the same opinion. Very frustrating that they gave up without uploading a FreeCAD file to test.
Laurie Hartley
Posts: 301
Joined: Mon Feb 27, 2017 5:33 am
Location: Australia

Re: Newbie: openscad -> FEM model problem

Post by Laurie Hartley »

[quote=keithsloan52 post_id=550985 time=1638437
[/quote]

Thanks for your post Keith. Not to worry on to the next challenge :)
user1234
Veteran
Posts: 1396
Joined: Mon Jul 11, 2016 5:08 pm

Re: Newbie: openscad -> FEM model problem

Post by user1234 »

keithsloan52 wrote: Thu Dec 02, 2021 9:23 am To my mind there is NOT concrete evidence that the problem is because the model was created with OpenSCAD
True.

- open FreeCAD
- open *.scad file
- open FEM workbench
- add analysis
- create mesh from *.scad result (max. 5mm, 1st order, 24 elements per curve, maybe can be done simpler)
- add material to *.scad result
- add a fix constraint
- add force constraint
- run analysis
- (optional: create a vtk post pipeline result for better visualization)
- win

0.png
0.png (879.09 KiB) Viewed 1808 times

Done in less then 5 min. And you can not make the workflow simpler, this is the minimum you have to do for a FEM in all CADs. The writing here takes 4 times more time.

Greetings
user1234
shinkansen
Posts: 15
Joined: Thu Nov 18, 2021 9:45 pm

Re: Newbie: openscad -> FEM model problem

Post by shinkansen »

Thanks - that's very helpful. Two things needed: 1st order meshing and finding a way to redo the mesh once the options were set (ie double clicking on the mesh element in the tree to recover the "task" pane which had hidden by then). Hence the problem was the default 2nd order meshes and me not realising this wasn't being recomputed unless I double clicked to get the task and applied it.

Now the model runs and produces reasonable results (considering the mesh).

So some remaining questions:

-I'd like to refine my mesh in interesting areas (esp around curves), I note user1234 set "24 elements per curve" but I don't have an option for that in my gmesh settings. Any idea how I can set this?

- I'm interested in plotting the strains which I can do by using eyy etc in a user defined plot. However, I cannot find options to display a scale/colorbar or changing the range displayed.

- I'd like to turn off the mesh in results view because this hides the detail but I can't find an option for that.

Thnks!
user1234
Veteran
Posts: 1396
Joined: Mon Jul 11, 2016 5:08 pm

Re: Newbie: openscad -> FEM model problem

Post by user1234 »

shinkansen wrote: Tue Dec 07, 2021 3:11 pm Two things needed: 1st order meshing and finding a way to redo the mesh once the options were set
Just said: 1st order is not that exactly as 2nd, but second needs much more RAM and is picky on curvatures. But for a good first estimation the 1st order is pretty well. Also when the 2nd order will not work due too rough mesh and to much RAM, a 1st order with a very fine mesh is also sometimes acceptable.

Redo mesh, just doubleclick and rerun gmsh, or first right click on the mesh, clear mesh, and then doubleclick on gmsh and rerun.


shinkansen wrote: Tue Dec 07, 2021 3:11 pm -I'd like to refine my mesh in interesting areas (esp around curves), I note user1234 set "24 elements per curve" but I don't have an option for that in my gmesh settings. Any idea how I can set this?
You need 0.20 for that. It is always a good idea to use the newest version for FEM.


shinkansen wrote: Tue Dec 07, 2021 3:11 pm - I'm interested in plotting the strains which I can do by using eyy etc in a user defined plot. However, I cannot find options to display a scale/colorbar or changing the range displayed.

- I'd like to turn off the mesh in results view because this hides the detail but I can't find an option for that.
I can only guess what you meaning, this?
0.webm
(859.99 KiB) Downloaded 24 times

Greetings
user1234
Post Reply