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

[snappyHexMesh] meshing of very small patches in comparison with the overall geometry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 16, 2014, 10:35
Default meshing of very small patches in comparison with the overall geometry
  #1
New Member
 
larry
Join Date: Jul 2014
Posts: 12
Rep Power: 11
christos is on a distinguished road
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;
Attached Images
File Type: jpg hotInletFig.jpg (10.2 KB, 131 views)
Attached Files
File Type: gz roomWithInlets.tar.gz (46.3 KB, 9 views)
christos is offline   Reply With Quote

Old   December 16, 2014, 16:48
Default
  #2
New Member
 
larry
Join Date: Jul 2014
Posts: 12
Rep Power: 11
christos is on a distinguished road
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
christos is offline   Reply With Quote

Old   December 17, 2014, 15:48
Default
  #3
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
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
tomf is offline   Reply With Quote

Old   December 17, 2014, 16:55
Default
  #4
New Member
 
larry
Join Date: Jul 2014
Posts: 12
Rep Power: 11
christos is on a distinguished road
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
Attached Files
File Type: gz hotInlet.bmp.tar.gz (5.0 KB, 71 views)
christos 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
[ANSYS Meshing] small geometry meshing error. why does it happen? zizie ANSYS Meshing & Geometry 3 August 10, 2016 02:29
[ICEM] Geometry Repair to Delanuay Meshing of a Nacelle Body in a Duct MaverickZ ANSYS Meshing & Geometry 3 June 4, 2015 07:48
[ANSYS Meshing] Using more than one meshing method on a single 2D geometry robbierich90 ANSYS Meshing & Geometry 0 October 30, 2011 13:12
Reg difficulties in meshing the geometry...Urgent arunraj ANSYS Meshing & Geometry 0 August 26, 2011 23:25
Geometry and meshing for OpenFOAM Remy OpenFOAM 2 August 12, 2009 07:02


All times are GMT -4. The time now is 01:29.