diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index f2f1a764d7786f439272648aa04e0c7399ce81af..3162fc3da6fa3d958f8a6c03c866c8ef05bb9df6 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -118,7 +118,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::checkPatches ( const primitivePatch& srcPatch, const primitivePatch& tgtPatch -) +) const { const scalar maxBoundsError = 0.05; @@ -188,7 +188,7 @@ Foam::label Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcDistribution ( const primitivePatch& srcPatch, const primitivePatch& tgtPatch -) +) const { label procI = 0; @@ -242,7 +242,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs const List<treeBoundBoxList>& procBb, const treeBoundBox& bb, boolList& overlaps -) +) const { overlaps.setSize(procBb.size()); overlaps = false; @@ -276,7 +276,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::distributePatches List<faceList>& faces, List<pointField>& points, List<labelList>& faceIDs -) +) const { PstreamBuffers pBufs(Pstream::nonBlocking); @@ -373,7 +373,7 @@ distributeAndMergePatches faceList& tgtFaces, pointField& tgtPoints, labelList& tgtFaceIDs -) +) const { // Exchange per-processor data List<faceList> allFaces; @@ -485,7 +485,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcProcMap ( const primitivePatch& srcPatch, const primitivePatch& tgtPatch -) +) const { // Get decomposition of patch List<treeBoundBoxList> procBb(Pstream::nProcs()); @@ -764,6 +764,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::appendNbrFaces template<class SourcePatch, class TargetPatch> void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces ( + label& startSeedI, label& srcFaceI, label& tgtFaceI, const primitivePatch& srcPatch0, @@ -771,7 +772,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces const boolList& mapFlag, labelList& seedFaces, const DynamicList<label>& visitedFaces -) +) const { // const labelList& srcNbrFaces = srcPatch0.pointFaces()[srcFaceI]; const labelList& srcNbrFaces = srcPatch0.faceFaces()[srcFaceI]; @@ -815,13 +816,13 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces { // try to use existing seed bool foundNextSeed = false; - for (label faceI = startSeedI_; faceI < mapFlag.size(); faceI++) + for (label faceI = startSeedI; faceI < mapFlag.size(); faceI++) { if (mapFlag[faceI]) { if (!foundNextSeed) { - startSeedI_ = faceI; + startSeedI = faceI; foundNextSeed = true; } @@ -843,13 +844,13 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces } // foundNextSeed = false; - for (label faceI = startSeedI_; faceI < mapFlag.size(); faceI++) + for (label faceI = startSeedI; faceI < mapFlag.size(); faceI++) { if (mapFlag[faceI]) { if (!foundNextSeed) { - startSeedI_ = faceI + 1; + startSeedI = faceI + 1; foundNextSeed = true; } @@ -867,6 +868,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces ( "void Foam::cyclicAMIPolyPatch::setNextFaces" "(" + "label&, " "label&, " "label&, " "const primitivePatch&, " @@ -1035,7 +1037,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing boolList mapFlag(nFacesRemaining, true); // reset starting seed - startSeedI_ = 0; + label startSeedI = 0; label nNonOverlap = 0; do @@ -1086,6 +1088,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing { setNextFaces ( + startSeedI, srcFaceI, tgtFaceI, srcPatch, @@ -1453,7 +1456,6 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation tgtAddress_(), tgtWeights_(), treePtr_(NULL), - startSeedI_(0), triMode_(triMode), srcMapPtr_(NULL), tgtMapPtr_(NULL) @@ -1486,7 +1488,6 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation tgtAddress_(), tgtWeights_(), treePtr_(NULL), - startSeedI_(0), triMode_(triMode), srcMapPtr_(NULL), tgtMapPtr_(NULL) @@ -1574,7 +1575,6 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation tgtAddress_(), tgtWeights_(), treePtr_(NULL), - startSeedI_(0), triMode_(fineAMI.triMode_), srcMapPtr_(NULL), tgtMapPtr_(NULL) diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H index ed62292430868fbdee75ea174be06f1bfca0e408..52d5b0787ff02b22eab734b73818f38994d2dca5 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H @@ -148,9 +148,6 @@ class AMIInterpolation //- Octree used to find face seeds autoPtr<indexedOctree<treeType> > treePtr_; - //- Starting face seed index - label startSeedI_; - //- Face triangulation mode const faceAreaIntersect::triangulationMode triMode_; @@ -187,7 +184,7 @@ class AMIInterpolation ( const primitivePatch& srcPatch, const primitivePatch& tgtPatch - ); + ) const; //- Reset the octree for the traget patch face search void resetTree(const primitivePatch& tgtPatch); @@ -201,14 +198,14 @@ class AMIInterpolation ( const primitivePatch& srcPatch, const primitivePatch& tgtPatch - ); + ) const; label calcOverlappingProcs ( const List<treeBoundBoxList>& procBb, const treeBoundBox& bb, boolList& overlaps - ); + ) const; void distributePatches ( @@ -218,7 +215,7 @@ class AMIInterpolation List<faceList>& faces, List<pointField>& points, List<labelList>& tgtFaceIDs - ); + ) const; void distributeAndMergePatches ( @@ -228,13 +225,13 @@ class AMIInterpolation faceList& tgtFaces, pointField& tgtPoints, labelList& tgtFaceIDs - ); + ) const; autoPtr<mapDistribute> calcProcMap ( const primitivePatch& srcPatch, const primitivePatch& tgtPatch - ); + ) const; // Initialisation @@ -268,6 +265,7 @@ class AMIInterpolation //- Set the source and target seed faces void setNextFaces ( + label& startSeedI, label& srcFaceI, label& tgtFaceI, const primitivePatch& srcPatch0, @@ -275,7 +273,7 @@ class AMIInterpolation const boolList& mapFlag, labelList& seedFaces, const DynamicList<label>& visitedFaces - ); + ) const; // Evaluation diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C index 96bc3586211de1d15528c9e43b7f1d774e7da8d0..917c65ca5f0beab8a0a8d8e2ab6d310a8609091a 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C @@ -207,7 +207,9 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalar Cmu25 = pow(Cmu_, 0.25); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index 51dabb01fd07c61f50bcd48743bceb7f150eab1f..41f7c926d32e9c5d8f25e0bf77c0d9181c469b16 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -47,7 +47,9 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; // The flow velocity at the adjacent cell centre const scalarField magUp(mag(Uw.patchInternalField() - Uw)); @@ -80,7 +82,9 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcYPlus const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0)); scalarField& yPlus = tyPlus(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index 37b641ebcd57d5d55e5f9dc221fd2a7c86653f1b..93b6376601bc6f483ec8411e88b55ec22fb61e56 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -47,7 +47,9 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField magGradU(mag(Uw.snGrad())); - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; return max ( @@ -181,7 +183,9 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::yPlus() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; return y*calcUTau(mag(Uw.snGrad()))/nuw; } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C index 2ed3f35c95f33a3fe1907d4466e9604b45d8f458..4bb2c1ea1958e993326b18f837709332b99682e1 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -49,7 +49,9 @@ tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::calcNut() const const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); const scalarField magGradU(mag(Uw.snGrad())); - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; return max @@ -182,7 +184,9 @@ tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; const scalarField Rey(magUp*y/nuw); return Rey/(calcUPlus(Rey) + ROOTVSMALL); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C index ce150094c84b57f533fa42b005feca11bdb6e528..77fc20e46a0b44209fd19ea12dc32b2ab21e6bb6 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -47,7 +47,9 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; tmp<scalarField> tyPlus = calcYPlus(magUp); scalarField& yPlus = tyPlus(); @@ -77,7 +79,9 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcYPlus const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0)); scalarField& yPlus = tyPlus(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index 893c3aa97706a939c7d78ebc617e263b587966b9..9dc82a03ad2e15f4d6adfdcd43d4f681b19d656a 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -71,7 +71,9 @@ tmp<scalarField> nutkRoughWallFunctionFvPatchScalarField::calcNut() const const scalarField& y = rasModel.y()[patchI]; const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C index 8b7ed5cded473e7b91e88f9bffde3e4a73cac478..157b88731a567d58f1d505278ddc8ce074271c5c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -80,7 +80,9 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const const scalarField& y = rasModel.y()[patchI]; const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); @@ -220,7 +222,9 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); tmp<scalarField> kwc = k.boundaryField()[patchI].patchInternalField(); - const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; return pow025(Cmu_)*y*sqrt(kwc)/nuw; }