SketchUp

Mesh generators, CAD programs, and other tools
bomastudio
Posts: 36
Joined: 22 Aug 2012, 13:43
Antispam: Yes

SketchUp

Post by bomastudio »

I solved the problem of drawing my 3d models! I use SketchUp (a free CAD modeller originally by Google) which is the simplest and rapid CAD I ever use. I use it also with my students in Architecture. And now I can use it also with the engineer ones!!! After the model is fine I export it, with a plugin (http://forums.sketchucation.com/viewtopic.php?t=43307) in *.iges format. So I can open it directly with Elmer or mesh it with Netgen. :D :D
rainer.ochs
Posts: 22
Joined: 19 Oct 2012, 01:24
Antispam: Yes

Re: SketchUp

Post by rainer.ochs »

Do you get results?
I am experimenting with the same set-up, but am trying to simulate magnetic fields and therefore have multiple bodies - the simulation needs an air cube to simulate the fields.
Importing the multi-body iges into ElmerGUI results in only one body, the shapes are not separated. That is reasonable, as the isges converter only creates one brep of the model - I know because I am the one who actually wrote it.
When I import the iges into NETGEN there the different shells are separated into different bodies. When I generate the mesh there and export it in elmer format, I can read it in in ElmerGui and can see separate bodies. I also can identify surface and body index and adapt the .sif file accordingly.
I do not get results however, I have convergence problems and the solver stops.
I have tried examples from the forum. I can calculate the example, but when I create the same geometry with the above work-flow it does not work anymore.

I am an absolute fan of SketchUp, I have written a optical simulation package in it. The IGES converter was part oft his work. It is a great advantage to model the geometry in a easy to use graphical package.

Has anyone an idea why this does not work that way?
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: SketchUp

Post by Juha »

Hi,

if you have a simple & smallish example (sif+mesh), i could try investigating the
convergence troubles... ?

Regards, Juha
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: SketchUp

Post by mzenker »

Hi Rainer,

if your bodies share faces, do you get a conformal mesh at the interface?

Matthias
rainer.ochs
Posts: 22
Joined: 19 Oct 2012, 01:24
Antispam: Yes

Re: SketchUp

Post by rainer.ochs »

I started with the example AWG24 from this forum. I downloaded it and can run the solver from ElmerGUI and am getting results.
Then I created a similar model in SketchUp and exported to IGES. This was loaded into Netgen (4.9.13) meshed with standard settings and exported to elmer. (I also have tried much finer meshes with similar results). Then I open the mesh in ElmerGUI and identify the face and body indexes. This is the only thing I changed in the .sif file: body and boundry indexes.

I get:
5001 0.3219E+07
ERROR:: IterSolve: Failed convergence tolerances.

It really does not converge, the numbers are getting bigger and bigger.

I am a novice to FEM Simulation and Elmer, though have many years experience in simulations (electrical and optical).
I come from the application side and sometimes have trouble to understand all the mathematics that is involved here. I have a practical problem with a magnetic setup I want to look into. As this is geometrically complex the import form M-CAD is essential.
My impression is, that Elmer is a very powerful tool, however it is quite hard to get going. A more intuitive approach for model building should be a valuable contribution. If I can get this work I have some Ideas for an easier work-flow based on SketchUp .

@ Juha: I greatly appreciate your help!
@ mezenker: What is a conformal mesh? I have been looking into with ElmerGUI - though it is difficult for me to tell I have the impression that I have two superimposed meshes - what would explain the problem. I guess that the outer mesh should have the same nodes as the inner mesh.
How can I generate something like that? I tried the work-flow with salome that is described in the wiki. I got different bodies in the mesh, but only one surface,so I cannot define boundary conditions.

Rainer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: SketchUp

Post by mzenker »

Hi Rainer,

a conformal mesh is when the meshes of two bodies with a common interface share nodes at the interface. IF they don't, no heat or electrical current can flow from one bodya into the other. You can see if your mesh is conformal by closely inspecting it in ElmerGUI or netgen (or whatever mesher you use), or by making a small test simulation where, for example, one surface is set to a certain temperature, and heat flows from this surface into the whole geometry.
Meshing a geometry exported from 3D CAD is still a problem with free meshers, because the exported data (like STEP) have duplicated interfaces between bodies. Repairing this might work sometimes: netgen has healing functionality for STEP format (and also iges, I believe). Salome is said to be able to repair many of such cases. Algorithms of Salome have been inported to gmsh ("cut and merge faces"). If non of those work, you have a problem. For not too complex geometries, the basic CAD functionality of meshers like gmsh might be used to build the geometry directly or repair the duplicated interfaces by hand. At the moment, there is no better free solution I know of.

HTH,

Matthias
rainer.ochs
Posts: 22
Joined: 19 Oct 2012, 01:24
Antispam: Yes

Re: SketchUp

Post by rainer.ochs »

Thanks for the Information. After your suggestions I inspected my nets and found, that most probably the nets of the bodies just were superimposed nets with no common interface.
I tried with salome and the procedure given in the wiki and succeeded in importing my IGES there - The trick is to export each body seperately and then follow the procedure. I had not read the last sentence in the wiki with tells how to separate the surfaces.
When I follow this procedure I am able to build a net that simulates! A quick check indicates that the data is reasonable.
The procedure however is very complicated and involves a lot of steps - It is possible but hardly practical for real work. I would like to simplify that.
The initial problem is, that my IGES converter does not recognize the fact that there are bodies inside of bodies and does not create a hollow object outside. If I do it this way (I tried with a CAD-System) then I get the problem you describe, that I have duplicate surfaces at the interface.

One solution would be to create a script in salome to ease the process. Or I find a way to get rid of the duplicate surfaces and can use NETGEN what I would prefer.

Regards, Rainer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: SketchUp

Post by mzenker »

Hi Rainer,

I myself have this problem from time to time. I use gmsh and have made a scilab script which post-processes a 2D mesh, identifying and removing duplicated faces and merging nodes on duplicated lines. It is not mature enough to share it, and it has shortcomings: merging of partially overlapping surfaces does not work yet, and the processing time is long.
If you find a better way to get a CAD exported geometry meshed, even with partially overlapping surfaces and surfaces which do match only with a certain tolerance, many people would be happy...

Matthias
rainer.ochs
Posts: 22
Joined: 19 Oct 2012, 01:24
Antispam: Yes

Re: SketchUp

Post by rainer.ochs »

I have created an automated setup to convert the SketchUp model to a working multi-body mesh!
The big advantage of this procedure is, that all relevant geometric data is defined in one program. Once the .sif file matches to the body and boundary definitions, changes in geometry or meshing parameters can be processed without further manual interaction.

The geometry is defined in SketchUp. Here also the body indexes are assigned as well as boundary indexes for the boundaries that are needed for boundary conditions. A SketchUp Plug-In then converts the bodies separately to IGES. The Plug-In also creates a python script that handles all the processing in Salome. Starting Salome with this script produces a mesh that can, after conversion with ElmerGrid directly be used for ElmerSolver. All processing steps are controlled by the plugin.
There may be multiple bodies, bodies may be submerged within other bodies or share faces. Partly overlapping however is not permitted.

As far as I have tested it by now it is working great. I will work with it for a while and then publish it.
If someone wants to do some testing on the current beta state please let me know.

Rainer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: SketchUp

Post by mzenker »

Hi Rainer,

good to hear that such a workflow exists. If you manage to handle partly overlapping surfaces let me know... ;)

Matthias
Post Reply