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] Problem with the boundary layer using snappyHexMesh (https://www.cfd-online.com/Forums/openfoam-meshing/71861-problem-boundary-layer-using-snappyhexmesh.html)

LVDH January 18, 2010 07:22

Problem with the boundary layer using snappyHexMesh
 
1 Attachment(s)
Hello,
this is my first post here.
Currently I am working at a company which provides CFD services mainly for the automotive industry. Right now I am still an intern but shortly will start writing my diploma thesis here. Well my task is to find out what can be done with OpenFoam.

Often, when I try to create a mesh with snappyHexMesh I get problems with the boundary layer. And this leads to my first question:

Check out the attached picture of a Porsche I have meshed.
http://www.cfd-online.com//http://ww...1&d=1263817250Why is the boundary layer below the door?

In case you think my blockMeshDict is fault, here is the text:

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}

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

convertToMeters 1.0;

vertices
(
      (      -70        -70        8.000)
      (        300        -70        8.000)
      (        300        140        8.000)
      (      -70        140        8.000)
     
      (      -70        -70        100.000)
      (        300        -70        100.000)
      (        300        140        100.000)
      (      -70        140        100.000)
);

blocks
(
      hex (0 1 2 3 4 5 6 7) (40 20 10) simpleGrading (1 1 1)

);

edges
(
);

patches
(
      patch inlet
      (
            (0 4 7 3)
      )
      patch outlet
      (
            (1 2 6 5)
      )
      patch floor
      (
            (0 3 2 1)
      )
      patch sides
      (
            (0 1 5 4)
            (4 5 6 7)
            (2 3 7 6)
      )
);

mergeMatchPairs
(
);


amgode January 19, 2010 00:17

Hi,

You need to post the snappyHexMeshDict ........


-- Amol

LVDH January 19, 2010 05:07

4 Attachment(s)
Hi,

I seem to have solved my first problem. The surrounding box generated by blockMesh cut off a small part of the cars tires. I did this on purpose but enlarging the box and therefor having a levitating car got the boundary layer on the car.

Still I have a problem with this boundary layer. It is not to be found everywhere. On some sections it is missing on some others it does not have the desired number of layers. See the attached pictures.

Since I have rescaled the 100m long Porsche to a 4m long Porsche my Dicts have changed:

Code:

{
     version    2.0;
     format      ascii;
     class      dictionary;
     object      blockMeshDict;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 convertToMeters 1.0;
 
 vertices
 (
       (      -3        -3        0.25)
       (        12        -3        0.25)
       (        12        6        0.25)
       (      -3        6        0.25)
 
       (      -3        -3        4.000)
       (        12        -3        4.000)
       (        12        6        4.000)
       (      -3        6        4.000)
 
 
 /*      (      -70        -70        6.000)
       (        300        -70        6.000)
       (        300        140        6.000)
       (      -70        140        6.000)
 
       (      -70        -70        100.000)
       (        300        -70        100.000)
       (        300        140        100.000)
       (      -70        140        100.000)*/
 );
 
 blocks
 (
       hex (0 1 2 3 4 5 6 7) (40 20 10) simpleGrading (1 1 1)
 
 );
 
 edges
 (
 );
 
 patches
 (
       patch inlet
       (
             (0 4 7 3)
       )
       patch outlet
       (
             (1 2 6 5)
       )
       patch floor
       (
             (0 3 2 1)
       )
       patch sides
       (
             (0 1 5 4)
             (4 5 6 7)
             (2 3 7 6)
       )
 );
 
 mergeMatchPairs
 (
 );

Code:

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

 castellatedMesh true;
 snap            true;
 addLayers      true;
 

 geometry
 {
     porsche.stl
     {
         type triSurfaceMesh;
         name AUTO;
     }
 
     refinementBox
     {
         type searchableBox;
         min (-1 -0.5 0.25);
         max ( 8  3.5 3);
     }
 };
 
 
 

 castellatedMeshControls
 {
 

     maxLocalCells 100000;
 
     maxGlobalCells 200000;

     minRefinementCells 10;

     nCellsBetweenLevels 6;
 
 

     features
     (
         //{
         //    file "someLine.eMesh";
         //    level 2;
         //}
     );
 
 
 

     refinementSurfaces
     {
         AUTO
         {

             level (4 4);
         }
     }
 

     resolveFeatureAngle 30;
 
 


     refinementRegions
     {
         refinementBox
         {
             mode inside;
             levels ((1E15 2));
         }
 
 
       AUTO
       {
         mode distance;
         levels ((0.6 3) (1.1 2));
       }
 
     }
 
 

     locationInMesh (-2.234 -2.0343 3.43);
 }
 
 
 

 snapControls
 {

     nSmoothPatch 4;
 

     tolerance 4.5;
 

     nSolveIter 40;

     nRelaxIter 6;
 }
 
 
 

 addLayersControls
 {
     relativeSizes true;
 

     layers
     {
 
         AUTO_patch8224
         {
             nSurfaceLayers 5;
         }
 
     }
 

     expansionRatio 1.2;
 

     finalLayerThickness 0.2;
 

     minThickness 0.04;

     nGrow 1;
 
 

     featureAngle 30;
 

     nRelaxIter 3;
 

     nSmoothSurfaceNormals 1;
 

     nSmoothNormals 3;
 

     nSmoothThickness 10;
 

     maxFaceThicknessRatio 0.5;
 

     maxThicknessToMedialRatio 0.3;
 

     minMedianAxisAngle 130;
 

     nBufferCellsNoExtrude 0;

     nLayerIter 50;
 }

 meshQualityControls
 {

     maxNonOrtho 65;

     maxBoundarySkewness 20;
     maxInternalSkewness 4;

     maxConcave 80;
 

     minFlatness 0.5;
 

     minVol 1e-13;
 

     minArea -1;

     minTwist 0.02;
 
     minDeterminant 0.001;
 

     minFaceWeight 0.02;
 

     minVolRatio 0.01;
 
     minTriangleTwist -1;

     nSmoothScale 4;

     errorReduction 0.75;
 }
 
 
  debug 0;
 
 
 mergeTolerance 1E-6;


amgode January 26, 2010 23:58

Check the post below and see if it helps!:)

