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 Segmentation Fault (https://www.cfd-online.com/Forums/openfoam-meshing/152792-snappyhexmesh-segmentation-fault.html)

avd28 May 8, 2015 15:52

snappyHexMesh Segmentation Fault
 
1 Attachment(s)
Hello all,

I'am trying to mesh a geometry shown below using snappyHexMesh.. The geometry itself is like a pipe but with internal indentations..

After I run the snappyHexMesh command I get the error message outlined in the screenshot.
It is basically a segmentation fault.

I suspect my error has something to do with the locationinmesh entry.
I'am relatively new to OpenFOAM, so please forgive any obvious newbie errors I might have committed. Could someone help out?

Sincerely,

alexB May 9, 2015 16:26

Hi avd,

You would get more help if you post a picture with higher resolution or even better copy the error message in a code environment.
the snappyhexmeshdict file would be a further help to get help.
perhaps also the .stl or whatever file of your geometry.

regards
Alex

avd28 May 10, 2015 12:53

2 Attachment(s)
Sorry for insufficient information in my first post. I have attached 2 pictures of the geometry that I'am trying to mesh. I will upload the code files ASAP

avd28 May 10, 2015 18:48

1 Attachment(s)
THis is the complete readout of the error message. I have also attached the sHMDict file
Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : snappyHexMesh -overwrite
Date  : May 08 2015
Time  : 13:04:20
Host  : "linux-zbsl"
PID    : 19583
Case  : /home/avd28/OpenFOAM/OpenFOAM-2.3.0/run/Cerebrus2
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create mesh for time = 0

Read mesh in = 0.01 s

Overall mesh bounding box  : (-0.0006 -0.0006 -0.0012) (0.0006 0.0006 0.0024)
Relative tolerance        : 1e-06
Absolute matching distance : 3.97995e-09

Reading refinement surfaces.
Read refinement surfaces in = 0.02 s

Reading refinement shells.
Read refinement shells in = 0 s

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

Reading features.
Read edgeMesh Cerebrus2.eMesh
    points      : 640
    edges      : 784
    boundingBox : (-0.0003 -0.0003 0) (0.0003 0.0003 0.0012)

Refinement level according to distance to "Cerebrus2.eMesh" (640 points, 784 edges).
    level 0 for all cells within 0 metre.
Read features in = 0 s


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

Edge intersection testing:
    Number of edges            : 756
    Number of edges to retest  : 756
    Number of intersected edges : 0
Calculated surface intersections in = 0 s

Initial mesh : cells:216  faces:756  points:343
Cells per refinement level:
    0  216

Adding patches for surface regions
----------------------------------

Patch Type                Region                       
----- ----                ------                       
Added patches in = 0 s

Selecting decompositionMethod none
Layer thickness specified as final layer and expansion ratio.

Refinement phase
----------------

Found point (-0.0003 -0.0001 0) in cell 85 on processor 0

Feature refinement iteration 0
------------------------------

Marked for refinement due to explicit features            : 0 cells.
Determined cells to refine in = 0.01 s
Selected for feature refinement : 0 cells (out of 216)
Stopping refining since too few cells selected.


Surface refinement iteration 0
------------------------------

Marked for refinement due to surface intersection          : 0 cells.
Determined cells to refine in = 0 s
Selected for refinement : 0 cells (out of 216)
Stopping refining since too few cells selected.


Removing mesh beyond surface intersections
------------------------------------------

Found point (-0.0003 -0.0001 0) in global region 0 out of 1 regions.
Keeping all cells in region 0 containing point (-0.0003 -0.0001 0)
Selected for keeping : 216 cells.
Edge intersection testing:
    Number of edges            : 756
    Number of edges to retest  : 0
    Number of intersected edges : 0

Shell refinement iteration 0
----------------------------

Marked for refinement due to distance to explicit features : 0 cells.
Marked for refinement due to refinement shells            : 0 cells.
Determined cells to refine in = 0 s
Selected for internal refinement : 0 cells (out of 216)
Stopping refining since too few cells selected.


Dangling coarse cells refinement iteration 0
--------------------------------------------

Determined cells to refine in = 0 s
Selected for refinement : 0 cells (out of 216)
Stopping refining since too few cells selected.


Dangling coarse cells refinement iteration 0
--------------------------------------------

Determined cells to refine in = 0 s
Selected for refinement : 0 cells (out of 216)
Stopping refining since too few cells selected.


Splitting mesh at surface intersections
---------------------------------------

Introducing baffles for 0 faces that are intersected by the surface.

Edge intersection testing:
    Number of edges            : 756
    Number of edges to retest  : 0
    Number of intersected edges : 0
Created baffles in = 0 s


After introducing baffles : cells:216  faces:756  points:343
Cells per refinement level:
    0  216

Introducing baffles to block off problem cells
----------------------------------------------

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  in "/lib64/libc.so.6"
#3  Foam::List<int>::List(int, int const&) at ??:?
#4  Foam::meshRefinement::nearestPatch(Foam::List<int> const&) const at ??:?
#5  Foam::meshRefinement::markFacesOnProblemCells(Foam::dictionary const&, bool, Foam::Field<double> const&, Foam::List<int> const&) const at ??:?
#6  Foam::meshRefinement::handleSnapProblems(Foam::snapParameters const&, bool, bool, Foam::Field<double> const&, Foam::dictionary const&, Foam::Time&, Foam::List<int> const&, Foam::List<int> const&) at ??:?
#7  Foam::meshRefinement::baffleAndSplitMesh(bool, Foam::snapParameters const&, bool, bool, Foam::Field<double> const&, bool, double, Foam::dictionary const&, Foam::Time&, Foam::List<int> const&, Foam::List<int> const&, Foam::Vector<double> const&) at ??:?
#8  Foam::autoRefineDriver::baffleAndSplitMesh(Foam::refinementParameters const&, Foam::snapParameters const&, bool, Foam::dictionary const&) at ??:?
#9  Foam::autoRefineDriver::doRefine(Foam::dictionary const&, Foam::refinementParameters const&, Foam::snapParameters const&, bool, Foam::dictionary const&) at ??:?
#10 
 at ??:?
#11  __libc_start_main in "/lib64/libc.so.6"
#12 
 at /home/abuild/rpmbuild/BUILD/glibc-2.19/csu/../sysdeps/x86_64/start.S:125
Segmentation fault


alexB May 11, 2015 06:39

perhaps someone more experienced with SHM could offer better help.

But a first suggestion from me:
Is your bounding box defined in blockMesh big enough?
Your posted code says in one line (-0.0006 -0.0006 -0.0012) (0.0006 0.0006 0.0024)
and in another line (-0.0003 -0.0003 0) (0.0003 0.0003 0.0012) .
Perhaps its an error because some parts of your geometry are cut off.


regards
Alex

P.S.:
what are you trying to do with your geometry?
should something flow inside the defined cylinder? or around the whole geometry? or inside the volume defined by your .stl file ?

danielpiaget May 11, 2015 10:27

Hello,

I notice that your STL geometry is not a close surface. To mesh sith snappyHexMesh, the domain needs to a close surface.You must generate a closed surface for your geometry.

Thanks,

Daniel

avd28 May 11, 2015 11:50

Quote:

Originally Posted by alexB (Post 545839)
perhaps someone more experienced with SHM could offer better help.

But a first suggestion from me:
Is your bounding box defined in blockMesh big enough?
Your posted code says in one line (-0.0006 -0.0006 -0.0012) (0.0006 0.0006 0.0024)
and in another line (-0.0003 -0.0003 0) (0.0003 0.0003 0.0012) .
Perhaps its an error because some parts of your geometry are cut off.


regards
Alex

P.S.:
what are you trying to do with your geometry?
should something flow inside the defined cylinder? or around the whole geometry? or inside the volume defined by your .stl file ?

(-0.0006 -0.0006 -0.0012) (0.0006 0.0006 0.0024) are the dimensions for my bounding box while, (-0.0003 -0.0003 0) (0.0003 0.0003 0.0012) are dimensions for my geometry. So yes, my bounding box does cover the entirety of my geometry.
I am trying to determine the characteristics of flow through the geometry. I have 2 versions, one which is closed, and this one which is open. The problem with using the closed one is I'am unsure how to name the patches after I have meshed it in sHM. sHM might be useful for flow around a geometry but I'am beginning to wonder whether I have made the correct choice for a meshing protocol in this case.

avd28 May 11, 2015 11:54

1 Attachment(s)
Quote:

Originally Posted by danielpiaget (Post 545875)
Hello,

I notice that your STL geometry is not a close surface. To mesh sith snappyHexMesh, the domain needs to a close surface.You must generate a closed surface for your geometry.

Thanks,

Daniel

I see what you mean. So, I should be using a geometry like the one I have attached below, right? My area of interest as I mentioned in my previous post is flow though the pipe like structure, not flow around it. If I do mesh the closed geometry using sHM do you think the interior will be meshed as well?

danielpiaget May 11, 2015 12:46

Hello again,

SHM builds the Castellated mesh in the following way:

-All the edges of the initial mesh (generate with blockMesh I assume) are tested for intersection with the STL surface.
-A Castellated mesh (made up of cubes) is generated with the specified refinements base on the surface\regions specified in the snappyHexMeshdict. The final mesh is generated by removing the undesired elements. This is base on the locationInMesh point and the STL surface. If you wish to keep only the mesh inside the STL surface, the locationInMesh point must be inside the surface.But the point cannot be on an edge or a face after the refinement is completed, or else snappyHexMesh will stop.

But to answer your question, the locationInMesh must be inside the STL surface. Add some extra decimals to the three coordinate to avoid having the point lie on a face or edge. You can split the geometry, and view the STL surface in Paraview to pick an adequate location.

Thanks,

Daniel

alexB May 11, 2015 16:47

Hi avd,

If you want to simulate the flow through the pipe your geometry has to look like the volume where your fluid can flow.
You don't have to print the geometry of the walls... just the volume confined from the walls.

But here is a goog video tutorial for your problem...
https://www.youtube.com/watch?v=ObsFQUiVi1U
Currently I am also working with it.

regards
Alex

avd28 May 11, 2015 16:58

Yeah, Iam doing the same too. :D Thanks for your help :)

avd28 May 11, 2015 20:32

Hi All,

The issue was resolved successfully. I had left some keywords empty in the snap section.

Thanks again for all your help.


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