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

[snappyHexMesh] SnappyHexMesh..

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 27, 2010, 12:27
Default SnappyHexMesh..
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19
samiam1000 is on a distinguished road
Dear All,

I have a question: is it possible to generate a volume mesh inside a certain surface?

I mean, I have a non-simple stl geometry (the reconstruction of nasal cavity) and I wanna mesh the inside volume.

If my file is called nasal_cavity.stl, how can I set a good snappyHexMeshDict file in order to generate my mesh inside the surface??
It is a closed surface. The only problem is that is presents some loops. I hope this is not a problem.

Here is my snappyHexMeshDict file:
Code:
geometry
  {
      nasal_cavity.stl // STL filename
      {
          type triSurfaceMesh;
      }
  
      box  // User defined region name
      {
          type   searchableBox;       // region defined by bounding box
          min    (-0.0422 -0.0880 -0.576);
          max    (-0.0338 0.00583 -0.479);
      }
  
  };
But it does not work. I get this:
Code:
samiam@penrose: ~/Desktop/naso_ok/test > snappyHexMesh snappyHexMeshDict 

Usage: snappyHexMesh [-overwrite] [-parallel] [-case dir]  [-help] [-doc] [-srcDoc]



--> FOAM FATAL ERROR: 
Wrong number of arguments, expected 0 found 1


FOAM exiting


samiam@penrose: ~/Desktop/naso_ok/test > blockMesh snappyHexMeshDict 

Usage: blockMesh [-dict dictionary] [-case dir] [-blockTopology] [-region name]  [-help] [-doc] [-srcDoc]



--> FOAM FATAL ERROR: 
Wrong number of arguments, expected 0 found 1


FOAM exiting


samiam@penrose: ~/Desktop/naso_ok/test >
Thanks a lot,

Samuele
samiam1000 is offline   Reply With Quote

Old   October 29, 2010, 08:23
Default volume mesh inside a region
  #2
New Member
 
CFD user
Join Date: Apr 2010
Location: Germany
Posts: 28
Rep Power: 16
subhkirti is on a distinguished road
Hi samiam,

Did you use the locationInMesh to specify the portion of your geometry you wanted to keep? You can find the details about its usage in the User guide.
__________________
Thanks,
subhkirti is offline   Reply With Quote

Old   October 29, 2010, 08:33
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19
samiam1000 is on a distinguished road
What does this mean? Also, could you link me the SnappyHexMesh user guide, please??
Do you mean the OpenFOAM u'sg??

Thanks a lot,

Samuele
samiam1000 is offline   Reply With Quote

Old   October 29, 2010, 08:34
Default
  #4
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
Hi

two things:
1) as mentioned in the previous post the location in mesh entry is a point in the part of the mesh that will be kept

2) the correct command is

>this/is/your/case/directory>snappyHexMesh

and maybe one of the arguments specified in your failure message.
You don't have to tell sHM that your are using a Dict-file.
The stl you probably have here:

>this/is/your/case/directory/constant/triSurface

and the sHMD file here

>this/is/your/case/directory/system

then everything should be alright

hope that helps
regards
Colin

Edit: yes he is refering to the OF userguide, where sHM is explained
Edit2: Have you heard about the motorbike tutorial? maybe you should try that first and then adapt your case
to that one.

Last edited by colinB; October 29, 2010 at 08:38. Reason: Add Edit and Edit 2
colinB is offline   Reply With Quote

Old   October 29, 2010, 08:36
Default
  #5
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19
samiam1000 is on a distinguished road
Dear Collin,

thanks for your answer.

Well, just 1 more question:

1. where should I add the line with a point that I wanna include in the meshed region?

Thanks.

Samuele
samiam1000 is offline   Reply With Quote

Old   October 29, 2010, 08:40
Default
  #6
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
in your snappyHexMeshDict file line 160
locationInMesh (X Y Z);
this point must be in the area you want to keep (in your pipe what ever)
and must not coincidence with a face!
colinB is offline   Reply With Quote

