CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

SnappyHexMesh howto assign boundary patches

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

Like Tree4Likes
  • 4 Post By linnemann

Reply
 
LinkBack Thread Tools Display Modes
Old   November 25, 2008, 02:49
Default Hey all just an FYI.. If yo
  #1
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 439
Rep Power: 13
linnemann will become famous soon enough
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
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   December 8, 2008, 08:22
Default Hello All, Also I am impres
  #2
Senior Member
 
Mark Couwenberg
Join Date: Mar 2009
Location: Netherlands
Posts: 130
Rep Power: 7
markc is on a distinguished road
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
markc is offline   Reply With Quote

Old   December 8, 2008, 08:43
Default Hello Mark You are right ab
  #3
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 439
Rep Power: 13
linnemann will become famous soon enough
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
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   February 19, 2009, 06:25
Default Hi Niels an others, i'm try
  #4
Member
 
Marco Müller
Join Date: Mar 2009
Location: Germany
Posts: 94
Rep Power: 7
marico is on a distinguished road
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
marico is offline   Reply With Quote

Old   February 19, 2009, 08:52
Default hi marco, see my thread wit
  #5
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 7
wolle1982 is on a distinguished road
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 is offline   Reply With Quote

Old   February 19, 2009, 09:00
Default Hi Mark, I tried to answer you
  #6
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 7
wolle1982 is on a distinguished road
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
wolle1982 is offline   Reply With Quote

Old   February 19, 2009, 10:38
Default Hi (Hallo) Wolfgang ;) Very
  #7
Member
 
Marco Müller
Join Date: Mar 2009
Location: Germany
Posts: 94
Rep Power: 7
marico is on a distinguished road
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
marico is offline   Reply With Quote

Old   February 20, 2009, 03:12
Default Hi Marco, in first instance
  #8
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 7
wolle1982 is on a distinguished road
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.
wolle1982 is offline   Reply With Quote

Old   February 20, 2009, 19:07
Default Marco, Also check out surfa
  #9
Member
 
Michael Roth
Join Date: Mar 2009
Location: Guelph, Ontario, Canada
Posts: 46
Rep Power: 7
roth is on a distinguished road
Marco,

Also check out surfaceTransformPoints in OpenFOAM.

Michael
roth is offline   Reply With Quote

Old   March 4, 2009, 07:25
Default Hi Michael, thanks for the
  #10
Member
 
Marco Müller
Join Date: Mar 2009
Location: Germany
Posts: 94
Rep Power: 7
marico is on a distinguished road
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
marico is offline   Reply With Quote

Old   March 4, 2009, 09:13
Default hi michael, yes, move the m
  #11
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 7
wolle1982 is on a distinguished road
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.
wolle1982 is offline   Reply With Quote

Old   March 4, 2009, 09:39
Default Hi Wolfgang, thanks for you
  #12
Member
 
Marco Müller
Join Date: Mar 2009
Location: Germany
Posts: 94
Rep Power: 7
marico is on a distinguished road
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
marico is offline   Reply With Quote

Old   March 4, 2009, 11:13
Default Hi Marco, Just to check. Did
  #13
Senior Member
 
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 7
hemph is on a distinguished road
Hi Marco,
Just to check. Did you remember to change the number of patches in the boundary-file after deleting maxX, maxY etc?

Rasmus
hemph is offline   Reply With Quote

Old   March 4, 2009, 12:13
Default Hi Marco, I think I fixed y
  #14
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 7
wolle1982 is on a distinguished road
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 is offline   Reply With Quote

Old   March 4, 2009, 12:25
Default boundaryfile before correction
  #15
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 7
wolle1982 is on a distinguished road
boundaryfile before correction


boundaryfile after correction

wolle1982 is offline   Reply With Quote

Old   March 5, 2009, 02:39
Default Hi Wolfang and Rasmus, than
  #16
Member
 
Marco Müller
Join Date: Mar 2009
Location: Germany
Posts: 94
Rep Power: 7
marico is on a distinguished road
Hi Wolfang and Rasmus,

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

Marco
marico is offline   Reply With Quote

Old   March 5, 2009, 03:13
Default Great. And for all other I'
  #17
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 7
wolle1982 is on a distinguished road
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;
}
)

wolle1982 is offline   Reply With Quote

Old   May 18, 2012, 01:10
Default Unable to see mesh created by snappyHexMesh in ParaFoam
  #18
New Member
 
Amit Mangtani
Join Date: May 2012
Posts: 5
Rep Power: 4
amitmangtani is on a distinguished road
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 View Post
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
amitmangtani is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to assign radiation boundary conditions? Jinfeng CFX 0 January 10, 2009 17:18
SnappyHexMesh generates 8823 patches cricke OpenFOAM Mesh Utilities 4 November 14, 2008 16:28
How to make boundary patches in STL file nzy102 OpenFOAM Mesh Utilities 2 August 29, 2008 13:53
Cyclic boundary conditions for non conformed Patches turnow OpenFOAM Running, Solving & CFD 1 October 19, 2007 01:17
how to assign fan boundary condition yakubu FLUENT 5 January 31, 2007 07:58


All times are GMT -4. The time now is 15:00.