Added allowFreeStandingZoneFaces flag

This determines when faceZones and cellZones are being meshed any zone faces
can only be on the boundary of the cellZone or also 'free standing'. The
latter option can be used to e.g. create free-standing baffles
(that do not separate two regions)
This commit is contained in:
mattijs
2009-12-10 15:31:04 +00:00
parent 17846a6bda
commit 35eeedeaa5
5 changed files with 32 additions and 7 deletions

View File

@ -560,7 +560,11 @@ void Foam::autoRefineDriver::zonify
const_cast<Time&>(mesh.time())++;
}
meshRefiner_.zonify(refineParams.keepPoints()[0]);
meshRefiner_.zonify
(
refineParams.keepPoints()[0],
refineParams.allowFreeStandingZoneFaces()
);
if (debug)
{

View File

@ -44,6 +44,7 @@ Foam::refinementParameters::refinementParameters
curvature_(readScalar(dict.lookup("curvature"))),
nBufferLayers_(readLabel(dict.lookup("nBufferLayers"))),
keepPoints_(dict.lookup("keepPoints")),
allowFreeStandingZoneFaces_(dict.lookup("allowFreeStandingZoneFaces")),
maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance",0))
{}
@ -55,6 +56,7 @@ Foam::refinementParameters::refinementParameters(const dictionary& dict)
minRefineCells_(readLabel(dict.lookup("minRefinementCells"))),
nBufferLayers_(readLabel(dict.lookup("nCellsBetweenLevels"))),
keepPoints_(pointField(1, dict.lookup("locationInMesh"))),
allowFreeStandingZoneFaces_(dict.lookup("allowFreeStandingZoneFaces")),
maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance",0))
{
scalar featAngle(readScalar(dict.lookup("resolveFeatureAngle")));

View File

@ -38,6 +38,7 @@ SourceFiles
#include "dictionary.H"
#include "pointField.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -73,6 +74,10 @@ class refinementParameters
//- Areas to keep
const pointField keepPoints_;
//- FaceZone faces allowed which have owner and neighbour in same
// cellZone?
Switch allowFreeStandingZoneFaces_;
//- Allowed load unbalance
scalar maxLoadUnbalance_;
@ -137,6 +142,13 @@ public:
return keepPoints_;
}
//- Are zone faces allowed only inbetween different cell zones
// or also just free standing?
bool allowFreeStandingZoneFaces() const
{
return allowFreeStandingZoneFaces_;
}
//- Allowed load unbalance
scalar maxLoadUnbalance() const
{

View File

@ -704,7 +704,11 @@ public:
//- Put faces/cells into zones according to surface specification.
// Returns null if no zone surfaces present. Region containing
// the keepPoint will not be put into a cellZone.
autoPtr<mapPolyMesh> zonify(const point& keepPoint);
autoPtr<mapPolyMesh> zonify
(
const point& keepPoint,
const bool allowFreeStandingZoneFaces
);
// Other topo changes

View File

@ -2032,7 +2032,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::dupNonManifoldPoints()
// Zoning
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
(
const point& keepPoint
const point& keepPoint,
const bool allowFreeStandingZoneFaces
)
{
const wordList& cellZoneNames = surfaces_.cellZoneNames();
@ -2344,9 +2345,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
}
//// Make sure namedSurfaceIndex is unset inbetween same cell cell zones.
//makeConsistentFaceIndex(cellToZone, namedSurfaceIndex);
// Make sure namedSurfaceIndex is unset inbetween same cell cell zones.
if (!allowFreeStandingZoneFaces)
{
makeConsistentFaceIndex(cellToZone, namedSurfaceIndex);
}
// Topochange container
polyTopoChange meshMod(mesh_);
@ -2440,7 +2443,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
}
else if (ownZone == neiZone)
{
// Can only happen for coupled boundaries. Keep master
// Free-standing zone face or coupled boundary. Keep master
// face unflipped.
flip = !isMasterFace[faceI];
}