CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [CAD formats] Creating waterproof STL using snappyHexMesh or salome (https://www.cfd-online.com/Forums/openfoam-meshing/170210-creating-waterproof-stl-using-snappyhexmesh-salome.html)

priyankap July 8, 2019 04:04

Quote:

Originally Posted by Tobi (Post 629093)
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


Hi Tobias,


I am using Salome to generate mesh for a little complex geometry. I am trying to use NETGEN 1D-2D-3D algorithm to create the mesh with very small cell size. And here are the problems that I am facing:


1. It takes ages to create this mesh.
2. The number of cells are very high.
3. When I import it to OpenFOAM, I get too many non-orthogonal faces.



Is there any other faster way to mesh this complex geometry using Salome to avoid non-orthogonal errors?


Is there any tutorial or something similar which explains complex meshing using salome?


Thanks!

Tobi July 8, 2019 08:00

Hi,

the generation of 3D meshes within the Salome toolbox takes long, that is a fact. However, non-orthogonality in the mesh is not a big deal for OpenFOAM. You have to choose the appropriate numerical schemes for that. E.g. for the laplacian scheme, you can use a limited one.

Good luck, by the way - your reply is off-topic as this thread is about surface triangulation for snappyHexMesh

sisetrun July 8, 2019 08:08

Hey Priyanka,

Do you need NETGEN 1D-2D-3D?

have you tried to mesh your surface with 2D: Triangle Mefisto (max element area) and 1D: Wire Discretisation (Number of Segments)?
You can define individual 1D or 2D lines/areas in the geometry mode...

Until now, I always got a nice (yes, sometimes big) STL for all my geometries by playing around with these two parameters!
By constructing your patches as individual 2D surfaces in Salome, to can combine them into one big regionSTL and use this 2D STL as input for snappyHexMesh to generate your simulation mesh.

Give it a try!

priyankap July 9, 2019 04:40

Hello sisetrun,


I have no experience in using the snappyHexMesh tool of OpenFOAM. I have been using Salome for meshing and then ideasUnvToFoam to export this mesh to OpenFOAM.


But this time I am using relatively complex geometry and I am not able to do it with a routine meshing in Salome for this geometry.


Is there any OpenFOAM document which explains snappyHexMesh technique in detail?



My main problem is the non-orthogonal faces in my mesh. That too, it has max 89.7 degrees of non-orthogonal faces. So I can't use this for my simulation.


Can you please help me figure out with the possibility to eliminate these non-orthogonal faces?


Thank you!

sisetrun July 11, 2019 04:08

Well snappyHexMesh is quite powerful but way to complex to explain it in detail in a post... I have made and still make all my meshes with this tool.

I think you have to search the internet for information. There is a lot of info from videos to ppt available out there... With some experience, just come back and as more specific questions to your problem!

HappyS5 July 23, 2019 20:12

Can Salome Mesh Be Used As Precursor For SnappyHexMesh?
 
Hello,

Forgive my ignorant question but I am new.

I know blockMesh can be used to create a starting mesh for snappyHexMesh. Can Salome be used to create a starting mesh?

Specifically, I will be meshing a flow nozzle with moderately complex geometry.

Thanks!

sisetrun July 24, 2019 03:56

Hey,

yes it can be used for sure.

Create a proper block and mesh the block in the meshing tool.

Create the mesh by "assign a set of hypotheses" with 3D Automatic Hexahedralization. Select 1D as local length and assign your cell size of the background mesh!

Mesh the Block and export the mesh as UNV file...

Before you start snappy, create the background mesh by typing ideasUnvToFoam in the command line... this will create the background mesh in the constant/polymesh!

haze_1986 November 6, 2019 00:04

I am curious which function is used in blender to produce the watertight geometry?

Rasmusiwersen November 12, 2019 03:53

Work around for AutoCAD
 
Hi Tobias and all readers,

Thank you for the post, I've been troubled with coarse .stl files created by AutoCAD. Instead of exporting a "perfect" circle the .stl file was more like a polygon with 12 edges. I found a workaround in AutoCAD which helped me to a satisfacory (read not optimal!!) result, namely settings FACERES=10 instead of 0.5, the latter being the default value. The polygon now has a lot more edges, although it is not a "perfect" cylinder still.Ļ

Hopefully this will help whoever might deal with similar problems.

/Rasmus

Arghavani November 20, 2019 06:08

Snappyhexmesh
 
Hi,
I am doing a project that it needs a stl file but due to the snappyhexmesh I dont have uniform hex mesh but I want to have uniform hex mesh inside and outside of stl file (I mean in the background geometry as well) is there any suggestion how to make it with out using snappyhexmesh ?


kind regards,
Arghavn

HappyS5 November 20, 2019 17:28

LocationinMesh
 
Quote:

Originally Posted by Arghavani (Post 750268)
Hi,
I am doing a project that it needs a stl file but due to the snappyhexmesh I dont have uniform hex mesh but I want to have uniform hex mesh inside and outside of stl file (I mean in the background geometry as well) is there any suggestion how to make it with out using snappyhexmesh ?


kind regards,
Arghavn

I apologize if I am misunderstanding your question. Is it possible that you can specify locationinmesh in a region outside the inside region to get meshing throughout? locationinmesh is part of snappyHexMesh programming.

Arghavani November 21, 2019 01:52

Quote:

Originally Posted by HappyS5 (Post 750318)
I apologize if I am misunderstanding your question. Is it possible that you can specify locationinmesh in a region outside the inside region to get meshing throughout? locationinmesh is part of snappyHexMesh programming.

No Problem. let me make it clear. in my stl file, I have two-cylinder and they are located in front of each other with some distances what I meant about the inside of the geometry is actually only the surface of these two cylinders and about outside I meant the mesh between these two cylinders.

kind regards,
Arghavan

Bazinga November 21, 2019 01:57

Quote:

Originally Posted by Arghavani (Post 750346)
No Problem. let me make it clear. in my stl file, I have two-cylinder and they are located in front of each other with some distances what I meant about the inside of the geometry is actually only the surface of these two cylinders and about outside I meant the mesh between these two cylinders.

kind regards,
Arghavan

If you really need a uniform mesh you might want to consider using blockMesh.

Arghavani November 21, 2019 02:06

Quote:

Originally Posted by Bazinga (Post 750347)
If you really need a uniform mesh you might want to consider using blockMesh.

Thank you. I am doing my background mesh by blockMesh, but I think I can do the uniform mesh by fluent for the stl file.

otaolafr May 1, 2020 10:04

hello, I have always worked with Onshape software as it is a great CAD software and free for educational porpuses. but if I separate the surfaces in the exportation, they are not watertight. I come across this post that is super interesting and helpful, but there is one thing I not sure of understanding, from what I read, Salome and blender can generate separate STL for each patch and that together they WILL be watertight. but is it possible to import an STEP file to salome to recover the separate patches stls? as I want to keep using Onshape to generate my geometries, can I export them and import them in salome this purpose?

so add two previous step where I create the CAD model in Onshape and copy it to salome for the patch separation.
for info, Onshape has several exportation type files including: parasolid, acis, step, iges, solidworks, collada, rhino, gltf, stl.
can it be done? or should I stop looking around for a solution for this issue?
thanks in advance, franco

Arghavani May 1, 2020 10:13

Hello,
Unfortunately, I am not using Salome. I don't have any information about it.


best,
Arghavan

otaolafr May 12, 2020 13:31

hello, i am having issues with salome when creating the mesh,
i exported my STEP file and wanted to mesh the surface,
I followed as tobi have done in this video: https://youtu.be/oZi1TAri4fk?t=419
i created the groups of each patch (in geometry, new entry/group/new group and select the respectively faces), inlet, outlet, symmetry plane1, symmetry plane2, and walls (all the others) (for the walls group I choose select all option and then deselect the inlet, outlet symmetry plane1 and 2).
then went to mesh,
mesh/create mesh/assign a set of hypotheses/3D automatic hexahedralization (then in hypotesis construction i did not select anything)
went to 1D option hypotesis, local lenght and selected a really small length (0.00005)
but when I generate the mesh I got several errors (645 in total) with the types are the followings:
inverted elements generated.
unexpected geometry. wrong number of wires: 134.
unexpected geometry. face must have 4 sides but not 3.
bug 3 sides found instead of 4.
I known that my geometry has absurdly small details, and the step is watertight as i created myself.
any idea where to go? if necessary here is the step file (sorry it was too big for the forum directly) https://drive.google.com/file/d/15-K...ew?usp=sharing
thanks, a lot

Tobi May 13, 2020 05:40

Quote:

Originally Posted by otaolafr (Post 768200)
hello, I have always worked with Onshape software as it is a great CAD software and free for educational porpuses. but if I separate the surfaces in the exportation, they are not watertight. I come
....
....
can it be done? or should I stop looking around for a solution for this issue?
thanks in advance, franco

Dear Franco,

I did not read your last post but to the one above. Yes, you can export the STEP file from your CAD system, import it to SALOME, create your patches there, triangulate the whole surface, use the previous created patches for your single STLīs, export all single STL files and combine it to one. Done.

otaolafr May 13, 2020 06:01

Quote:

Originally Posted by Tobi (Post 770217)
Dear Franco,

I did not read your last post but to the one above. Yes, you can export the STEP file from your CAD system, import it to SALOME, create your patches there, triangulate the whole surface, use the previous created patches for your single STLīs, export all single STL files and combine it to one. Done.

hello tobi! i tried this, as the video of you doing it (that someone post it was not functional anymore...) but as I was following you in youtube i found the video about suzanne case and follow the steps that you created the "external box".
but when i gave my geometry (my last post) the mesh in salome shows a lot of errors,
i have done several approaches,
1. export the model in 1 stl, it is watertight, but as i can not achive to separate the patches with surfaceAutoPatch, i finish with only one patch for the snappyHex so i can not add the boundary layers in the "wall" patch. (after this i separate the patches (post snappy) with topoSet and creatPatch -overwrite) but if is not perfect by all means.
2. export the model in several stls, it is not watertight and from what i get from surfaceCheck (the quantity of defects I am not sure that a surfaceHook would work...). also i am in the finer resolution i can export the mesh from the CAD.
3. export the model in STEP, and tried your method with SALOME, following the same steps as you for suzanne https://youtu.be/oZi1TAri4fk?t=395 but i got a lot of errors (that i copied in last post).
the model is watertight, and it is a solid before i exported in STEP file...
it would be possible to have a look about my file?
thanks, best regards, franco


All times are GMT -4. The time now is 08:32.