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

[snappyHexMesh] snappyHexMesh does not work

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2023, 10:13
Default snappyHexMesh does not work
  #1
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
Hello,

I need help.

1. blockmesh grid creation
2. snappyHexMesh with Fluid.stl --> leads into an error and I do not know why.

Can someone tell me, what I do wrong at the attached case file?

Last edited by Siassei; September 28, 2023 at 14:06.
Siassei is offline   Reply With Quote

Old   September 27, 2023, 10:31
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,067
Rep Power: 26
Yann will become famous soon enough
Hello,

Could you please post what error you are getting ?

Please read this thread in order to maximize your chances to get help: How to give enough info to get help
Yann is offline   Reply With Quote

Old   September 27, 2023, 10:35
Default
  #3
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
Code:
snappyHexMesh 
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2306                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _fbf00d6b-20230626 OPENFOAM=2306 version=2306
Arch   : "LSB;label=32;scalar=64"
Exec   : snappyHexMesh
Date   : Sep 27 2023
Time   : 14:33:57
Host   : 316689b2cf39
PID    : 257
I/O    : uncollated
Case   : /home/openfoam
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0

Read mesh in = 0.12 s

Overall mesh bounding box  : (-0.055 -0.001 0) (0.105 0 0.15)
Relative tolerance         : 1e-11
Absolute matching distance : 2.19319401787e-12

Reading refinement surfaces.
Read refinement surfaces in = 0 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 extendedFeatureEdgeMesh Fluid.extendedFeatureEdgeMesh
    points      : 62
    edges       : 68
    boundingBox : (-55 -1 0) (105 0 150)
    point classification :
        convex feature points          :        8
        concave feature points         :        0
        mixed feature points           :        4
        other (non-feature) points     :       50
    edge classification :
        external (convex angle) edges  :       58
        internal (concave angle) edges :        0
        flat region edges              :        0
        open edges                     :       10
        multiply connected edges       :        0

Refinement level according to distance to "Fluid.extendedFeatureEdgeMesh" (62 points, 68 edges).
    level 0 for all cells within 0 metre.
Read features in = 0.01 s


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

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

Initial mesh : cells:24000  faces:96310  points:48622
Cells per refinement level:
    0	24000
Setting refinement level of surface to be consistent with curvature.
Checked curvature refinement in = 0.01 s


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

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

Edge intersection testing:
    Number of edges             : 96310
    Number of edges to retest   : 0
    Number of intersected edges : 0
Decomposition method none [1]

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

Found point (0.01 -0.0005 0.005) in cell 865 on processor 0

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

Marked for refinement due to explicit features             : 0 cells.
Determined cells to refine in = 0.14 s
Selected for feature refinement : 0 cells (out of 24000)
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 24000)
Stopping refining since too few cells selected.


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

Setting cellZones according to locationsInMesh:
Location : (0.01 -0.0005 0.005)
    cellZone : none

For cellZone none found point (0.01 -0.0005 0.005) in global region 0 out of 1 regions.
--> FOAM Warning : 
    From void Foam::meshRefinement::nearestFace(const labelUList&, const Foam::bitSet&, Foam::autoPtr<Foam::mapDistribute>&, Foam::labelList&, Foam::label) const
    in file meshRefinement/meshRefinement.C at line 515
    Did not visit some faces, e.g. face 0 at (-0.054 -0.0005 0.0005)
Keeping all cells containing inside points
Selected for keeping : 24000 cells.
Edge intersection testing:
    Number of edges             : 96310
    Number of edges to retest   : 0
    Number of intersected edges : 0

Big gap refinement iteration 0
------------------------------

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


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 24000)
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 24000)
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 24000)
Stopping refining since too few cells selected.


Refinement transition refinement iteration 0
--------------------------------------------

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


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

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

Setting cellZones according to locationsInMesh:
Location : (0.01 -0.0005 0.005)
    cellZone : none

For cellZone none found point (0.01 -0.0005 0.005) in global region 0 out of 1 regions.
Created baffles in = 0.02 s


After introducing baffles : cells:24000  faces:96310  points:48622
Cells per refinement level:
    0	24000

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

markFacesOnProblemCells : marked 0 additional internal faces to be converted into baffles.
Analyzed problem cells in = 0.03 s


Introducing baffles to delete problem cells.

Created baffles in = 0 s


After introducing baffles : cells:24000  faces:96310  points:48622
Cells per refinement level:
    0	24000
Setting cellZones according to locationsInMesh:
Location : (0.01 -0.0005 0.005)
    cellZone : none

For cellZone none found point (0.01 -0.0005 0.005) in global region 0 out of 1 regions.

