From 431042dc232f8f0eff5af80b71d8ad5be55b8915 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 13 Oct 2015 16:22:03 +0100 Subject: [PATCH] BUG: polyMeshGeometry: fixed updating of local geometric properties --- .../motionSmoother/motionSmootherAlgo.H | 16 ++- .../motionSmoother/motionSmootherAlgoCheck.C | 100 +++++++------- .../polyMeshGeometry/polyMeshGeometry.C | 122 +++++++++--------- 3 files changed, 128 insertions(+), 110 deletions(-) diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H index d4c1054860..724658012e 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -332,6 +332,17 @@ public: const dictionary& paramDict() const; + //- Return reference to the point motion displacement field + pointVectorField& pointDisplacement() + { + return displacement_; + } + + //- Return const reference to the point motion displacement field + const pointVectorField& pointDisplacement() const + { + return displacement_; + } // Edit @@ -339,7 +350,6 @@ public: //- Take over existing mesh position. void correct(); - //- Set patch fields on patchIDs to be consistent with // all other boundary conditions static void setDisplacementPatchFields @@ -471,6 +481,7 @@ public: const bool report, const dictionary& dict, const polyMeshGeometry&, + const pointField&, const labelList& checkFaces, labelHashSet& wrongFaces ); @@ -483,6 +494,7 @@ public: const bool report, const dictionary& dict, const polyMeshGeometry&, + const pointField&, const labelList& checkFaces, const List& baffles, labelHashSet& wrongFaces diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgoCheck.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgoCheck.C index 07859539a5..8928dc29bb 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgoCheck.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgoCheck.C @@ -2,8 +2,8 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation - \\/ M anipulation | + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -434,6 +434,7 @@ bool Foam::motionSmootherAlgo::checkMesh const bool report, const dictionary& dict, const polyMeshGeometry& meshGeom, + const pointField& points, const labelList& checkFaces, labelHashSet& wrongFaces ) @@ -445,6 +446,7 @@ bool Foam::motionSmootherAlgo::checkMesh report, dict, meshGeom, + points, checkFaces, emptyBaffles, wrongFaces @@ -457,6 +459,7 @@ bool Foam::motionSmootherAlgo::checkMesh const bool report, const dictionary& dict, const polyMeshGeometry& meshGeom, + const pointField& points, const labelList& checkFaces, const List& baffles, labelHashSet& wrongFaces @@ -482,14 +485,14 @@ bool Foam::motionSmootherAlgo::checkMesh ( readScalar(dict.lookup("minArea", true)) ); - //const scalar maxIntSkew - //( - // readScalar(dict.lookup("maxInternalSkewness", true)) - //); - //const scalar maxBounSkew - //( - // readScalar(dict.lookup("maxBoundarySkewness", true)) - //); + const scalar maxIntSkew + ( + readScalar(dict.lookup("maxInternalSkewness", true)) + ); + const scalar maxBounSkew + ( + readScalar(dict.lookup("maxBoundarySkewness", true)) + ); const scalar minWeight ( readScalar(dict.lookup("minFaceWeight", true)) @@ -512,7 +515,6 @@ bool Foam::motionSmootherAlgo::checkMesh ( readScalar(dict.lookup("minDeterminant", true)) ); - label nWrongFaces = 0; Info<< "Checking faces in error :" << endl; @@ -544,8 +546,8 @@ bool Foam::motionSmootherAlgo::checkMesh meshGeom.checkFacePyramids ( report, - minVol, - meshGeom.mesh().points(), + minTetQuality, + points, checkFaces, baffles, &wrongFaces @@ -566,7 +568,7 @@ bool Foam::motionSmootherAlgo::checkMesh ( report, minTetQuality, - meshGeom.mesh().points(), + points, checkFaces, baffles, &wrongFaces @@ -575,7 +577,7 @@ bool Foam::motionSmootherAlgo::checkMesh label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp