CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: snappyHexMesh and Others (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/)
-   -   snappy hex mesh error (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/95746-snappy-hex-mesh-error.html)

kd55 December 31, 2011 08:35

snappy hex mesh error
 
2 Attachment(s)
Hi there, I am trying to get to grips with sHM but am finding it hard to follow some of the tutorials online and in the user guide. I have an STL file of a cylinder which will be used for preliminary tests. Would it be possible for someone to have a quick look at the error I am getting when I run snappyHexMesh and point me in the right drection:

FOAM Warning :
From function entry::getKeyword(keyType&, Istream&)
in file db/dictionary/entry/entryIO.C at line 78
Reading /home/kd55/OpenFOAM/kd55-1.6/run/tutorials/incompressible/pisoFoam/ras/STLCylinder2-copy/system/snappyHexMeshDict
found on line 86 the punctuation token '{'
expected either } or EOF

keyword meshQualityControls is undefined in dictionary "/home/kd55/OpenFOAM/kd55-1.6/run/tutorials/incompressible/pisoFoam/ras/STLCylinder2-copy/system/snappyHexMeshDict"
file: /home/kd55/OpenFOAM/kd55-1.6/run/tutorials/incompressible/pisoFoam/ras/STLCylinder2-copy/system/snappyHexMeshDict from line 24 to line 87.
From function dictionary::subDict(const word& keyword)
in file db/dictionary/dictionary.C at line 467.
FOAM exiting

relevant files should be attatched bar the STL

Kind Regards,

Kit

wyldckat December 31, 2011 13:23

1 Attachment(s)
Greetings Kit,

It looks to me like you aren't using a proper text editor. My favourite one is Kate, although it requires KDE to be installed, which can mean that you would need to download and install an additional 200-300 MB of packages.

Either way, I suggest that you take more care with where the brackets "{" and "}" are placed, because the following fields have the "}" ones in the wrong place:
  • addLayersControls - has a closing bracket too soon.
  • meshQualityControls - didn't even have a closing bracket.
Another thing that I advise you is to define in your text editor to use spaces instead of tabs.

Another advice is to always have the original "snappyHexMeshDict" open in another window, so you can consult it and compare it with your current version.

edit: by what I've seen from your previous posts, you might be running on Windows. So you might be interested in this: http://code.google.com/p/bluecfd-sin...epad2_manually

Best regards and good luck!
Bruno

kd55 January 5, 2012 10:01

thanks Bruno, sHM now seems to be working.

Thanks again,

Kit

aqua January 6, 2012 12:08

Quote:

Originally Posted by kd55 (Post 337981)
thanks Bruno, sHM now seems to be working.

Thanks again,

Kit

Dear Kit,
I have the same problem as yours, could you please tell me how you got your case working?
Thank you so much!
Aqua

kd55 January 7, 2012 11:01

Hi Aqua,

I'm not so sure I have got it working now, as I am using snappy in the pisofoam solver which I can't run at the moment as it has a bug which is caused by the R file in the 0 directory. However, I do have a few pointers on where you might be going wrong as I have spent quite a lot of time on this now:
- if you are using paraview (not parafoam), i would use foamToVTK to transfer the data files
- copy the snappyHexMesh dict from the motorbike tutorial and make sure you are carefull when making changes to it, i.e. be carefull with th {,(,),}. change little bits at a time and make sure you know what you are changing, there is plenty of info on here. There are also some online tutorials:
http://www.hydroniumion.de/general/s...mesh-tutorial/
http://www.hydroniumion.de/studium/s...torial-part-2/

Regards,

Kit

aqua January 9, 2012 06:53

Quote:

Originally Posted by kd55 (Post 338236)
Hi Aqua,

