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

[snappyHexMesh] Why doesn't SnappyHexMesh retain patches from BlockMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2019, 17:32
Default Why doesn't SnappyHexMesh retain patches from BlockMesh
  #1
New Member
 
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8
Nidalsb is on a distinguished road
Hi,

I have the following blockMeshDict, with a defined inlet, outlet and walls.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0 0 400)
    (0 400 400)
    (400 400 400)
    (400 0 400)
    (0 0 0)
    (0 400 0)
    (400 400 0)
    (400 0 0)

);

blocks
(
    hex (0 1 2 3 4 5 6 7) 
    square (100 100 100) simpleGrading (1 1 1)

);

edges
(
);

patches
(
    	patch xmin
    (
       (0 1 5 4)
    )
    	
      patch xmax
    (
      (3 2 6 7)
    )

     	patch ymin
    (
    	(0 3 4 7)
    )

	    patch ymax
    (
	    (1 5 6 2)
    )

	    patch zmin
    (
	    (0 3 2 1)
    )

	    patch zmax
    (
	    (4 5 6 7)
    )

);

mergePatchPairs
(
);

// ************************************************************************* //
After that I ran the following snappyHexMeshDict.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  dev                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       false;


// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
    Exo5.stl
    {
        type triSurfaceMesh;
        name interiorWalls;
    }
    
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    maxLocalCells 90000000;
    maxGlobalCells 90000000;
    minRefinementCells 10;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 3;



    features
    (
    );



    refinementSurfaces
    {
        interiorWalls
        {
            // Surface-wise min and max refinement level
            level (3 3);

        }
    }


    refinementRegions
    {
    }

	resolveFeatureAngle 30;
	
	locationInMesh (0 7.628 0);
	
    // Whether any faceZones (as specified in the refinementSurfaces)
    // are only on the boundary of corresponding cellZones or also allow
    // free-standing zone faces. Not used if there are no faceZones.
    allowFreeStandingZoneFaces false;

	}

// Settings for the snapping.
snapControls
{
    //- Number of patch smoothing iterations before finding correspondence
    //  to surface
    nSmoothPatch 3;

    //- Relative distance for points to be attracted by surface feature point
    //  or edge. True distance is this factor times local
    //  maximum edge length.
    tolerance 2.0;

    //- Number of mesh displacement relaxation iterations.
    nSolveIter 200;

    //- Maximum number of snapping relaxation iterations. Should stop
    //  before upon reaching a correct mesh.
    nRelaxIter 5;

    // Feature snapping

    //- Number of feature edge snapping iterations.
    //  Leave out altogether to disable.
    nFeatureSnapIter 10;

    //- Detect (geometric only) features by sampling the surface
    //  (default=false).
    implicitFeatureSnap false;

    //- Use castellatedMeshControls::features (default = true)
    explicitFeatureSnap true;

    //- Detect points on multiple surfaces (only for explicitFeatureSnap)
    multiRegionFeatureSnap false;
}



