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] meshing with snappy: im a very beginner (https://www.cfd-online.com/Forums/openfoam-meshing/68767-meshing-snappy-im-very-beginner.html)

hamsadhwani8 February 22, 2010 20:34

water flow into a tank in 3D
 
Hi,

I want to create a 3D mesh

lcnmy August 4, 2010 21:27

I am newbie in OPENFOAM too. While I run the execution with snappyHexMesh, it is fatal error,

cnlee@cnlee-desktop:~/OpenFOAM/cnlee-1.7.0/run/tutorials/mesh/snappyHexMesh/motorBike$ snappyHexMesh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.7.0-279cc8e8233b
Exec : snappyHexMesh
Date : Aug 05 2010
Time : 09:26:16
Host : cnlee-desktop
PID : 2511
Case : /home/cnlee/OpenFOAM/cnlee-1.7.0/run/tutorials/incompressible/simpleFoam/motorBike
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/cnlee/OpenFOAM/cnlee-1.7.0/run/tutorials/incompressible/simpleFoam/motorBike/system/fvSolution at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 61.

FOAM exiting

Anyone know what is my OpenFoam problem? Btw, I using OpenFOAM 1.7

Regards
Lee

bigphil August 5, 2010 04:54

Hi Lee,

snappyHexMesh cannot find the fvSolution file, did you copy the motorbike case directly from $FOAM_TUTORIALS without making any changes to it?

There should be a fvSolution file in the system folder in the motorbike case? Is this file (motorbike/system/fvSolution) there?

Philip

lcnmy August 5, 2010 21:22

Hi Philip,

It works for me now. Thanks a lot! May I ask you another question? If I want to do a snappyHexMesh for other stl file, what file need to make a change? Sorry, I am a newbie in OpenFOAM.

Regards
Lee

bigphil August 8, 2010 09:52

Lee,


You can put your stl file (I think it should be a ASCII stl) in the "constant/triSurface" directory.
You then need to open the "system/snappyHexMeshDict" file and find where the stl file is specified and change motorbike.stl to the name of your stl.
You have to create your background mesh some how too, usually with blockMesh.

It is all explained well in the User Guide: http://www.openfoam.com/docs/user/snappyHexMesh.php


Philip C

watashiwa August 27, 2010 01:35

Error during snappyHexMesh
 
Hi all,

(Motorbike)
I have no problem executing the blockMesh command. Then I execute, snappyHexMesh, the errors show below. It's freshly install openfoam. (ubuntu 9.10, OF 1.6.)

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.6-53b7f692aa41
Exec : snappyHexMesh
Date : Aug 27 2010
Time : 13:19:42
Host : orange
PID : 2674
Case : /home/orange/OpenFOAM/orange-1.6/run/tutorials/incompressible/simpleFoam/motorBike
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 500

Read mesh in = 0.04 s

Overall mesh bounding box : (-5 -4 0) (15 4 8)
Relative tolerance : 1e-06
Absolute matching distance : 2.29783e-05

Reading refinement surfaces.
Read refinement surfaces in = 3.06 s

Reading refinement shells.
Refinement level 4 for all cells inside refinementBox
Read refinement shells in = 0 s

Setting refinement level of surface to be consistent with shells.
Checked shell refinement in = 0.03 s


Determining initial surface intersections
-----------------------------------------

#0 Foam::error::printStack(Foam::Ostream&) in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::primitiveMesh::cellEdges(int, Foam::DynamicList<int, 0u, 2u, 1u>&) const in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::primitiveMesh::cellEdges(int) const in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::hexRef8::getLevel0EdgeLength() const in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libdynamicMesh.so"
#6 Foam::hexRef8::hexRef8(Foam::polyMesh const&, Foam::List<int> const&, Foam::List<int> const&, Foam::refinementHistory const&) in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libdynamicMesh.so"
#7 Foam::meshRefinement::meshRefinement(Foam::fvMesh& , double, bool, Foam::refinementSurfaces const&, Foam::shellSurfaces const&) in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libautoMesh.so"
#8 main in "/home/orange/OpenFOAM/OpenFOAM-1.6/applications/bin/linuxGccDPOpt/snappyHexMesh"
#9 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#10 _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/i386/elf/start.S:122
Segmentation fault


Any idea, what went wrong?

Thank you so much.

watashiwa newbie

bigphil August 27, 2010 06:14

Hi watashiwa,


I am not sure what is causing your error, maybe someone else here has a better idea, but did you just install OpenFOAM or did you compile it too?

If you compiled it then I would recommend to try re-compiling snappyHexMesh:
Code:

cd $FOAM_UTILITIES/mesh/generation/snappyHexMesh
wclean
wmake

or maybe try re-compiling the libraries mentioned in the error (libOpenFOAM.so, lipdynamicMesh.so).
Code:

cd $FOAM_SRC
wmake libso OpenFOAM
wmake libso dynamicMesh

If you just installed OpenFOAM and did not compile it then you will need to compile all of OpenFOAM which can be tricky but there are lots of really good guides and scripts on the forum.
BUT it might be over-kill compiling OpenFOAM,maybe someone else has an easier solution.


Philip

watashiwa August 27, 2010 10:59

Hi Phil,

I have just tried that out, same problem. No idea, what's wrong. what do you think if I replace the stl file which is related to my research, will snappyHexMesh solver is affected due to this error? I reckon installation should be no problem since I can use solidDisplacementFoam without any problem. Hmm...

Anyway I will try that out by replacing my stl file and see how it goes.

I hope someone can come out with this solution.
Thank you so much.

watashiwa is sad

awacs September 10, 2010 06:42

Dear all.

Can snappyHexMesh generate meshes for the inner region of the triangulated surface geometries in Stereolithography (STL) format ?

bigphil September 10, 2010 06:46

Quote:

Originally Posted by awacs (Post 274727)
Dear all.

Can snappyHexMesh generate meshes for the inner domain of the triangulated surface geometries in Stereolithography (STL) format ?

Hi,


Yes it can.

Just set the locationInMesh in the snappyHexMesh dictionary to be inside your STL geometry.


Philip

awacs September 11, 2010 06:25

1 Attachment(s)
Hi Philip ,

Thanks for your reply. As you suggested, internal meshes for the STL geometry can be generated by seting the locationInMesh in the snappyHexMesh dictionary to be inside the STL geometry. But there is only one patch named as the wall of the STL geometry.

My question is that how to seperate this patch into different patches (as noted in the enclosed picture ) ?

Eugene suggested use separate STL surfaces for each region.
http://www.cfd-online.com/Forums/ope...pyhexmesh.html

And I do split my STL surfaces into three seperate regions : inlet, runner and cavity and get three STL files : "inlet.stl", "runner.stl" and "cavity.stl".



The corresponding patches are defined in the STL file as follows:
  • for inlet
solid inlet
...
endsolid inlet
  • for runner
solid runner

...
endsolid runner

  • for cavity
solid cavity

...
endsolid cavity


The following methods are used:
  1. using three STL files (in triSurface directory)
  2. using a combined STL file from above three files.
However only one part of the three seperated regions can be meshed. It depends on where the point of locationInMesh is defined. Is it possible to define numbers of locationInMesh points in the snappyHexMesh dictionary ?

Any suggestions will be highly appreciated.

Jitao

amgode September 13, 2010 01:14

Hi,


"My question is that how to seperate this patch into different patches (as noted in the enclosed picture ) ?"

After the mesh generation (using snappyHexMesh) is complete you might want to use the
> autoPatch
utility for obtaining patches based on feature angle.
I have not used it though.


"However only one part of the three seperated regions can be meshed. It depends on where the point of locationInMesh is defined. "

The only reason for this (as far as I know) is due to the individual stl's being closed.


"Is it possible to define numbers of locationInMesh points in the snappyHexMesh dictionary ? "

Though I am not the right person to answer this question; but then defining multiple points as locationInMesh is not available in snappyHexMesh.


Suggestions:

run
> surfaceCheck
on the individual stl files - to see if they are closed geometries.
And we don't want them to be closed.
The combined stl though needs to be closed geometry, if you wish to have a mesh inside the enclosed surface.

Hope it helps !:)


