CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] snappyHexMesh geometry

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Kristianur

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2009, 08:59
Default snappyHexMesh geometry
  #1
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17
Kristianur is on a distinguished road
Hi

I'm trying to generate a mesh from a stl-file consisting of several different solids and I'm not sure what to type into the geometry subdirectory. I've tried to do it similarly to the motorBike tutorial but it doesn't work.

Here's the message I get when I try running Snappy:

Cannot find triSurfaceMesh starting from "/home/kristian/OpenFOAM/kristian-1.5/run/localHawk/constant/triSurface/LocalHawk.stl"

From function triSurfaceMesh::checkFile(const fileName&, const fileName&)
in file searchableSurface/triSurfaceMesh.C at line 56.

FOAM exiting


Is this because of an error in the geometry subdirectory?

Kristian

btw: I'm a beginner to openFOAM.
Kristianur is offline   Reply With Quote

Old   May 15, 2009, 10:02
Default
  #2
New Member
 
Daniele
Join Date: May 2009
Location: Rome, Italy
Posts: 7
Rep Power: 17
dani is on a distinguished road
Send a message via MSN to dani
Hello Kristian,
make sure to have in the snappyHexMeshDict all the subsequent entries:


geometry
{
NACAgeo1.stl
{
type triSurfaceMesh;
name NACAgeo1;
}
.....
....
refinementSurfaces
{
NACAgeo1
{
// Surface-wise min and max refinement level
level (0 0);
}
}
....
locationInMesh (0.001 0.001 0.001);
....

hi!

dani
dani is offline   Reply With Quote

Old   May 15, 2009, 11:31
Default
  #3
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17
Kristianur is on a distinguished road
Thank you dani.

I've read through the file several times and I'm almost certain I've included the stl-file name correctly everywhere I'm supposed to.

Could any other errors result in the same message?

e.g if there's something wrong with the stl?

I am also not sure about the refinementbox entry. can someone explain to me what exactly the "min" and "max" entries are?
Kristianur is offline   Reply With Quote

Old   May 15, 2009, 12:43
Default
  #4
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17
Kristianur is on a distinguished road
Okay.. I just found out it would be a good idea to check and see if my model was even inside the background mesh. Which it wasn't, so I'm guessing that is the problem.

Why has the origin moved from where it originally was in my SolidWorks-file and what can i do to align it?

Edit: Nope. That didn't solve it either. Any Ideas?
amuzeshi likes this.

Last edited by Kristianur; May 15, 2009 at 13:06.
Kristianur is offline   Reply With Quote

Old   May 15, 2009, 13:44
Default
  #5
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
hi kristianur,

1. min/max refinement level means what is says: force to minimum refinement, and limit maximum. My hint: make both the same (eg. (3 3) then the mesh even looks better.

2. on the STL file: make sure, the STL file contains the region name of the "patch" you want to use and refine. see http://www.cfd-online.com/Forums/ope...e-stlfile.html
remember: the filename is a different from the geometry name inside the file.

3. most CAD progs work in mm. OF and sHM work in m. So maybe your geometry i just 1000times bigger. or if it's offseted from the origin in the CAD prog by 1 mm, in OF it is offseted 1m ! check that! in that case, just mesh 1000times bigger and later transformate with the transformPoints Tool.

hope that helps a little
wolle1982 is offline   Reply With Quote

Old   May 15, 2009, 17:34
Default
  #6
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17
Kristianur is on a distinguished road
Yes thank you, that helped a lot.

I was actually wondering about the
refinementBox
{
type searchableBox;
min (-0.3 -0.4 -0.1);
max ( 3.0 0.4 1.4);
}
entry in the motorBike example. but I saw you hadn't typed it into your example so I guess it's not necessary?

The modell is 790mm long in SolidWorks. Does that mean that it's probably 790m in the stl file?
Kristianur is offline   Reply With Quote

Old   May 18, 2009, 05:06
Default
  #7
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
hi,

yes, the CAD Prog works in mm. the STL File doesn't contain any units. so it says: "lenght 790" eg. importing it into OF which works in m would make it 790m wide. but, as i said, don't worry. just mesh it like this and afterwards use the command
transformPoints -scale "(0.001 0.001 0.001)"
that will solve it. you can check with checkMesh there it prints out the bounding box of your model in m.
Otherwise there are some openSource tools to scale/transform/rotate STL files. just search for...

The searchable box is only a BOX where the mesh will get refined in (the name "searchable" is a little missunderstanding, i know). it is useful in refining the wake area behind a geometry. the searchable box can also be a sphere, as can be seen in the igloo tutorial.
wolle1982 is offline   Reply With Quote

Old   May 20, 2009, 14:24
Default
  #8
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17
Kristianur is on a distinguished road
Thanks.

I think I have understood all that now. There's an option in the export window in SW that allows you to change the units from mm to m f.ex.

But I still can't run my snappy. when I try running it now it tells me that snapControls is undefined:

<< keyword snapControls is undefined in dictionary "/home/kristian/OpenFOAM/kristian-1.5/run/localHawk/system/snappyHexMeshDict"

file: /home/kristian/OpenFOAM/kristian-1.5/run/localHawk/system/snappyHexMeshDict from line 9 to line 180.

From function dictionary::subDict(const word& keyword)
in file db/dictionary/dictionary.C at line 288. >>

Du I have to specify the snapControls for each region in the geometry? If yes, how?

I tried running a code with the exact same syntax on a single body geometry and that worked fine.
Kristianur is offline   Reply With Quote

Old   May 20, 2009, 14:36
Default
  #9
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
hoi,

the error sounds like you've deleted sometihing BEFORE the snapcontrol command. most likely a ";" or "." oder ")" oder "}" .....

no, you don't have to define multi snap control...
wolle1982 is offline   Reply With Quote

Old   May 21, 2009, 09:25
Default
  #10
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17
Kristianur is on a distinguished road
you were right. A missing ";" was the problem.

But here's another (probably simple) question:

What can cause the program to think that the "locationInMesh" is "not inside the mesh or on a face or edge" when in fact it isn't?
I am sure I've positioned the point right next to my geometry and I tried moving it slightly to make sure it's not on a face or edge, and moving it to the edge of the domain and inside the geometry.

no matter where I move it I get the same message.

thanks for all the help.
Kristian
Kristianur is offline   Reply With Quote

Old   May 25, 2009, 03:56
Default
  #11
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
hi,

i also once had the same problem. the geometry MUST have the same coordinate system as later used in openfoam. so check already while building in CAD.

then again: mm and m checked??
wolle1982 is offline   Reply With Quote

Old   July 29, 2009, 03:07
Default how to use snappy mesh
  #12
New Member
 
sivakumar
Join Date: May 2009
Posts: 12
Rep Power: 17
s.sivakumar is on a distinguished road
Hi foamers,
i am trying to use snappy mesh for simpleFoam solver (snappy motor bike tutorial case), just increased the cells 100000 in to 3400000.
my questions are:

*) this is confusing question for me, can we use minX, maxX, minY,maxY,minZ, maxZ as a boundary?
if yes i am using like this
minX= inlet, maxX=outlet, minY,maxY,minZ and maxZ are wall.
please tell me is it right or not?

the remaining motor bike as wall

1) if it is wrong how can we give the inlet and outlet conditions?

