SketchUp - Salome Meshing Work-Flow
Posted: 28 Nov 2012, 01:54
If the simulation geometry is complex or there are multiple bodies involved generating the mesh is a major task.
The mesh generators have GUIs difficult to use so often it is required to code the geometry in the form of a script.
Besides the big effort this is inflexible and error prone.
On the other side there are CAD tools that allow the generation of Geometry in a more intuitive form.
My favourite choice is SketchUp because it is free, has a very intuitive and easy to use GUI and has a scripting interface for extensions and plug ins. And Salome is the only mesher that works satisfactory with multiple imported bodies.
As an Engineer I am interested in a quick and easy to use solution. I have to see what I do and I want to do it quickly. I am optimizing geometry what requires a lot of slightly different geometry to mesh. And I want my bodies and boundaries to have static indexes to reuse the .sif-files
So I have written a plug-in for SketchUp that does the meshing of a complete model using Salome as a mesher.
I have used it for some time and am very satisfied with it. It basically automates the workflow given in the Wiki for Salome in a push-button solution.
It has the following features:
- one or more bodies that may have common faces
- Bodies may be contained within other bodies
- Geometry may be very complex
- the indexes of the bodies can be controlled from the SketchUp model
- the indexes of boundaries can be controlled from the SketchUp model
- Meshing parameters can be controlled from SketchUp.
How it works:
- The geometry is drawn in SketchUp.
- Each body is grouped, the group is named and the name contains a String that denotes the body index ("part1 INDEX=1")
- each boundary that is needed in the simulation for boundary conditions is attached a material. The material name is edited to contain the "INDEX=n" string.
- The function "Elmer Salome Meshing" is executed from the tools menu.
- The plug-in now exports all groups in IGES format, using the name of the group.
- The plug-in generates a python script for Salome
- the plug-in starts Salome with the script as a parameter (at first start the user is prompted to give the location of Salome)
- Salome executes the script, imports the bodies. Then bodies and boundaries are identified from coordinate information SketchUp has placed in the script and grouped in the given order. The model is meshed with the parameters given in SketchUp and saved in .unv-format. when completed a log-file is written.
- As soon as the log file is present the plug-in starts ElmerGrid to convert the unv to elmer format and displays the Salome-log.
7/2013: There was an bug in the template for single bodies.
Rainer
The mesh generators have GUIs difficult to use so often it is required to code the geometry in the form of a script.
Besides the big effort this is inflexible and error prone.
On the other side there are CAD tools that allow the generation of Geometry in a more intuitive form.
My favourite choice is SketchUp because it is free, has a very intuitive and easy to use GUI and has a scripting interface for extensions and plug ins. And Salome is the only mesher that works satisfactory with multiple imported bodies.
As an Engineer I am interested in a quick and easy to use solution. I have to see what I do and I want to do it quickly. I am optimizing geometry what requires a lot of slightly different geometry to mesh. And I want my bodies and boundaries to have static indexes to reuse the .sif-files
So I have written a plug-in for SketchUp that does the meshing of a complete model using Salome as a mesher.
I have used it for some time and am very satisfied with it. It basically automates the workflow given in the Wiki for Salome in a push-button solution.
It has the following features:
- one or more bodies that may have common faces
- Bodies may be contained within other bodies
- Geometry may be very complex
- the indexes of the bodies can be controlled from the SketchUp model
- the indexes of boundaries can be controlled from the SketchUp model
- Meshing parameters can be controlled from SketchUp.
How it works:
- The geometry is drawn in SketchUp.
- Each body is grouped, the group is named and the name contains a String that denotes the body index ("part1 INDEX=1")
- each boundary that is needed in the simulation for boundary conditions is attached a material. The material name is edited to contain the "INDEX=n" string.
- The function "Elmer Salome Meshing" is executed from the tools menu.
- The plug-in now exports all groups in IGES format, using the name of the group.
- The plug-in generates a python script for Salome
- the plug-in starts Salome with the script as a parameter (at first start the user is prompted to give the location of Salome)
- Salome executes the script, imports the bodies. Then bodies and boundaries are identified from coordinate information SketchUp has placed in the script and grouped in the given order. The model is meshed with the parameters given in SketchUp and saved in .unv-format. when completed a log-file is written.
- As soon as the log file is present the plug-in starts ElmerGrid to convert the unv to elmer format and displays the Salome-log.
7/2013: There was an bug in the template for single bodies.
Rainer