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

[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree13Likes
  • 10 Post By SirWombat
  • 1 Post By SirWombat
  • 2 Post By john myce

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2012, 06:13
Default Add Mesh Layers doesnt work on the whole surface
  #1
New Member
 
Join Date: Sep 2012
Posts: 8
Rep Power: 14
Kryo is on a distinguished road
Hello,

I just tried to make a simple mesh with snappyHexMesh, and everything worked quite well so far.

But now I am at a point, where I cannot find a solution to my current problem.

I got a simple "rocket" which exists of a cylinder and a cone as tip and rear.
When creating the mesh it adds the layers on the surface correctly, but only on the cylindrical part.

you can find a screenshot here: https://dl.dropbox.com/u/3545765/layersproblem.png

as you see the layers stop at the edge, same on the tip and rear side.

my snappyhexmeshdict as follows:
Code:
addLayersControls
{
   
    relativeSizes true;


    layers
    {
        rocketbody_rocketbodysurf

        {
            nSurfaceLayers 20;
        }
    }


    expansionRatio 1.1;

     finalLayerThickness 1e-1;


    minThickness 1e-10;

    nGrow 1;

  
    featureAngle 310;


    nRelaxIter 3;

    nSmoothSurfaceNormals 1;


    nSmoothNormals 3;


    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;

    maxThicknessToMedialRatio 0.3;

    
    minMedianAxisAngle 180;


    nBufferCellsNoExtrude 0;


    nLayerIter 1500;
}
changing feature angle does impact it slightly, but still even with 360° it doesnt work. The STL file is all in one, so there is only one surface which is rocketbody_rocketbodysurf.

Anyone any ideas? Thanks in advance!


EDIT: maybe the output would also be interesting:
Code:
Shrinking and layer addition phase
----------------------------------

Using mesh parameters 
{
    maxNonOrtho     180;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave      180;
    minVol          -1e-13;
    minTetQuality   1e-30;
    minArea         -1;
    minTwist        0.02;
    minDeterminant  0.001;
    minFaceWeight   0.02;
    minVolRatio     0.01;
    minTriangleTwist -1;
    nSmoothScale    4;
    errorReduction  0.75;
}



Merging all faces of a cell
---------------------------
    - which are on the same patch
    - which make an angle < 310 degrees
      (cos:0.642788)
    - as long as the resulting face doesn't become concave by more than 90 degrees
      (0=straight, 180=fully concave)

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

No straight edges simplified and no points removed ...

Checking mesh manifoldness ...

Checking initial mesh ...
Checking faces in error :
    faces with face pyramid volume < -1e-13                 : 0
    faces with face-decomposition tet quality < 1e-30      : 0
    faces with skewness >   4 (internal) or  20 (boundary) : 0
    faces with interpolation weights (0..1)  <  0.02       : 0
    faces with volume ratio of neighbour cells <  0.01     : 0
    faces with face twist <  0.02                          : 0
    faces on cells with determinant < 0.001                : 0
Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)

Adding in total 0 inter-processor patches to handle extrusion of non-manifold processor boundaries.
Constructing mesh displacer ...

Handling points with inconsistent layer specification ...

Handling non-manifold points ...

Checking patch manifoldness ...
Outside of local patch is multiply connected across edges or points at 0 points.
Set displacement to zero for all 0 non-manifold points

Handling feature edges ...

Handling cells with warped patch faces ...
Set displacement to zero on 0 warped faces since layer would be > 0.5 of the size of the bounding box.

Growing non-extrusion points by one layer ...
Set displacement to zero for an additional 0 points.

patch                     faces    layers avg thickness[m]
                                          near-wall overall
-----                     -----    ------ --------- -------
rocketbody_rocketbodysurf 4536     20     0.00511   0.293   

medialAxisSmoothingInfo : Calculate distance to Medial Axis ...
shrinkMeshDistance : Smoothing normals ...
    Iteration 0   residual 0.0105
shrinkMeshDistance : Smoothing normals ...
shrinkMeshDistance : Smoothing normals in interior ...
    Iteration 0   residual 0.0632

