From 66b3934ab6a086b44bae4d6e8d8af20a7cd61dce Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 15 Sep 2017 15:04:16 +0100 Subject: [PATCH] ENH: foamyHexMesh: Set no refinement iterations in global dictionary ENH: foamyHexMesh: Made default region volume type that of it's parent Foamy surface conformation entries have a "meshableSide" entry which controls which side of the surface is to be meshed. Typically this is set "inside" for boundaries and "both" for baffles. A sub-region's default entry is now taken from it's parent, rather than a specific value (it was "inside"). This is consistent with how other entries are handled. surfaceConformation { locationInMesh (0 0 0); geometryToConformTo { baffle { featureMethod extractFeatures; includedAngle 120; meshableSide both; // <-- per-surface setting regions { disk { meshableSide both; // <-- per-region setting* // *in this example, this entry is not needed, as it // is taken from the per-surface setting above } } } // ... } } ENH: foamyHexMesh: Added (reinstated) baffle patches A patch can now be assigned to a baffle surface. This assignment will take precedence over any face-zones. surfaceConformation { locationInMesh (0 0 0); geometryToConformTo { disk { featureMethod extractFeatures; includedAngle 120; meshableSide both; // <-- baffle patchInfo { type wall; inGroups (walls); } } // ... } } STYLE: foamyHexMesh: Switched off output of all the secondary meshes --- .../conformalVoronoiMeshCalcDualMesh.C | 83 ++++++++++--------- .../conformationSurfaces.C | 8 +- etc/caseDicts/foamyHexMeshDict | 8 +- 3 files changed, 55 insertions(+), 44 deletions(-) diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index 7fcbfffd10..09abf0f1e2 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -2227,47 +2227,52 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches } else { -// if -// ( -// ptPairs_.isPointPair(vA, vB) -// || ftPtConformer_.featurePointPairs().isPointPair(vA, vB) -// ) -// { - patchIndex = geometryToConformTo_.findPatch(ptA, ptB); -// } - - if (patchIndex != -1) + if + ( + !vA->boundaryPoint() + || !vB->boundaryPoint() + || ptPairs_.isPointPair(vA, vB) + || ftPtConformer_.featurePointPairs().isPointPair(vA, vB) + ) { -// if -// ( -// vA->boundaryPoint() && vB->boundaryPoint() -// && !ptPairs_.isPointPair(vA, vB) -// ) -// { -// indirectPatchFace[patchIndex].append(true); -// } -// else -// { -// indirectPatchFace[patchIndex].append(false); -// } -// patchFaces[patchIndex].append(newDualFace); -// patchOwners[patchIndex].append(own); -// indirectPatchFace[patchIndex].append(false); -// -// if -// ( -// labelPair(vB->index(), vB->procIndex()) -// < labelPair(vA->index(), vA->procIndex()) -// ) -// { -// patchPPSlaves[patchIndex].append(vB->index()); -// } -// else -// { -// patchPPSlaves[patchIndex].append(vA->index()); -// } + patchIndex = geometryToConformTo_.findPatch(ptA, ptB); } -// else + + if + ( + patchIndex != -1 + && geometryToConformTo_.patchInfo().set(patchIndex) + ) + { + // baffle faces + + patchFaces[patchIndex].append(newDualFace); + patchOwners[patchIndex].append(own); + indirectPatchFace[patchIndex].append(false); + + reverse(newDualFace); + + patchFaces[patchIndex].append(newDualFace); + patchOwners[patchIndex].append(nei); + indirectPatchFace[patchIndex].append(false); + + if + ( + labelPair(vB->index(), vB->procIndex()) + < labelPair(vA->index(), vA->procIndex()) + ) + { + patchPPSlaves[patchIndex].append(vB->index()); + patchPPSlaves[patchIndex].append(vB->index()); + } + else + { + patchPPSlaves[patchIndex].append(vA->index()); + patchPPSlaves[patchIndex].append(vA->index()); + } + + } + else { // internal face faces[dualFacei] = newDualFace; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C index 327eaa3332..761b5a5fea 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -443,7 +443,11 @@ Foam::conformationSurfaces::conformationSurfaces regionDict.lookupOrDefault ( "meshableSide", - "inside" + extendedFeatureEdgeMesh:: + sideVolumeTypeNames_ + [ + globalVolumeTypes[surfI] + ] ) ] ); diff --git a/etc/caseDicts/foamyHexMeshDict b/etc/caseDicts/foamyHexMeshDict index ee8abb7e15..ab43e20559 100644 --- a/etc/caseDicts/foamyHexMeshDict +++ b/etc/caseDicts/foamyHexMeshDict @@ -68,6 +68,8 @@ motionControl { maxSmoothingIterations 100; + maxRefinementIterations 0; + cellAspectRatioControl { aspectRatio 1.0; @@ -114,9 +116,9 @@ polyMeshFiltering { filterEdges on; filterFaces off; - writeTetDualMesh true; - writeCellShapeControlMesh true; - writeBackgroundMeshDecomposition true; + writeTetDualMesh false; + writeCellShapeControlMesh false; + writeBackgroundMeshDecomposition false; }