I'm not so sure I have got it working now, as I am using snappy in the pisofoam solver which I can't run at the moment as it has a bug which is caused by the R file in the 0 directory. However, I do have a few pointers on where you might be going wrong as I have spent quite a lot of time on this now:
- if you are using paraview (not parafoam), i would use foamToVTK to transfer the data files
- copy the snappyHexMesh dict from the motorbike tutorial and make sure you are carefull when making changes to it, i.e. be carefull with th {,(,),}. change little bits at a time and make sure you know what you are changing, there is plenty of info on here. There are also some online tutorials:
http://www.hydroniumion.de/general/s...mesh-tutorial/
http://www.hydroniumion.de/studium/s...torial-part-2/

Regards,

Kit

Hello Kit,
Thank you so much for your help! I am reading the turorials and hopefully will find some solution!

Thank you so much and wish you good luck in your research!

Aqua

Elise February 17, 2012 04:07

2 Attachment(s)
I get the same error; keyword meshQualityControls is undefined in dictionary snappyHexDict. I looked at the right places for the brackets but I can't figure it out?

I'm trying to make a mesh inside the scour stl file instead of outside the region.

Elise February 17, 2012 05:42

1 Attachment(s)
I had the wrong internal co-ordinates and also had an old mesh in the polymesh folder.

However, I want to refine my grid at the walls inside the stl file, how can I do this?

And further I want to make a patch at the left small tube to let water in and a patch on the left largest circle part to let water out again. The rest I want as a patch to specify a B.C. on it (wall, no velocity, no flux). How can I do this?

aqua February 17, 2012 17:20

Quote:

Originally Posted by Elise (Post 344905)
I had the wrong internal co-ordinates and also had an old mesh in the polymesh folder.

However, I want to refine my grid at the walls inside the stl file, how can I do this?

And further I want to make a patch at the left small tube to let water in and a patch on the left largest circle part to let water out again. The rest I want as a patch to specify a B.C. on it (wall, no velocity, no flux). How can I do this?

Hi,
I think you need to creat different parts in stl file first according to how many patches you want to creat.

Aqua

wyldckat February 18, 2012 08:02

Greetings to all!

@Elise: You can with createPatch. You can find several examples by running:
Code:

find $WM_PROJECT_DIR -name createPatchDict
If your geometry has good features (i.e., not trying to create a small patch in a flat surface), you can use autoPatch.

Best regards,
Bruno

aqua February 20, 2012 07:55

Quote:

Originally Posted by wyldckat (Post 345083)
Greetings to all!

@Elise: You can with createPatch. You can find several examples by running:
Code:

find $WM_PROJECT_DIR -name createPatchDict
If your geometry has good features (i.e., not trying to create a small patch in a flat surface), you can use autoPatch.

Best regards,
Bruno

Hello Bruno,
I wonder, If my geometry is a car with only one part named "car", in a stl file.
After snappyHexMesh, in the boundary file there is only the patch named "car". Then,
Now I want to create different parts for the car such as "car_frontwindow", "car_backwindow", "car_leftsidewindow" etc.
Is it possible to do that in OF?

Thank you so much!
Aqua

Elise February 20, 2012 08:41

I loaded in the different stl files instead of one stl file, now I have the different patches.
Next time I will use autopatch, easier to use I think.

wyldckat February 20, 2012 09:56

Quote:

Originally Posted by aqua (Post 345301)
Hello Bruno,
I wonder, If my geometry is a car with only one part named "car", in a stl file.
After snappyHexMesh, in the boundary file there is only the patch named "car". Then,
Now I want to create different parts for the car such as "car_frontwindow", "car_backwindow", "car_leftsidewindow" etc.
Is it possible to do that in OF?

It should be possible. Like I wrote on the other post, search for the examples that already exist ;)

Quote:

Originally Posted by Elise (Post 345309)
I loaded in the different stl files instead of one stl file, now I have the different patches.
Next time I will use autopatch, easier to use I think.

The downside of autoPatch (besides the previously mentioned issue) is that you then have to manually rename every patch on "*/polyMesh/boundary". If the geometry doesn't change, or at least not the order of the patches being found, you can use a "changeDictionaryDict" for renaming patches with a pre-done renaming pattern ;)

Best regards,
Bruno


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