From ff9aeade66a34f317bc3c9cadc74b50d29a73ead Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Nov 2011 15:46:35 +0000 Subject: [PATCH] BUG: Corrected rotorDiskSource face area calculation for parellel running --- .../rotorDiskSource/rotorDiskSource.C | 139 +++++++++++++----- .../rotorDiskSourceTemplates.C | 11 ++ 2 files changed, 110 insertions(+), 40 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C index 00e9b59ff4..3b300e08ae 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C @@ -29,6 +29,7 @@ License #include "unitConversion.H" #include "geometricOneField.H" #include "fvMatrices.H" +#include "syncTools.H" using namespace Foam::constant; @@ -122,58 +123,116 @@ void Foam::rotorDiskSource::checkData() void Foam::rotorDiskSource::setFaceArea(vector& axis, const bool correct) { - // calculate rotor face areas - const vectorField& Sf = mesh_.Sf(); - const scalarField& magSf = mesh_.magSf(); + static const scalar tol = 0.8; - boolList selectedCells(mesh_.nCells(), false); - boolList processedFaces(mesh_.nFaces(), false); - UIndirectList(selectedCells, cells_) = boolList(cells_.size(), true); + const label nInternalFaces = mesh_.nInternalFaces(); + const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); + const vectorField& Sf = mesh_.Sf().internalField(); + const scalarField& magSf = mesh_.magSf().internalField(); vector n = vector::zero; - label nFace = 0; - area_ = 0.0; - forAll(cells_, i) + + // calculate cell addressing for selected cells + labelList cellAddr(mesh_.nCells(), -1); + UIndirectList