Layer addition iteration 0
--------------------------
Prevented extrusion on 0 coupled patch points during syncPatchDisplacement.

Determining displacement for added points according to pointNormal ...
Prevented extrusion on 0 coupled patch points during syncPatchDisplacement.

shrinkMeshMedialDistance : Smoothing using Medial Axis ...
shrinkMeshMedialDistance : Reduce layer thickness at 0 nodes where thickness to medial axis distance is large 
shrinkMeshDistance : Removing isolated regions ...
Number isolated points extrusion stopped : 0
shrinkMeshDistance : Smoothing field ...
    Iteration 0   residual 9.04e-05
shrinkMeshMedialDistance : Moving mesh ...
Iteration 0
Moving mesh using diplacement scaling : min:1  max:1
Checking faces in error :
    faces with face pyramid volume < -1e-13                 : 0
    faces with face-decomposition tet quality < 1e-30      : 0
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.02        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 0.001                : 0
shrinkMeshMedialDistance : Successfully moved mesh
shrinkMeshMedialDistance : Finished moving mesh ...
Prevented extrusion on 0 coupled patch points during syncPatchDisplacement.
truncateDisplacement : Unextruded 0 faces due to non-consecutive vertices being extruded.
truncateDisplacement : Unextruded 0 faces due to stringed edges with inconsistent extrusion.

Setting up information for layer truncation ...

Checking mesh with layer ...
Checking faces in error :
    faces with face pyramid volume < -1e-13                 : 0
    faces with face-decomposition tet quality < 1e-30      : 3588
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.02        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 0.001                : 0
Detected 3588 illegal faces (concave, zero area or negative cell pyramid volume)
Extruding 4016 out of 4536 faces (88.5%). Removed extrusion at 302 faces.

Growing non-extrusion points by one layer ...
Set displacement to zero for an additional 198 points.


Layer addition iteration 1
--------------------------
Prevented extrusion on 0 coupled patch points during syncPatchDisplacement.

Determining displacement for added points according to pointNormal ...
Prevented extrusion on 0 coupled patch points during syncPatchDisplacement.

shrinkMeshMedialDistance : Smoothing using Medial Axis ...
shrinkMeshMedialDistance : Reduce layer thickness at 0 nodes where thickness to medial axis distance is large 
shrinkMeshDistance : Removing isolated regions ...
Number isolated points extrusion stopped : 9
shrinkMeshDistance : Smoothing field ...
    Iteration 0   residual 0.00104
shrinkMeshMedialDistance : Moving mesh ...
Iteration 0
Moving mesh using diplacement scaling : min:1  max:1
Checking faces in error :
    faces with face pyramid volume < -1e-13                 : 0
    faces with face-decomposition tet quality < 1e-30      : 0
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.02        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 0.001                : 0
shrinkMeshMedialDistance : Successfully moved mesh
shrinkMeshMedialDistance : Finished moving mesh ...
Prevented extrusion on 0 coupled patch points during syncPatchDisplacement.
truncateDisplacement : Unextruded 0 faces due to non-consecutive vertices being extruded.
truncateDisplacement : Unextruded 0 faces due to stringed edges with inconsistent extrusion.

Setting up information for layer truncation ...

Checking mesh with layer ...
Checking faces in error :
    faces with face pyramid volume < -1e-13                 : 0
    faces with face-decomposition tet quality < 1e-30      : 0
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.02        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 0.001                : 0
Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)
Extruding 3736 out of 4536 faces (82.4%). Removed extrusion at 0 faces.
Edge intersection testing:
    Number of edges             : 339036
    Number of edges to retest   : 0
    Number of intersected edges : 60289
Writing 55752 added cells to cellSet addedCells
Writing 52016 faces inside added layer to faceSet layerFaces
Layer mesh : cells:109064  faces:339036  points:121291
Cells per refinement level:
    0    7568
    1    2456
    2    6988
    3    7552
    4    2780
    5    8004
    6    73716
Writing mesh to time 3e-07
Wrote mesh in = 5.26 s.
Layers added in = 5.26 s.
Finished meshing in = 12.6 s.
End

