Newbie: openscad -> FEM model problem

About the development of the FEM module/workbench.

Moderator: bernd

shinkansen
Posts: 13
Joined: Thu Nov 18, 2021 9:45 pm

Re: Newbie: openscad -> FEM model problem

Post by shinkansen »

That's the same as I get but then if I run the model I get the no-positive jacobian error.

If you look at the model there are some horizontal lines on the outer ring next to the two countersunk screwholes on either side. These lines are not there in openscad. There is also a vertical line next to the screw holes. These are a feature of the way the model is drawn but aren't actually there in the shape (it's the overlap of two cubiods). These lines show up in the meshing (and shouldn't) as if there is an internal wall.

I can't find out where the dodgy nodes are but I suspect the problem is something to do with these lines showing up.
keithsloan52
Posts: 2153
Joined: Mon Feb 27, 2012 5:31 pm

Re: Newbie: openscad -> FEM model problem

Post by keithsloan52 »

shinkansen wrote: Thu Nov 25, 2021 9:28 am That's the same as I get but then if I run the model I get the no-positive jacobian error.

If you look at the model there are some horizontal lines on the outer ring next to the two countersunk screwholes on either side. These lines are not there in openscad. There is also a vertical line next to the screw holes. These are a feature of the way the model is drawn but aren't actually there in the shape (it's the overlap of two cubiods). These lines show up in the meshing (and shouldn't) as if there is an internal wall.

I can't find out where the dodgy nodes are but I suspect the problem is something to do with these lines showing up.
How are you meshing the Object created by OpenSCAD import?
I tried with Gmsh and could not get it to produce a FEMMesh but as I said I am not that familiar with the FEM workbench.
Anyway as a test I used the Mesh Workbench to create a Mesh of difference001 and that seemed fine 841points and 1738 facets, so I tried the NetGen tool and that seemed to create a FEMMesh okay. Is that what you have tried? Could you upload your file i.e. with what FEM constraints you are trying to test etc.
Image 25-11-2021 at 09.45.jpeg
Image 25-11-2021 at 09.45.jpeg (406.44 KiB) Viewed 324 times
File too large so here on dropbox https://www.dropbox.com/sh/t0cgmh9y081c ... JIxpa?dl=0
keithsloan52
Posts: 2153
Joined: Mon Feb 27, 2012 5:31 pm

Re: Newbie: openscad -> FEM model problem

Post by keithsloan52 »

Those lines I think you are referring to are due to the way the model has been built/scripted. If you toggle cube11 and cube12 you will see this. However if the shape is FEMmeshed okay I would have expected it to be okay.
shinkansen
Posts: 13
Joined: Thu Nov 18, 2021 9:45 pm

Re: Newbie: openscad -> FEM model problem

Post by shinkansen »

It doesn't matter what the constraints are the non positive Jacobian is the same. Choose any constraints and run the model and it generates the errors.

I've managed to highlight the mesh points with errors and the model is riddled with them. Usefully the errors aren't at the geometry lines I previously thought suspect (althougth I'd like to be able to remove these lines because they affect the meshing). Instead the errors are on the cylindrical cutouts (holes) in the model. I'll try to post and image.
shinkansen
Posts: 13
Joined: Thu Nov 18, 2021 9:45 pm

Re: Newbie: openscad -> FEM model problem

Post by shinkansen »

FEM simulation errors
Attachments
Screenshot_20211125_201733.png
Screenshot_20211125_201733.png (167.33 KiB) Viewed 217 times
keithsloan52
Posts: 2153
Joined: Mon Feb 27, 2012 5:31 pm

Re: Newbie: openscad -> FEM model problem

Post by keithsloan52 »

shinkansen wrote: Thu Nov 25, 2021 8:21 pm (althougth I'd like to be able to remove these lines because they affect the meshing). Instead the errors are on the cylindrical cutouts (holes) in the model. I'll try to post and image.
I think it might help if you understand at a deeper level what happens when you import a OpenSCAD script.
OpenSCAD deals itself with Meshes so when doing unions and the like it can create a new mesh from the existing objects so when it unions two cubes there will be no trace of where the two objects touched or overlapped unlike FreeCAD Objects

OpenSCAD scad file is scripting with language constructs, it can produce a CSG file which is basically the same but minus the higher level language constructs. The CSG file basically says create this sized cube at this position, perform a union etc.
Now FreeCAD which is built on top on OCC OpenCascade understands Brep shapes. So the way the OpenSCAD importer works is to get FreeCAD to create a CSG from the SCAD file, it then parses the CSG script and where the script says create a Box it creates a Box, where it says perform a Union it performs a Union, so what you are seeing with the Differences001 is the result of interpreting the scad file. The same FreeCAD objects could be created by the Parts Workbench. I tried creating a compound from Differences001 but it did not seem to make any difference to the FEMMesh. The thinking being that rather than a series of objects use an Object which just has a single Brep Shape. One thing you might try is to export as a STEP file and reimport with the FreeCAD import STEP option set to create a single compound object. Note: There are some regressions with STEP processing with OCC 7.5, I think you need to either go with OCC 7.4.0 ( Old ) or OCC 7.5.2
user1234
Posts: 891
Joined: Mon Jul 11, 2016 5:08 pm

Re: Newbie: openscad -> FEM model problem

Post by user1234 »

shinkansen wrote: Thu Nov 25, 2021 8:23 pm FEM simulation errors
No wonder, the mesh is way to rough that any FEM can work, especially the thin round places. Netgen generally does not work on my computer, but when i use gmsh (gmsh4.8.4), set it in the first order and max. mesh elemet is 5mm, it works flawless. Because of the thin circles, i would increase the Mesh Size From Curvature as high as your RAM while the FEM calculation can take. Maybe a finer meshregion on the sides woulbe be also good.

Greetings
user1234
Attachments
0.png
0.png (313.74 KiB) Viewed 157 times
shinkansen
Posts: 13
Joined: Thu Nov 18, 2021 9:45 pm

Re: Newbie: openscad -> FEM model problem

Post by shinkansen »

I've already tried changing the mesh size and it makes no difference to the error.
shinkansen
Posts: 13
Joined: Thu Nov 18, 2021 9:45 pm

Re: Newbie: openscad -> FEM model problem

Post by shinkansen »

"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?
shinkansen
Posts: 13
Joined: Thu Nov 18, 2021 9:45 pm

Re: Newbie: openscad -> FEM model problem

Post by shinkansen »

I'm going to chalk this up to "the openscad feature doesn't work".

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
Post Reply