From c96ff47d98590a546d39baea8bb98ee587416626 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 9 Oct 2017 21:33:02 +0100 Subject: [PATCH] ENH: blockMesh: Added switch to disable face correspondence checking To disable face correspondence checking set checkFaceCorrespondence off; in blockMeshDict. This is necessary in the rare cases where adjacent block faces do not need to correspond because they are geometrically collapsed, e.g. to form a pole/axis. Resolves bug-report https://bugs.openfoam.org/view.php?id=2711 --- src/mesh/blockMesh/blockMesh/blockMesh.C | 6 +++++- src/mesh/blockMesh/blockMesh/blockMesh.H | 5 ++++- src/mesh/blockMesh/blockMesh/blockMeshMerge.C | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.C b/src/mesh/blockMesh/blockMesh/blockMesh.C index a4d6d8c38e..de3130d9d8 100644 --- a/src/mesh/blockMesh/blockMesh/blockMesh.C +++ b/src/mesh/blockMesh/blockMesh/blockMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,6 +40,10 @@ Foam::blockMesh::blockMesh(const IOdictionary& dict, const word& regionName) : meshDict_(dict), verboseOutput(meshDict_.lookupOrDefault("verbose", true)), + checkFaceCorrespondence_ + ( + meshDict_.lookupOrDefault("checkFaceCorrespondence", true) + ), geometry_ ( IOobject diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.H b/src/mesh/blockMesh/blockMesh/blockMesh.H index 74471c8e90..9510553275 100644 --- a/src/mesh/blockMesh/blockMesh/blockMesh.H +++ b/src/mesh/blockMesh/blockMesh/blockMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,6 +71,9 @@ class blockMesh //- Switch for verbose output bool verboseOutput; + //- Switch checking face consistency (defaults to true) + bool checkFaceCorrespondence_; + //- Optional searchable geometry to project face-points to searchableSurfaces geometry_; diff --git a/src/mesh/blockMesh/blockMesh/blockMeshMerge.C b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C index 1cccc5a2fe..2ef5796037 100644 --- a/src/mesh/blockMesh/blockMesh/blockMeshMerge.C +++ b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -212,7 +212,11 @@ void Foam::blockMesh::calcMergeInfo() const List>& blockNfaceFaces = blocks[blockNlabel].boundaryPatches()[blockNfaceLabel]; - if (blockPfaceFaces.size() != blockNfaceFaces.size()) + if + ( + checkFaceCorrespondence_ + && blockPfaceFaces.size() != blockNfaceFaces.size() + ) { FatalErrorInFunction << "Inconsistent number of faces between block pair "