// Settings for the layer addition.
addLayersControls
{
    // Are the thickness parameters below relative to the undistorted
    // size of the refined cell outside layer (true) or absolute sizes (false).
    relativeSizes true;

    // Per final patch (so not geometry!) the layer information
    layers
    {
        "interiorWalls.*"
        {
            nSurfaceLayers 1;
        }
    }

    // Expansion factor for layer mesh
    expansionRatio 1.15;

    // Wanted thickness of final added cell layer. If multiple layers
    // is the thickness of the layer furthest away from the wall.
    // Relative to undistorted size of cell outside layer.
    // See relativeSizes parameter.
    finalLayerThickness 0.1;

    // Minimum thickness of cell layer. If for any reason layer
    // cannot be above minThickness do not add layer.
    // Relative to undistorted size of cell outside layer.
    minThickness 0.1;

    // If points get not extruded do nGrow layers of connected faces that are
    // also not grown. This helps convergence of the layer addition process
    // close to features.
    // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
    nGrow 0;

    // Advanced settings

    // When not to extrude surface. 0 is flat surface, 90 is when two faces
    // are perpendicular
    featureAngle 60;

    // At non-patched sides allow mesh to slip if extrusion direction makes
    // angle larger than slipFeatureAngle.
    slipFeatureAngle 30;

    // Maximum number of snapping relaxation iterations. Should stop
    // before upon reaching a correct mesh.
    nRelaxIter 3;

    // Number of smoothing iterations of surface normals
    nSmoothSurfaceNormals 1;

    // Number of smoothing iterations of interior mesh movement direction
    nSmoothNormals 3;

    // Smooth layer thickness over surface patches
    nSmoothThickness 10;

    // Stop layer growth on highly warped cells
    maxFaceThicknessRatio 0.5;

    // Reduce layer growth where ratio thickness to medial
    // distance is large
    maxThicknessToMedialRatio 0.3;

    // Angle used to pick up medial axis points
    // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
    minMedianAxisAngle 90;


    // Create buffer region for new layer terminations
    nBufferCellsNoExtrude 0;


    // Overall max number of layer addition iterations. The mesher will exit
    // if it reaches this number of iterations; possibly with an illegal
    // mesh.
    nLayerIter 50;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
    #include "meshQualityDict"


    // Advanced

    //- Number of error distribution iterations
    nSmoothScale 4;
    //- Amount to scale back displacement at error points
    errorReduction 0.75;
}


// Advanced

// Write flags
writeFlags
(
    scalarLevels
    layerSets
    layerFields     // write volScalarField for layer coverage
);


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-06;


// ************************************************************************* //
I would have expected that my patches in blockMeshDict (xmin,xmax,ymin...) should be retained in snappyHexMesh and my final mesh however that did not happen. any idea why this might have happened? or is there a way to keep those patches?

IMPORTANT NOTE: When I open my BlockMesh the patches do show. when I run snappyHexMesh, the patches exist in the boundary file but all of them have 0 faces.

Thank you!
Nidalsb is offline   Reply With Quote

Old   June 22, 2022, 15:23
Default
  #2
New Member
 
Goutham Ponnusamy
Join Date: Dec 2019
Location: Birmingham
Posts: 7
Rep Power: 7
g.ponnusamy is on a distinguished road
Send a message via Skype™ to g.ponnusamy
Quote:
Originally Posted by Nidalsb View Post
Hi,

I have the following blockMeshDict, with a defined inlet, outlet and walls.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0 0 400)
    (0 400 400)
    (400 400 400)
    (400 0 400)
    (0 0 0)
    (0 400 0)
    (400 400 0)
    (400 0 0)

);

blocks
(
    hex (0 1 2 3 4 5 6 7) 
    square (100 100 100) simpleGrading (1 1 1)

);

edges
(
);

patches
(
    	patch xmin
    (
       (0 1 5 4)
    )
    	
      patch xmax
    (
      (3 2 6 7)
    )

     	patch ymin
    (
    	(0 3 4 7)
    )

	    patch ymax
    (
	    (1 5 6 2)
    )

	    patch zmin
    (
	    (0 3 2 1)
    )

	    patch zmax
    (
	    (4 5 6 7)
    )

);

mergePatchPairs
(
);

// ************************************************************************* //
After that I ran the following snappyHexMeshDict.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  dev                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       false;


// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
    Exo5.stl
    {
        type triSurfaceMesh;
        name interiorWalls;
    }
    
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    maxLocalCells 90000000;
    maxGlobalCells 90000000;
    minRefinementCells 10;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 3;



    features
    (
    );



    refinementSurfaces
    {
        interiorWalls
        {
            // Surface-wise min and max refinement level
            level (3 3);

        }
    }


    refinementRegions
    {
    }

	resolveFeatureAngle 30;
	
	locationInMesh (0 7.628 0);
	
    // Whether any faceZones (as specified in the refinementSurfaces)
    // are only on the boundary of corresponding cellZones or also allow
    // free-standing zone faces. Not used if there are no faceZones.
    allowFreeStandingZoneFaces false;

	}