Remove unreachable sections of mesh
-----------------------------------

Split mesh in = 0.01 s


After subsetting : cells:24000  faces:96310  points:48622
Cells per refinement level:
    0	24000

Introducing zones for interfaces
--------------------------------

Setting cellZones according to locationsInMesh:
Location : (0.01 -0.0005 0.005)
    cellZone : none

For cellZone none found point (0.01 -0.0005 0.005) in global region 0 out of 1 regions.
Setting faceZones according to neighbouring cellZones:

Edge intersection testing:
    Number of edges             : 96310
    Number of edges to retest   : 0
    Number of intersected edges : 0

Handling cells with snap problems
---------------------------------

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

Setting cellZones according to locationsInMesh:
Location : (0.01 -0.0005 0.005)
    cellZone : none

For cellZone none found point (0.01 -0.0005 0.005) in global region 0 out of 1 regions.
Created baffles in = 0.08 s


After introducing baffles : cells:24000  faces:96310  points:48622
Cells per refinement level:
    0	24000

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

markFacesOnProblemCells : marked 0 additional internal faces to be converted into baffles.
Analyzed problem cells in = 0.02 s


Introducing baffles to delete problem cells.

Created baffles in = 0.01 s


After introducing baffles : cells:24000  faces:96310  points:48622
Cells per refinement level:
    0	24000
Setting cellZones according to locationsInMesh:
Location : (0.01 -0.0005 0.005)
    cellZone : none

For cellZone none found point (0.01 -0.0005 0.005) in global region 0 out of 1 regions.

Remove unreachable sections of mesh
-----------------------------------

Split mesh in = 0.01 s


After subsetting : cells:24000  faces:96310  points:48622
Cells per refinement level:
    0	24000

Merge free-standing baffles
---------------------------

freeStandingBaffles : detected 0 free-standing baffles out of 0

Detected free-standing baffles : 0
Merged free-standing baffles in = 0.01 s


dupNonManifoldPoints : Found : 0 non-manifold points (out of 48622)
Detected unsplittable baffles : 0

Merge refined boundary faces
----------------------------

Merging 0 sets of faces.

No faces merged ...

Merging all points on surface that
- are used by only two boundary faces and
- make an angle with a cosine of more than 0.707106781187.

No straight edges simplified and no points removed ...
Refined mesh : cells:24000  faces:96310  points:48622
Cells per refinement level:
    0	24000
Writing mesh to time 0
Wrote mesh in = 0.18 s.
Mesh refined in = 0.59 s.

Morphing phase
--------------

Duplicating 0 points on faceZones of type boundary
Snapping to features in 10 iterations ...
Constructing mesh displacer ...
Using mesh parameters 
{
    maxNonOrtho     65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave      80;
    minVol          1e-13;
    minTetQuality   1e-15;
    minArea         -1;
    minTwist        0.02;
    minDeterminant  1e-08;
    minFaceWeight   0.05;
    minVolRatio     0.01;
    minTriangleTwist -1;
    nSmoothScale    4;
    errorReduction  0.75;
    relaxed
    {
        maxNonOrtho     75;
        minTetQuality   -1e+30;
        minTwist        -1;
    }
}


Checking initial mesh ...
Checking faces in error :
    non-orthogonality > 65  degrees                        : 0
    faces with face pyramid volume < 1e-13                 : 0
    faces with face-decomposition tet quality < 1e-15      : 0
    faces with concavity > 80  degrees                     : 0
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 1e-08                : 0
Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)
Checked initial mesh in = 0.05 s


Smoothing patch points ...
Smoothing iteration 0
Found 0 non-manifold point(s).

Scaling iteration 0
Moving mesh using displacement scaling : min:1  max:1
[stack trace]
=============
#1  Foam::sigFpe::sigHandler(int)sh: 1: addr2line: not found
 addr2line failed
#2  ?sh: 1: addr2line: not found
 addr2line failed
#3  Foam::fvGeometryScheme::setMeshPhi() constsh: 1: addr2line: not found
 addr2line failed
#4  Foam::fvGeometryScheme::movePoints()sh: 1: addr2line: not found
 addr2line failed
#5  Foam::basicFvGeometryScheme::movePoints()sh: 1: addr2line: not found
 addr2line failed
#6  Foam::surfaceInterpolation::updateGeom()sh: 1: addr2line: not found
 addr2line failed
#7  Foam::polyMesh::movePoints(Foam::Field<Foam::Vector<double> > const&)sh: 1: addr2line: not found
 addr2line failed
#8  Foam::fvMesh::movePoints(Foam::Field<Foam::Vector<double> > const&)sh: 1: addr2line: not found
 addr2line failed