Last edited by Kryo; September 10, 2012 at 06:34.
Kryo is offline   Reply With Quote

Old   September 11, 2012, 03:22
Default
  #2
New Member
 
Jane L
Join Date: May 2012
Posts: 23
Rep Power: 14
Jane L is on a distinguished road
For my current project, I can control that kind of proplem with the following options

resolveFeatureAngle 180;
featureAngle 180;

I don't know for sure if it helps because you have allready a tall number for featureAngle

good luck!
Jane L is offline   Reply With Quote

Old   September 11, 2012, 05:47
Default
  #3
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 19
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
The featureAngle should be fine, though any number beyond 180 should make no difference than using 180.

but lets have a look at the output:

Quote:
Originally Posted by Kryo View Post
Hello,
Code:
Checking faces in error :
    faces with face pyramid volume < -1e-13                 : 0
    faces with face-decomposition tet quality < 1e-30      : 3588
I recommend to alter the quality settings! Just try a to switch that "minTetQuality" off by using
Code:
minTetQuality   -1e30;
and see where that leads.

Also I highly recommend to reduce the "nLayerIter" to a reasonable number, i.e. 10. Else SHM may get stuck in iterating if it fails to meet your quality settings. Better check the output to see if it does converge.

If you want the furthest layer cell to be of equal thickness to the surrounding mesh (finalLayerThickness 1;), then use the following:

Code:
...
    nSmoothSurfaceNormals 50;
    nSmoothNormals 50;
    nSmoothThickness 100;
    maxFaceThicknessRatio 0.8;
    maxThicknessToMedialRatio 0.9;
...

Greetings,
Jan
__________________
~~~_/)~~~

Last edited by SirWombat; September 12, 2012 at 02:00.
SirWombat is offline   Reply With Quote

Old   September 11, 2012, 16:37
Default
  #4
New Member
 
Join Date: Sep 2012
Posts: 8
Rep Power: 14
Kryo is on a distinguished road
thanks a lot SirWombat, that did actually help now nearly all parts of the surface have the layer

Now I can start running some solvers, and see what problems that will bringt forth :P
Kryo is offline   Reply With Quote

Old   September 13, 2012, 05:32
Default
  #5
Senior Member
 
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14
Eloise is on a distinguished road
Hi Jan,

Could you develop a bit about the reason why you recommend those parameters? What is their actual effect on the layers? This would be great help!

Regards,
Eloïse

Quote:
Originally Posted by SirWombat View Post
If you want the furthest layer cell to be of equal thickness to the surrounding mesh (finalLayerThickness 1;), then use the following:
Code:
...
    nSmoothSurfaceNormals 50;
    nSmoothNormals 50;
    nSmoothThickness 100;
    maxFaceThicknessRatio 0.8;
    maxThicknessToMedialRatio 0.9;
...
Eloise is offline   Reply With Quote

Old   September 13, 2012, 05:50
Default
  #6
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 19
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
Hi Eloïse,

it's just what I've been experimenting with and found it to be most suitable for smooth geometries. But I'll try to give an answer anyway:

the smoothing-parameters should be clear .. they smooth the "layer-surface", which consist of all faces between the added layers and the rest of the mesh.

The maxFaceThicknessRatio in combination with maxThicknessToMedialRatio have a strong influence on how thick those layer-cells get in relation to surrounding layer cells, especially towards to the end/edge of the added layer region.

If you would like to experiment yourself then switch off all quality controls and try some variations on those "addLayer"-parameters. Do this on a small and simple mesh so to get a fast result. You will find it to be enlightening!

G Jan
y_jiang likes this.
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   September 13, 2012, 06:08
Default
  #7
New Member
 
Join Date: Sep 2012
Posts: 8
Rep Power: 14
Kryo is on a distinguished road
well here I am again. Its not quite fitting to the thread title, but I didnt want to open another one.

The calculation is now working fine, but now I wanted to ask, is there no adaptive mesh refinement utility in OpenFoam? I am using sonicFoam with Mach 1.6, and have compression shocks, where I would like to refine the mesh automatically where there is a high pressure gradient. But google didnt help me
Kryo is offline   Reply With Quote

