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/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index 555e6e0cfe..feacdd34ad 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - turbFoam + pisoFoam Description Transient solver for incompressible flow. @@ -40,15 +40,14 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "initContinuityErrs.H" -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -56,8 +55,8 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readPISOControls.H" -# include "CourantNo.H" + #include "readPISOControls.H" + #include "CourantNo.H" // Pressure-velocity PISO corrector { @@ -120,7 +119,7 @@ int main(int argc, char *argv[]) } } -# include "continuityErrs.H" + #include "continuityErrs.H" U -= rUA*fvc::grad(p); U.correctBoundaryConditions(); 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