in the inlet 0/U
type fixedValue;
value uniform (20 0 0);

in the outlet 0/p
type fixedValue;
value uniform 0;

when i run simpleFoam solver i am getting the following error message;

Create mesh for time = 0

Reading field p

ill defined primitiveEntry starting at keyword 'boundaryField' on line 18 and ending at line 388

file: /volume/cfd4_shared/2009-ct-PI-004/OpenFOAM/sivakumar1.5.x/run/tutorials/snappyHexMesh/motorBike/0/p at line 388.

From function primitiveEntry::readEntry(const dictionary& dict,Istream& is)
in file db/dictionary/primitiveEntry/primitiveEntryIO.C at line 210.

FOAM exiting

i have attached k epsilon U and p as well the boundary please have a look and help me to overcome this problem

Thanks All,
sivakumar
s.sivakumar is offline   Reply With Quote

Old   March 3, 2010, 11:59
Default
  #13
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Hi,

I have attached an image of the motorbike tutorial after just 50 iterations.

The case seems to run fine.

The question is about the surface mesh on the side of the motorbike.

In some places it is very strange (like 2 cells; the first over the second) with green spots.

Is it just a problem of viewing correctly the surface mesh or not ?

What is the 'best way' to view grids done with snappyHexMesh ?

Best regards,