bigphil September 13, 2010 04:46

Quote:

Originally Posted by awacs (Post 274836)
My question is that how to seperate this patch into different patches (as noted in the enclosed picture ) ?

As amgode suggested, autopatch should work if your intended patches have well defined edges between them.
There is also a GUI tool called patchTool which was in OpenFOAM-1.4 where you could pick individual faces and add them to a patch, but I don't think there is any similar utility in the current version - you could try install the old version but the mesh formats are slightly different so this seems like a lot of work.


Quote:

Originally Posted by awacs (Post 274836)
However only one part of the three seperated regions can be meshed. It depends on where the point of locationInMesh is defined. Is it possible to define numbers of locationInMesh points in the snappyHexMesh dictionary ?

One idea is you could mesh each geometry individually (using different cases) and then merge the meshes (with mergeMeshes) and then stitch them together (with stitchMesh).


Hope it helps,
Philip

ziad September 13, 2010 11:55

Awacs,

If all your stl files are enclosed in the blockMesh outer domain and your reference location point is well positioned then there should not be any problem. To be on the safe side I usually place the location point just inside one of the outer corners of the domain.

Now for having different patch names, just edit the individual stl files and add the patch name after the word solid which occurs at the very top of the stl file, and the word endsolid which occurs at the very bottom of the stl file. You also have to define the patch names as regions in the snappyHexMeshDict geometry section. Then you should use these patch names directly in the addLayersControls section. However, in the refinementSurfaces sections stick to the stl file name as defined in the geometry section. See the example below for the stl file of a geometry section from stl file Terrace.stl, called Terrace, and associated to patch name TERRACE.

