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

[snappyHexMesh] Fail to create boundary layers during sHM

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By farahiam

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2011, 06:24
Default Fail to create boundary layers during sHM
  #1
New Member
 
farahidayu
Join Date: Aug 2010
Posts: 20
Rep Power: 16
farahiam is on a distinguished road
Hello all,
I am currently working on the external aerodynamics case for a car.
Basically, I manage to do the snappyHexMesh
However, eventhough I set the number of layers = 10, but, I fail to create even a single layer.
I dont know what is the problem with my file.
The part in sHM where I define the no.of layers are as below:

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

// Per final patch (so not geometry!) the layer information
layers
{
car3
{
nSurfaceLayers 3;
}
}

// 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.0055; //absolute
finalLayerThickness 0.1; //relative

//- 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.0005; //absolute
minThickness 0.1; //relative

//- 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.
nGrow 1;


// Advanced settings

//- When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.

featureAngle 15;
//featureAngle 30;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 3;

// 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.0025; //absolute
maxFaceThicknessRatio 1.0; //relative

// Reduce layer growth where ratio thickness to medial
// distance is large
//maxThicknessToMedialRatio 0.0015; //absolute
maxThicknessToMedialRatio 1.0; //relative

// Angle used to pick up medial axis points
minMedianAxisAngle 130;

// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;

// Overall max number of layer addition iterations
nLayerIter 50;
}


Hope someone could help me on this.
The pics of the section cuts are as attached.

Thank you.
Attached Images
File Type: jpg 2011-06-01_172318.jpg (87.1 KB, 574 views)
File Type: jpg 2011-06-01_172358.jpg (72.2 KB, 580 views)
farahiam is offline   Reply With Quote

Old   June 6, 2011, 20:32
Default
  #2
Member
 
Scott
Join Date: Sep 2009
Posts: 44
Rep Power: 17
scott is on a distinguished road
It might be good if you post a log of your snappy run. I use snappyHexMesh -overwrite >Snappy_Log

This will create a Snappy_Log file which you can post here which should tell us/someone why it doesn't work.

I am having the same problem, and I think it is due to the complexity of the geometry and layers possibly crashing into each other. Would be good to know for sure though.

Scott
scott is offline   Reply With Quote

Old   June 6, 2011, 21:56
Default
  #3
New Member
 
farahidayu
Join Date: Aug 2010
Posts: 20
Rep Power: 16
farahiam is on a distinguished road
Hello Scott!
Thanks alot for the reply.
I really appreciate your attention..

Here, I attached my log file for snappyHexMesh process.
I am not sure what is the actual problem.
I am really hoping to figure this out and solve the problem.

N.B. I divide the file into 2 parts as this web has size limitation on the filesize.

Tq.
Attached Files
File Type: txt log.snappy-2.txt (78.8 KB, 140 views)
File Type: txt log.snappy-1.txt (41.1 KB, 97 views)
farahiam is offline   Reply With Quote

Old   June 6, 2011, 23:03
Default
  #4
Member
 
Scott
Join Date: Sep 2009
Posts: 44
Rep Power: 17
scott is on a distinguished road
It says that there are no layers to add... It may be that something is not right in the setup.

Can you please also post your snappyHexMeshDict file.

Thanks,

Scott
scott is offline   Reply With Quote

Old   June 6, 2011, 23:25
Default
  #5
New Member
 
farahidayu
Join Date: Aug 2010
Posts: 20
Rep Power: 16
farahiam is on a distinguished road
Hi Scott,
I include the half part of the snappyHexMeshDict file as below.
FYI, my y+ values are very small, which I am not sure how to increase the y+ values (attached is the y+ log file).

Regards,
Ayu

Snappy:

// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 10;

//- 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;

//- Number of mesh displacement relaxation iterations.
nSolveIter 50;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 10;
}



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

// Per final patch (so not geometry!) the layer information
layers
{
ext_aero
{
nSurfaceLayers 10;
}
}

// 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.001; //absolute
//finalLayerThickness 0.1; //relative

//- 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.010; //absolute
//minThickness 0.1; //relative

//- 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.
nGrow 5;


// Advanced settings

//- When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.

//featureAngle 15;
featureAngle 30;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 3;

// 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.0025; //absolute
maxFaceThicknessRatio 1.0; //relative

// Reduce layer growth where ratio thickness to medial
// distance is large
//maxThicknessToMedialRatio 0.0015; //absolute
maxThicknessToMedialRatio 1.0; //relative

// Angle used to pick up medial axis points
minMedianAxisAngle 130;

// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;

// Overall max number of layer addition iterations
nLayerIter 50;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 65;

//- Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 20;
maxInternalSkewness 4;

//- Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;

//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;

//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;

//- Minimum face area. Set to <0 to disable.
minArea -1;

//- Minimum face twist. Set to <-1 to disable. dot product of face normal
//- and face centre triangles normal
minTwist 0.02;

//- minimum normalised cell determinant
//- 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;

//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;

//- minVolRatio (0 -> 1)
minVolRatio 0.01;

//must be >0 for Fluent compatibility
minTriangleTwist -1;


// Advanced

//- Number of error distribution iterations
nSmoothScale 4;
//- amount to scale back displacement at error points
errorReduction 0.75;
}


// Advanced

// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;


// 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 Files
File Type: txt log_yPlus.txt (3.6 KB, 100 views)
farahiam is offline   Reply With Quote

Old   June 6, 2011, 23:32
Default
  #6
Member
 
Scott
Join Date: Sep 2009
Posts: 44
Rep Power: 17
scott is on a distinguished road
What is the full patch name for ext_aero in the boundary file under constant/polymesh?

I think you need to use the full patch name, not just the name of that section.

It might be car_ext_aero or something similar... I do not think that it is recognising the ext_aero by itself.

I'm only coming to terms with Snappy now myself, but I think I am on the right track for your problem.

As far as Y+ goes, its the non-dimensional cell distance from the wall and its relation to the local velocity of that cell. Hence if you want to increase (or decrease) it then you need to go to larger (or smaller) cell heights at the surface. I guess you can do this by modifying the thickness of the layers or also by not refining the surface as much, hence the first cell would be larger.

Hope this helps!

Scott
scott is offline   Reply With Quote

Old   June 6, 2011, 23:57
Default
  #7
New Member
 
farahidayu
Join Date: Aug 2010
Posts: 20
Rep Power: 16
farahiam is on a distinguished road
"It might be car_ext_aero or something similar... I do not think that it is recognising the ext_aero by itself."

Hi Scott, I have been thinking about this too but I havent tried anything yet. Yes, just like you guessed, my .stl files has different names. Below is the initial part of the sHMD file where I define each diff. components of the car:

// Which of the steps to run
castellatedMesh true;
snap true;
addLayers true;

// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
car3.stl
{
type triSurfaceMesh;
name ext_aero;
regions
{
airdam
{
name airdam;
}
battery
{
name battery;
}
body
{
name body;
}
bumper_headlamp
{
name bumper_headlamp;
}
CAC
{
name CAC;
}
cond
{
name cond;
}
cowl-top
{
name cowl-top;
}
ECU-box
{
name ECU-box;
}
engine
{
name engine;
}
exhaust-pipe
{
name exhaust-pipe;
}
fan-blade
{
name fan-blade;
}
fan-shroud
{
name fan-shroud;
}
firewall
{
name firewall;
}
fuel-tank
{
name fuel-tank;
}
grills
{
name grills;
}
hood
{
name hood;
}
intercooler
{
name intercooler;
}
rad
{
name rad;
}
side-mirror
{
name side-mirror;
}
snorkel-inlet
{
name snorkel-inlet;
}
spoiler
{
name spoiler;
}
fr-suspension
{
name fr-suspension;
}
rr-suspension
{
name rr-suspension;
}
trans-oil
{
name trans-oil;
}
underfloor
{
name underfloor;
}

}
}
/*
refinementFrontGrill
{
type searchableBox;
min (-2.17 -0.75 -0.07);
max (-0.7 0.75 0.55);
}
*/
refinementWake
{
type searchableBox;
min (3.18 -0.771 -0.108);
max (6.131 0.771 0.838);
}
/* refinementSnorkel
{
type searchableBox;
min (-0.746 -0.312 0.473);
max (-0.573 -0.063 0.629);
}
*/
refinementTunnel_01
{
type searchableBox;
min (-2.182 -1.507 -0.667);
max (7.523 1.508 2.007);
}
refinementTunnel_02
{
type searchableBox;
min (-4.782 -2.300 -0.670);
max (12.20 2.300 3.000);
}
refinementTunnel_03
{
type searchableBox;
min (-10.06 -3.500 -0.670);
max (15.06 3.500 4.000);
}
/*
refinementBOX_WINDOW_RH
{
type searchableBox;
min (0.986 0.602 0.695);
max (1.535 0.860 1.105);
}
refinementBOX_BACKSIDE
{
type searchableBox;
min (2.865 -0.860 0.655);
max (3.225 0.860 1.055);
}
*/
}



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~

