CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] Problem with the boundary layer using snappyHexMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By openfoam_user

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2010, 08:22
Default Problem with the boundary layer using snappyHexMesh
  #1
Member
 
LVDH's Avatar
 
Andre Z
Join Date: Dec 2009
Posts: 75
Rep Power: 17
LVDH is on a distinguished road
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.
Why 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
(
);
Attached Images
File Type: png BL.png (20.6 KB, 396 views)

Last edited by LVDH; January 18, 2010 at 08:39.
LVDH is offline   Reply With Quote

Old   January 19, 2010, 01:17
Default
  #2
New Member
 
amgode's Avatar
 
Amol
Join Date: Jul 2009
Location: Limerick, Ireland
Posts: 24
Blog Entries: 2
Rep Power: 17
amgode is on a distinguished road
Hi,

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


-- Amol
amgode is offline   Reply With Quote

Old   January 19, 2010, 06:07
Default
  #3
Member
 
LVDH's Avatar
 
Andre Z
Join Date: Dec 2009
Posts: 75
Rep Power: 17
LVDH is on a distinguished road
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;
Attached Images
File Type: png P1.png (8.4 KB, 286 views)
File Type: png P2.png (9.2 KB, 286 views)
File Type: png P3.png (8.0 KB, 224 views)
File Type: png P4.png (9.5 KB, 225 views)
LVDH is offline   Reply With Quote

Old   January 27, 2010, 00:58
Default
  #4
New Member
 
amgode's Avatar
 
Amol
Join Date: Jul 2009
Location: Limerick, Ireland
Posts: 24
Blog Entries: 2
Rep Power: 17
amgode is on a distinguished road
Check the post below and see if it helps!

http://www.cfd-online.com/Forums/ope...modelling.html
amgode is offline   Reply With Quote

Old   January 28, 2010, 08:36
Default
  #5
Member
 
LVDH's Avatar
 
Andre Z
Join Date: Dec 2009
Posts: 75
Rep Power: 17
LVDH is on a distinguished road
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?
LVDH is offline   Reply With Quote

Old   March 4, 2010, 08:11
Default
  #6
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
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 is offline   Reply With Quote

Old   March 4, 2010, 09:45
Default
  #7
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
I have attached a picture to show again the problem.

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

Stephane.
Attached Images
File Type: jpg pict.jpg (46.5 KB, 228 views)
openfoam_user is offline   Reply With Quote

Old   March 10, 2010, 09:46
Default
  #8
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Any ideas how to solve this problem ?

Stephane.
openfoam_user is offline   Reply With Quote

Old   March 15, 2010, 08:47
Default
  #9
New Member
 
Julius
Join Date: Mar 2009
Posts: 27
Rep Power: 17
juliuslein is on a distinguished road
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
juliuslein is offline   Reply With Quote

Old   March 15, 2010, 09:30
Default
  #10
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
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.
Attached Images
File Type: jpg pict3.jpg (56.4 KB, 203 views)
Richal Sun likes this.
openfoam_user is offline   Reply With Quote

Old   March 15, 2010, 10:19
Default
  #11
New Member
 
Julius
Join Date: Mar 2009
Posts: 27
Rep Power: 17
juliuslein is on a distinguished road
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
juliuslein is offline   Reply With Quote

Old   March 15, 2010, 10:42
Default
  #12
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Julius,

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

Stephane.
openfoam_user is offline   Reply With Quote

Old   March 15, 2010, 11:30
Default
  #13
New Member
 
Julius
Join Date: Mar 2009
Posts: 27
Rep Power: 17
juliuslein is on a distinguished road
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
Attached Images
File Type: png screenshot.png (87.7 KB, 155 views)
juliuslein is offline   Reply With Quote

Old   March 15, 2010, 11:42
Default
  #14
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
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.
openfoam_user is offline   Reply With Quote

Reply

Tags
snappyhexmesh


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] Triangular elements in boundary layers generated by snappyHexMesh mike.franky OpenFOAM Meshing & Mesh Conversion 0 June 3, 2018 10:46
[cfMesh] boundary layer problem using cfMesh dupeng OpenFOAM Community Contributions 1 May 28, 2018 16:30
[snappyHexMesh] problem with snappyHexMesh kanes OpenFOAM Meshing & Mesh Conversion 10 January 26, 2016 07:11
Validity & transformation of boundary layer equations Obad Main CFD Forum 2 April 27, 2015 03:59
[snappyHexMesh] Problem with snappyHexMesh samiam1000 OpenFOAM Meshing & Mesh Conversion 2 December 13, 2012 09:41


All times are GMT -4. The time now is 13:43.