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/)
-   -   [snappyHexMesh] SnappyHexMesh howto assign boundary patches (https://www.cfd-online.com/Forums/openfoam-meshing/61475-snappyhexmesh-howto-assign-boundary-patches.html)

linnemann November 25, 2008 02:49

SnappyHexMesh howto assign boundary patches
 
Hey all just an FYI..

If you are using Salome to create your geometry. (CAElinux is a live dvd with salome installed if you want to try it out)

You have the option to explode your geometry into faces give them names like vel_inlet press_outlet etc.. and export each face to their own .stl file.

exporting to an ASCII .stl will allow you to edit the text and give each solid names.

You can then use these multiple files in snappyHexMesh (haven't tried this so don't know if it handles multiple files).

The other way is to combine the face .stl files into a fully defined solid by appending each separate .stl file into one by for example using a command like this. (assuming it is a cylinder)

cat inlet.stl >> assembly.stl
cat outlet.stl >> assembly.stl
cat walls.stl >> assembly.stl

Then you have a fully defined solid and provided you have given the three solids names these will be added to your final boundaries file and you can specify the inlet/oulet conditions as usual after running snappyHexMesh.

Hope this helps anyone.

Regards

markc December 8, 2008 08:22

Hello All, Also I am impres
 
Hello All,

Also I am impressed of the possibilities of snappyHexMesh.

One comment on the thread of Niels and one new question.

Comment:
The procedure described by Niels might work but than the edges (and nodes) of the different files must exactly coincide. I did something similar using Rhino but because all surfaces were meshed separately, edges showed gaps, causing SHM to fail. So it might only work if you are able to mesh all surfaces in one go and assign the mesh patches to its corresponding surfaces. In my version of Rhino this is not possible, possibly in Salome it is.

Question:
I want to add a surface layer of cells which are aligned with the local surface, as described in the UM. This could be done by the field layer. Using the igloo tutorial I did the following:
>>>
igloo_region0
{
nSurfaceLayers 5;
}
<<<

After playing some with other parameters I finally found that layers were indeed added as desired but: they are left in a separate set (faceSet layerFaces) while the mesh itself remains unchanged.

What am I doing wrong? How can I make the utility to incorporate the set in the mesh? Is it kept separate due to quality constraints?

Best regards,

Mark

linnemann December 8, 2008 08:43

Hello Mark You are right ab
 
Hello Mark

You are right about that but I'm not meshing the faces in Salome I'm only exporting to a .stl and I haven't had any problems yet in this method.

The only problem is that you cant define the quality of the triangles used to interpret the geometry.

But again if you manually mesh the faces you could surely run into problems.

Thanks for the update Mark and I'm sorry I cant answer your question :-)

Regards Niels

marico February 19, 2009 06:25

Hi Niels an others, i'm try
 
Hi Niels an others,

i'm trying to create an mesh with snappyhexmesh. The geometry was an step file which I splitted with Salome in 5 different STL's (ASCII). After that I renamed them by the desired region name, e.g. "solid Inlet ... endsolid" in the .stl-Files. Then I put them together in one .stl file.
My problem is now that snappyhexmesh works without failure but creates no mesh, the blockMesh remains. I also tried to use the 5 single .stl files with the same effort. What can I do wrong? (btw: I used the motorBike tutorial and changed it)
Curiosly snappyhexmesh generates patches during solution named after <filename>_<regionname> which do not appear in ParaView...
I'm a bit confused about stls, solids, patches, regions, faces...

Thanks for your help!
Marco

wolle1982 February 19, 2009 08:52

hi marco, see my thread wit
 
hi marco,

see my thread with sHM manual for stl files and multi regions

http://www.cfd-online.com/cgi-bin/Op...show.cgi?1/101

--> in paraview you have to mark some patches in the list, apply, dismark one, apply. then you'll see the created patches in the patchlist.

also name in stl file like this: "solid inlet......endsolid inlet"

please read my thread with the manual and tell me, if it's a good advice for snappyHexMesh.

greetz

wolle1982 February 19, 2009 09:00

Hi Mark, I tried to answer you
 
Hi Mark, I tried to answer your question in another thread. for the rest, maybe, this helps.

http://www.cfd-online.com/OpenFOAM_D...es/1/9255.html

marico February 19, 2009 10:38

Hi (Hallo) Wolfgang ;) Very
 
Hi (Hallo) Wolfgang ;)

Very nice manual! I found out, what my problem was: the exported STL-Files were of units "mm" instead of OF using "m"...

Thank you (until the next question)!

Marco

wolle1982 February 20, 2009 03:12

Hi Marco, in first instance
 
Hi Marco,

in first instance I was facing the same problem, that the CAD program is in mm. But the CAD program isn't exact enough to do all a factor 1000 smaller.

There is the program "AdMesh" (search for in forum or directly on Net) which can resize STL files.

Other solution, which works fine for me, is blockMesh "convertToMeters 1000;" snappyHex it and afterwards use command

transformPoints -scale "(0.001 0.001 0.001)"

on final Mesh.

roth February 20, 2009 19:07

Marco, Also check out surfa
 
Marco,

Also check out surfaceTransformPoints in OpenFOAM.

Michael

marico March 4, 2009 07:25

Hi Michael, thanks for the
 
Hi Michael,

thanks for the hint! Now I'm able to get a mesh and have the following questions:

