CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

addLayersControls in snappyHexMesh around cylinder

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By LuckyTran
  • 1 Post By AtoHM

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2023, 03:39
Default addLayersControls in snappyHexMesh around cylinder
  #1
New Member
 
Abhijit
Join Date: Aug 2020
Location: India
Posts: 27
Rep Power: 5
Redrakham is on a distinguished road
I created 3d mesh using snappyHexMesh for vortex-induced vibration of cylinder in OpenFOAM-v1906. When adding layers around the cylinder, the points are not distributed evenly around the cylinder. It created some unwanted vorticity in front of the cylinder. Many many thanks for the help.


I attached the mesh around the cylinder and vorticity contour.



mesh.jpg vorticity.jpg



This is my snappyHexMeshDict file:
/*--------------------------------*- C++ -*----------------------------------*\

| ========= | |

| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |

| \\ / O peration | Version: v1912 |

| \\ / A nd | Website: www.openfoam.com |

| \\/ M anipulation | |

\*---------------------------------------------------------------------------*/

FoamFile

{

version 2.0;

format ascii;

class dictionary;

location "system";

object snappyHexMeshDict;

}

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



castellatedMesh true;

snap true;

addLayers true;



geometry

{

cylinder1.stl

{

type triSurfaceMesh;

name cylinder1;

}

refinementcyl

{

type searchableCylinder;

point1 (0 0 -9.6);

point2 (0 0 0);

radius 0.7;

}

refinementBox1

{

type box;

min (0 -1 -9.6);

max (2 1 0);

}

refinementBox2

{

type box;

min (2 -2 -9.6);

max (6 2 0);

}

refinementBox3

{

type box;

min (6 -3 -9.6);

max (10 3 0);

}

refinementBox4

{

type box;

min (10 -4.5 -9.6);

max (20 4.5 0);

}

refinementBox5

{

type box;

min (-10 -10 -9.6);

max (20 10 0);

}

};

castellatedMeshControls

{

maxLocalCells 100000;



maxGlobalCells 2000000;



minRefinementCells 0;



maxLoadUnbalance 0.1;



nCellsBetweenLevels 5;



features

(

{

file "cylinder1.eMesh";

level 4;

}

);



refinementSurfaces

{

cylinder1

{

level (5 5); // (surface refinement level, curvature refinement level)

}



patchInfo

{

type wall;

inGroups (wall);

}

}



resolveFeatureAngle 30;



planarAngle 30;



refinementRegions

{

refinementcyl

{

mode inside;

levels ((1E15 5));

}

refinementBox1

{

mode inside;

levels ((1E15 4));

}

refinementBox2

{

mode inside;

levels ((1E15 4));

}

refinementBox3

{

mode inside;

levels ((1E15 3));

}

refinementBox4

{

mode inside;

levels ((1E15 2));

}

refinementBox5

{

mode inside;

levels ((1E15 0));

levelIncrement (0 4 (0 0 1));

}



}



locationInMesh (1.001 2.001 -4.5001);



allowFreeStandingZoneFaces true;



}



snapControls

{



nSmoothPatch 3;



tolerance 2.0;



nSolveIter 300;



nRelaxIter 5;



nFeatureSnapIter 2;



implicitFeatureSnap true;



explicitFeatureSnap false;



multiRegionFeatureSnap true;



}



addLayersControls

{



expansionRatio 1.15;



finalLayerThickness 1.0;



minThickness 0.002;



relativeSizes true;



layers

{



cylinder1

{

nSurfaceLayers 21;

}/*

back

{

nSurfaceLayers 4;

}*/



}



nGrow 0;



featureAngle 60;



maxFaceThicknessRatio 0.5;



nSmoothSurfaceNormals 10;



nSmoothThickness 10;



//minMedialAxisAngle 90;



minMedianAxisAngle 90;



nSmoothDisplacement 90;



maxThicknessToMedialRatio 0.3;



nSmoothNormals 15;



slipFeatureAngle 30;



nRelaxIter 5;



nBufferCellsNoExtrude 0;



nLayerIter 50;



nRelaxedIter 20;



meshShrinker displacementMotionSolver;



solver displacementLaplacian;



displacementLaplacianCoeffs

{

diffusivity quadratic inverseDistance 1(cylinder1);

}



}



meshQualityControls

{

#include "meshQualityDict"



relaxed

{

maxNonOrtho 75;

}

// Advanced



//- Number of error distribution iterations

nSmoothScale 4;

//- Amount to scale back displacement at error points

errorReduction 0.75;

}



mergeTolerance 1e-6;

// ************************************************** *********************** //
Redrakham is offline   Reply With Quote

Old   January 4, 2023, 10:17
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
From the image it looks like snappy is working exactly as it should. If the cells are not evenly distributed to your like, then the cells in the input mesh are not even.
Redrakham likes this.
LuckyTran is offline   Reply With Quote

Old   January 4, 2023, 23:35
Default
  #3
New Member
 
Abhijit
Join Date: Aug 2020
Location: India
Posts: 27
Rep Power: 5
Redrakham is on a distinguished road
Thank you very much for your reply. What do you mean by "cells in the input mesh are not even"? The nodes on the cylinder surface are not equally spaced and there is sudden jump in the element size along the surface of the cylinder. How do I rectify it?
Redrakham is offline   Reply With Quote

Old   January 5, 2023, 01:11
Default
  #4
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
The input mesh for snappyHexMesh is the blockMesh. Lucky suggests to check the spacing there. You can deactivate the layer generation and try to get the distribution as good as possible with a given blockMesh. Then go and reactivate layers generation.
Redrakham likes this.
AtoHM 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] snappyHexMesh - cylinder appears as a square! chia87 OpenFOAM Meshing & Mesh Conversion 1 October 23, 2018 21:41
[snappyHexMesh] Openfoam snappyhexmesh addLayersControls - non uniform layer BakedAlmonds OpenFOAM Meshing & Mesh Conversion 1 July 19, 2016 14:39
flow over a cylinder urgent! kevin FLUENT 8 August 11, 2015 13:00
[ANSYS Meshing] uniform mesh, cylinder with a cut Matiasi ANSYS Meshing & Geometry 5 June 8, 2015 15:08
[blockMesh] 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:05.