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

[snappyHexMesh] Multi-region meshing produces too many regions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2023, 06:13
Default Multi-region meshing produces too many regions
  #1
New Member
 
Fotis Anagnostopoulos
Join Date: Feb 2023
Location: Athens, Greece
Posts: 10
Rep Power: 3
efalpha is on a distinguished road
Dear all,

I am trying to simulate a multi-physics flow. In particular, I have a high temperature flow through a pipe surrounded by ambient air. Similarly to "snappyHeatExchanger" example, I create different .stl files for each surface.

The problem is that, after the meshing with snappy, splitMesh do not result the proper regions, i.e. 'env', 'solid' and 'pipe_flow' but instead I get up to 2k new regions. Moreover, the reconstructed pipe surface is coarse and with HOLES (pls see figures).

I tried so far to play with the following increasing initial blockMesh resolution, increasing refinement level, using implicitFeatureSnap, subdivide the .stl's for more dense surface, using admesh to correct the stls, etc. The problem persists.

Please help, I have run out of ideas and the deadline is coming fast. Ι include the "snappyHexMeshDict" here, along with some images, while the full case dir (along with VTK files after snappyHex) can be found at: https://mega.nz/folder/xE0XGAYQ#I2I_DTAlujoTq4YW1mDNbA



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

#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"

castellatedMesh on;
snap            on;
addLayers       off;

geometry
{
    pipe_flow
    {
        type            triSurfaceMesh;
        file            "pipe_flow.stl";
        regions
        {
            inlet           { name inlet; }
            outlet           { name outlet; }
        }
    }
    env
    {
        type            triSurfaceMesh;
        file            "env.stl";
        regions
        {
            inlet           { name inlet; }
            outlet           { name outlet; }
            walls           { name walls; }
        }
    }
    solid
    {
        type            triSurfaceMesh;
        file            "solid.stl";
        regions
        {
            onOutlet        { name onOutlet; }
            OnInlet        { name OnInlet; }
        }
    }
    pipe_to_solid
    {
        type            triSurfaceMesh;
        file            "pipe_to_solid.stl";
    }
    env_to_solid
    {
        type            triSurfaceMesh;
        file            "env_to_solid.stl";
    }
};






castellatedMeshControls
{

// Settings for the castellatedMesh generation.
    // Refinement parameters
    // ~~~~~~~~~~~~~~~~~~~~~
    maxLocalCells 10000000;   //max cells per CPU core
    maxGlobalCells 20000000; //max cells to use before mesh deletion step
    minRefinementCells 10;  //was 0 - zero means no bad cells are allowed during refinement stages 
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 2; // expansion factor between each high & low refinement zone



    features
    (

        {
        file "pipe_to_solid.eMesh"; // file containing edge mesh
        level 2;               // level of refinement
        }

        {
        file "env_to_solid.eMesh"; // file containing edge mesh
        level 2;               // level of refinement
        }
    );


    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~
    refinementSurfaces
    {
        env
        {
            level           (1 2);
            regions
            {
                inlet           { level (1 2); patchInfo { type patch; } }
                outlet           { level (1 2); patchInfo { type patch; } }
                walls           { level (1 2); patchInfo { type wall; } }
            }
        }
        pipe_flow
        {
            level           (1 2);
            regions
            {
                inlet           { level (1 2); patchInfo { type patch; } }
                outlet           { level (1 2); patchInfo { type patch; } }
            }
        }
        solid
        {
            level           (1 2);
            regions
            {
                onOutlet        {level (1 2); patchInfo { type patch; } }
                onInlet        {level (1 2); patchInfo { type patch; } }
            }
        }
        pipe_to_solid
        {
            level           (1 2);
            faceZone        pipe_to_solid;
            cellZone        pipe_flow;
            cellZoneInside  outside;
        }
        env_to_solid
        {
            level           (1 2);
            faceZone        env_to_solid;
            cellZone        env;
            cellZoneInside  outside;
        }
    }

    refinementRegions
    {
    } 

      locationInMesh (0.00 0.008 0.015); 
  // locationInMesh (-0.0025 0.001 0.002);
   // locationInMesh (-0.025 0.00 0.05); // TUBE
   // locationOutMesh (0.0040 0.008 0.015); 

    //resolveFeatureAngle 45;
    // resolveFeatureAngle 45;

    resolveFeatureAngle 60;
    featureAngle 30;
}

snapControls
{
    // implicitFeatureSnap    true;
    nSmoothPatch 20;
    tolerance 10;
    nSolveIter 300;//25;
    nRelaxIter 10;
    nFeatureSnapIter 25;
    implicitFeatureSnap true;
    explicitFeatureSnap false;
    multiRegionFeatureSnap false;
}

addLayersControls
{
    layers
    {
        walls
        {
            nSurfaceLayers 2;
            mergeFaces true;
        }
        pipe_to_solid
        {
            nSurfaceLayers 2;
            mergeFaces true;
        }
        env_to_solid
        {
            nSurfaceLayers 2;
            mergeFaces true;
        }
    }

    relativeSizes       true;
    expansionRatio      1.2;
    finalLayerThickness 0.1;
    minThickness        1e-4;
}
writePrecision 6;
mergeTolerance 1e-5;

// ************************************************************************* //
Thank you all in advance for your help.
Attached Images
File Type: jpg 20-00----may15---ENV-TO_SOLID25.jpg (47.2 KB, 12 views)
efalpha is offline   Reply With Quote

Old   June 6, 2023, 04:23
Default
  #2
New Member
 
Fotis Anagnostopoulos
Join Date: Feb 2023
Location: Athens, Greece
Posts: 10
Rep Power: 3
efalpha is on a distinguished road
I found that the problem is in the geometry: the .stl files are not meshed properly.
The question that could be asked now is with regard to the proper way to make .stl meshes. I will put the question in a new thread.
efalpha 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
[snappyHexMesh] Multi region spliting doesn't result in desired boundaries Hr_kules OpenFOAM Meshing & Mesh Conversion 1 July 20, 2022 09:33
conjugate heat transfer in OpenFOAM skuznet OpenFOAM Running, Solving & CFD 99 March 16, 2017 06:07
[snappyHexMesh] Multi region meshing with SHM creates extra regions Dav3dum OpenFOAM Meshing & Mesh Conversion 0 August 8, 2016 09:54
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 15:07
decomposePar -region (OF 2.1) without splitting regions in separate parts michielm OpenFOAM Pre-Processing 1 November 15, 2013 06:07


All times are GMT -4. The time now is 18:42.