CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[CAD formats] Creating waterproof STL using snappyHexMesh or salome

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree52Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2016, 17:19
Default
  #21
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Yes I agree
In my case, I am using STEP files from grabcad which are sometimes really crazy. So I just wanted to state, that the GUI can also handle complex geometries. However, I think doing everything in python is much faster but I cannot do it because I am too lazy to learn Salome + Python in a good way...
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 22, 2016, 11:23
Default
  #22
Member
 
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12
enginpower is on a distinguished road
Thanks to all for this helpful discussion.

I'm a beginner, and me too I need a solution for a similar problem. Sorry to need a more deep help, but maybe it will be useful for all beginners.

The procedure you explained is the following (I'm quoting one of you):
  • Generate the cad geometry: I exported the geometry from the CAD, all ok
  • Explode them to faces, group them if needed: I import the STL file in Salome. Then I explode it in faces, and I group them as I need (inlet, wall, surface2refine, etc...). Right? Is necessary to explode, or could I create the group anyway?
  • Mesh each face/group with same mesh size: I move to Mesh section of Salome, then I create a mesh. Which algorithm? I should mesh only the surfaces? How? Only 2D meshes?Just default mesh settings? Please, could you provide more clear information?
  • export each face/group individually in STL format: Will each mesh be exported separately? Or what?
  • Then modify each exported stl file (solid -> solid outlet, endsolid -> endsolid outlet) and combine them into one single file: is there an order to follow? which part is the up-part? No mind?
  • perform surfaceCheck to check whether the combined stl file is closed: how to use this command?
Sorry if most of them are stupid questions, but it will help me a lot (I'm very newbie).



Thanks
enginpower is offline   Reply With Quote

Old   January 3, 2017, 05:50
Default
  #23
Member
 
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11
sisetrun is on a distinguished road
Hey Valentine,

to your second point:
try to export the geomerty as .step from you CAD.
Then, load the .step in salome Geometry! Make you patches with New Entity - Group - Crate Groupe!
After that, you switch to Salome Mesh by clicking on the icon. Here, you can mesh your groups. Select the geometry. Mesh type is Triangular. Then, select your 2D (Triangle Mefsto) and 1D (Wire). The 1D should be the same for contacting groups. This is important waterproof stl. You can play around with the discretisation hypothesis go get the proper result.
After you "stl-meshing" you can export the parts of your geometry as stl and continue with the steps you already have mentioned.

Hope this works for you...

Best regards

Sebastian
sisetrun is offline   Reply With Quote

Old   January 3, 2017, 07:50
Default
  #24
Member
 
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12
enginpower is on a distinguished road
good explanation for that

Thanks

Is it possible that dividing a solid in stl patches like inlet, wall and outlet become huger when meshed?
What I mean is that: I meshed a solid as stl file and I succeeded, then I divided it following your procedure in three parts, that are inlet, wall, and outlet stl files, but when I meshed with the same snappyHexMesh conditions it overcomes the need of RAM.
I divided it to set the buondary conditions later in the simulation step.

Is it possible?

Last edited by enginpower; January 3, 2017 at 11:55.
enginpower is offline   Reply With Quote

Old   January 22, 2017, 08:57
Default
  #25
Member
 
Vignesh Rajendiran
Join Date: Aug 2016
Location: Chennai, India
Posts: 62
Rep Power: 9
Vignesh2508 is on a distinguished road
Hi Tobi,

Your post was interesting. I was trying to mesh a car stl file and the mesh I got after doing sHM seems quite bad. But i did not know if it is because of the reason you mentioned in your post. Could you take a look at the pictures i attached and give me a reply.


Thanks

Vicky
Attached Images
File Type: jpg Mesh_overview.jpg (190.1 KB, 255 views)
File Type: jpg Zoomed_mesh.jpg (111.3 KB, 204 views)
File Type: jpg Zoomed_mesh_rear.jpg (122.1 KB, 187 views)
File Type: jpg Fully_zoomed.jpg (105.3 KB, 164 views)
Vignesh2508 is offline   Reply With Quote

Old   January 23, 2017, 08:54
Default
  #26
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hey Vikki,

how would you like to have a good mesh if your resolution is not good? However, you mean the small misfits of snapping? I think you can handle that with different settings, change and analyze the feature edges etc.

If someone is interested, check out this. I think there is no need for further discussions then

https://www.cfd-online.com/Forums/op...e-scratch.html
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 23, 2017, 10:15
Default
  #27
Member
 
Vignesh Rajendiran
Join Date: Aug 2016
Location: Chennai, India
Posts: 62
Rep Power: 9
Vignesh2508 is on a distinguished road
Hi Tobi,

Thank you for your reply. This might be the problem. My stl file is a 3d model of a car. But I was trying to do a 2D simulation from that. My idea was to do a sHM on the model and then finally do an extrudeMesh to convert that to a 2D mesh. In my blockmesh file i tried to choose a domain of thickness 0.1m.

In this domain of 0.1m the model is not protruded straight but has an angle. This might be the reason why i got the problem on the interface between the surface and the mesh. Even if i add layers that is not properly applied on the surface.

Can you suggest me a method to do a 2D simulation of that without this problem?


Thanks


Vicky
Vignesh2508 is offline   Reply With Quote

Old   January 30, 2017, 09:59
Default
  #28
Member
 
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12
enginpower is on a distinguished road
Hello,
I followed the methods explained here to get a closed STL file but with different patches. As in the tutorial, I have different patches and I created correctly submesh to accord the mesh on common edges. It works greatly.

When I checked the surface I get this:
Code:
Surface is not closed since not all edges connected to two faces:
    connected to one face : 192
    connected to >2 faces : 0
I watched again all the model and I found that the problem is that some surfaces of the same group is not connected. How is it possible?
I have the group of inlet surfaces, the group of wall surfaces etc... and looking to the group of wall (the same mesh), I have some surfaces that are not connected. Again the problem is not between inlet surface group and wall surface group, but in the same group. How to solve that? It seems does not occur in the tutorials

Thanks for your help

Last edited by enginpower; January 30, 2017 at 11:56. Reason: grammar
enginpower is offline   Reply With Quote

Old   August 4, 2017, 09:09
Default
  #29
New Member
 
Oliver K
Join Date: May 2017
Posts: 15
Rep Power: 9
silencebreak is on a distinguished road
Hey there,

I'm trying to create a waterproofed STL for OpenFOAM with salome. I've created them in other cases without problems the way Tobi described.

After I created a solid out of the geometry in salome, which is done without any errors, the surfaceCheck in OpenFOAM tells me that my case isn't waterproofed. So how does it come that salome says it's waterproofed and openfoam says it isn't?
The error is that some are single and some a multiply connected. If interested I can upload the .hdf file

Thank you in advance
silencebreak is offline   Reply With Quote

Old   August 7, 2017, 02:10
Default
  #30
Member
 
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11
sisetrun is on a distinguished road
Hello Oliver,

Did you mesh your solid before exporting as an stl?

have a look at Tobis screencast on youtube:

https://www.youtube.com/watch?v=NBmB...GLaiE2oL3CN4WA

Best regards
sisetrun is offline   Reply With Quote

Old   August 10, 2017, 08:11
Default
  #31
New Member
 
Oliver K
Join Date: May 2017
Posts: 15
Rep Power: 9
silencebreak is on a distinguished road
Quote:
Originally Posted by sisetrun View Post
Hello Oliver,

Did you mesh your solid before exporting as an stl?

have a look at Tobis screencast on youtube:

https://www.youtube.com/watch?v=NBmB...GLaiE2oL3CN4WA

Best regards
Thanks for the reply. Actually I thinks it's been an error of handling Salome with an extreme case of open boundaries. So I just draw my stuff from the scratch and now it worked after creating a single solid
silencebreak is offline   Reply With Quote

Old   November 24, 2017, 16:40
Default
  #32
Member
 
Ali Noaman Ibrahim
Join Date: Sep 2015
Location: US_Chicago
Posts: 97
Rep Power: 10
alinuman15 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Dear Vignesh,

if you have several surfaces in Salome you are not allowed to export these surfaces in the geometry module. You have to mesh the surfaces in the mesh module to make a homogeneous discretization on the lines. If you export these STL files then you end up with a waterproofed STL. That is the way I prefer for all STL's.

To check it, just load your exported STL into paraview. You will see that the contact lines will not share the same triangle points.
Dear Tobi:-
I have struggled with exporting mesh as stl file by using Salome for a while. Look at the inserted image where when I mesh the surface in mesh module and export it as stl , I face that warning and even when I skip it, it will not produce the good waterproofed stl file.
Any clue how to handle that ?
Knowing that I installed different versions of Salome ( now Meca 2017) but the problem still there.
Thanks !
Attached Images
File Type: jpg stl_Salome.jpg (98.7 KB, 101 views)

Last edited by Tobi; November 24, 2017 at 16:42. Reason: Removed broken link
alinuman15 is offline   Reply With Quote

Old   November 24, 2017, 16:45
Default
  #33
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

the error message you get is normal. I got the same message too. Hmmm... actually never focused that problem. Can you upload the STL file of that particular patch? You can try exporting
Code:
LC_ALL=C
start Salome and try it again. However, Salome itself should overwrite (temporary) based on that output:
Code:
WARNING:salomeContext:Overwriting environment variable: LC_NUMERIC=C
I am using the Salome version given at Salome-Platforms.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 24, 2017, 19:39
Default
  #34
Member
 
Ali Noaman Ibrahim
Join Date: Sep 2015
Location: US_Chicago
Posts: 97
Rep Power: 10
alinuman15 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,

the error message you get is normal. I got the same message too. Hmmm... actually never focused that problem. Can you upload the STL file of that particular patch? You can try exporting
Code:
LC_ALL=C
start Salome and try it again. However, Salome itself should overwrite (temporary) based on that output:
Code:
WARNING:salomeContext:Overwriting environment variable: LC_NUMERIC=C
I am using the Salome version given at Salome-Platforms.
Thank you for replying Tobi :-)
I typed LC_ALL=C in terminal (without defining OF environment) and it defined LC_ALL environmental variable fine. But, I got the same warning when tried to export the inserted file agin on mesh module.
Waiting for your feedback
Note:- You could find the regionSTL.stl ( for the whole patches) on the following link:-
https://drive.google.com/drive/u/0/f...l82TEl6NNXJFGP
Attached Files
File Type: gz stlFile.tar.gz (2.3 KB, 1 views)

Last edited by alinuman15; November 24, 2017 at 22:20.
alinuman15 is offline   Reply With Quote

Old   November 25, 2017, 01:48
Default
  #35
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Can you dump the study as python Script and share it? The warning is common.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 25, 2017, 09:01
Default
  #36
Member
 
Ali Noaman Ibrahim
Join Date: Sep 2015
Location: US_Chicago
Posts: 97
Rep Power: 10
alinuman15 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Can you dump the study as python Script and share it? The warning is common.
I attached the dump study and have another question ( in addition to the warning):-
As you can see the triangle and background stls together represent the bottom of the cube. If my focus is to refine them only with snappyHexMesh (knowing that all the rest stls are patches as well), is that true to include just triangle and background inside the features subdictionary of castellatedMeshControls as follows:-
features
(
{file "triangle.eMesh"; level 3;}
{file "background.eMesh"; level 3;}
);
?
Thanks again!
Attached Files
File Type: gz dump.py.tar.gz (2.0 KB, 4 views)
alinuman15 is offline   Reply With Quote

Old   November 25, 2017, 09:38
Default
  #37
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

if you want to refine surface this is wrong. Please check that: https://holzmann-cfd.de/training/sta...enfoam-project

You study and the export is working as expected. Maybe you are doing: File -> Export -> STL. That is wrong. Go to mesh module, right click on the object you want to export -> Export -> STL. Done.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 25, 2017, 12:38
Smile
  #38
Member
 
Ali Noaman Ibrahim
Join Date: Sep 2015
Location: US_Chicago
Posts: 97
Rep Power: 10
alinuman15 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,

if you want to refine surface this is wrong. Please check that: https://holzmann-cfd.de/training/sta...enfoam-project

You study and the export is working as expected. Maybe you are doing: File -> Export -> STL. That is wrong. Go to mesh module, right click on the object you want to export -> Export -> STL. Done.
I did it that way but the warning is still showing up.

Last edited by alinuman15; November 27, 2017 at 18:00.
alinuman15 is offline   Reply With Quote

Old   August 31, 2018, 12:34
Default guidelines for Blender exporting .stl?
  #39
New Member
 
Riccardo
Join Date: Jan 2016
Posts: 16
Rep Power: 10
RANSES is on a distinguished road
Dear all

I profit from the open thread for asking few questions on the same topic.
I'm working on ABL (Atmospheric Boundary Layer), simulating the flow-field around buildings or city districts (real scale), with a geometry whose dimensions can easily reach more than one kilometer in radius. Recently I tried to simulate the Shinjuku district of Tokyo in OpenFoam, facing a huge number of difficulties, starting from the construction of the mesh.
As stressed before in this thread, I use blender to create/edit the geometries and to export them in .stl, for finally meshing in snappyHexMesh.
The original .stl file on which I'm working can be easily downloaded from https://www.aij.or.jp/jpn/publish/cfdguide/index_e.htm , it is free of copyright. Since the high instability of the simulations, I also fear there could be a problem in the geometry.
In this regard I would like to ask you if Blender could still be considered as a useful/proper software for fixing these problems (from a geometry check, there are many of them: non manifold edges, bad contain. edges, intersect face, etc)....and if there are some good suggestions on how to export in the best way a .stl from blender to be finally used in OpenFOAM... e.g. the geometry should be triangulated or quadrilateral?
What I fear is that, in some conditions, there could be better software than blender for modeling the geometry to be used in CFD. Is this a legit fear?
If you could share your personal experience and suggestions, it would be much appreciated.
enginpower likes this.
RANSES is offline   Reply With Quote

Old   February 1, 2019, 01:57
Default Clarifications regarding SnappyHexMesh
  #40
New Member
 
SOORYA PRAKASH
Join Date: Aug 2018
Location: Mumbai
Posts: 1
Rep Power: 0
SOORYA is on a distinguished road
Dear Sir,


I am an MTech Student from IIT Bombay. I am simulating continous casting of steel systems. I have made the geometry in SolidWorks. Have imported the .STEP file in Salome and created various groups like inlet outlet as .STL files. I have merged the various .STL files in terminal as single .STL file. While performing snappyHexMesh command on the single merged .STL file i am not getting many features similar to my SolidWorks geometry. Unable to find out the reason for the same. Kindly help.


Mail Id: sooryaprakashj@gmail.com

Regards,
Soorya Prakash
Attached Images
File Type: jpg SolidWorks actual geometry.jpg (89.0 KB, 72 views)
File Type: jpg Parts Missing.jpg (121.6 KB, 67 views)
File Type: png Distorted Parts..png (12.0 KB, 66 views)
SOORYA is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] Creating STL files with regions for snappyHexMesh nusivares OpenFOAM Meshing & Mesh Conversion 4 August 7, 2018 20:09
[snappyHexMesh] With FreeCAD: creating waterproof STL files? robob OpenFOAM Meshing & Mesh Conversion 11 April 29, 2018 11:33
[snappyHexMesh] Creating stl file for snappyHexMesh from xyz coordinates Vignesh2508 OpenFOAM Meshing & Mesh Conversion 2 April 25, 2017 08:43
[snappyHexMesh] What types of stl files are needed in snappyhexmesh? phandy OpenFOAM Meshing & Mesh Conversion 1 February 19, 2015 05:36
[snappyHexMesh] Experimentally obtained STL file for internal Flow SnappyHexMesh Irish09 OpenFOAM Meshing & Mesh Conversion 9 April 7, 2012 08:50


All times are GMT -4. The time now is 20:40.