Creating waterproof STL using snappyHexMesh or salome
2 Attachment(s)
Dear all,
the last few years I experienced the necessity of a good surface triangulation while using snappyHexMesh. Most people are using common CAD software packages and export single surfaces as STL files. These STL files have two big problems, if they represent a closed volume:
Both (and especially the second one) influences the mesh generation in a very bad way. The good thing is that in some case it does not matter ;). The bad thing is, that you could really get unexpected results (I made a lot of tests with my collegue Dr. Alexander Vakhrushev). Some unexpected results were:
Not water proofed STL have a further bad behavior in the point of feature edges. STL's (or region STL) that share share a curvatured edge will end up with two feature edges due to the fact that the STL's share not the same points (and therefore not the same edge). After creating the feature edges, you will extract both feature edges. Now ask yourself, which line should be used? (Here one comment, please check your featureEdge mesh using paraview and correct it if its wrong with blender).
Code:
surfaceMeshTriangulate myNewSurface.stl Attachment 47016 The procedure is as follow (short form summarized and clear):
My personal suggestions are:
If you have to mesh a lot of different designs, I would prefer the generation of the STL using snappyHexMesh. You also can implement this way into a optimization loop. So good luck and keep foaming, hope this will help somebody. |
So far freecad 0.16 seems to generate "waterproof " stl
|
Non -closed
1 Attachment(s)
Hi Tobi,
Can you tell me how to create a closed stl file when we combine individual surfaces (stl file) manually after labeling them ? I always get "surface is not closed" when i do a surface check for the combined stl file but it does not happen for the stl file of the part. Can you tell me what i am doing wrong ?? I have attached the files PS: I used salome for creating the solid which i exploded into individual surfaces. |
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. |
1 Attachment(s)
Quote:
Thanks for the quick reply. I tried as you suggested, still i get "surfaces is not closed" :confused:. By the way when i view the combined stl file in paraview the contact lines share same triangle points !! |
1 Attachment(s)
Hi,
if you check our STL it is not closed. Each surface has different points on the interface. The interface does not share the points of both surfaces. See the picture (for you it should be obvious). Check out my STL's in my tutorials and you see that the interface (the line that is shared by both) has the same points on both surfaces. |
Hi Tobi,
I understood the mistake that i made during meshing in salome. Thanks for pointing it out. Now its working :D |
Hey Tobias,
I tried to reproduce your workflow: -stl generation in salome -created groups -created edges of the groups -change to mesh mode -triangulated the geometry by meshing -made mesh groups of the patches BUT... when I combine the patches in in big file, I still get unconnected surfaces... What point do I miss? I want the stl file as input for cfMesh! Thanks a lot for your advice! Best regards, Sebastian At this point, I |
Hi Sebastian,
Did you keep the edge length same for all faces (groups) while meshing ? |
Hey Vignesh,
Jap, I did not change any settings for the meshing! How is your workflo9w? Which geometry parts do you use? I am not sure if I have to use the whole geometry to mesh (how do i capture feature edges) or if a mesh the grouped geometry parts on their own with the same settings? Just from viewing the stl in paraview, it was fine. The triangles in the areas where the patches touch each looked quite nice... Thanks again... Best regards, Sebastian |
Hi Sebastian,
My workflow in salome is
Hope this helps you Quote:
|
Thanks a lot for your fast replay!
I will give it a try on my geometry and report the result... |
All good (for the moment :D )
Thank you so much! |
1 Attachment(s)
Hi vigneshTG,
I'm using meshLab to convert text file to stl format. After that, I've used surfaceCheck to check my geometry. End of surfaceCheck, surface is not closed errors are shown no matter how I try to fix with admesh or meshLab. How should I fix that problem? Please advice me!! thanks |
Then use salome to create your STL.
If you have single STL's it will not work. |
Dear Tobi,
Thanks for your reply and suggest. Can I use salome even my terrain is topography? |
Dear Tobi,
I was having problems for days and now that actually hits the spot. I will try Salome right quick, thanks. Utkan |
The salome user interface is a little clunky, and for anything complex or repetitive you will need the script interface. This script interface can also help in understanding the work flow needed. In the attached salome python script I have created the stl files and UNV file for the snappyhexmesh tutorial for Chtmultiregion.
In this script you can see:
Code:
# -*- coding: utf-8 -*- |
I do not agree with your statement. I am using Salomes GUI for really high complex geometries and till now I could do anything without the python interface. Of course you can get a lot of information out of the python script and it allows to use it for optimization but the necessity of python for complex geometry - no, I cannot agree.
Sent from my HTC One mini using CFD Online Forum mobile app |
Quote:
|
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... |
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):
Thanks |
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 |
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? |
4 Attachment(s)
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 |
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 |
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 |
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: 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 |
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 :) |
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 |
Quote:
|
1 Attachment(s)
Quote:
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 ! |
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 Code:
WARNING:salomeContext:Overwriting environment variable: LC_NUMERIC=C |
1 Attachment(s)
Quote:
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 |
Can you dump the study as python Script and share it? The warning is common.
|
1 Attachment(s)
Quote:
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! |
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. |
Quote:
|
guidelines for Blender exporting .stl?
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. :) |
Clarifications regarding SnappyHexMesh
3 Attachment(s)
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 |
All times are GMT -4. The time now is 18:57. |