#9  Foam::motionSmootherAlgo::scaleMesh(Foam::List<int>&, Foam::List<Foam::Pair<int> > const&, Foam::dictionary const&, Foam::dictionary const&, bool, int)sh: 1: addr2line: not found
 addr2line failed
#10  Foam::motionSmootherAlgo::scaleMesh(Foam::List<int>&, Foam::List<Foam::Pair<int> > const&, bool, int)sh: 1: addr2line: not found
 addr2line failed
#11  Foam::snappySnapDriver::preSmoothPatch(Foam::meshRefinement const&, Foam::snapParameters const&, int, Foam::List<Foam::Pair<int> > const&, Foam::motionSmoother&)sh: 1: addr2line: not found
 addr2line failed
#12  Foam::snappySnapDriver::doSnap(Foam::dictionary const&, Foam::dictionary const&, Foam::meshRefinement::FaceMergeType, double, double, Foam::snapParameters const&)sh: 1: addr2line: not found
 addr2line failed
#13  ?sh: 1: addr2line: not found
 addr2line failed
#14  ?sh: 1: addr2line: not found
 addr2line failed
#15  __libc_start_mainsh: 1: addr2line: not found
 addr2line failed
#16  ?sh: 1: addr2line: not found
 addr2line failed
=============
Floating point exception (core dumped)
Siassei is offline   Reply With Quote

Old   September 27, 2023, 10:45
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,067
Rep Power: 26
Yann will become famous soon enough
Thanks, it looks like you don't have any patches to refine in your surface refinement:

Code:
Adding patches for surface regions
----------------------------------

