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

[snappyHexMesh] Attempting to lower skew, with some issues

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 7, 2025, 21:00
Default Attempting to lower skew, with some issues
  #1
New Member
 
Noah
Join Date: Dec 2025
Posts: 2
Rep Power: 0
NohBalls is on a distinguished road
Hello! I am working on running CFD on a road bicycle frame with wheels, to see the effects of certain changes in the frame on its aerodynamics. I have chosen to use OpenFOAM with FreeCad 1.0.2 and CfdOF, and I am using snappyHexMesh.

The model is quite complex, and I have made some effort to remove bodies that add complexity with little relevance to the analysis. Using Fusion 360 I export as STEP and import into FreeCAD. I made a compound of the bicycle model and the rectangular space where the bike resides.

I have tried meshing with other meshers available in FreeCad CfdOF, but snappyHexMesh is the only one to successfully mesh. Upon checking the mesh, I am getting a maximum skewness from 5-10 in most cases, which fails the mesh check. When I try to refine my mesh further to reduce the skew, snappyHexMesh will often freeze on "Introducing zones for interfaces", and not continue.

To summarize, I am running a base element size of 50mm, often refining down to around 0.1 relative element size on the surface refinements of the bicycle components. I have stayed with 3 cells between levels, explicit edge detection, and no edge refinement. When I try and go below 0.1 relative, snappy freezes and does not continue.



Here is a snappyHexMeshDict for a recent mesh of mine, which gave a max skew of about 5.46:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
|                                                                             |
|                Generated by the CfdOF workbench for FreeCAD                 |
|                      https://github.com/jaheyns/CfdOF                       |
|                                                                             |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     4.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;
snap            true;
addLayers       false;

geometry
{
    "Compound_Geometry.stl"
    {
        type triSurfaceMesh;
        name Compound_Geometry;
        file "Compound_Geometry.stl";
        regions
        {
            patch_0_1
            {
                name patch_0_1;
            }

            patch_0_2
            {
                name patch_0_2;
            }

            patch_0_3
            {
                name patch_0_3;
            }

            patch_1_0
            {
                name patch_1_0;
            }

            patch_2_0
            {
                name patch_2_0;
            }

            patch_3_0
            {
                name patch_3_0;
            }

        }
    }

    "MeshRefinement.stl"
    {
        type triSurfaceMesh;
        name MeshRefinement;
        file "MeshRefinement.stl";
    }

    "MeshRefinement001.stl"
    {
        type triSurfaceMesh;
        name MeshRefinement001;
        file "MeshRefinement001.stl";
    }

    "MeshRefinement002.stl"
    {
        type triSurfaceMesh;
        name MeshRefinement002;
        file "MeshRefinement002.stl";
    }

};

castellatedMeshControls
{
    maxLocalCells 100000000;
    maxGlobalCells 2000000000;
    minRefinementCells 0;
    nCellsBetweenLevels 3;
    maxLoadUnbalance 0.20;

    features
    (
        {
            file "Compound_Geometry.eMesh";
            level 0;
        }
        {
            file "MeshRefinement.eMesh";
            level 0;
        }

        {
            file "MeshRefinement001.eMesh";
            level 0;
        }

        {
            file "MeshRefinement002.eMesh";
            level 0;
        }

    );

    refinementSurfaces
    {
        Compound_Geometry
        {
            level (0 0);
        }

        MeshRefinement
        {
            level (4 4);
            faceZone MeshRefinement;
        }

        MeshRefinement001
        {
            level (4 4);
            faceZone MeshRefinement001;
        }

        MeshRefinement002
        {
            level (4 4);
            faceZone MeshRefinement002;
        }

    }

    resolveFeatureAngle 30;

    refinementRegions
    {
    }

    locationInMesh (0.0 0.0 0.0);
    allowFreeStandingZoneFaces true;
}

snapControls
{
    nSmoothPatch 3;
    tolerance 1.0;
    nSolveIter 100;
    nRelaxIter 5;
    nFeatureSnapIter 10;

    implicitFeatureSnap false;
    explicitFeatureSnap true;
}

addLayersControls
{
    relativeSizes true;
    layers
    {
    }

    expansionRatio 1.2;
    finalLayerThickness 0.3;
    minThickness 0.1;
    nGrow 0;
    featureAngle 120;
    nRelaxIter 3;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedialAxisAngle 90;
    minMedianAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
}