// While refining maximum number of cells per processor. This is basically
// the number of cells that fit on a processor. If you choose this too small
// it will do just more refinement iterations to obtain a similar mesh.
maxLocalCells 10000000;
//maxLocalCells 1000000;

// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 20000000;
//maxGlobalCells 2000000;

// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 10;

// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 3;

"As far as Y+ goes, its the non-dimensional cell distance from the wall and its relation to the local velocity of that cell. Hence if you want to increase (or decrease) it then you need to go to larger (or smaller) cell heights at the surface. I guess you can do this by modifying the thickness of the layers or also by not refining the surface as much, hence the first cell would be larger."

Ok, I will give it a try on your suggestions.

Thanks a lot Scott. I really appreciate your help.


Regards,
Ayu
farahiam is offline   Reply With Quote

Old   June 7, 2011, 00:06
Default
  #8
Member
 
Scott
Join Date: Sep 2009
Posts: 44
Rep Power: 17
scott is on a distinguished road
Hi again,

Ok, by the looks of it I'd try car3_ext_aero when defining the names for the layers. One way to check for sure is to look at the resultant $RUN_DIRECTORY/constant/polymesh/boundary file.

If anyone else familiar with snappyHexMesh can have a look at this problem then I'd also like to hear your comments. I am just thinking along the lines of the simple things I have done in the past to resolve similar issues.

For complex geometries mine will start to create the layers, based on the naming convention I have used above, but then it all falls in a heap and after a few undo iterations there are no layers in my final mesh.

Thanks,

Scott
scott is offline   Reply With Quote

Old   June 7, 2011, 00:59
Default
  #9
New Member
 
farahidayu
Join Date: Aug 2010
Posts: 20
Rep Power: 16
farahiam is on a distinguished road
Ok Thanks a lot Scott.
I will re-post once I've obtained the results.

Cheers!
Ayu
farahiam is offline   Reply With Quote

Old   June 7, 2011, 22:25
Default
  #10
New Member
 
farahidayu
Join Date: Aug 2010
Posts: 20
Rep Power: 16
farahiam is on a distinguished road
Hi Scot,
I have managed to create the boundary layers on the car. Pictures as attached.
In my opinion, to capture the BL on complex geometry, maybe you could play around with the feature angle? I am not sure whether this helps.

Ayu
Attached Images
File Type: jpg BL_1.jpg (87.4 KB, 899 views)
File Type: jpg BL_2.jpg (100.0 KB, 891 views)
farahiam is offline   Reply With Quote

Old   June 7, 2011, 22:38
Default
  #11
Member
 
Scott
Join Date: Sep 2009
Posts: 44
Rep Power: 17
scott is on a distinguished road
Hi Ayu,

Good to see that it is working!

For future reference for others who come across this thread, what was the fix?

I'll try feature angle but I think its due to the complexities of my geometry.

Could you please post a closer up photo of your underbody/engine bay? Has it included boundary layers there also? Have you modified any of the settings/feature angles etc to get this to work?

Cheers,

Scott
scott is offline   Reply With Quote

Old   June 7, 2011, 22:55
Default
  #12
New Member
 
farahidayu
Join Date: Aug 2010
Posts: 20
Rep Power: 16
farahiam is on a distinguished road
Yes, I also manage to capture the BL on the underbody.
Attached picture shows the BL near the exhaust pipe & underfloor and rear muffler & rr bumper.

Below are the part of the files that define the layers settings:

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

// Per final patch (so not geometry!) the layer information
layers
{
"ext_aero.*" {nSurfaceLayers 10;}
airdam {nSurfaceLayers 10;}
battery {nSurfaceLayers 10;}
body {nSurfaceLayers 10;}
bumper_headlamp {nSurfaceLayers 10;}
cowl-top {nSurfaceLayers 10;}
ECU-box {nSurfaceLayers 10;}
engine {nSurfaceLayers 10;}
exhaust-pipe {nSurfaceLayers 10;}
fr-suspension {nSurfaceLayers 10;}
fuel-tank {nSurfaceLayers 10;}
grills {nSurfaceLayers 10;}
hood {nSurfaceLayers 10;}
rr-suspension {nSurfaceLayers 10;}
side-mirror {nSurfaceLayers 10;}
spoiler {nSurfaceLayers 10;}
underfloor {nSurfaceLayers 10;}
}

// 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.001; //absolute
finalLayerThickness 0.1; //relative

//- 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.010; //absolute
minThickness 0.1; //relative

//- 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.
nGrow 1; //5


// Advanced settings

//- When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.

//featureAngle 15;
featureAngle 30;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 3;

// 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.0025; //absolute
maxFaceThicknessRatio 1.0; //relative

// Reduce layer growth where ratio thickness to medial
// distance is large
//maxThicknessToMedialRatio 0.0015; //absolute
maxThicknessToMedialRatio 1.0; //relative

// Angle used to pick up medial axis points
minMedianAxisAngle 130;

// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;

// Overall max number of layer addition iterations
nLayerIter 50;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 65;

//- Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 20;
maxInternalSkewness 4;

//- Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;

//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;

//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;

//- Minimum face area. Set to <0 to disable.
minArea -1;

//- Minimum face twist. Set to <-1 to disable. dot product of face normal
//- and face centre triangles normal
minTwist 0.02;

//- minimum normalised cell determinant
//- 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;

//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;

//- minVolRatio (0 -> 1)
minVolRatio 0.01;

//must be >0 for Fluent compatibility
minTriangleTwist -1;


// Advanced

//- Number of error distribution iterations
nSmoothScale 4;
//- amount to scale back displacement at error points
errorReduction 0.75;
}


// Advanced

// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;

I change the setting to relative (instead of absolute) - means that the layers addition is relative to the near wall cell dimensions.
Hope this helps.

Ayu
Attached Images
File Type: jpg BL_3.jpg (99.2 KB, 687 views)
File Type: jpg BL_4.jpg (96.9 KB, 643 views)
pavlossemelides likes this.
farahiam is offline   Reply With Quote

Old   June 16, 2013, 10:35
Default
  #13
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Hello Guys, I have a similar problem with much more complex geometry. I haven't managed to make BL around the hole body since now.
Working for days and trying different combinations of options and settings is useless.

I have attached an image.
Do you have any idea how can I make it work?

Dear Scott and Ayu,

Quote:
Originally Posted by scott View Post
For complex geometries mine will start to create the layers, based on the naming convention I have used above, but then it all falls in a heap and after a few undo iterations there are no layers in my final mesh.
Is this because of mesh controls? How can I prevent sHM not to undo layer adding?

Quote:
Originally Posted by farahiam View Post
In my opinion, to capture the BL on complex geometry, maybe you could play around with the feature angle? I am not sure whether this helps.
I tried different feature angles 0, 15, 30, 180, but no success.

Quote:
Originally Posted by farahiam View Post
I change the setting to relative (instead of absolute) - means that the layers addition is relative to the near wall cell dimensions.
Hope this helps.
even making it relative or absolute doesn't effect anything.

Why is it so hard for sHM to create boundary layers? wasn't it better for sHM and other meshing programs to make boundary layers at first and then mesh the rest of the domain? for example like GAMBIT.

Thank you very much,
Mojtaba
Attached Images
File Type: jpg Screenshot from 2013-06-16 17:37:40.jpg (75.4 KB, 453 views)
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   October 15, 2014, 20:46
Default layer creat problem
  #14
New Member
 
sd
Join Date: May 2014
Posts: 14
Rep Power: 12
OvGU is on a distinguished road
Quote:
Originally Posted by scott View Post
It might be good if you post a log of your snappy run. I use snappyHexMesh -overwrite >Snappy_Log

This will create a Snappy_Log file which you can post here which should tell us/someone why it doesn't work.

I am having the same problem, and I think it is due to the complexity of the geometry and layers possibly crashing into each other. Would be good to know for sure though.

Scott
I am trying to creat a surface layer in a simple cylinder combined of 2 radius (cone+ cylinder).This can be a reason or not, I don't know. But It's not working. If anybody can give any solution .....................
N.B- picture in problem region
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

