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] meshing of very small patches in comparison with the overall geometry (https://www.cfd-online.com/Forums/openfoam-meshing/145988-meshing-very-small-patches-comparison-overall-geometry.html)

christos December 16, 2014 10:35

meshing of very small patches in comparison with the overall geometry
 
2 Attachment(s)
Hi everyone,

I have a problem on meshing very small stl surfaces that coexists with bigger stl surfaces. Please find below a description of my problem:


There is a big room (dimensions 15x11x3 m). Outside of the room there is a gas heater which transfers hot air inside the room through a pipe installation. The part of the pipe that is inside the room has small holes, hence hot air escapes from these holes and warms the room. For simplification purposes I want to first model my case from these small holes and afterwards (later on I will include the pipe installation). Hence, I create .stl surfaces for the room and for these small holes. Now the problem is that snappyHexMesh does a very bad coarse refinement in the region of these small holes, despite the fact that I increase the edge refinement level and the surface refinement.
In addition these small holes (hotInlets) are defined as faceZones in the SHM dictionary.

Thanks a lot for your help!!!



SnappyHexMeshDict


Code:

castellatedMesh true;
snap            true;
addLayers      true;



geometry
{
  roomWalls.stl
  {
    type triSurfaceMesh;
    name roomWalls;
  }
 
  hotInlet1.stl
  {
    type triSurfaceMesh;
    name hotInlet1;
  }
 
  hotInlet2.stl
  {
    type triSurfaceMesh;
    name hotInlet2;
  }
 
  hotInlet3.stl
  {
    type triSurfaceMesh;
    name hotInlet3;
  }
 
  hotInlet4.stl
  {
    type triSurfaceMesh;
    name hotInlet4;
  }
 
  hotInlet5.stl
  {
    type triSurfaceMesh;
    name hotInlet5;
  }
 
  hotInlet6.stl
  {
    type triSurfaceMesh;
    name hotInlet6;
  }
 
  outlet1.stl
  {
    type triSurfaceMesh;
    name outlet1;
  }
 
  outlet2.stl
  {
    type triSurfaceMesh;
    name outlet2;
  }
 
  outlet3.stl
  {
    type triSurfaceMesh;
    name outlet3;
  }
 
 
  roomVolume.stl
  {
    type triSurfaceMesh;
    name roomVolume;
  }
 
 
 
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{
 

  maxLocalCells 1000000;
 
 
  maxGlobalCells 2000000;
 
 
  minRefinementCells 0;
 
 
  nCellsBetweenLevels 1;
 
 
 
 
  features
  (
    {
      file "roomWalls.eMesh";
      level 1;
    }
    {
      file "hotInlet1.eMesh";
      level 3;
    }
    {
      file "hotInlet2.eMesh";
      level 3;
    }
    {
      file "hotInlet3.eMesh";
      level 3;
    }
    {
      file "hotInlet4.eMesh";
      level 3;
    }
    {
      file "hotInlet5.eMesh";
      level 3;
    }
    {
      file "hotInlet6.eMesh";
      level 3;
    }
    {
      file "outlet1.eMesh";
      level 1;
    }

    {
      file "outlet2.eMesh";
      level 1;
    }
    {
      file "outlet3.eMesh";
      level 1;
    }
   

   
   
  );
 
 
 

 
  refinementSurfaces
  {
    roomWalls
    {
      // Surface-wise min and max refinement level
      level (1 1);
      patchInfo
      {
        type wall;
        //inGroups (hotOutlet);
      } 

    }
   
    outlet1
    {
      // Surface-wise min and max refinement level
      level (1 1);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      }

    }
   
    outlet2
    {
      // Surface-wise min and max refinement level
      level (1 1);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      } 
     
      }
     
      outlet3
    {
      // Surface-wise min and max refinement level
      level (1 1);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      } 
     
      }
     
     
     
   
   
    hotInlet1
    {
      // Surface-wise min and max refinement level
      level (3 3);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      }         
      faceZone hotInlet1;
      faceType baffle;
     
    }
   
   
    hotInlet2
    {
      // Surface-wise min and max refinement level
      level (3 3);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      }         
      faceZone hotInlet2;
      faceType baffle;
     
    }
   
   
    hotInlet3
    {
      // Surface-wise min and max refinement level
      level (3 3);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      }         
      faceZone hotInlet3;
      faceType baffle;
     
    }
   
   
    hotInlet4
    {
      // Surface-wise min and max refinement level
      level (3 3);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      }         
      faceZone hotInlet4;
      faceType baffle;
     
    }
   
    hotInlet5
    {
      // Surface-wise min and max refinement level
      level (3 3);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      }         
      faceZone hotInlet5;
      faceType baffle;
     
    }

    hotInlet6
    {
      // Surface-wise min and max refinement level
      level (3 3);
      patchInfo
      {
        type patch;
        //inGroups (hotOutlet);
      }         
      faceZone hotInlet6;
      faceType baffle;
     
    }
   
   
   
   
   
   
   
  }
 
  // Resolve sharp angles
  resolveFeatureAngle 30;//30
 
  refinementRegions
  {

       
       
  }
 
 
       
        locationInMesh (0.00001123 0.1 0.1);
       
        allowFreeStandingZoneFaces true;
  }
 
 
 
  // Settings for the snapping.
  snapControls
  {
    //- Number of patch smoothing iterations before finding correspondence
    //  to surface
    nSmoothPatch 3;
   
    //- Relative distance for points to be attracted by surface feature point
    //  or edge. True distance is this factor times local
    //  maximum edge length.
    tolerance 4.0;//1
   
    //- Number of mesh displacement relaxation iterations.
    nSolveIter 30;//300
   
    //- Maximum number of snapping relaxation iterations. Should stop
    //  before upon reaching a correct mesh.
    nRelaxIter 5;
   
    //- Highly experimental and wip: number of feature edge snapping
    //  iterations. Leave out altogether to disable.
    //  Of limited use in this case since faceZone faces not handled.
    nFeatureSnapIter 10;
    //- Detect (geometric) features by sampling the surface
    implicitFeatureSnap false;
   
    //- Use castellatedMeshControls::features
    explicitFeatureSnap true;
   
    //- Detect features between multiple surfaces
    //  (only for explicitFeatureSnap, default = false)
    multiRegionFeatureSnap true;
   
   
   
  }
 
 
 
  // Settings for the layer addition.
  addLayersControls
  {
    relativeSizes true;
   
    // Per final patch (so not geometry!) the layer information
    layers
    {
      /*maxY
      {
        nSurfaceLayers 1;
      }*/
    }
   
    // Expansion factor for layer mesh
    expansionRatio 1.0;
   
    // Wanted thickness of final added cell layer. If multiple layers
    // is the thickness of the layer furthest away from the wall.
    // Relative to undistorted size of cell outside layer.
    finalLayerThickness 0.3;
   
    // Minimum thickness of cell layer. If for any reason layer
    // cannot be above minThickness do not add layer.
    // Relative to undistorted size of cell outside layer.
    minThickness 0.25;
   
    // If points get not extruded do nGrow layers of connected faces that are
    // also not grown. This helps convergence of the layer addition process
    // close to features.
    // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
    nGrow 1;//0
   
    // Advanced settings
   
    // When not to extrude surface. 0 is flat surface, 90 is when two faces
    // are perpendicular
    featureAngle 60;//30
   
    // Maximum number of snapping relaxation iterations. Should stop
    // before upon reaching a correct mesh.
    nRelaxIter 5;
   
    // Number of smoothing iterations of surface normals
    nSmoothSurfaceNormals 1;
   
    // Number of smoothing iterations of interior mesh movement direction
    nSmoothNormals 3;
   
    // Smooth layer thickness over surface patches
    nSmoothThickness 10;
   
    // Stop layer growth on highly warped cells
    maxFaceThicknessRatio 0.5;
   
    // Reduce layer growth where ratio thickness to medial
    // distance is large
    maxThicknessToMedialRatio 0.3;
   
    // Angle used to pick up medial axis points
    // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
    minMedianAxisAngle 130;//90
   
    // Create buffer region for new layer terminations
    nBufferCellsNoExtrude 0;
   
    // Overall max number of layer addition iterations. The mesher will exit
    // if it reaches this number of iterations; possibly with an illegal
    // mesh.
    nLayerIter 50;
    nRelaxedIter 20;
  }
 
 
 
  // Generic mesh quality settings. At any undoable phase these determine
  // where to undo.
  meshQualityControls
  {
    #include "meshQualityDict"
   
    maxNonOrtho 75;
    maxBoundarySkewness 20;
    maxConcave 80;
    minFlatness 0.5;
    minVol 1e-13;
    minArea -1;
    minTwist 0.05;
    minDeterminant 0.001;
    minFaceWeight 0.05;
    minVolRatio 0.01;
    minTriangleTwist -1;
   
   
    //- Number of error distribution iterations
    nSmoothScale 4;
    //- amount to scale back displacement at error points
    errorReduction 0.75;
  }
 
 
  // Advanced
 
  // Merge tolerance. Is fraction of overall bounding box of initial mesh.
  // Note: the write tolerance needs to be higher than this.
  mergeTolerance 1e-6;