meshQualityControls
{
    maxNonOrtho 65;

    maxBoundarySkewness 20;
    maxInternalSkewness 4;

    maxConcave 80;
    minVol 1e-13;
    minTetQuality -1;
    minArea -1;
    minTwist 0.01;
    minDeterminant 0.001;
    minFaceWeight 0.05;
    minVolRatio 0.01;
    minTriangleTwist -1;
    nSmoothScale 4;
    errorReduction 0.75;
    relaxed
    {
        maxNonOrtho 75;
    }
}

mergeTolerance 1e-6;

// ************************************************************************* //
Here are the lines produced for a successful mesh with a skew of about 4.83:

Code:
18:02:48  End

18:02:48  Executing: checkMesh -meshQuality in C:\Users\nohda\AppData\Local\Temp\meshCase
18:03:20  /*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  12
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
/*   Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt   *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com   |
\*---------------------------------------------------------------------------*/
Build  : 12-8e8552546d20
Exec   : checkMesh -meshQuality
Date   : Dec 07 2025
Time   : 18:03:20
Host   : "NOHRIGG"
PID    : 43976
I/O    : uncollated
Case   : C:/Users/nohda/AppData/Local/Temp/meshCase
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

--> FOAM Warning : 
    From function static Foam::instantList Foam::timeSelector::select0(Foam::Time&, const Foam::argList&)
    in file db/Time/timeSelector.C at line 269
    No time specified or available, selecting 'constant'
Create polyMesh for time = constant

18:03:20  Enabling user-defined geometry checks.

18:03:31  Time = constant

18:03:31  Mesh stats
    points:           2263607
    faces:            6641921
    internal faces:   6524876
    cells:            2189733
    faces per cell:   6.01296916108037
    boundary patches: 6
    point zones:      0
    face zones:       3
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     2176117
    prisms:        425
    wedges:        0
    pyramids:      0
    tet wedges:    2
    tetrahedra:    0
    polyhedra:     13189
    Breakdown of polyhedra by number of faces:
        faces   number of cells
            4   886
            5   1536
            6   3673
            9   4553
           12   1525
           15   955
           18   61

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
18:03:31      Point usage OK.
18:03:32      Upper triangular ordering OK.
18:03:32      Face vertices OK.
18:03:34      Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
                   Patch    Faces   Points                  Surface topology
               patch_0_1     6374     7217  multiply connected (shared edge)
               patch_0_2     7492     8482  ok (non-closed singly connected)
               patch_0_3     1637     1811  multiply connected (shared edge)
               patch_1_0    12051    12272  ok (non-closed singly connected)
               patch_2_0    12051    12272  ok (non-closed singly connected)
               patch_3_0    77440    77880  ok (non-closed singly connected)

Checking geometry...
    Overall domain bounding box (-2.96645712852478 -1.16999995708466 -0.805481016635895) (0.541160702705383 1.16999995708466 1.24515795707703)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
18:04:12      Max cell openness = 3.4554989943061e-16 OK.
    Max aspect ratio = 7.84703747468256 OK.
    Minimum face area = 2.78960374638515e-08. Maximum face area = 0.000478492562917788.  Face area magnitudes OK.
    Min volume = 2.47891579817589e-08. Max volume = 9.6185816079543e-06.  Total volume = 16.8191569129124.  Cell volumes OK.
    Mesh non-orthogonality Max: 64.7241437838534 average: 2.35993054673786
    Non-orthogonality check OK.
18:04:13      Face pyramids OK.
 ***Max skewness = 4.82949782233829, 1 highly skew faces detected which may impair the quality of the results
    Coupled point location match (average 0) OK.
Checking faces in error :
18:04:15      non-orthogonality >  90 degrees                        : 0
18:04:15      faces with face pyramid volume <     0                 : 0
18:04:16      faces with concavity >  90 degrees                     : 0
18:04:16      faces with skewness >  50 (internal) or 100 (boundary) : 0
    faces with interpolation weights (0..1)  < 0.0001       : 0
    faces with volume ratio of neighbour cells < 0.0001     : 0
18:04:17      faces on cells with determinant <     0                : 0
18:04:17  
Failed 1 mesh checks.

End

18:04:17
And finally, the output when running an unsuccessful mesh, where it froze in an attempt to refine further.

Code:
........

Introducing baffles to delete problem cells.

18:19:53  Edge intersection testing:
    Number of edges             : 24981346