// Which of the steps to run
castellatedMesh true; // make basic mesh ?
snap true; // decide to snap back to surface ?
addLayers true;//false; // decide to add viscous layers ?


geometry // Load in STL files here
{
inlet_1.stl {type triSurfaceMesh; name inlet_1;}
outlet.stl {type triSurfaceMesh; name outlet;}
inlet_2.stl {type triSurfaceMesh; name inlet_2;}
inlet_3.stl {type triSurfaceMesh; name inlet_3;}
wall.stl {type triSurfaceMesh; name wall;}
//cylinder.stl {type triSurfaceMesh; name volume;}
refineCylinder {type searchableCylinder; point1 (0 0 0); point2 (0 0 2); radius 0.13;}
//refinementBox {type searchableBox; min (-0.5 -0.5 -0.5); max ( 0.5 0.5 0.5);}
};

castellatedMeshControls
{
maxLocalCells 1000000; //max cells per CPU core
maxGlobalCells 2000000; //max cells to use before mesh deletion step
minRefinementCells 10; //was 0 - zero means no bad cells are allowed during refinement stages
maxLoadUnbalance 0.10;
nCellsBetweenLevels 1; // expansion factor between each high & low refinement zone

// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

features // taken from STL from each .eMesh file created by "SurfaceFeatureExtract" command
(
{file "inlet_1.eMesh"; level 2;}
{file "outlet.eMesh"; level 2;}
{file "wall.eMesh"; level 3;}
{file "inlet_2.eMesh"; level 2;}
{file "inlet_3.eMesh"; level 2;}
);

// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~

refinementSurfaces // Surface-wise min and max refinement level
{
inlet_1 {level (2 2);}
outlet {level (2 2);}
wall {level (5 5);}
inlet_2 {level (2 2);} // was 4 4
inlet_3 {level (2 2);} // was 4 4
}


resolveFeatureAngle 80; // Resolve sharp angles // Default 30
refinementRegions // In descending levels of fine-ness
{refineCylinder {mode distance; levels ((1E15 2));}} // (0.002 3) (0.01 2));}} // was ((0.001 4) (0.003 3) (0.01 2))
locationInMesh (0.01 0.01 0.01); //to decide which side of mesh to keep **
allowFreeStandingZoneFaces true;
}


// Settings for the snapping.
snapControls
{
nSmoothPatch 3;
tolerance 4.0;
nSolveIter 30;
nRelaxIter 5;
nFeatureSnapIter 15; // default is 10

// New settings from openfoam 2.2 onwards for SHMesh

implicitFeatureSnap false; // default is false - detects without doing surfaceFeatureExtract
explicitFeatureSnap true; // default is true
multiRegionFeatureSnap false; // deafault is false - detects features between multiple surfaces

}



// Settings for the layer addition.
addLayersControls //add the PATCH names from inside the STL file so STLpatchName_insideSTLName
{
relativeSizes false; // was true
layers
{
wall
{nSurfaceLayers 3;} // was 3
//visc_refine_1
// {nSurfaceLayers 3;} // was 3
//visc_refine_2
// {nSurfaceLayers 3;} // was 3
}

expansionRatio 1.3;
finalLayerThickness 0.00016; //was 0.00016
minThickness 0.00008; //was 0.00008
nGrow 0; // was 1


// Advanced settings

featureAngle 80; // was 70 //- When not to extrude surface. 0 is flat, 90 is right angle.
nRelaxIter 3; //- Max# of snapping relaxation iter. Should stop before upon reaching a correct mesh.
nSmoothSurfaceNormals 1; // Number of smoothing iterations of surface normals
nSmoothNormals 3; // Number of smoothing iterations of interior mesh movement direction
nSmoothThickness 10; // Smooth layer thickness over surface patches
maxFaceThicknessRatio 0.5; // Stop layer growth on highly warped cells
maxThicknessToMedialRatio 0.3; // Reduce layer growth where ratio thickness to medial distance is large
minMedianAxisAngle 130; // Angle used to pick up medial axis points
nBufferCellsNoExtrude 0; // Create buffer region for new layer terminations
nLayerIter 50; // Overall max number of layer addition iterations
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minFlatness 0.5;
minVol 1e-13;
minTetQuality 1e-9;
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;


// 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 mesh.jpg (59.5 KB, 205 views)
OvGU 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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 19:02
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 09:42.