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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2019, 16:32
Default Why doesn't SnappyHexMesh retain patches from BlockMesh
  #1
New Member
 
Nidal
Join Date: Nov 2018
Posts: 8
Rep Power: 4
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

Reply

Tags
boundary, mesh, patch, patches, snappyhexmesh

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


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