Old   September 13, 2012, 06:44
Default
  #8
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 19
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
sorry I cannot help you with that topic but google "openfoam adaptive mesh refinement" and have a look at the first result: Chalmers compiled a new solver including AMR ... maybe there's a way to do that with sonicFoam as well ...
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   September 13, 2012, 09:28
Default
  #9
New Member
 
Join Date: Sep 2012
Posts: 8
Rep Power: 14
Kryo is on a distinguished road
so there is no way other than coding something like that myself?
Kryo is offline   Reply With Quote

Old   June 29, 2018, 02:44
Default addLayers
  #10
New Member
 
rajat tripathi
Join Date: May 2018
Location: india
Posts: 9
Rep Power: 8
aero.rajat is on a distinguished road
I am facing issues with addLayers. Is anyone out there?
aero.rajat is offline   Reply With Quote

Old   March 7, 2020, 16:47
Default
  #11
Senior Member
 
Ali Shayegh
Join Date: Oct 2015
Posts: 131
Rep Power: 11
amuzeshi is on a distinguished road
Quote:
Originally Posted by SirWombat View Post
...I recommend to alter the quality settings! Just try a to switch that "minTetQuality" off by using
Code:
minTetQuality   -1e30;
and see where that leads.
hello;

Do you know what does minTetQuality mathematically mean? May turning it off produce negative volume cells?

Thanks.
Ali
amuzeshi is offline   Reply With Quote

Old   March 10, 2020, 03:27
Default
  #12
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 8
john myce is on a distinguished road
Hello,

You can have a nice description of the mesh quality criteria on this pdf :
https://openfoamwiki.net/images/f/f0...SlidesOFW7.pdf - slide 54 for minTetQuality

In my case I have got negative minTetVolume but it does not produce negative volume. I think it is related to the direction of the three vectors (slide 54) that characterized the cell.

Cheers
amuzeshi and Aabadani like this.
john myce is offline   Reply With Quote

Old   March 11, 2020, 16:16
Default
  #13
Senior Member
 
Ali Shayegh
Join Date: Oct 2015
Posts: 131
Rep Power: 11
amuzeshi is on a distinguished road
Quote:
Originally Posted by john myce View Post
Hello,

You can have a nice description of the mesh quality criteria on this pdf :
https://openfoamwiki.net/images/f/f0...SlidesOFW7.pdf - slide 54 for minTetQuality

In my case I have got negative minTetVolume but it does not produce negative volume. I think it is related to the direction of the three vectors (slide 54) that characterized the cell.

Cheers

Referring to the slide that you have mentioned, since cr is always positive, there is only one possibility that can cause negative minTetQuality, namely negative tv; But when it happens?
Since the angle between a and b is always < 180 (this angle is one of the three angles of a triangle), there remains only one possibility for minTetQualituy to be negative, that is, Angle between axb and c > 90. Here we must know how OpenFOAM selects a and b.
  1. If it always selects a and b such that axb points inward the cell, so, negative minTetQuality is a serious topological error which may indicate an inside-out tet (Please correct me if I am wrong).
  2. But if OpenFOAM selects a and b regardless of the direction of their cross product, negative minTetQuality is not necessarily a topological error.

Thank you,
Ali

Last edited by amuzeshi; March 11, 2020 at 22:42.
amuzeshi is offline   Reply With Quote

Old   February 17, 2022, 07:34
Default
  #14
Member
 
George
Join Date: Dec 2020
Posts: 31
Rep Power: 5
damon707 is on a distinguished road
Hello all,

Sorry for bringing up this issue again.
Did anyone manage to answer how important minTetQuality is? Anyone able to answer the last remark that Ali made on this post?

Best,
George
damon707 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[snappyHexMesh] snappyHexMesh generates not planar surface krzychu111 OpenFOAM Meshing & Mesh Conversion 2 April 23, 2020 16:38
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 04:17
[ICEM] surface mesh merging problem everest ANSYS Meshing & Geometry 44 April 14, 2016 06:41
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan OpenFOAM Meshing & Mesh Conversion 3 October 22, 2015 11:05
[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 04:04.