// Settings for the snapping.
snapControls
{
    //- Number of patch smoothing iterations before finding correspondence
    //  to surface
    nSmoothPatch 3;

    //- Relative distance for points to be attracted by surface feature point
    //  or edge. True distance is this factor times local
    //  maximum edge length.
    tolerance 2.0;

    //- Number of mesh displacement relaxation iterations.
    nSolveIter 200;

    //- Maximum number of snapping relaxation iterations. Should stop
    //  before upon reaching a correct mesh.
    nRelaxIter 5;

    // Feature snapping

    //- Number of feature edge snapping iterations.
    //  Leave out altogether to disable.
    nFeatureSnapIter 10;

    //- Detect (geometric only) features by sampling the surface
    //  (default=false).
    implicitFeatureSnap false;

    //- Use castellatedMeshControls::features (default = true)
    explicitFeatureSnap true;

    //- Detect points on multiple surfaces (only for explicitFeatureSnap)
    multiRegionFeatureSnap false;
}



// Settings for the layer addition.
addLayersControls
{
    // Are the thickness parameters below relative to the undistorted
    // size of the refined cell outside layer (true) or absolute sizes (false).
    relativeSizes true;

    // Per final patch (so not geometry!) the layer information
    layers
    {
        "interiorWalls.*"
        {
            nSurfaceLayers 1;
        }
    }

    // Expansion factor for layer mesh
    expansionRatio 1.15;

    // Wanted thickness of final added cell layer. If multiple layers
    // is the thickness of the layer furthest away from the wall.
    // Relative to undistorted size of cell outside layer.
    // See relativeSizes parameter.
    finalLayerThickness 0.1;

    // Minimum thickness of cell layer. If for any reason layer
    // cannot be above minThickness do not add layer.
    // Relative to undistorted size of cell outside layer.
    minThickness 0.1;

    // If points get not extruded do nGrow layers of connected faces that are
    // also not grown. This helps convergence of the layer addition process
    // close to features.
    // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
    nGrow 0;

    // Advanced settings

    // When not to extrude surface. 0 is flat surface, 90 is when two faces
    // are perpendicular
    featureAngle 60;

    // At non-patched sides allow mesh to slip if extrusion direction makes
    // angle larger than slipFeatureAngle.
    slipFeatureAngle 30;

    // Maximum number of snapping relaxation iterations. Should stop
    // before upon reaching a correct mesh.
    nRelaxIter 3;

    // Number of smoothing iterations of surface normals
    nSmoothSurfaceNormals 1;

    // Number of smoothing iterations of interior mesh movement direction
    nSmoothNormals 3;

    // Smooth layer thickness over surface patches
    nSmoothThickness 10;

    // Stop layer growth on highly warped cells
    maxFaceThicknessRatio 0.5;

    // Reduce layer growth where ratio thickness to medial
    // distance is large
    maxThicknessToMedialRatio 0.3;

    // Angle used to pick up medial axis points
    // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
    minMedianAxisAngle 90;


    // Create buffer region for new layer terminations
    nBufferCellsNoExtrude 0;


    // Overall max number of layer addition iterations. The mesher will exit
    // if it reaches this number of iterations; possibly with an illegal
    // mesh.
    nLayerIter 50;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
    #include "meshQualityDict"


    // Advanced

    //- Number of error distribution iterations
    nSmoothScale 4;
    //- Amount to scale back displacement at error points
    errorReduction 0.75;
}


// Advanced

// Write flags
writeFlags
(
    scalarLevels
    layerSets
    layerFields     // write volScalarField for layer coverage
);


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-06;


