CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   SnappyHexMesh cylinder 2D (https://www.cfd-online.com/Forums/openfoam-pre-processing/114272-snappyhexmesh-cylinder-2d.html)

mzweemer March 8, 2013 04:20

SnappyHexMesh cylinder 2D
 
1 Attachment(s)
Good morning!

Currently working on a 2d problem where I would like to cut out a perfect cylinder shape from the mesh by using the SnappyHexMesh tool. Problems I'm facing are the shape of the cylinder which isn't perfect (there are some bumps in the cylinder, even when decreasing the mesh size), and is it possible to prevent cells to become triangular shaped (as the cells which lay next to the ones generated with 'addlayercontrols')? Underneath you can find my snappyHexMeshDict and a figure of the mesh.

Thanks!

-------------------

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / 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 true;

// Geometry. Definition of all surfaces. All surfaces are of class

geometry
{

outCylinder
{
type searchableCylinder;
point1 (900e-5 100e-5 0);
point2 (900e-5 100e-5 1e-5);
radius 50.0e-5;
}
};

castellatedMeshControls

maxLocalCells 100000;
maxGlobalCells 2000000;
minRefinementCells 0;
maxLoadUnbalance 0.10;
nCellsBetweenLevels 1;

refinementSurfaces
{
outCylinder
{
level (0 0);
}
}

resolveFeatureAngle 30;

// Region-wise refinement
refinementRegions
{
outCylinder
{
mode outside;
levels ((1.0 0));
}
}

// Mesh selection
locationInMesh (1200.001e-5 100.001e-5 0.001e-5);
snapControls
{
nSmoothPatch 5;
tolerance 2.0;
nSolveIter 30;
nRelaxIter 5;
}

addLayersControls
{
relativeSizes true;

layers
{
outCylinder_region0
{
nSurfaceLayers 8;
}
}

expansionRatio 1.0;
finalLayerThickness 1.0;
minThickness 0.25;
nGrow 0;

// Advanced settings
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 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minVol 1e-18;
minTetQuality 1e-9;
minArea -1;
minTwist 0.05;
minDeterminant 0.001;
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;
//minVolCollapseRatio 0.5;

// Advanced
nSmoothScale 4;
errorReduction 0.75;
relaxed
{
maxNonOrtho 75;
}
}

// Advanced
debug 0;
mergeTolerance 1e-6;

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

skeptik March 26, 2013 10:05

mesh
 
Hi!

No there is no way to generate mesh without prism cells.

And what you mean by "bumps"? I see that your cylinder is not bad.

mzweemer March 27, 2013 07:53

Hi Skeptik,

I've already improved my current mesh but too bad there is no way to get rid of the triangular shaped grid cells. The bumps I ment can be seen at the inner wall of the cyllinder. But I have got rid of them by running SnappyHexMesh a second time, adding some additional layers on the inside of the cyllinder. Herewith the cyllinder became perfectly round!

Arnoldinho March 27, 2013 09:14

Alternatively, if you are interested in cylinders only (and don't want to use it as a simple test case for complex geometries), you could go for a blockMesh-created cylinder. Have a look at the forum, there should be some examples that use m4 macro processor utility. But to be honest - doesn't the mesh look nice enough?

Arne

mzweemer March 27, 2013 10:58

Hi Arne,

The fact is that I'm interested in the behavior of a bubble in liquid passing this cylinder. The minor errors on the cylinder wall influences the break-up of the bubble, so a perfect shaped cylinder is what I want.
I have been struggeling with the blockMesh-created cylinder as well, but that took me to long.

Matthijs

skeptik March 27, 2013 14:07

Quote:

Originally Posted by mzweemer (Post 416760)
Hi Arne,

The fact is that I'm interested in the behavior of a bubble in liquid passing this cylinder. The minor errors on the cylinder wall influences the break-up of the bubble, so a perfect shaped cylinder is what I want.
I have been struggeling with the blockMesh-created cylinder as well, but that took me to long.

Matthijs

So.. sHM, i think, is not a good choice)
blockMesh is better. espesially when you have analytical surfaces.

Arnoldinho March 28, 2013 04:34

Quote:

Originally Posted by skeptik (Post 416809)
So.. sHM, i think, is not a good choice)
blockMesh is better. espesially when you have analytical surfaces.

That's what I think as well. Especially when you want to compare your results with analytical solutions, you should have a 'perfect' shape. sHM does not provide this.


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