CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

Sphere in a channel by snappyHexMesh

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 14, 2016, 17:01
Default Sphere in a channel by snappyHexMesh
  #1
Member
 
Arsalan
Join Date: Jul 2014
Posts: 72
Rep Power: 5
arsalan.dryi is on a distinguished road
Dear Foamers,

I want to mesh a sphere inside a channel in both regions of inside and outside of the sphere. For this purpose, I'm trying to mesh these regions separately using sHM and merge them using mergeMesh.( Do you have any better suggestion??!)
For the region outside of the sphere, I'm using Tobias' tutorial (many thanks to him for great tutorials) but with my defined regions not the stl surfaces. ( I also used the stl surfaces, but with no success!)
My problem is snapping not works properly when a finer grid is used as the background mesh by blockMesh, or when I use high levels for refinement region around the sphere. And as a result of bad snapping, layering procedure not works!
My sHM dict is as follows:
Code:
  
// Which of the steps to run
castellatedMesh   true;
snap              true;
addLayers         true;

geometry
{

    sphere
    {
        type searchableSphere;
        centre (0 0 0);
        radius 0.0025;
    }

};

// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    maxLocalCells 1000000;

    maxGlobalCells 2000000;


    minRefinementCells 0;


    maxLoadUnbalance 0.0;


    nCellsBetweenLevels 3;

    features
    (

    );


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

    resolveFeatureAngle 60;


    refinementRegions
    {

    }

    locationInMesh (0.01 0.01 0.01);


    allowFreeStandingZoneFaces no;
}


snapControls
{
 
    nSmoothPatch 3;

    tolerance 1.2;

    nSolveIter 185;


    nRelaxIter 4;


        nFeatureSnapIter 5;


        implicitFeatureSnap false;

        explicitFeatureSnap true;

        multiRegionFeatureSnap false;
}


addLayersControls
{

    relativeSizes true;

    layers
    {
        sphere 
        {
            nSurfaceLayers  6;
        }
    }

    // Expansion factor for layer mesh
    expansionRatio 1.1;

    finalLayerThickness 0.7;

    minThickness 0.0001;

    nGrow 0;

 
    featureAngle 85;

    slipFeatureAngle 25;

    nRelaxIter 5;

    nSmoothSurfaceNormals 4;

    nSmoothNormals 3;

    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;

    maxThicknessToMedialRatio 0.2;
    minMedianAxisAngle 90;

    nBufferCellsNoExtrude 0;

    nLayerIter 50;
}

meshQualityControls
{
    #include "meshQualityDict"
    //- Number of error distribution iterations
    nSmoothScale 4;
    //- amount to scale back displacement at error points
    errorReduction 0.75;
}

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

mergeTolerance 1e-6;
And here is blockMeshDict :
Code:
convertToMeters 0.0005;

vertices
(
    (-30 -30  -30)
    ( 30 -30  -30)
    ( 30  30  -30)
    (-30  30  -30)
    (-30 -30   30)
    ( 30 -30   30)
    ( 30  30   30)
    (-30  30   30)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (60 60 60) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    maxY
    {
        type wall;
        faces
        (
            (3 7 6 2)
        );
    }
    minX
    {
        type wall;
        faces
        (
            (0 4 7 3)
        );
    }
    maxX
    {
        type wall;
        faces
        (
            (2 6 5 1)
        );
    }
    minY
    {
        type wall;
        faces
        (
            (1 5 4 0)
        );
    }
    minZ
    {
        type wall;
        faces
        (
            (0 3 2 1)
        );
    }
    maxZ
    {
        type wall;
        faces
        (
            (4 5 6 7)
        );
    }
);

mergePatchPairs
(
);
For example the whole meshing procedure works well with a 30*30*30 grid and refinement levels of (3 3) around the sphere, but increasing grid numbers to 60*60*60 results bad snapping and no layer around the sphere. while with a 60*60*60 grid and refinement levels of (1 3) around the sphere, everything works well!
I really need to high levels of refinement around the sphere and a finer grid of the whole domain together.

Any help and comment will be appreciated.
Regards,
Arsalan.
Attached Images
File Type: jpg sphere.jpg (139.3 KB, 17 views)
arsalan.dryi is offline   Reply With Quote

Reply

Tags
layer, shm, snap, snapping, snappyhexmesh

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
transient motion of sphere in a square channel sajeesh FLUENT 0 March 4, 2013 11:15
simple sphere with snappyhexmesh Duncan_vdH OpenFOAM Native Meshers: snappyHexMesh and Others 17 August 9, 2012 11:43
Meshing a sphere with snappyHexMesh Cyberholmes OpenFOAM 2 July 19, 2011 16:46
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37
Motion of sphere freely suspended in channel flow faithkim Main CFD Forum 1 August 12, 1999 10:42


All times are GMT -4. The time now is 23:12.