Old   October 29, 2010, 08:48
Default
  #7
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19
samiam1000 is on a distinguished road
I think I did a mistake then..
My snappyHexMeshDict file is no bigger than 20 lines..

Code:
geometry
  {
      nasal_cavity.stl // STL filename
      {
          type triSurfaceMesh;
      }
  
      box  // User defined region name
      {
          type   searchableBox;       // region defined by bounding box
          min    (-0.0422 -0.0880 -0.576);
          max    (-0.0338 0.00583 -0.479);
      }
  
  };
Where's the problem in my file?
samiam1000 is offline   Reply With Quote

Old   October 29, 2010, 09:05
Default
  #8
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
Oh that is a problem.
I assumed its not bigger than 20 lines but I really hoped that you just quoted parts of your sHMD.
Well then I highly recommend like I did it in one of my previous posts the motorbike-
tutorial and the user guide.

the motorbike tutorial you find here:

openFoam171/tutorials/incompressible/simpleFoam/motorBike

have a look in the system folder there you find an example file for the sHMD

the user guide you find here

good look with it
and if you have further questions just ask
regards
colinB is offline   Reply With Quote

Old   October 29, 2010, 09:13
Default
  #9
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19
samiam1000 is on a distinguished road
I'll work hard on it.
Thanks a lot.

Just one more question before beginning: in the motorbike tutorial (the Dict file!) I can find different "zones" to describe the surface..
But I do not need them.
Can I delete that part, right??
samiam1000 is offline   Reply With Quote

Old   October 29, 2010, 09:17
Default
  #10
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
yes you can delete them
colinB is offline   Reply With Quote

Old   October 29, 2010, 15:39
Default
  #11
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
Samuele, you might want to read up on sHM in the user's manual. There you'll find a nicely commented simple case.

Quote:
Originally Posted by samiam1000 View Post
I'll work hard on it.
Thanks a lot.

Just one more question before beginning: in the motorbike tutorial (the Dict file!) I can find different "zones" to describe the surface..
But I do not need them.
Can I delete that part, right??
ziad is offline   Reply With Quote

Old   November 10, 2010, 17:09
Default
  #12
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19
samiam1000 is on a distinguished road
Dear All,

it's again from me.

I read the tutorials and I followed your advice. However, there is a point I can not find anywhere.
I have a complicated geometry and I have its internal mesh. The point is that I don't know how to set which is the inlet and which is the outlet. Of course, I can not write the cell numbers, manually. Is there an automatic tool to find the inlet and the outlet section(s)??

Thanks,

Samuele
samiam1000 is offline   Reply With Quote

Old   November 11, 2010, 05:36
Default
  #13
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
Hi

ususally this is done by the blockMesh background mesh.
Otherwise you have to specify different regions in your stl file so you get different patches and then assign in the files listed in the 0 folder different BC eg inlet outlet to these patches.

check for this the different layers of the motorBike tutorial, but in this case to all of the layers the BC describing them as a wall are assigned

regards
Colin
colinB is offline   Reply With Quote

Old   November 11, 2010, 09:53
Default
  #14
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19
samiam1000 is on a distinguished road
Dear Colin,

thanks for answering.

I will try to have a look. I guess that your second solution (layers!) is the best one.

Bu I am not sure to be able to define different regions in the stl files.. But I will try to do my best.

Thanks again,

Samuele
samiam1000 is offline   Reply With Quote

Reply


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
[CAD formats] Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Meshing & Mesh Conversion 58 May 13, 2020 07:01
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing peterhess OpenFOAM Meshing & Mesh Conversion 2 January 3, 2018 03:54
[snappyHexMesh] Tutorial crashes: snappyHexMesh floating point exception. jasv OpenFOAM Meshing & Mesh Conversion 4 May 10, 2016 03:55
[snappyHexMesh] snappyhexmesh doesn't creat mesh in parallel issue? klausb OpenFOAM Meshing & Mesh Conversion 1 March 7, 2015 12:55
[snappyHexMesh] stitchMesh and snappyHexMesh gdbaldw OpenFOAM Meshing & Mesh Conversion 0 December 23, 2009 03:09


All times are GMT -4. The time now is 19:35.