AFTER sucessfull running of snappyhm I get the directories 1,2 maybe 3... how do I move on.
Do I HAVE to copy the mesh files into polyMesh directory?
My simulation is an INTERNAL flow, but the patches maxY, minX ... still remain in the boundary file though they have of course no faces. Deleting them makes paraFoam crash. Leaving them inside makes solver complaining about missing BC's for these patches.
Is the only way to solve this to define "dummy BC's" for maxY... ?

Thanks
Marco

wolle1982 March 4, 2009 09:13

hi michael, yes, move the m
 
hi michael,

yes, move the mesh from directory 3/polymesh (it's the mesh with boundarylayer) to a new case directory constant/polymesh don't simulate in the old case (or delete the folders 1,2,3 before).

are you sure to have the locationinmesh point set INSIDE your geometry. since this point tells sHM which mesh to keep and since you're simulating an inside flow you have to do this.

marico March 4, 2009 09:39

Hi Wolfgang, thanks for you
 
Hi Wolfgang,

thanks for your reply. yes I'm sure... shm did everything right (internal mesh is correct!) except of the thing with max,min patches (without containing faces) which remain in boundary file!

Marco

hemph March 4, 2009 11:13

Hi Marco, Just to check. Did
 
Hi Marco,
Just to check. Did you remember to change the number of patches in the boundary-file after deleting maxX, maxY etc?

Rasmus

wolle1982 March 4, 2009 12:13

Hi Marco, I think I fixed y
 
Hi Marco,

I think I fixed your problem. I used the example case you can see here

http://www.cfd-online.com/OpenFOAM_D...s/1/11251.html

I corrected the locationInMesh Point to (0 0 0) which is inside the sphere-ellipse geometry. Then I ran snappyHexMesh and got a polyMesh with the following boundary-file

As you can see, the inlet, outlet,... (=X_Min,..) patches have 0 faces.

after copying the polyMesh-folder to the constant-folder you have to edit the boundary-file to make it look like this

delete all patches, you don't need and don't forget to correct the number of listed patches at the top of the file (here: from 8 to 2).

Now set your 0-folder-files right and you'll be fine (my case worked this way as an inside stream).

If this doesn't help, please post your error message.

greetings
wolfgang

wolle1982 March 4, 2009 12:25

boundaryfile before correction
 
boundaryfile before correction


boundaryfile after correction


marico March 5, 2009 02:39

Hi Wolfang and Rasmus, than
 
Hi Wolfang and Rasmus,

thanks, that was the hint... small little 12, I've never seen before.. ;)

Marco

wolle1982 March 5, 2009 03:13

Great. And for all other I'
 
Great.

And for all other I'm adding the before and after boundary file as text now (because damn file-upload doesn't work).

boundary-file created by sHM:

8
(
top
{
type patch;
nFaces 0;
startFace 30453;
}
inlet
{
type patch;
nFaces 0;
startFace 30453;
}
outlet
{
type patch;
nFaces 0;
startFace 30453;
}
boden
{
type patch;
nFaces 0;
startFace 30453;
}
back
{
type patch;
nFaces 0;
startFace 30453;
}
front
{
type patch;
nFaces 0;
startFace 30453;
}
sphere
{
type wall;
nFaces 1184;
startFace 30453;
}
ellipse
{
type wall;
nFaces 2944;
startFace 31637;
}
)

and boundary file like it has to be:

2
(
inlet
{
type patch;
nFaces 1184;
startFace 30453;
}
outlet
{
type patch;
nFaces 2944;
startFace 31637;
}
)


amitmangtani May 18, 2012 01:10

Unable to see mesh created by snappyHexMesh in ParaFoam
 
Hello,

I am also facing the same problem of not viewing the mesh around the sphere in ParaFoam generated by snappyHexMesh.Only able to see the blockMesh.
Also. I am not able to access the user manual you have attached.. Can you suggest me a solution for this problem??

Regards,
Amit Mangtani

Quote:

Originally Posted by wolle1982 (Post 187504)
hi marco,

see my thread with sHM manual for stl files and multi regions

http://www.cfd-online.com/cgi-bin/Op...show.cgi?1/101

--> in paraview you have to mark some patches in the list, apply, dismark one, apply. then you'll see the created patches in the patchlist.

also name in stl file like this: "solid inlet......endsolid inlet"

please read my thread with the manual and tell me, if it's a good advice for snappyHexMesh.

greetz


Cagatayemre January 22, 2018 16:58

1 Attachment(s)
Hello Wolfgang, I have a similar problem. My reference case is flange. I have an stl file of a cylinder. Cylinder is inside a large box. When I run snappyHexMesh, boundary patches of the cylinder doesnt occur inside constant/polymes/boundary. A file
called /sets/wrongFaces occurs inside polymesh folder. My snappyHexMeshDict file is attached. Thank you very much.
Quote:

Originally Posted by wolle1982 (Post 187504)
hi marco,

see my thread with sHM manual for stl files and multi regions

http://www.cfd-online.com/cgi-bin/Op...show.cgi?1/101

--> in paraview you have to mark some patches in the list, apply, dismark one, apply. then you'll see the created patches in the patchlist.

also name in stl file like this: "solid inlet......endsolid inlet"

please read my thread with the manual and tell me, if it's a good advice for snappyHexMesh.

greetz



All times are GMT -4. The time now is 22:31.