CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] SnappyHexMesh.. (https://www.cfd-online.com/Forums/openfoam-meshing/81460-snappyhexmesh.html)

samiam1000 October 27, 2010 11:27

SnappyHexMesh..
 
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

subhkirti October 29, 2010 07:23

volume mesh inside a region
 
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.

samiam1000 October 29, 2010 07:33

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

colinB October 29, 2010 07:34

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.

samiam1000 October 29, 2010 07:36

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

colinB October 29, 2010 07:40

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!

samiam1000 October 29, 2010 07:48

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?

colinB October 29, 2010 08:05

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

samiam1000 October 29, 2010 08:13

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??

colinB October 29, 2010 08:17

yes you can delete them

ziad October 29, 2010 14:39

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 (Post 281366)
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 November 10, 2010 16:09

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

colinB November 11, 2010 04:36

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

samiam1000 November 11, 2010 08:53

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


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