http://www.cfd-online.com/Forums/ope...modelling.html

LVDH January 28, 2010 07:36

I have tried the tips deducted from that thread.
Now the mesh is getting better. Still there are areas without boundarylayer.
I guess I just have to tweak the snappyHexMesh settings a little more.

I never had such trouble, but I guess after I finish this mesh my new experience will allow me to get my other stuff meshed a bit faster.

Hey, maybe someone else who tried to mesh this car (I have seen a few other meshes) can show me his snappyDict?

openfoam_user March 4, 2010 07:11

Hi Andre,

I have exactly the same problem. I have areas where there is no boundary layers.

Did you solve the problem ?

Which parameters are important to improve the boundary layers ?

Best regards,

Stephane.

openfoam_user March 4, 2010 08:45

1 Attachment(s)
I have attached a picture to show again the problem.

There are some areas (corners) where there is no layer.

Stephane.

openfoam_user March 10, 2010 08:46

Any ideas how to solve this problem ?

Stephane.

juliuslein March 15, 2010 07:47

Hello Stephane,

all snappyHexMesh boundary layers were collapsing at the end of a surface, this seems to be normal. Have look at the Porsche above, too. This should be modifyable in a certain range with the featureAngle setting in the "addLayerControls" subdictionary.

Good Luck, Julius

openfoam_user March 15, 2010 08:30

1 Attachment(s)
Hi Julius,

it seems to work (see attached picture).

I have changed the featureAngle value in the "addLayerControls" subdictionary.

Default value was 30
New value is 5

To be sure I would like to select only the cells located into the boundary layers. Do you know how to do it with paraview ?

Regards,

Stephane.

juliuslein March 15, 2010 09:19

Hello again,

if you're using ParaFoam (paraview with the native OpenFOAM reader) you should be able to select the "include Sets" option. Now the "added Cells - cellSet" and the "layerFaces - faceSet" appear in the "region status" box. The added Cells set should be what you're looking for.

Regards, Julius

openfoam_user March 15, 2010 09:42

Julius,

I can't find the "region status" box !

Stephane.

juliuslein March 15, 2010 10:30

1 Attachment(s)
Stephane,

If you use paraFoam it will look like the following screenshot. There you see the mentioned box and above the "include sets" option checked.

In case you don't know how to use / compile paraFoam and the necessary PV3FoamReader please search the forum because this is a common issue.

Regards, Julius

openfoam_user March 15, 2010 10:42

Julius,

OK. Thanks. Now I can visualize the boundary layers cells.

I use paraFoam 3.6.1. And the box name is mesh parts.

Regards,

Stephane.


All times are GMT -4. The time now is 22:33.