// ************************************************************************* //
I would have expected that my patches in blockMeshDict (xmin,xmax,ymin...) should be retained in snappyHexMesh and my final mesh however that did not happen. any idea why this might have happened? or is there a way to keep those patches?

IMPORTANT NOTE: When I open my BlockMesh the patches do show. when I run snappyHexMesh, the patches exist in the boundary file but all of them have 0 faces.

Thank you!
my issue is block mesh patches are not going away, after snap. any advice ?

i am trying to simulate combustion in a fire stove using fireFoam, i don’t know why after the blockmesh are still there along with my stove and wood geometry boundary conditions
g.ponnusamy is offline   Reply With Quote

Old   June 22, 2022, 15:28
Default
  #3
New Member
 
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8
Nidalsb is on a distinguished road
Quote:
Originally Posted by g.ponnusamy View Post
my issue is block mesh patches are not going away, after snap. any advice ?

i am trying to simulate combustion in a fire stove using fireFoam, i don’t know why after the blockmesh are still there along with my stove and wood geometry boundary conditions
Can you explain further? do you mean you want to delete patches or do you have a patch between blocks that you want to remove
Nidalsb is offline   Reply With Quote

Old   June 22, 2022, 15:30
Default
  #4
New Member
 
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8
Nidalsb is on a distinguished road
Resolved: by making sure to run surfaceFeatures before running SHM, this way you get an output of the exact bounds of the STL and you can make sure that the STL sits inside the blocks created.
Nidalsb is offline   Reply With Quote

Old   June 22, 2022, 15:35
Default
  #5
New Member
 
Goutham Ponnusamy
Join Date: Dec 2019
Location: Birmingham
Posts: 7
Rep Power: 7
g.ponnusamy is on a distinguished road
Send a message via Skype™ to g.ponnusamy
Thank you, also one more thing, sorry. My geometry contains two volumes;
Volume1- Wood Stove,
Volume2- wood log, (2 in inside 1 as a separate geometry)

two surfaces from each volume touches, will snappy hex mesh would snap them properly or will it be an error ?
Attached Images
File Type: png stove model1.PNG (83.6 KB, 32 views)
g.ponnusamy is offline   Reply With Quote

Old   June 22, 2022, 15:40
Default
  #6
New Member
 
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8
Nidalsb is on a distinguished road
Quote:
Originally Posted by g.ponnusamy View Post
Thank you, also one more thing, sorry. My geometry contains two volumes;
Volume1- Wood Stove,
Volume2- wood log, (2 in inside 1 as a separate geometry)

two surfaces from each volume touches, will snappy hex mesh would snap them properly or will it be an error ?
Can you show me your blockmesh file?
Nidalsb is offline   Reply With Quote

Old   June 22, 2022, 15:45
Default
  #7
New Member
 
Goutham Ponnusamy
Join Date: Dec 2019
Location: Birmingham
Posts: 7
Rep Power: 7
g.ponnusamy is on a distinguished road
Send a message via Skype™ to g.ponnusamy
My Geometry and blockMeshfile
Attached Images
File Type: png stove model1.PNG (83.6 KB, 24 views)
Attached Files
File Type: txt blockMeshDict.txt (1.7 KB, 12 views)
g.ponnusamy is offline   Reply With Quote

Old   June 22, 2022, 15:57
Default
  #8
New Member
 
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8
Nidalsb is on a distinguished road
This is way too complex for a geometry, if you are able to remove any unnecessary details that would help. The problem is that you need to create more than 1 block to get a good mesh here. I would look into creating 4 blocks, one for the bottom part, one for the fins, the next block and then for the tube. This way you can get the result you are looking for. I hope this helps
Nidalsb is offline   Reply With Quote

Old   June 22, 2022, 16:04
Default
  #9
New Member
 