ASCII stl file Terrace.stl:
Code:

solid TERRACE
 facet normal  0.000000e+00  1.000000e+00 -0.000000e+00
  outer loop
    vertex  3.600000e+00  3.950000e+00  1.670000e+01
.
.
.
    vertex  3.600000e+00  3.950000e+00  1.670000e+01
  endloop
 endfacet
endsolid TERRACE

geometry specification:
Code:

    Terrace.stl
    {
      type triSurfaceMesh;
      name Terrace;
      regions
      {
        TERRACE
        {
          name TERRACE;
        }
      }
    }

refinementSurfaces specification:
Code:

        Terrace
        {
            level (2 2);
        }

addLayersControls specification:
Code:

        TERRACE
        {
            nSurfaceLayers 1;
        }

Hope this helps.
Ziad

awacs September 15, 2010 21:35

Hi,

Many thanks to Amol, Philip and Ziad. I will try it out and feed back soon.

Hikachu August 24, 2011 11:37

Hello, I'm also a beginner with paraFoam, and here is my (stupid) problem :

I'm on the motorbike case, and when I create the castellated mesh, I don't know how to display it on paraview.

When I open paraview, and tape I want to open the log.castellated file, it tells me :

" A reader for "/home/my_name/OpenFOAM/my_name-1.7.1/run/tutorials/incompressible/simpleFoam/motorBike could not be found, please choose one : "
and I have a list of programs I have to choose.

Do you know what to do??


Thx a lot!

romant August 25, 2011 07:28

Quote:

Originally Posted by Hikachu (Post 321417)
Hello, I'm also a beginner with paraFoam, and here is my (stupid) problem :

I'm on the motorbike case, and when I create the castellated mesh, I don't know how to display it on paraview.

When I open paraview, and tape I want to open the log.castellated file, it tells me :

" A reader for "/home/my_name/OpenFOAM/my_name-1.7.1/run/tutorials/incompressible/simpleFoam/motorBike could not be found, please choose one : "
and I have a list of programs I have to choose.

Do you know what to do??


Thx a lot!

You just open it with the command paraFoam from the case directory and then hit "Apply" in the panel on the left side. You should see a big block. If you only want to see the motorbike, deselect the internal mesh and select only the patches of the motorbike, you will then see the motorbike only.

Rik_Tonnaer November 29, 2011 04:51

Sorry, my post is now totally off topic. My reply was a response to a message from 2009. Didn`t notice the date ;)

If you want to use paraFoam to see time step 3 you can do the following:

1) Make sure your terminal is in the main directory of the motorBike case ../motorbike.
2) run paraFoam
3) if paraFoam opens correctly, use the buttons at the top to go to time step 3. The buttons look like -> http://images.wikia.com/scivis/image...e_controls.png

It now should visualize timestep 3 and if your case ran correctly, time step three gives the fully castellated and snapped motorbike.

So for clarity, don`t run paraFoam from inside the folder named 3, just run it in the main folder and use the timecontroles inside paraView to change what you are looking at.


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