CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

snappyHexMesh geometry

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 15, 2009, 07:59
Default snappyHexMesh geometry
  #1
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 8
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, 09:02
Default
  #2
New Member
 
Daniele
Join Date: May 2009
Location: Rome, Italy
Posts: 7
Rep Power: 8
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, 10:31
Default
  #3
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 8
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, 11:43
Default
  #4
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 8
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?

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

Old   May 15, 2009, 12:44
Default
  #5
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 9
wolle1982 is on a distinguished road
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, 16:34
Default
  #6
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 8
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, 04:06
Default
  #7
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 9
wolle1982 is on a distinguished road
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, 13:24
Default
  #8
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 8
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, 13:36
Default
  #9
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 9
wolle1982 is on a distinguished road
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, 08:25
Default
  #10
New Member
 
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 8
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, 02:56
Default
  #11
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 9
wolle1982 is on a distinguished road
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, 02:07
Default how to use snappy mesh
  #12
New Member
 
sivakumar
Join Date: May 2009
Posts: 12
Rep Power: 8
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: 300
Rep Power: 9
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, 148 views)
openfoam_user is offline   Reply With Quote

Old   March 3, 2010, 16:37
Default
  #14
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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: 300
Rep Power: 9
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, 10:06
Default
  #16
New Member
 
Francisco Miguel
Join Date: Apr 2010
Posts: 13
Rep Power: 7
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, 10:14
Default
  #17
New Member
 
Francisco Miguel
Join Date: Apr 2010
Posts: 13
Rep Power: 7
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

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
Importing CAD geometry and Editing edges to match Ahmed CFX 14 June 26, 2015 12:16
SnappyHexMesh meshes inside and outside of an STL geometry villier OpenFOAM Mesh Utilities 17 June 15, 2010 19:51
snappyHexMesh - geometry edges johannesk OpenFOAM Native Meshers: snappyHexMesh and Others 8 January 13, 2010 18:13
SnappyHexMesh One instead of two zones bastil OpenFOAM Mesh Utilities 0 November 5, 2008 08:54
vitual _ real deneb FLUENT 3 January 22, 2007 05:31


All times are GMT -4. The time now is 05:16.