mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: extrudePatchMesh: support for features. See #2103
Optional 'featureAngle' entry to disable extrusion on sharp corners
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -33,6 +33,7 @@ License
|
||||
#include "wallPolyPatch.H"
|
||||
#include "emptyPolyPatch.H"
|
||||
#include "wedgePolyPatch.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -157,6 +158,12 @@ void Foam::extrudePatchMesh::extrudeMesh(polyPatchList& regionPatches)
|
||||
if (this->boundaryMesh().empty())
|
||||
{
|
||||
const bool columnCells = dict_.get<bool>("columnCells");
|
||||
scalar featAngleCos = -GREAT;
|
||||
scalar featAngle = -1;
|
||||
if (dict_.readIfPresent("featureAngle", featAngle))
|
||||
{
|
||||
featAngleCos = Foam::cos(degToRad(featAngle));
|
||||
}
|
||||
|
||||
bitSet nonManifoldEdge(extrudedPatch_.nEdges());
|
||||
for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++)
|
||||
@ -165,12 +172,25 @@ void Foam::extrudePatchMesh::extrudeMesh(polyPatchList& regionPatches)
|
||||
{
|
||||
nonManifoldEdge.set(edgeI);
|
||||
}
|
||||
else if (extrudedPatch_.edgeFaces()[edgeI].size() > 2)
|
||||
else
|
||||
{
|
||||
// TBD: issue #2780 : non-manifold edges get seen as internal
|
||||
const auto& fcs = extrudedPatch_.edgeFaces()[edgeI];
|
||||
if (fcs.size() > 2)
|
||||
{
|
||||
// TBD: issue #2780 : non-manifold edges get seen as
|
||||
// internal.
|
||||
// This bit of code can be removed once #2780 is solved.
|
||||
nonManifoldEdge.set(edgeI);
|
||||
}
|
||||
else if (fcs.size() == 2 && featAngleCos >= -1)
|
||||
{
|
||||
const auto& n = extrudedPatch_.faceNormals();
|
||||
if ((n[fcs[0]] & n[fcs[1]]) < featAngleCos)
|
||||
{
|
||||
nonManifoldEdge.set(edgeI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
autoPtr<extrudeModel> model_(extrudeModel::New(dict_));
|
||||
|
||||
@ -44,6 +44,9 @@ Description
|
||||
expansionRatio 1;
|
||||
columnCells true;
|
||||
|
||||
// Optional feature angle to avoid extruding feature-angles
|
||||
featureAngle 45;
|
||||
|
||||
// Patch information
|
||||
bottomCoeffs
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user