18:20:03      Number of edges to retest   : 7176955
18:20:03      Number of intersected edges : 3545085
18:20:06  Created baffles in = 13.715 s
18:20:06  

18:20:06  After introducing baffles : cells:6758398  faces:24981346  points:7820483
18:20:07  Cells per refinement level:
18:20:07      0	2328737
    1	92109
    2	299683
    3	530281
    4	3507588

18:20:07  Remove unreachable sections of mesh
-----------------------------------

18:20:07  Keeping all cells in regions containing any point in 1((0 0 0))
18:20:27  Selected for keeping : 5324409 cells.
18:20:27  Edge intersection testing:
    Number of edges             : 16932619
18:20:33      Number of edges to retest   : 0
18:20:33      Number of intersected edges : 904445
18:20:33  Split mesh in = 26.377 s


18:20:33  After subsetting : cells:5324409  faces:16932619  points:6257126
18:20:33  Cells per refinement level:
18:20:33      0	2102050
    1	92090
    2	272538
    3	515300
    4	2342431

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

Surface : MeshRefinement
    faceZone : MeshRefinement
    cellZone : 
Surface : MeshRefinement001
    faceZone : MeshRefinement001
    cellZone : 
Surface : MeshRefinement002
    faceZone : MeshRefinement002
    cellZone : 
18:20:33  Walking from locations-in-mesh 1((0 0 0)) to assign cellZones - crossing a faceZone face changes cellZone
18:20:34  
18:20:34  Found point (0 0 0) in global region 0 out of 1 regions.
18:20:50  Detected 802903 free-standing zone faces
18:20:51
Any and all help, suggestions, comments, and concerns are welcome. Thanks!
NohBalls is offline   Reply With Quote

Old   December 10, 2025, 03:41
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 729
Rep Power: 14
AtoHM is on a distinguished road
I have tried several OF solvers with meshes of skew up to 12. None of it fails or produces bad output as long as you are under 12 and its a non-significant ratio of the total cells. Usually its some spot or a few spots with only a few cells.
Go for the simulation, check p is converging and you should be good. 1 cell > 4 is a dream
AtoHM is offline   Reply With Quote

Old   December 16, 2025, 11:11
Default
  #3
Senior Member
 
Join Date: Dec 2021
Posts: 295
Rep Power: 7
Alczem is on a distinguished road
Hey,


The brake disc looks all choppy and poorly meshed, are you sure it is propely resolved? I would try to either remove it or thicken it a bit if you cannot afford to refine the mesh at this location.
Alczem is offline   Reply With Quote

Old   January 5, 2026, 19:33
Default
  #4
New Member
 
Noah
Join Date: Dec 2025
Posts: 2
Rep Power: 0
NohBalls is on a distinguished road
Quote:
Originally Posted by AtoHM View Post
I have tried several OF solvers with meshes of skew up to 12. None of it fails or produces bad output as long as you are under 12 and its a non-significant ratio of the total cells. Usually its some spot or a few spots with only a few cells.
Go for the simulation, check p is converging and you should be good. 1 cell > 4 is a dream
That is reassuring. I will say I've since refined my mesh further, and despite still having a higher skew, I am able to get my p to converge. Thanks for your help and advice!

Quote:
Originally Posted by Alczem View Post
Hey,

The brake disc looks all choppy and poorly meshed, are you sure it is propely resolved? I would try to either remove it or thicken it a bit if you cannot afford to refine the mesh at this location.
I have since refined my mesh and the brake disc looks much better. I do agree that this may be worth removing, but I will proceed with it for now.
I did not think to thicken the disc a bit! I will give that a shot.

In hindsight I made this post in a bit of a panic and have since made good progress on my case.
I will create another post once I require some more feedback and advice.
Thanks to you both and best wishes to your new year!
NohBalls is offline   Reply With Quote

Reply

Tags
freecad, openfoam, skewness

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] Skew Faces in Mesh CfdUser5855 OpenFOAM Meshing & Mesh Conversion 0 August 3, 2022 09:55
Temperature lower than possible in closed domain Czarulla Main CFD Forum 1 January 15, 2015 06:01
[snappyHexMesh] upper and lower patch for a 0_thick Membrane in a wind tunnel hfs OpenFOAM Meshing & Mesh Conversion 7 October 15, 2013 17:41
Lower heating value Andrea Siemens 2 July 30, 2007 08:19
equiangle skew with tetrahedral cells Wouter FLUENT 0 December 7, 2005 06:03


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