Anamitra |
June 14, 2016 05:38 |
snappyHexMesh for Intersecting surfaces
1 Attachment(s)
Hello everyone!!
I am trying to mesh two intersecting surfaces in snappyhexMesh.
Issue: I have two stl surfaces, stl1 and stl2. Both are close and sometimes intersecting. I would like to have both as separate patches and would also need a finer mesh around them. However, as I do understand that it might be bit difficult.
I tried with 'inside' - refinement box, 'distance' - from the surfaces ( which I didn't expect to work anyway).
Hence my question is,
-Are there other options which I might use?
-or is there any other meshing software which might help, and can also export the mesh to openfoam format later.
Please let me know if I should add some more info.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
castellatedMesh true; // make basic mesh ?
snap true; // decide to snap back to surface ?
addLayers false; // decide to add viscous layers ?
geometry // Load in STL files here
{
stl1.stl {type triSurfaceMesh; name stl1;}
stl2.stl {type triSurfaceMesh; name stl2;}
refinementBox
{
type searchableBox;
min (-3 -1 16.65);
max (15 4 18.95);
}
// refinementBox2 {type searchableBox; min ( -6 -85); max ( 10 3 -6);}
};
castellatedMeshControls
{
maxLocalCells 2500000; //max cells per CPU core
maxGlobalCells 20000000; //max cells to use before mesh deletion step
minRefinementCells 0; //was 0 - zero means no bad cells are allowed during stages
maxLoadUnbalance 0.10;
nCellsBetweenLevels 4; // 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.eMesh"; level 0;} // add STL files if needed
{file "stl1.eMesh"; level 2;}
{file "stl2.eMesh"; level 2;}
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
refinementSurfaces // Surface-wise min and max refinement level
{
stl1 {level (4 5);}
stl2 {level (3 4);}
}
resolveFeatureAngle 60; // Resolve sharp angles // Default 30
refinementRegions // In descending levels of fine-ness
{
stl2 { mode distance; levels ((0.008 5)); }
// refinementBox2 { mode inside; levels ((1.0 5)); }
}
locationInMesh (5.235 6.235 17.235);
//to decide which side of mesh to keep **
allowFreeStandingZoneFaces true;
}
// Settings for the snapping.
snapControls
{
nSmoothPatch 3;
tolerance 2.0;
nSolveIter 60;
nRelaxIter 15;
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 true; // was true
layers
{
// jetwall {nSurfaceLayers 4;} // was 3
}
expansionRatio 1.0;
finalLayerThickness 0.03; //was 0.00016
minThickness 0.00008; //was 0.0008
nGrow 1; // 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-14;
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-4;
|