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

[blockMesh] SnappyHexMesh Not Refining Cells

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2022, 07:39
Post SnappyHexMesh Not Refining Cells
  #1
New Member
 
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5
CfdUser5855 is on a distinguished road
Hi All,


I'm running into issues trying to get my mesh to refine near the surface. I have run SHM many times, and been able to get different levels of surface refinement across a variety of surfaces, but in this case I simply can't get any level of refinement, the cells are all the same size in the domain. SHM runs without any errors, and the STL snaps into the domain no problem.



My blockMesh and SHM files are listed below, and a screenshot of what the domain looks like after Meshing is attached:


BlockMesh


convertToMeters 1;

vertices
(
(44 -2451510 -1765)
(1465 -2451510 -1765)
(1465 -2449783 -1765)
(44 -2449783 -1765)
(44 -2451510 -1400)
(1465 -2451510 -1400)
(1465 -2449783 -1400)
(44 -2449783 -1400)
);

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

edges
(
);

boundary
(
outlet
{
type patch;
faces
(
(0 4 7 3)
(3 7 6 2)

);
}

inlet
{
type patch;
faces
(
(2 6 5 1)
(1 5 4 0)
);
}

Mesa
{
type wall;
faces
(
(0 3 2 1)
);
}
top
{
type patch;
faces
(
(4 5 6 7)
);
}
);

mergePatchPairs
(
);


snappyHexMesh



/*--------------------------------*- 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;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
castellatedMesh true;
snap true;
addLayers true;

geometry
{
refinementBox
{
type searchableBox;
min (0 -2451600 -2000);
max (1470 -2440000 -1000);
}

Mesa
{
type triSurfaceMesh;
file "Mesa.stl";
}
};


castellatedMeshControls
{
maxLocalCells 2000000000;

maxGlobalCells 2000000000;

minRefinementCells 1;

maxLoadUnbalance 0.10;

nCellsBetweenLevels 1;

features
(

);

refinementSurfaces
{
Mesa
{
level (0 2);

regions
{
refinementBox
{
level (3 3);
}
}
}
}

resolveFeatureAngle 5;

refinementRegions
{

refinementBox
{
mode inside;
levels ((5 5));
}

}

locationInMesh (1000 -2450000 -1600);

allowFreeStandingZoneFaces true;
}

snapControls
{
nSmoothPatch 3;

tolerance 1.0; //was 2.0

nSolveIter 30;

nRelaxIter 5;
}


addLayersControls
{
relativeSizes true;

layers
{

}

expansionRatio 1.0;

finalLayerThickness 1; //was 0.3

minThickness 0.25;

nGrow 0;

featureAngle 60;

nRelaxIter 5;

nSmoothSurfaceNormals 1;

nSmoothNormals 3;

nSmoothThickness 10;

maxFaceThicknessRatio 0.5;

maxThicknessToMedialRatio 0.3;

minMedianAxisAngle 90;

nBufferCellsNoExtrude 0;

nLayerIter 50;

nRelaxedIter 20;
}

meshQualityControls
{
maxNonOrtho 45;
maxBoundarySkewness 10;
maxInternalSkewness 2;

maxConcave 80;

minVol 1e-13;

minTetQuality 1e-30;

minArea -1;

minTwist 0.05;

minDeterminant 0.001;

minFaceWeight 0.05;

minVolRatio 0.01;

minTriangleTwist -1;

nSmoothScale 4;

errorReduction 0.75;

relaxed
{
maxNonOrtho 45;
}
}

mergeTolerance 1e-5;


// ************************************************** *********************** //



Using this SHM script on other domains (switching relevant values out) has produced refinement before, but not in this case. If anyone could provide some insight that would be greatly appreciated
Attached Images
File Type: jpg Screenshot from 2022-04-13 12-28-56.jpg (138.7 KB, 8 views)
CfdUser5855 is offline   Reply With Quote

Old   April 13, 2022, 09:35
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
This looks like an error to me. Do you write out a log file for your sHM-Runs? If you do, it should show an error. The refinementBox is not a region of Mesa, it should be a separate entry.

Code:
refinementSurfaces
    {
        Mesa
        {
            level (0 2);

            regions
            {
                refinementBox
                {
                    level (3 3);
                }
            }
        }
    }
Another hint: set the locationInMesh components to some odd values to avoid it landing on a node -> this can cause issues.
AtoHM is offline   Reply With Quote

Old   April 14, 2022, 06:28
Default
  #3
New Member
 
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5
CfdUser5855 is on a distinguished road
Hi Ato,

Thanks for the reply, I don't write out a log after it's finished I just watch it as it does it. It finishes with no errors and checkMesh produces no errors either.

What do you mean regarding the refinement box? Apologies for the confusion
CfdUser5855 is offline   Reply With Quote

Old   April 15, 2022, 06:23
Default
  #4
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
CheckMesh wouldn't show errors, as you have the blockMesh it can work on.

I am not sure why you mention the refinementBox at all in refinementSurfaces subdictionary, but if you do, it should probably look like this


Code:
refinementSurfaces
    {
        Mesa
            {
                level (0 2);
            }
        refinementBox
            {
                level (3 3);
            }
    }
But normally, you would just have it in refinementRegions (as you have already). There it gets refined to lvl 5, no need to add another refinement here. Although this seems not to be the real cause of your issue. Try using an odd location in mesh like locationInMesh (999.214 -2450001.214 -1600.145);
Hopefully this helps.
AtoHM is offline   Reply With Quote

Reply

Tags
cfd, refine mesh, shm


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] SnappyHexMesh running killed! Mark JIN OpenFOAM Meshing & Mesh Conversion 7 June 14, 2022 01:37
cellZone not taking all the cells inside rahulksoni OpenFOAM 0 January 16, 2019 01:16
Problem with divergence TDK FLUENT 13 December 14, 2018 06:00
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
[snappyHexMesh] snappyHexMesh Segmentation Fault avd28 OpenFOAM Meshing & Mesh Conversion 11 May 11, 2015 20:32


All times are GMT -4. The time now is 14:28.