CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

SnappyHexMesh cylinder 2D

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 8, 2013, 04:20
Default SnappyHexMesh cylinder 2D
  #1
New Member
 
Matthijs Zweemer
Join Date: Feb 2013
Posts: 5
Rep Power: 4
mzweemer is on a distinguished road
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;

// ************************************************** *********************** //
Attached Images
File Type: jpg Mesh.jpg (96.4 KB, 184 views)

Last edited by mzweemer; March 8, 2013 at 06:38.
mzweemer is offline   Reply With Quote

Old   March 26, 2013, 10:05
Default mesh
  #2
Member
 
Ilya
Join Date: Dec 2011
Location: Russia
Posts: 75
Blog Entries: 38
Rep Power: 5
skeptik is on a distinguished road
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.
__________________
practice makes perfect
skeptik is offline   Reply With Quote

Old   March 27, 2013, 07:53
Default
  #3
New Member
 
Matthijs Zweemer
Join Date: Feb 2013
Posts: 5
Rep Power: 4
mzweemer is on a distinguished road
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!
mzweemer is offline   Reply With Quote

Old   March 27, 2013, 09:14
Default
  #4
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
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
Arnoldinho is offline   Reply With Quote

Old   March 27, 2013, 10:58
Default
  #5
New Member
 
Matthijs Zweemer
Join Date: Feb 2013
Posts: 5
Rep Power: 4
mzweemer is on a distinguished road
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
mzweemer is offline   Reply With Quote

Old   March 27, 2013, 14:07
Default
  #6
Member
 
Ilya
Join Date: Dec 2011
Location: Russia
Posts: 75
Blog Entries: 38
Rep Power: 5
skeptik is on a distinguished road
Quote:
Originally Posted by mzweemer View Post
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.
__________________
practice makes perfect
skeptik is offline   Reply With Quote

Old   March 28, 2013, 04:34
Default
  #7
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Quote:
Originally Posted by skeptik View Post
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.
Arnoldinho is offline   Reply With Quote

Reply

Tags
2d problem, cylinder, snappyhexmesh

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create cylinder around snappyHexMesh for MRF/rotating linnemann OpenFOAM Meshing & Mesh Conversion 6 October 19, 2014 23:19
snappyHexMesh - 2D Cylinder Problems Logan Page OpenFOAM Native Meshers: snappyHexMesh and Others 4 May 27, 2013 12:07
Incorrect Drag and Drag Coefficient for flow over a cylinder ozzythewise Main CFD Forum 8 June 13, 2012 06:24
SnappyHexMesh Meshing inside a cylinder nammari OpenFOAM 5 March 11, 2011 20:49
Specifying boundary faces failes in blockMesh blaise OpenFOAM Meshing & Mesh Conversion 0 May 10, 2010 03:56


All times are GMT -4. The time now is 09:50.