diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C index 5f04825a94..a3d68f55ca 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C @@ -38,7 +38,8 @@ Foam::scalar Foam::compressibleCourantNo scalar CoNum = 0.0; scalar meanCoNum = 0.0; - if (mesh.nInternalFaces()) + //- Can have fluid domains with 0 cells so do not test. + //if (mesh.nInternalFaces()) { surfaceScalarField SfUfbyDelta = mesh.surfaceInterpolation::deltaCoeffs() diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 58f324160e..cc975eb970 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -131,6 +131,12 @@ castellatedMeshControls level (3 3); } } + + // Optional angle to detect small-large cell situation perpendicular + // to the surface. Is the angle of face w.r.t the local surface + // normal. Use on flat(ish) surfaces only. Otherwise + // leave out or set to negative number. + //perpendicularAngle 10; } } @@ -317,9 +323,10 @@ meshQualityControls minTriangleTwist -1; //- if >0 : preserve single cells with all points on the surface if the - // resulting volume after snapping is larger than minVolFraction times old - // volume. If <0 : delete always. - minVolFraction 0.1; + // resulting volume after snapping (by approximation) is larger than + // minVolCollapseRatio times old volume (i.e. not collapsed to flat cell). + // If <0 : delete always. + //minVolCollapseRatio 0.5; // Advanced diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index de69375595..14f5704836 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -102,6 +102,67 @@ Foam::label Foam::checkTopology } } + if (allTopology) + { + labelList nInternalFaces(mesh.nCells(), 0); + + for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++) + { + nInternalFaces[mesh.faceOwner()[faceI]]++; + nInternalFaces[mesh.faceNeighbour()[faceI]]++; + } + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + forAll(patches, patchI) + { + if (patches[patchI].coupled()) + { + const unallocLabelList& owners = patches[patchI].faceCells(); + + forAll(owners, i) + { + nInternalFaces[owners[i]]++; + } + } + } + + faceSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100); + faceSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100); + + forAll(nInternalFaces, cellI) + { + if (nInternalFaces[cellI] <= 1) + { + oneCells.insert(cellI); + } + else if (nInternalFaces[cellI] == 2) + { + twoCells.insert(cellI); + } + } + + label nOneCells = returnReduce(oneCells.size(), sumOp