Patch Type                Region                        
----- ----                ------                        
Added patches in = 0 s
You need to define surface refinement for your geometry, this is how snappy knows what surfaces it has to mesh.
Minimal example (you'll have to adjust the refinement levels):

Code:
refinementSurfaces
    {
        Fluid.stl
        {
            level (0 0);
        }
    }
Yann is offline   Reply With Quote

Old   September 27, 2023, 10:53
Default
  #5
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
Thanks, but the error still happens
Siassei is offline   Reply With Quote

Old   September 27, 2023, 13:53
Default
  #6
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
The problem occurs at the snap section. The first smoothing operation leads into an floating point error.

Code:
hecked initial mesh in = 0.49 s


Smoothing patch points ...
Smoothing iteration 0
Found 660 non-manifold point(s).

Scaling iteration 0
Moving mesh using displacement scaling : min:1  max:1
[stack trace]
=============
#1  Foam::sigFpe::sigHandler(int)sh: 1: addr2line: not found
 addr2line failed
#2  ?sh: 1: addr2line: not found
 addr2line failed
#3  Foam::fvGeometryScheme::setMeshPhi() constsh: 1: addr2line: not found
 addr2line failed
#4  Foam::fvGeometryScheme::movePoints()sh: 1: addr2line: not found
 addr2line failed
#5  Foam::basicFvGeometryScheme::movePoints()sh: 1: addr2line: not found
 addr2line failed
#6  Foam::surfaceInterpolation::updateGeom()sh: 1: addr2line: not found
 addr2line failed
#7  Foam::polyMesh::movePoints(Foam::Field<Foam::Vector<double> > const&)sh: 1: addr2line: not found
 addr2line failed
#8  Foam::fvMesh::movePoints(Foam::Field<Foam::Vector<double> > const&)sh: 1: addr2line: not found
 addr2line failed
#9  Foam::motionSmootherAlgo::scaleMesh(Foam::List<int>&, Foam::List<Foam::Pair<int> > const&, Foam::dictionary const&, Foam::dictionary const&, bool, int)sh: 1: addr2line: not found
 addr2line failed
#10  Foam::motionSmootherAlgo::scaleMesh(Foam::List<int>&, Foam::List<Foam::Pair<int> > const&, bool, int)sh: 1: addr2line: not found
 addr2line failed
#11  Foam::snappySnapDriver::preSmoothPatch(Foam::meshRefinement const&, Foam::snapParameters const&, int, Foam::List<Foam::Pair<int> > const&, Foam::motionSmoother&)sh: 1: addr2line: not found
 addr2line failed
#12  Foam::snappySnapDriver::doSnap(Foam::dictionary const&, Foam::dictionary const&, Foam::meshRefinement::FaceMergeType, double, double, Foam::snapParameters const&)sh: 1: addr2line: not found
 addr2line failed
#13  ?sh: 1: addr2line: not found
 addr2line failed
#14  ?sh: 1: addr2line: not found

Last edited by Siassei; September 28, 2023 at 14:06.
Siassei is offline   Reply With Quote

Old   September 27, 2023, 14:25
Default
  #7
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
Your blockMesh is on a wrong scale. Its bounding box is
Code:
boundingBox: (-0.055 -0.001 0) (0.105 0 0.15)
And your stl bounding box is
Code:
boundingBox: (-55 -1 0) (105 0 150)
Remove
Code:
scale   0.001;
from blockMeshDict. Also: make the blockMesh slightly bigger than the geometry, otherwise you will run into other problems.


And I noticed your geometry has an open face (its missing completely), so that will probably cause a different output than what you are looking for if it stays as it is.


General advice: always check visually what you can check visually.
Attached Images
File Type: png open.PNG (11.1 KB, 7 views)
AtoHM is offline   Reply With Quote

Old   September 28, 2023, 03:46
Default
  #8
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
I fixed the opening in the stl file (gmsh bug).
The problem is still the same, but interessting things goes on.

Does snappyHexMesh support meshes with 1x element in one direction ("pseudo 2D")?

Code:
Smoothing patch points ...
Smoothing iteration 0
Found 0 non-manifold point(s).

Scaling iteration 0
Moving mesh using displacement scaling : min:1  max:1
[stack trace]
=============
#1  Foam::sigFpe::sigHandler(int) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#2  ? in /lib/x86_64-linux-gnu/libc.so.6
#3  Foam::fvGeometryScheme::setMeshPhi() const in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#4  Foam::fvGeometryScheme::movePoints() in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#5  Foam::basicFvGeometryScheme::movePoints() in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#6  Foam::surfaceInterpolation::updateGeom() in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#7  Foam::polyMesh::movePoints(Foam::Field<Foam::Vector<double> > const&) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#8  Foam::fvMesh::movePoints(Foam::Field<Foam::Vector<double> > const&) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#9  Foam::motionSmootherAlgo::scaleMesh(Foam::List<int>&, Foam::List<Foam::Pair<int> > const&, Foam::dictionary const&, Foam::dictionary const&, bool, int) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libdynamicMesh.so
#10  Foam::motionSmootherAlgo::scaleMesh(Foam::List<int>&, Foam::List<Foam::Pair<int> > const&, bool, int) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libdynamicMesh.so
#11  Foam::snappySnapDriver::preSmoothPatch(Foam::meshRefinement const&, Foam::snapParameters const&, int, Foam::List<Foam::Pair<int> > const&, Foam::motionSmoother&) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libsnappyHexMesh.so
#12  Foam::snappySnapDriver::doSnap(Foam::dictionary const&, Foam::dictionary const&, Foam::meshRefinement::FaceMergeType, double, double, Foam::snapParameters const&) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libsnappyHexMesh.so
#13  ? in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/bin/snappyHexMesh
#14  ? in /lib/x86_64-linux-gnu/libc.so.6
#15  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#16  ? in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/bin/snappyHexMesh
=============

Last edited by Siassei; September 28, 2023 at 14:06.
Siassei is offline   Reply With Quote

Old   September 28, 2023, 04:01
Default
  #9
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,067
Rep Power: 26
Yann will become famous soon enough
Snappy does not support pseudo 2D mesh (it will also refine cells in the 3rd direction) .
I don't think the 1 element thickness should be an issue, however it's bad practice to have the blockMesh boundaries perfectly overlapping the STL faces. It often leads to wrongly defined patches where snappy mixed the blockMesh boundaries and STL boundaries.

2 options
  1. create a blockMesh bigger than your STL in all 3 directions, with some room between STL and blockMesh boundaries in order to let snappy do its snapping job
  2. create a blockMesh bigger than your STL in the 2 directions of interest, and extend your STL thickness in the 3rd direction to have a clean intersection between the STL and the blockMesh boundary (see attached picture)

After meshing with snappy, if you had to refine some areas you will end up with several cells along the 3rd direction. You will have to use extrudeMesh to extrude one of the side patch in order to create a mesh fit for 2D simulation (one cell thickness)
Attached Images
File Type: jpg screen_airfoil.jpg (75.6 KB, 7 views)
Yann 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
PROBLEM USING rhoCentralFoam AND snappyHexMesh davidvzq OpenFOAM Running, Solving & CFD 0 May 27, 2021 00:01
[snappyHexMesh] snappyHexMesh runs endless - I need general advise TeresaT OpenFOAM Meshing & Mesh Conversion 5 November 17, 2015 02:50
potentialFoam & simpleFoam crashes after snappyhexmesh [parallel execution] pilot320 OpenFOAM Running, Solving & CFD 10 November 12, 2015 16:56
First order in fvSchemes does not seem to work gerritgroot OpenFOAM Running, Solving & CFD 0 September 30, 2015 20:06
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


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