christos December 16, 2014 16:48

Hi guys,

I increased the intensity of the background hex mesh and the results are worse. Is there sth that I am doing wrong or is it a bug of snappyHexMesh?
One question that I think is connected with my problem, concerning the background hex mesh:
In the user guide of OpenFoam (page U-147) it is written:

Quote:

There must be at least one intersection of a cell edge with the STL surface
If I have a domain with various .stl surfaces, does that means that the background hex mesh must also intersect with the smaller .stl surface?

Is there anyone out there that can shed some light to the problem that I have. I am really stuck for some days on this...

Thanks a lot for your time!!

Regards, Christos

tomf December 17, 2014 15:48

Hi Christos,

I think it may be due to these settings in your castellated mesh control:

Code:

  maxLocalCells 1000000;
  maxGlobalCells 2000000;

Especially since you increased the cell count for the background mesh and you got worse results would indicate that you hit 1 of these limits, so snappy stops refining.

You should increase these limits and see if this helps.

Regards,
Tom

christos December 17, 2014 16:55

1 Attachment(s)
Hi Tom,

First of all thank you very much for your reply!!

I obtained a very good mesh when I made a hexagon pattern of the profile of these inlet holes (see picture attached).
I will also check what you proposed and see if it makes the mesh better.

Thanks again!

Regards, Christos


All times are GMT -4. The time now is 04:35.