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

[snappyHexMesh] Bad mesh in small channel

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 19, 2023, 11:06
Default Bad mesh in small channel
  #1
Member
 
Vinzenz Götz
Join Date: Mar 2021
Location: Munich, Germany
Posts: 31
Rep Power: 5
Vinzmann is on a distinguished road
Hello everybody,

I have a small channel in my geometry which is a kind of nozzle. My problem is that my mesh in this channel always looks horrible.

I'd be very thankful if you could take a look at my snappyHexMeshDict and my meshQualityDict.

The small geometry is called duese and the inlet sits at the face of this channel.

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

// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       true;
keepPatches	yes;


geometry
{
   	rohr.stl
    	{
        	type triSurfaceMesh;
        	name rohr;
		inGroups (walls);
    	}

    	inlet.stl
    	{
        	type triSurfaceMesh;
        	name inlet;
    	}
	
    	cOut.stl
    	{
        	type triSurfaceMesh;
        	name cOutlet;
		inGroups (outlets);
    	}
	
	wOut.stl
    	{
        	type triSurfaceMesh;
        	name wOutlet;
    		inGroups (outlets);
	}
	
	drossel.stl
	{
        	type triSurfaceMesh;
		name drossel;
		inGroups (walls);
	}
	
	duese.stl
	{
		type triSurfaceMesh;
		name duese;
		inGroups (dueseGroup);
	}
	
	kammer.stl
    	{
        	type triSurfaceMesh;
        	name kammer;
		inGroups (walls);
    	}

	globalRefinement
	{
		type	searchableCylinder;
		point1	(0 0 0.1);
		point2	(0 0 0.2);
		radius	0.02;
	}

		
};




castellatedMeshControls
{


    maxLocalCells 10000000; 

    maxGlobalCells 200000000; 


    minRefinementCells 5; 

  


    nCellsBetweenLevels 5; 




    features
    (
        {
            	file "rohr.eMesh";
            	level 4; 
        }
		
	{
            	file "drossel.eMesh";
            	level 1; 
        }
		
	{
		file "duese.eMesh";
		level 3;
	}
		
        {
        	file "inlet.eMesh";
        	level 3; 
        }
		
	{
        	file "wOut.eMesh";
        	level 1; 
        }
		
        {
        	file "cOut.eMesh";
        	level 1; 
        }
		
	{
        	file "kammer.eMesh";
        	level 1; 
        }

    );





    refinementSurfaces
    {


	"(rohr)"
        {
            level (3 3); 
            patchInfo
            {
                type wall;
		inGroups (walls);
            }
        }
	
	"(kammer)"
        {
            	level (1 3); 
            	patchInfo
            {
                type wall;
		inGroups (walls);
            }
        }
		
	"(drossel)"
        {
            level (1 1); 
			gapLevelIncrement 2;
            patchInfo
            {
                type wall;
		inGroups (walls);
            }
        }
		
	"(duese)"
        {
            level (5 5); 
            patchInfo
            {
                type wall;
                inGroups (dueseGroup);
            }
        }

	"(inlet)"
        {
            level (5 5); 
            patchInfo
            {
                
		type mappedPatch;
        	offset          (0 0.1 0);
        	sampleRegion    region0;
        	sampleMode      nearestCell;
        	samplePatch     none;
            }
        }
		
	"(cOutlet)"
        {
            level (1 1); 
            patchInfo
            {
                type patch;
                inGroups (outlets);
            }
        }
		
	"(wOutlet)"
        {
            level (1 1); 
            patchInfo
            {
                type patch;
             	inGroups (outlets);
            }
        }
    }

    resolveFeatureAngle 30; 



    refinementRegions
    {

		globalRefinement
		{
			mode	inside;
			levels	((1e15 1));
			gapMode	mixed;
			gapLevel (4 0 4); 
		}
		
		rohr
		{
			mode distance;
			levels ((0.001 2));
		}
		
		inlet
		{
			mode distance;
			levels ((0.002 2));
		}
				
		kammer
		{
			mode distance;
			levels ((0.001 2));
		}
		
		drossel
		{
			mode distance;
			levels ((0.0004 4) (0.0008 3));
		}

    }


 
    locationInMesh (0.001 0.001 0.1);


 
    allowFreeStandingZoneFaces true;
	
	
	
}



snapControls
{
    nSmoothPatch 1; 

  
    nSmoothInternal 1; 

    tolerance 0.7; 

    nSolveIter 100; 

    nRelaxIter 8; 



        nFeatureSnapIter 80;

        implicitFeatureSnap false;

        explicitFeatureSnap true;

        multiRegionFeatureSnap false;
}



addLayersControls
{

    relativeSizes true; 
    	layers
    	{

		walls
		{
			nSurfaceLayers	7;
			
		}
		
		duese
		{
			nSurfaceLayers	10;
		}

		inlet
		{
			nSurfaceLayers	6;
			thickness	2;
			expansionRatio	1;
		}


	}

    expansionRatio 1.2;

    	//finalLayerThickness 2;
	thickness 2;

    minThickness 0.0001; 

 
    nGrow 0;


    featureAngle 230; 

    slipFeatureAngle 90; 

    nRelaxIter 1;

    nSmoothSurfaceNormals 2;

    nSmoothNormals 3; 

    nSmoothThickness 10; 

    maxFaceThicknessRatio 0.3;

    maxThicknessToMedialRatio 0.3;

    minMedialAxisAngle 90;

    nBufferCellsNoExtrude 0;

    nLayerIter 50; 

    nRelaxedIter 1;

	additionalReporting true;
}




meshQualityControls
{
    #include "meshQualityDict"
    relaxed
    {
        maxNonOrtho 35;
    }

	maxNonOrtho 35;
    nSmoothScale 8;
    errorReduction 1.5;
}



writeFlags
(
    scalarLevels
    layerSets
    layerFields     
);



mergeTolerance 1e-6;


// ************************************************************************* //
My meshQualityDict looks like this:

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

minFaceWeight 0.02;
maxBoundarySkewness     3;//20
maxInternalSkewness     2;//4
maxConcave              30;//40
minVol                  1e-13;
minTetQuality           1e-3;//1e-15
minArea                 -1;
minTwist                0.02;
minDeterminant          0.01;//0.001
minFaceWeight           0.05;//0.05
minFaceFlatness         -1;
minVolRatio             0.01;//0.01
minTriangleTwist        -1;
nSmoothScale            8;//8
errorReduction          1.5;//.75


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

I've attached a picture of the mesh.

Best regards,
Vinz
Attached Images
File Type: jpg 2023-05-19 16_57_12-Clipboard.jpg (86.4 KB, 25 views)
Vinzmann is offline   Reply With Quote

 


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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[ICEM] Bad Quality **Anny** ANSYS Meshing & Geometry 7 May 28, 2015 05:03
[ICEM] Unstructured Mesh / cyclic channel Metternich ANSYS Meshing & Geometry 0 October 9, 2014 10:38
Mesh motion with Translation & Rotation Doginal CFX 2 January 12, 2014 06:21
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 04:24


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