对于一个既有网格已经保存在constant/polyMesh中,使用snappyHexMesh进行 边界层加密 需要的设置。
一,在system 下创建 snappyHexMeshDict 文件
FoamFile
{
version 4.0;
format ascii;
class dictionary;
location system;
object snappyHexMeshDict;
}
castellatedMesh no;
snap no;
addLayers yes;
keepPatches yes; // yes
//singleRegionName yes
//mergePatchFaces yes; // no
geometry
{
}
castellatedMeshControls
{
maxLocalCells 1000000;
maxGlobalCells 10000000;
minRefinementCells 10;
maxLoadUnbalance 0.10;
nCellsBetweenLevels 3;
resolveFeatureAngle 45;
allowFreeStandingZoneFaces true;
locationInMesh (3 3 3);
features
(
);
refinementSurfaces
{
}
refinementRegions
{
}
}
snapControls
{
nSmoothPatch 3;
tolerance 1;
nSolveIter 1;
nRelaxIter 1;
nFeatureSnapIter 5;
extractFeaturesRefineLevel on;
explicitFeatureSnap on;
implicitFeatureSnap off;
}
addLayersControls
{
relativeSizes off;
expansionRatio 1;
finalLayerThickness 0.02;
minThickness 0.01;
featureAngle 130;
layers
{
bottom {nSurfaceLayers 3;}
inner_bottom {nSurfaceLayers 3;}
bldg {nSurfaceLayers 3;}
//outer_interface {nSurfaceLayers 3;}
//inner_interface {nSurfaceLayers 3;}
}
nGrow 1;
slipFeatureAngle 30;
nRelaxIter 5;
nSmoothSurfaceNormals 1;
nSmoothThickness 10;
nSmoothNormals 1;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.3;
minMedianAxisAngle 90;
nBufferCellsNoExtrude 0;
nLayerIter 50;
nRelaxedIter 30;
}
meshQualityControls
{
maxNonOrtho 70;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minFlatness 0.5;
minVol 1e-13;
minTetQuality 1e-15;
minArea -1;
minTwist 0.02;
minDeterminant 0.001;
minFaceWeight 0.02;
minVolRatio 0.01;
minTriangleTwist -1;
nSmoothScale 4;
errorReduction 0.75;
relaxed
{
maxNonOrtho 75;
}
}
debug 0; //0
debugFlags
(
//layerInfo
);
writeFlags
(
//scalarLevels
//layerSets
//layerFields // write volScalarField for layer coverage
);
mergeTolerance 1E-6;
}
二,修改参数
使得 addLayer 为 yes,不进行 castellatedMesh 和 snap 动作,只进行边界加密。
castellatedMesh no;
snap no;
addLayers yes;
找到计算域内的一点,修改 locationInMesh (3 3 3); 的坐标值
根据constant/polyMesh/boundary 文件中的 patch 名字,修改参数确定边界层层数,每一层厚度等
relativeSizes off;
expansionRatio 1;
finalLayerThickness 0.02;
minThickness 0.01;
featureAngle 130;
layers
{
bottom {nSurfaceLayers 3;}
inner_bottom {nSurfaceLayers 3;}
bldg {nSurfaceLayers 3;}
}
三,执行命令,生成边界层
snappyHexMesh -overwrite
四,检查边界层网格质量