CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] "Jagged" U at refined mesh areas (https://www.cfd-online.com/Forums/openfoam-meshing/112326-jagged-u-refined-mesh-areas.html)

Steven Chew January 25, 2013 21:51

"Jagged" U at refined mesh areas
 
Hi all,

Need some assistance here. I virtually copied the Motorbike case from the tutorial and tried to run using my own vehicle geometry. My case consists of an inlet uniform flow (22m/s) with pressure boundary outlet, and all 4 side walls including the stationary floor.

Running wise I got no problem, and I was able to run snappyHexMesh and simpleFoam and get some results. But when I checked the central cut plane U contour plot, this appears

http://i45.tinypic.com/34e9pox.jpg

At the entrance and exit area the velocity magnitude seem to be pretty smooth along the ground, but as it approaches even the first refined mesh, there is this jagged contours.

I do not really understand, and I have checked the motorbike case. The flow parameters I have used including the turbulence numbers are all the same. There are also jagged contour along the ground but it seems more controlled under a thinner layer.

I was suspecting should I increase the number of buffer layers? below is my snappyHexMeshdict file

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;
snap true;
addLayers true;

geometry
{
sunspec.stl
{
type triSurfaceMesh;
name sunspec;
}

refinementBox
{
type searchableBox;
min (-4000.0 -600.0 -1400.0);
max ( 8000.0 1000.0 1400.0);
}
};

// Settings for the castellatedMesh generation.
castellatedMeshControls
{
maxLocalCells 3000000;

maxGlobalCells 3000000;

minRefinementCells 10;

maxLoadUnbalance 0.10;

nCellsBetweenLevels 3;

features
(
);

// Surface based refinement
refinementSurfaces
{
sunspec
{
level (5 6);
}
}

// Resolve sharp angles
resolveFeatureAngle 30;

refinementRegions
{
refinementBox
{
mode inside;
levels ((1E15 4));
}
}


// Mesh selection
// ~~~~~~~~~~~~~~
locationInMesh (9700 1700 2100);

allowFreeStandingZoneFaces true;
}

// Settings for the snapping.
snapControls
{
nSmoothPatch 4;

tolerance 4.0;

nSolveIter 20;

nRelaxIter 5;
}

// Settings for the layer addition.
addLayersControls
{
relativeSizes true;

layers
{
"(walls|sunspec).*"
{
nSurfaceLayers 1;
}
}

// Expansion factor for layer mesh
expansionRatio 1.0;
finalLayerThickness 0.3;

minThickness 0.1;

nGrow 0;

featureAngle 30;

nRelaxIter 3;

nSmoothSurfaceNormals 1;

nSmoothNormals 3;

nSmoothThickness 10;

maxFaceThicknessRatio 0.5;

maxThicknessToMedialRatio 0.3;

minMedianAxisAngle 90;

nBufferCellsNoExtrude 0;

nLayerIter 50;
}

meshQualityControls
{
maxNonOrtho 65;

maxBoundarySkewness 20;
maxInternalSkewness 4;

maxConcave 80;

minVol 1e-13;

minTetQuality 1e-30;

minArea -1;

minTwist 0.02;

minDeterminant 0.001;

minFaceWeight 0.02;

minVolRatio 0.01;

minTriangleTwist -1;


// Advanced
nSmoothScale 4;
errorReduction 0.75;
}

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


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

doubtsincfd January 28, 2013 15:07

Are you adding layers on the ground also?

I also had similar experience, and for me layer addition+second order schemes made the profile smoother

Steven Chew January 29, 2013 03:34

Hi,

Yes, for this run, I have not put a second layer on the ground. I tested it out and it really smoothened out the jaggedness. Thanks!

But now between the inlet coarse mesh region and the finer mesh region near the vehicle, there is a region of layer 2 mesh (second coarsest) that exhibits this behaviour. Does this mean I actually need to cover the entire ground surface with refined meshing?

doubtsincfd January 30, 2013 09:03

Hi Stewen. Can you post more details of your simulation. Maybe contour plots you did before and fvSchemes file. Also, are you using boundary conditions from motorbike tutorial? They might not be realistic for your problem depending on the dimensions of the geometry.

I would mainly like to know the fvSchemes and the turbulence models you are using

Steven Chew February 10, 2013 11:01

Hi, here's my fvschemes file

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss linearUpwindV grad(U);
div(phi,k) Gauss upwind;
div(phi,omega) Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p;
}


And my turbulence model

FoamFile
{
version 2.0;
format ascii;
class dictionary;
// location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

RASModel kOmegaSST;
turbulence on;
printCoeffs on;


Using mostly the motorbike's stuff except the slip surface and symmetry condition I believe.

The entrance, exit and near-vehicle contours are alright now, but not at the transition, medium-res areas.

http://i45.tinypic.com/ip164i.jpg

doubtsincfd February 10, 2013 20:53

Hi Steven,

I would suggest the following:

1. Refine the mesh in the jagged areas. Maybe the mesh there is not fine enough to resolve the gradients. Seems your layers are thin (which is required for k-w sst), so you can go for more layers if the transition between the near wall layers and the interior mesh is not smooth.

I would suggest to use same refinement near the wall, since the gradients near the wall are highest near the entrance

2. Check y+ values. For k-w SST y+ <=1

3. Use Gauss linearUpwind for k and omega

4. Use cellMDLimited Gauss linear 1 for grad schemes


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