Commit 06336b70 authored by franjo.juretic@c-fields.com's avatar franjo.juretic@c-fields.com
Browse files

Improved boundary layer handling for tetMesh


git-svn-id: https://pl5.projectlocker.com/igui/meshGeneration/svn@66 fdcce57e-7e00-11e2-b579-49867b4cea03
parent 0861f318
......@@ -46,6 +46,7 @@ Description
#include "renameBoundaryPatches.H"
#include "checkMeshDict.H"
#include "triSurfacePatchManipulator.H"
#include "refineBoundaryLayers.H"
//#define DEBUG
......@@ -135,25 +136,28 @@ void tetMeshGenerator::optimiseMeshSurface()
void tetMeshGenerator::generateBoudaryLayers()
{
boundaryLayers bl(mesh_);
if( meshDict_.found("boundaryLayers") )
{
wordList createLayers;
boundaryLayers bl(mesh_);
const dictionary& bndLayers = meshDict_.subDict("boundaryLayers");
if( meshDict_.isDict("boundaryLayers") )
if( bndLayers.found("nLayers") )
{
const dictionary& dict = meshDict_.subDict("boundaryLayers");
createLayers = dict.toc();
const label nLayers = readLabel(bndLayers.lookup("nLayers"));
if( nLayers > 0 )
bl.addLayerForAllPatches();
}
else
else if( bndLayers.found("patchBoundaryLayers") )
{
wordList bndLayers(meshDict_.lookup("boundaryLayers"));
createLayers.transfer(bndLayers);
}
const dictionary& patchLayers =
bndLayers.subDict("patchBoundaryLayers");
const wordList createLayers = patchLayers.toc();
forAll(createLayers, patchI)
bl.addLayerForPatch(createLayers[patchI]);
forAll(createLayers, patchI)
bl.addLayerForPatch(createLayers[patchI]);
}
}
# ifdef DEBUG
......@@ -179,6 +183,23 @@ void tetMeshGenerator::optimiseFinalMesh()
# endif
}
void tetMeshGenerator::refBoundaryLayers()
{
if( meshDict_.isDict("boundaryLayers") )
{
refineBoundaryLayers refLayers(mesh_);
refineBoundaryLayers::readSettings(meshDict_, refLayers);
refLayers.refineLayers();
meshOptimizer optimizer(mesh_);
optimizer.optimizeLowQualityFaces();
optimizer.untangleMeshFV();
}
}
void tetMeshGenerator::replaceBoundaries()
{
renameBoundaryPatches rbp(mesh_, meshDict_);
......@@ -215,6 +236,8 @@ void tetMeshGenerator::generateMesh()
optimiseFinalMesh();
refBoundaryLayers();
renumberMesh();
replaceBoundaries();
......
......@@ -94,6 +94,9 @@ class tetMeshGenerator
//- mesh optimisation
void optimiseFinalMesh();
//- refine boundary layers
void refBoundaryLayers();
//- replace boundaries
void replaceBoundaries();
......
......@@ -219,7 +219,7 @@ void refineBoundaryLayers::refineLayers()
if( it->second > 1 )
refinePatch = true;
if( !(globalNumLayers_ > 1 || refinePatch) )
if( (globalNumLayers_ < 2) && !refinePatch )
return;
Info << "Starting refining boundary layers" << endl;
......@@ -305,6 +305,7 @@ void refineBoundaryLayers::readSettings
{
const label nLayers =
readLabel(patchDict.lookup("nLayers"));
refLayers.setNumberOfLayersForPatch(pName, nLayers);
}
if( patchDict.found("thicknessRatio") )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment