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

[snappyHexMesh] snapping doesn't work properly

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2015, 02:22
Default snapping doesn't work properly
  #1
New Member
 
Eugen
Join Date: Sep 2014
Posts: 18
Rep Power: 11
estang is on a distinguished road
I want to mesh a pipe and a fluid for conjugated heat transfer just to test the solver and learning how to use it. But my result is not snapped to the stl. I already played with the settings, i increased iterations in the snapControls and refined the mesh at the surface in castellatedMeshControls.

The images illustrate the fluiddomain and the soliddomain.

Code:
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
{
    FluidDomain.stl
    {
        type triSurfaceMesh;
        name fluid;
        faceZone fluidFaces;
        cellZone fluidZone;
        cellZoneInside insidePoint;
        insidePoint (-10 0 0);
    }
    SolidDomain.stl
    {
        type triSurfaceMesh;
        name solid;
        faceZone solidFaces;
        cellZone solidZone;
        cellZoneInside insidePoint;
        insidePoint (-10 0.240 0);
    }
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    // Refinement parameters
    // ~~~~~~~~~~~~~~~~~~~~~

    // If local number of cells is >= maxLocalCells on any processor
    // switches from from refinement followed by balancing
    // (current method) to (weighted) balancing before refinement.
    maxLocalCells 2000000;

    // Overall cell limit (approximately). Refinement will stop immediately
    // upon reaching this number so a refinement level might not complete.
    // Note that this is the number of cells before removing the part which
    // is not 'visible' from the keepPoint. The final number of cells might
    // actually be a lot less.
    maxGlobalCells 4444000;

    // The surface refinement loop might spend lots of iterations refining just a
    // few cells. This setting will cause refinement to stop if <= minimumRefine
    // are selected for refinement. Note: it will at least do one iteration
    // (unless the number of cells to refine is 0)
    minRefinementCells 0;

    // Allow a certain level of imbalance during refining
    // (since balancing is quite expensive)
    // Expressed as fraction of perfect balance (= overall number of cells /
    // nProcs). 0=balance always.
    maxLoadUnbalance 0.0;


    // Number of buffer layers between different levels.
    // 1 means normal 2:1 refinement restriction, larger means slower
    // refinement.
    nCellsBetweenLevels 5;



    // Explicit feature edge refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies a level for any cell intersected by its edges.
    // This is a featureEdgeMesh, read from constant/triSurface for now.
    features
    (
        {
            file "FluidDomain.eMesh";
            level 4;
        }
        {
            file "SolidDomain.eMesh";
            level 4;
        }
    );



    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies two levels for every surface. The first is the minimum level,
    // every cell intersecting a surface gets refined up to the minimum level.
    // The second level is the maximum level. Cells that 'see' multiple
    // intersections where the intersections make an
    // angle > resolveFeatureAngle get refined up to the maximum level.

    refinementSurfaces
    {    
    fluid
        {

            faceZone fluidFaces;
            cellZone fluidZone;
            cellZoneInside insidePoint;
            insidePoint (-10 0 0);
        
        level (2 2);
        }
        solid
        {
            faceZone solidFaces;
            cellZone solidZone;
            cellZoneInside insidePoint;
            insidePoint (-10 0.240 0);

        level (2 2);
        }
    }

    // Resolve sharp angles
    resolveFeatureAngle 30;


    // Region-wise refinement
    // ~~~~~~~~~~~~~~~~~~~~~~

    // Specifies refinement level for cells in relation to a surface. One of
    // three modes
    // - distance. 'levels' specifies per distance to the surface the
    //   wanted refinement level. The distances need to be specified in
    //   descending order.
    // - inside. 'levels' is only one entry and only the level is used. All
    //   cells inside the surface get refined up to the level. The surface
    //   needs to be closed for this to be possible.
    // - outside. Same but cells outside.

    refinementRegions
    {

    }


    // Mesh selection
    // ~~~~~~~~~~~~~~

    // After refinement patches get added for all refinementSurfaces and
    // all cells intersecting the surfaces get put into these patches. The
    // section reachable from the locationInMesh is kept.
    // NOTE: This point should never be on a face, always inside a cell, even
    // after refinement.
    locationInMesh (-10 0 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 true;
}



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

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

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

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

    // 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 true;
}
Attached Images
File Type: jpg soliddomain.jpg (45.7 KB, 73 views)
File Type: jpg fluiddomain.jpg (49.2 KB, 69 views)
estang is offline   Reply With Quote

Old   January 8, 2015, 16:43
Default
  #2
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12
ssss is on a distinguished road
Try to increase the background mesh it is too coarse I think
ssss is offline   Reply With Quote

Old   January 9, 2015, 02:50
Default
  #3
New Member
 
Eugen
Join Date: Sep 2014
Posts: 18
Rep Power: 11
estang is on a distinguished road
Thank you for your help.

I increased the level of surface Refinement to 4. The result is attached to this post.

Do you think the axial coarseness makes a problem?

The meshing finished with 95219 faces of non-orthogonality > 65 degrees.
Attached Images
File Type: jpg surfRefinement_4_4.jpg (97.7 KB, 54 views)
estang is offline   Reply With Quote

Old   January 9, 2015, 02:58
Default
  #4
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12
ssss is on a distinguished road
I mean, that you need to refine more the background mesh, this is the background you do with blockMesh before usign snappyHexMesh
ssss is offline   Reply With Quote

Old   January 9, 2015, 04:12
Default
  #5
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
Did you check the surface quality with OF tools: surfaceCheck surfaceClean surfaceOrient?
student666 is offline   Reply With Quote

Old   January 9, 2015, 08:20
Default
  #6
New Member
 
Eugen
Join Date: Sep 2014
Posts: 18
Rep Power: 11
estang is on a distinguished road
hi student666,

i checked it with surfaceCheck and it's fine.
estang is offline   Reply With Quote

Old   January 9, 2015, 18:22
Default
  #7
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
Well, i suggest you to look for some help here https://sites.google.com/site/snappywiki/snappyhexmesh

Or you try to mesh two domains jndividually, then merging them: mergeMeshes masterCase slaveCase -overwrite

Bye
student666 is offline   Reply With Quote

Old   January 12, 2015, 01:06
Default
  #8
New Member
 
Eugen
Join Date: Sep 2014
Posts: 18
Rep Power: 11
estang is on a distinguished road
Thank you i will try it
estang is offline   Reply With Quote

Reply


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
Companies that lease software & hardware for cloud-based work? Catthan ANSYS 0 June 18, 2014 10:53
Do all CFD analysts have to do some hands-on work except PhDs? e13drd Main CFD Forum 2 March 17, 2014 14:56
OpenFOAM does not work any more! kiddmax OpenFOAM Installation 12 June 25, 2013 02:56
Why do the Plant library cases don't work? Alumna Phoenics 6 June 22, 2004 12:08
why my In-Form doesn't work? green Phoenics 2 May 27, 2004 21:03


All times are GMT -4. The time now is 01:40.