|
[Sponsors] |
May 15, 2009, 08:59 |
snappyHexMesh geometry
|
#1 |
New Member
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17 |
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. |
|
May 15, 2009, 10:02 |
|
#2 |
New Member
|
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 |
|
May 15, 2009, 11:31 |
|
#3 |
New Member
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17 |
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? |
|
May 15, 2009, 12:43 |
|
#4 |
New Member
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17 |
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 13:06. |
|
May 15, 2009, 13:44 |
|
#5 |
Senior Member
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21 |
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 |
|
May 15, 2009, 17:34 |
|
#6 |
New Member
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17 |
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? |
|
May 18, 2009, 05:06 |
|
#7 |
Senior Member
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21 |
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. |
|
May 20, 2009, 14:24 |
|
#8 |
New Member
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17 |
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. |
|
May 20, 2009, 14:36 |
|
#9 |
Senior Member
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21 |
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... |
|
May 21, 2009, 09:25 |
|
#10 |
New Member
Kristian Strømstad
Join Date: May 2009
Location: Norway
Posts: 6
Rep Power: 17 |
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 |
|
May 25, 2009, 03:56 |
|
#11 |
Senior Member
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21 |
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?? |
|
July 29, 2009, 03:07 |
how to use snappy mesh
|
#12 |
New Member
sivakumar
Join Date: May 2009
Posts: 12
Rep Power: 17 |
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 |
|
March 3, 2010, 11:59 |
|
#13 |
Senior Member
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18 |
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. |
|
March 3, 2010, 16:37 |
|
#14 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings Stephane,
Let's see, by what I know:
Best regards, Bruno |
|
March 4, 2010, 04:16 |
|
#15 |
Senior Member
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18 |
Hi Bruno,
thanks for your advices. I use 1.6.x version. The "ExtractCellsByRegion" tool works well. Regards, Stephane. |
|
April 4, 2010, 11:06 |
|
#16 |
New Member
Francisco Miguel
Join Date: Apr 2010
Posts: 13
Rep Power: 16 |
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 |
|
April 4, 2010, 11:14 |
|
#17 |
New Member
Francisco Miguel
Join Date: Apr 2010
Posts: 13
Rep Power: 16 |
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)...
|
|
Tags |
geometry subdirectory, snappyhexmesh |
|
|
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 |