Stephane.
Attached Images
File Type: jpg motorbike1.jpg (98.4 KB, 206 views)
openfoam_user is offline   Reply With Quote

Old   March 3, 2010, 16:37
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Stephane,

Let's see, by what I know:
  1. if you are using OpenFOAM 1.6, the solver will start do give out garbage results at about 300 iterations. You'll have to upgrade to OpenFOAM 1.6.x.
  2. if it's just the mesh you want to see/debug, I just found about this, that using the ExtractCellsByRegion in Paraview helps to not get triangulated meshes, which is the standard when we cut the mesh to see how it is inside.
  3. as for "like 2 cells; the first over the second", the bike is hollow, and has puncture holes in it, so you'll get a single two sided mesh around the bike surface, so it's only natural that you get overlayed cells.
And that's all I know to answer your questions.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   March 4, 2010, 04:16
Default
  #15
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Hi Bruno,

thanks for your advices.

I use 1.6.x version.

The "ExtractCellsByRegion" tool works well.

Regards,

Stephane.
openfoam_user is offline   Reply With Quote

Old   April 4, 2010, 11:06
Default
  #16
New Member
 
Francisco Miguel
Join Date: Apr 2010
Posts: 13
Rep Power: 16
Curro5150 is on a distinguished road
Hello,

I am trying to evaluate the possibilities of OpenFOAM in the field of ship hydrodynamics, for the moment I want to try to get the wave field generated by a single catamaran hull using interFOAM. However, after creating the background mesh, I am having the same problem as the OP, I get the error with the .stl file. I have checked everything in this post but I keep getting the same message. The ASCII stl file looks ok, I even changed the solid name in the stl file to match the file name and the name I want to give the patch.
¿Any other suggestions?
Thanks,
Francisco
Curro5150 is offline   Reply With Quote

Old   April 4, 2010, 11:14
Default
  #17
New Member
 
Francisco Miguel
Join Date: Apr 2010
Posts: 13
Rep Power: 16
Curro5150 is on a distinguished road
Ok, forget about my previous post... The cause of the error is mainly that I am an idiot (and that the folder names are case sensitive)...
Curro5150 is offline   Reply With Quote

Reply

Tags
geometry subdirectory, snappyhexmesh


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] Problem and doubts with blockMesh, snappyHexMesh and multiple geometry luca1992 OpenFOAM Meshing & Mesh Conversion 0 August 23, 2017 12:40
[ANSYS Meshing] CATIA Geometry Generation and Meshing danielsullivan ANSYS Meshing & Geometry 0 April 3, 2017 22:11
[snappyHexMesh] snappyHexMesh beginner CRI_CFD OpenFOAM Meshing & Mesh Conversion 5 June 20, 2014 07:57
[snappyHexMesh] Parts of Geometry not meshed by snappyHexMesh Turbulence OpenFOAM Meshing & Mesh Conversion 5 August 8, 2012 17:27
[snappyHexMesh] SnappyHexMesh meshes inside and outside of an STL geometry villier OpenFOAM Meshing & Mesh Conversion 17 June 15, 2010 20:51


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