mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -560,7 +560,11 @@ void Foam::autoRefineDriver::zonify
|
|||||||
const_cast<Time&>(mesh.time())++;
|
const_cast<Time&>(mesh.time())++;
|
||||||
}
|
}
|
||||||
|
|
||||||
meshRefiner_.zonify(refineParams.keepPoints()[0]);
|
meshRefiner_.zonify
|
||||||
|
(
|
||||||
|
refineParams.keepPoints()[0],
|
||||||
|
refineParams.allowFreeStandingZoneFaces()
|
||||||
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -44,6 +44,7 @@ Foam::refinementParameters::refinementParameters
|
|||||||
curvature_(readScalar(dict.lookup("curvature"))),
|
curvature_(readScalar(dict.lookup("curvature"))),
|
||||||
nBufferLayers_(readLabel(dict.lookup("nBufferLayers"))),
|
nBufferLayers_(readLabel(dict.lookup("nBufferLayers"))),
|
||||||
keepPoints_(dict.lookup("keepPoints")),
|
keepPoints_(dict.lookup("keepPoints")),
|
||||||
|
allowFreeStandingZoneFaces_(dict.lookup("allowFreeStandingZoneFaces")),
|
||||||
maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance",0))
|
maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance",0))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -55,6 +56,7 @@ Foam::refinementParameters::refinementParameters(const dictionary& dict)
|
|||||||
minRefineCells_(readLabel(dict.lookup("minRefinementCells"))),
|
minRefineCells_(readLabel(dict.lookup("minRefinementCells"))),
|
||||||
nBufferLayers_(readLabel(dict.lookup("nCellsBetweenLevels"))),
|
nBufferLayers_(readLabel(dict.lookup("nCellsBetweenLevels"))),
|
||||||
keepPoints_(pointField(1, dict.lookup("locationInMesh"))),
|
keepPoints_(pointField(1, dict.lookup("locationInMesh"))),
|
||||||
|
allowFreeStandingZoneFaces_(dict.lookup("allowFreeStandingZoneFaces")),
|
||||||
maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance",0))
|
maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance",0))
|
||||||
{
|
{
|
||||||
scalar featAngle(readScalar(dict.lookup("resolveFeatureAngle")));
|
scalar featAngle(readScalar(dict.lookup("resolveFeatureAngle")));
|
||||||
|
|||||||
@ -38,6 +38,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "pointField.H"
|
#include "pointField.H"
|
||||||
|
#include "Switch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -73,6 +74,10 @@ class refinementParameters
|
|||||||
//- Areas to keep
|
//- Areas to keep
|
||||||
const pointField keepPoints_;
|
const pointField keepPoints_;
|
||||||
|
|
||||||
|
//- FaceZone faces allowed which have owner and neighbour in same
|
||||||
|
// cellZone?
|
||||||
|
Switch allowFreeStandingZoneFaces_;
|
||||||
|
|
||||||
//- Allowed load unbalance
|
//- Allowed load unbalance
|
||||||
scalar maxLoadUnbalance_;
|
scalar maxLoadUnbalance_;
|
||||||
|
|
||||||
@ -137,6 +142,13 @@ public:
|
|||||||
return keepPoints_;
|
return keepPoints_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Are zone faces allowed only inbetween different cell zones
|
||||||
|
// or also just free standing?
|
||||||
|
bool allowFreeStandingZoneFaces() const
|
||||||
|
{
|
||||||
|
return allowFreeStandingZoneFaces_;
|
||||||
|
}
|
||||||
|
|
||||||
//- Allowed load unbalance
|
//- Allowed load unbalance
|
||||||
scalar maxLoadUnbalance() const
|
scalar maxLoadUnbalance() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -704,7 +704,11 @@ public:
|
|||||||
//- Put faces/cells into zones according to surface specification.
|
//- Put faces/cells into zones according to surface specification.
|
||||||
// Returns null if no zone surfaces present. Region containing
|
// Returns null if no zone surfaces present. Region containing
|
||||||
// the keepPoint will not be put into a cellZone.
|
// 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
|
// Other topo changes
|
||||||
|
|||||||
@ -2032,7 +2032,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::dupNonManifoldPoints()
|
|||||||
// Zoning
|
// Zoning
|
||||||
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
|
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
|
||||||
(
|
(
|
||||||
const point& keepPoint
|
const point& keepPoint,
|
||||||
|
const bool allowFreeStandingZoneFaces
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const wordList& cellZoneNames = surfaces_.cellZoneNames();
|
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.
|
// Make sure namedSurfaceIndex is unset inbetween same cell cell zones.
|
||||||
//makeConsistentFaceIndex(cellToZone, namedSurfaceIndex);
|
if (!allowFreeStandingZoneFaces)
|
||||||
|
{
|
||||||
|
makeConsistentFaceIndex(cellToZone, namedSurfaceIndex);
|
||||||
|
}
|
||||||
|
|
||||||
// Topochange container
|
// Topochange container
|
||||||
polyTopoChange meshMod(mesh_);
|
polyTopoChange meshMod(mesh_);
|
||||||
@ -2440,7 +2443,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
|
|||||||
}
|
}
|
||||||
else if (ownZone == neiZone)
|
else if (ownZone == neiZone)
|
||||||
{
|
{
|
||||||
// Can only happen for coupled boundaries. Keep master
|
// Free-standing zone face or coupled boundary. Keep master
|
||||||
// face unflipped.
|
// face unflipped.
|
||||||
flip = !isMasterFace[faceI];
|
flip = !isMasterFace[faceI];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user