Goutham Ponnusamy
Join Date: Dec 2019
Location: Birmingham
Posts: 7
Rep Power: 7
g.ponnusamy is on a distinguished road
Send a message via Skype™ to g.ponnusamy
since i am creating multiple blocks can i split my geometry into multiple stl files ? i mean will it be easier, multiple stl files and 2 separate volumes placed one inside anothervolumes ?


Now I have onle (Stove volume + Inlet, Outlet, Wall) and (Wood volume + Wood sides)
g.ponnusamy is offline   Reply With Quote

Old   February 19, 2023, 23:06
Default
  #10
New Member
 
Join Date: Feb 2023
Posts: 3
Rep Power: 3
Omar Kriedy is on a distinguished road
Quote:
Originally Posted by Nidalsb View Post
Hi,

I have the following blockMeshDict, with a defined inlet, outlet and walls.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0 0 400)
    (0 400 400)
    (400 400 400)
    (400 0 400)
    (0 0 0)
    (0 400 0)
    (400 400 0)
    (400 0 0)

);

blocks
(
    hex (0 1 2 3 4 5 6 7) 
    square (100 100 100) simpleGrading (1 1 1)

);

edges
(
);

patches
(
    	patch xmin
    (
       (0 1 5 4)
    )
    	
      patch xmax
    (
      (3 2 6 7)
    )

     	patch ymin
    (
    	(0 3 4 7)
    )

	    patch ymax
    (
	    (1 5 6 2)
    )

	    patch zmin
    (
	    (0 3 2 1)
    )

	    patch zmax
    (
	    (4 5 6 7)
    )

);

mergePatchPairs
(
);

// ************************************************************************* //
After that I ran the following snappyHexMeshDict.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  dev                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       false;


// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
    Exo5.stl
    {
        type triSurfaceMesh;
        name interiorWalls;
    }
    
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    maxLocalCells 90000000;
    maxGlobalCells 90000000;
    minRefinementCells 10;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 3;



    features
    (
    );



    refinementSurfaces
    {
        interiorWalls
        {
            // Surface-wise min and max refinement level
            level (3 3);

        }
    }


    refinementRegions
    {
    }

	resolveFeatureAngle 30;
	
	locationInMesh (0 7.628 0);
	
    // Whether any faceZones (as specified in the refinementSurfaces)
    // are only on the boundary of corresponding cellZones or also allow
    // free-standing zone faces. Not used if there are no faceZones.
    allowFreeStandingZoneFaces false;

	}

// Settings for the snapping.
snapControls
{
    //- Number of patch smoothing iterations before finding correspondence
    //  to surface
    nSmoothPatch 3;

    //- Relative distance for points to be attracted by surface feature point
    //  or edge. True distance is this factor times local
    //  maximum edge length.
    tolerance 2.0;

    //- Number of mesh displacement relaxation iterations.
    nSolveIter 200;

    //- Maximum number of snapping relaxation iterations. Should stop
    //  before upon reaching a correct mesh.
    nRelaxIter 5;

    // Feature snapping

    //- Number of feature edge snapping iterations.
    //  Leave out altogether to disable.
    nFeatureSnapIter 10;

    //- Detect (geometric only) features by sampling the surface
    //  (default=false).
    implicitFeatureSnap false;

    //- Use castellatedMeshControls::features (default = true)
    explicitFeatureSnap true;

    //- Detect points on multiple surfaces (only for explicitFeatureSnap)
    multiRegionFeatureSnap false;
}



