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

[mesh manipulation] splitMeshRegion for chtMultiRegionFoamCase

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2017, 19:08
Default splitMeshRegion for chtMultiRegionFoamCase
  #1
New Member
 
Join Date: Nov 2016
Posts: 8
Rep Power: 10
Bob! is on a distinguished road
Hello Foamers,

I'm trying to use the Solver chtMultiRegionFoam.
I'm using OpenFoam 4.1.

I started my Case out of the tutorial "snappyMultiRegionHeater". In this Tutorial the blockMesh-Geometrie is embedded to the geometry of the final geometry after using snappyHexMesh.
In my case this is not possible. Down below you'll find a picture of the problematic wall i want to build.

While using splitMeshRegions i need the created "boundaries" of the blockMesh-Dict to disappear, except of the inlet and outlet (minX and maxX).
To show you what i mean, i just uploaded one wall and the concerning code (the wall has 5 parts, Spundwand, Rohr1, Rohr2, Rohr3, Rohr4)

With a normal snappyHexMesh Dict (means evrything remains the same, except the writing of faceZone, cellZone etc at the point refinementSurfaces in the snappyHexMeshDict) it works perfectly: The wall looks like i want it to be, the "boundary" "maxY" is cut of. This is the wall the picture shows below.

As soon as the options for the cellzone writing are added, i get several domains between "maxY" and my wall, which i definitly do not want to have. It looks like it wouldn't have snapped, both "boundaries" are there, maxY and my wall.

The splitMeshRegions-option i'm using at the moment is:
Code:
 splitMeshRegions -cellZones -overwrite
Viewing this site (https://openfoamwiki.net/index.php/SplitMeshRegions) i saw several options, not knowing how to use them. I thought about the "-inside point" option, also not knowing how to use it or if it will work out (just as an idea). Should be mentioned, that i would need several points for that option, since it will be several regions i want to use.

Any suggestions? Thank you in advantage,
Robert


here is my Code:

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

convertToMeters 1;

vertices
(
    (0 0 0)
    (3 0 0)
    (3 1.6 0)
    (0 1.6 0)

    (0 0 4)
    (3 0 4)
    (3 1.6 4)
    (0 1.6 4)
);

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

edges
(
);

boundary
(

    minX
    {
        type patch;
        faces
        (
            (0 3 7 4)
        );
    }

    maxX
    {
        type patch;
        faces
        (
            (2 1 5 6)
        );
    }

    minY
    {
        type wall;
        faces
        (
            (4 5 1 0)
        );
    }

    maxY
    {
        type wall;
        faces
        (
            (3 2 6 7)
        );
    }

    minZ
    {
        type wall;
        faces
        (
            (0 1 2 3)
        );
    }
    maxZ
    {
        type wall;
        faces
        (
            (7 6 5 4)
        );
    }
);

mergePatchPairs
(
);

// ************************************************************************* //
snappyHexMeshDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    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
{
    Spundwand.stl
    {
        type triSurfaceMesh;
        name Spundwand;
    }

    Rohr1.stl
    {
        type triSurfaceMesh;
        name Rohr1;
    }

    Rohr2.stl
    {
        type triSurfaceMesh;
        name Rohr2;
    }

    Rohr3.stl
    {
        type triSurfaceMesh;
        name Rohr3;
    }

    Rohr4.stl
    {
        type triSurfaceMesh;
        name Rohr4;
    }


};



// 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 100000;

    // 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 2000000;

    // 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 10;

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



    // 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 "Spundwand.eMesh";
            level 1;
        }
        {
            file "Rohr1.eMesh";
            level 1;
        }
        {
            file "Rohr2.eMesh";
            level 1;
        }
        {
            file "Rohr3.eMesh";
            level 1;
        }
        {
            file "Rohr4.eMesh";
            level 1;
        }

    );



    // 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
    {


        Spundwand
        {
            // Surface-wise min and max refinement level
            level (1 1);

            faceZone Spundwand;
            cellZone Spundwand;
            cellZoneInside inside; 
        }

        Rohr1
        {
            // Surface-wise min and max refinement level
            level (1 1);

           faceZone Rohr1;
            cellZone Rohr1;
            cellZoneInside inside; 
        }
        Rohr2
        {
            // Surface-wise min and max refinement level
            level (1 1);

            faceZone Rohr2;
            cellZone Rohr2;
            cellZoneInside inside; 
        }
        Rohr3
        {
            // Surface-wise min and max refinement level
            level (1 1);

            faceZone Rohr3;
            cellZone Rohr3;
            cellZoneInside inside;
        }
        Rohr4
        {
            // Surface-wise min and max refinement level
            level (1 1);

            faceZone Rohr4;
            cellZone Rohr4;
            cellZoneInside inside;
        }

    }

    // 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
    {
Gesant {mode distance; levels ((0.01 1) (0.05 1) (0.1 1));}
        //refinementBox
        //{
        //    mode inside;
        //    levels ((1E15 4));
        //}
    }


    // 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 (1 1 1);


    // 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 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 1.0;

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

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

    //- Highly experimental and wip: number of feature edge snapping
    //  iterations. Leave out altogether to disable.
    //  Of limited use in this case since faceZone faces not handled.
    nFeatureSnapIter 10;
}



// Settings for the layer addition.
addLayersControls
{
    relativeSizes true;

    // Per final patch (so not geometry!) the layer information
   layers
    {

    Spundwand
        {nSurfaceLayers 1;} // was 3

    Rohr1
        {nSurfaceLayers 1;} // was 3
    Rohr2
        {nSurfaceLayers 1;} // was 3
    Rohr3
        {nSurfaceLayers 1;} // was 3
    Rohr4
        {nSurfaceLayers 1;} // was 3

    }

    // Expansion factor for layer mesh
    expansionRatio 1.3;

    // 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 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 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 2;

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

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

    // 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

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


// ************************************************************************* //
Attached Images
File Type: png How it should be.png (44.9 KB, 50 views)
Bob! 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
[mesh manipulation] splitMeshRegion FekrKon OpenFOAM Meshing & Mesh Conversion 27 June 23, 2020 14:57
[Other] splitMeshRegion problem(cell in multi zones) huangkai OpenFOAM Meshing & Mesh Conversion 0 April 10, 2019 11:52
cht splitMeshRegion but keeping porous cellZones klilla OpenFOAM Pre-Processing 3 November 19, 2013 09:32
[mesh manipulation] splitMeshRegion Khelian973 OpenFOAM Meshing & Mesh Conversion 1 July 2, 2009 06:02
[mesh manipulation] SplitMeshRegion ivan_cozza OpenFOAM Meshing & Mesh Conversion 2 October 29, 2008 07:38


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