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

snappyHexMesh Boundary Conditions

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

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   June 23, 2011, 00:07
Default snappyHexMesh Boundary Conditions
  #1
New Member
 
Join Date: Jun 2011
Posts: 29
Rep Power: 6
Cyberholmes is on a distinguished road
I have just managed to successfully use snappyHexMesh to mesh a geometry I made in Blender. What I'm now wondering is how I go about assigning boundary conditions to the boundaries in this mesh.

For example, I have a protrusion in my geometry that needs to have a velocity boundary condition set on the boundary at its end. How do I specify that surface?

Thank you.
Cyberholmes is offline   Reply With Quote

Old   June 24, 2011, 11:08
Default
  #2
New Member
 
Join Date: Jun 2011
Posts: 29
Rep Power: 6
Cyberholmes is on a distinguished road
Can anyone shed a little light on this?
Cyberholmes is offline   Reply With Quote

Old   June 25, 2011, 03:14
Default
  #3
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
I think you have to assign a different name to the protrusion and then assign the boundary condition you need to that region.
lovecraft22 is offline   Reply With Quote

Old   June 26, 2011, 01:51
Default
  #4
New Member
 
Join Date: Jun 2011
Posts: 29
Rep Power: 6
Cyberholmes is on a distinguished road
What I don't know is how to assign a name to that region with snappyHexMesh. snappyHexMesh creates a meshing on its own, and it has hundreds of thousands of cells that have random names. I don't know how to specify a region out of that.
Cyberholmes is offline   Reply With Quote

Old   June 26, 2011, 05:19
Default
  #5
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@Cyberholmes: you've got two possible methods:
  1. Pre-define the surfaces in the STL and then associate those names to patches in snappyHexMeshDict. The usual method is to use an ASCII STL (text mode, not binary) and define solids by their names. Edit the motorBike STL example with a text editor, to see what I mean: mesh/snappyHexMesh/motorBike/constant/triSurface/motorBike.stl
  2. Or use createPatch for creating patches after the mesh is complete. An example dictionary is here: applications/utilities/mesh/manipulation/createPatch/createPatchDict
    You can find practical examples on the tutorials, simply by running this command on the tutorials folder:
    Code:
    find . -name createPatchDict
    Visit those cases and see how the Allrun scripts use createPatch and respective dictionary. Keep a look out for the command(s) before createPatch, which will define the face sets to be used by createPatch.
The rest is up to your detective skills

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 26, 2011, 13:00
Default
  #6
New Member
 
Join Date: Jun 2011
Posts: 29
Rep Power: 6
Cyberholmes is on a distinguished road
Thank you so much! You don't know how much of a help you've been!
Cyberholmes is offline   Reply With Quote

Old   June 26, 2011, 14:22
Default
  #7
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

Pre-define the surfaces in the STL and then associate those names to patches in snappyHexMeshDict. The usual method is to use an ASCII STL (text mode, not binary) and define solids by their names. Edit the motorBike STL example with a text editor, to see what I mean: mesh/snappyHexMesh/motorBike/constant/triSurface/motorBike.stl
How can you do that? By editing the stl text file by hand?
lovecraft22 is offline   Reply With Quote

Old   June 26, 2011, 17:10
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi lovecraft22,
Quote:
Originally Posted by lovecraft22 View Post
How can you do that? By editing the stl text file by hand?
It honestly depends on the source of your STL. Examples:
  • Some STL exporters in CAD like applications, can export selected surfaces onto a single STL file, whether ASCII or binary. They export the selection onto a single STL file.
    What we can do is a little bit of text hacking on ASCII STLs, by renaming the solid name and ending that solid with the respective name (see motorBike.stl).
    Then, after each STL has been properly fixed, manually or with a script, we can concatenate the various STL files into a single one.
    With a lot of patience, this can also be achieved with ParaView, by selecting triangles, extracting them and export the extraction to a separate STL file... but this requires a gigantic load of patience and the triangles must already be sized exactly as you want them. Keep in mind that ParaView is not a 3D CAD tool by trade!
  • Or you can use a proper geometry editing tool that can export the STL with the desired surface names. I honestly can't remember with 100% certainty of any geometry editor that does this, but I believe that MeshLab might do this. The other possibilities I can remember are Blender and SALOME. FreeCAD possibly can do this as well.
If you confirm which editor does this, feel free to tell us as well

Best regards,
Bruno
skuznet likes this.
wyldckat is offline   Reply With Quote

Old   June 27, 2011, 18:19
Default
  #9
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
There is a script that allows you to define boundaries in Blender and have it exported to STL. It is mentioned in the thread:

http://www.cfd-online.com/Forums/ope...cii-stlbs.html

I've used it and it works quite well.
mturcios777 is offline   Reply With Quote

Old   June 28, 2011, 10:36
Default
  #10
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 7
flowris is on a distinguished road
This one also shows how to define patches:
tutorials/incompressible/pimpleDyMFoam/wingMotion

The Allrun file shows you what to do.
flowris is offline   Reply With Quote

Reply

Tags
boundaries, boundaryfield, snappyhexmesh

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
Boundary conditions for 2D Navie-Stockes simulation L1011 OpenFOAM 5 December 13, 2012 09:17
Impinging Jet Boundary Conditions Anindya Main CFD Forum 24 January 11, 2012 14:40
Domain Imbalance HMR CFX 3 March 6, 2011 21:10
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 6 April 17, 2010 23:40
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15


All times are GMT -4. The time now is 14:33.