// Settings for the layer addition.
addLayersControls
{
    // Are the thickness parameters below relative to the undistorted
    // size of the refined cell outside layer (true) or absolute sizes (false).
    relativeSizes true;

    // Per final patch (so not geometry!) the layer information
    layers
    {
        "interiorWalls.*"
        {
            nSurfaceLayers 1;
        }
    }

    // Expansion factor for layer mesh
    expansionRatio 1.15;

    // Wanted thickness of final added cell layer. If multiple layers
    // is the thickness of the layer furthest away from the wall.
    // Relative to undistorted size of cell outside layer.
    // See relativeSizes parameter.
    finalLayerThickness 0.1;

    // Minimum thickness of cell layer. If for any reason layer
    // cannot be above minThickness do not add layer.
    // Relative to undistorted size of cell outside layer.
    minThickness 0.1;

    // If points get not extruded do nGrow layers of connected faces that are
    // also not grown. This helps convergence of the layer addition process
    // close to features.
    // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
    nGrow 0;

    // Advanced settings

    // When not to extrude surface. 0 is flat surface, 90 is when two faces
    // are perpendicular
    featureAngle 60;

    // At non-patched sides allow mesh to slip if extrusion direction makes
    // angle larger than slipFeatureAngle.
    slipFeatureAngle 30;

    // Maximum number of snapping relaxation iterations. Should stop
    // before upon reaching a correct mesh.
    nRelaxIter 3;

    // Number of smoothing iterations of surface normals
    nSmoothSurfaceNormals 1;

    // Number of smoothing iterations of interior mesh movement direction
    nSmoothNormals 3;

    // Smooth layer thickness over surface patches
    nSmoothThickness 10;

    // Stop layer growth on highly warped cells
    maxFaceThicknessRatio 0.5;

    // Reduce layer growth where ratio thickness to medial
    // distance is large
    maxThicknessToMedialRatio 0.3;

    // Angle used to pick up medial axis points
    // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
    minMedianAxisAngle 90;


    // Create buffer region for new layer terminations
    nBufferCellsNoExtrude 0;


    // Overall max number of layer addition iterations. The mesher will exit
    // if it reaches this number of iterations; possibly with an illegal
    // mesh.
    nLayerIter 50;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
    #include "meshQualityDict"


    // Advanced

    //- Number of error distribution iterations
    nSmoothScale 4;
    //- Amount to scale back displacement at error points
    errorReduction 0.75;
}


// Advanced

// Write flags
writeFlags
(
    scalarLevels
    layerSets
    layerFields     // write volScalarField for layer coverage
);


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-06;


// ************************************************************************* //
I would have expected that my patches in blockMeshDict (xmin,xmax,ymin...) should be retained in snappyHexMesh and my final mesh however that did not happen. any idea why this might have happened? or is there a way to keep those patches?

IMPORTANT NOTE: When I open my BlockMesh the patches do show. when I run snappyHexMesh, the patches exist in the boundary file but all of them have 0 faces.

Thank you!
Hey Nidalsb,
Could you solve this problem? I am running a case now and facing the same problem. I might be needing your help.
Thank you
Omar Kriedy is offline   Reply With Quote

Old   February 20, 2023, 09:48
Default
  #11
New Member
 
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8
Nidalsb is on a distinguished road
Quote:
Originally Posted by Omar Kriedy View Post
Hey Nidalsb,
Could you solve this problem? I am running a case now and facing the same problem. I might be needing your help.
Thank you
Check the comments above. Run surfaceFeatures, it will give you the bounding domain of your STL and make sure your blockMesh is within the correct domain.
Nidalsb is offline   Reply With Quote

Reply

Tags
boundary, mesh, patch, patches, snappyhexmesh


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 AMI vinz OpenFOAM Running, Solving & CFD 298 November 13, 2023 09:19
[snappyHexMesh] snappyHexMesh error "Cannot determine normal vector from patches." lethu OpenFOAM Meshing & Mesh Conversion 1 June 3, 2020 08:49
[snappyHexMesh] Creating baffes with snappyHexMesh BBack OpenFOAM Meshing & Mesh Conversion 0 September 22, 2019 06:10
[snappyHexMesh] snappyHexMesh does not create boundary patches from .stl files bug_or_feature OpenFOAM Meshing & Mesh Conversion 7 August 30, 2016 20:18
Possible bug with stitchMesh and cyclics in OpenFoam Jack001 OpenFOAM Pre-Processing 0 May 21, 2016 09:00


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